@medplum/app 3.2.27 → 3.2.29
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-D0DT0OBW.js +587 -0
- package/dist/assets/index-D0DT0OBW.js.map +1 -0
- package/dist/assets/index-DiFTsTJo.css +1 -0
- package/dist/index.html +3 -3
- package/package.json +13 -13
- package/dist/assets/index-Bn7KqbrB.css +0 -1
- package/dist/assets/index-DeSwaR1s.js +0 -587
- package/dist/assets/index-DeSwaR1s.js.map +0 -1
|
@@ -1,587 +0,0 @@
|
|
|
1
|
-
function Vj(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 s=Object.getOwnPropertyDescriptor(r,o);s&&Object.defineProperty(e,o,s.get?s:{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 s of o)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function yv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Am={exports:{}},Nc={},Mm={exports:{}},wt={};/**
|
|
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 _b;function j_(){if(_b)return wt;_b=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.iterator;function y(I){return I===null||typeof I!="object"?null:(I=m&&I[m]||I["@@iterator"],typeof I=="function"?I:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,w={};function j(I,F,J){this.props=I,this.context=F,this.refs=w,this.updater=J||x}j.prototype.isReactComponent={},j.prototype.setState=function(I,F){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,F,"setState")},j.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function T(){}T.prototype=j.prototype;function P(I,F,J){this.props=I,this.context=F,this.refs=w,this.updater=J||x}var k=P.prototype=new T;k.constructor=P,b(k,j.prototype),k.isPureReactComponent=!0;var E=Array.isArray,_=Object.prototype.hasOwnProperty,R={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function N(I,F,J){var de,Ee={},ve=null,we=null;if(F!=null)for(de in F.ref!==void 0&&(we=F.ref),F.key!==void 0&&(ve=""+F.key),F)_.call(F,de)&&!M.hasOwnProperty(de)&&(Ee[de]=F[de]);var _e=arguments.length-2;if(_e===1)Ee.children=J;else if(1<_e){for(var fe=Array(_e),Je=0;Je<_e;Je++)fe[Je]=arguments[Je+2];Ee.children=fe}if(I&&I.defaultProps)for(de in _e=I.defaultProps,_e)Ee[de]===void 0&&(Ee[de]=_e[de]);return{$$typeof:e,type:I,key:ve,ref:we,props:Ee,_owner:R.current}}function L(I,F){return{$$typeof:e,type:I.type,key:F,ref:I.ref,props:I.props,_owner:I._owner}}function z(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function q(I){var F={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(J){return F[J]})}var G=/\/+/g;function Y(I,F){return typeof I=="object"&&I!==null&&I.key!=null?q(""+I.key):F.toString(36)}function Q(I,F,J,de,Ee){var ve=typeof I;(ve==="undefined"||ve==="boolean")&&(I=null);var we=!1;if(I===null)we=!0;else switch(ve){case"string":case"number":we=!0;break;case"object":switch(I.$$typeof){case e:case t:we=!0}}if(we)return we=I,Ee=Ee(we),I=de===""?"."+Y(we,0):de,E(Ee)?(J="",I!=null&&(J=I.replace(G,"$&/")+"/"),Q(Ee,F,J,"",function(Je){return Je})):Ee!=null&&(z(Ee)&&(Ee=L(Ee,J+(!Ee.key||we&&we.key===Ee.key?"":(""+Ee.key).replace(G,"$&/")+"/")+I)),F.push(Ee)),1;if(we=0,de=de===""?".":de+":",E(I))for(var _e=0;_e<I.length;_e++){ve=I[_e];var fe=de+Y(ve,_e);we+=Q(ve,F,J,fe,Ee)}else if(fe=y(I),typeof fe=="function")for(I=fe.call(I),_e=0;!(ve=I.next()).done;)ve=ve.value,fe=de+Y(ve,_e++),we+=Q(ve,F,J,fe,Ee);else if(ve==="object")throw F=String(I),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.");return we}function te(I,F,J){if(I==null)return I;var de=[],Ee=0;return Q(I,de,"","",function(ve){return F.call(J,ve,Ee++)}),de}function V(I){if(I._status===-1){var F=I._result;F=F(),F.then(function(J){(I._status===0||I._status===-1)&&(I._status=1,I._result=J)},function(J){(I._status===0||I._status===-1)&&(I._status=2,I._result=J)}),I._status===-1&&(I._status=0,I._result=F)}if(I._status===1)return I._result.default;throw I._result}var O={current:null},A={transition:null},B={ReactCurrentDispatcher:O,ReactCurrentBatchConfig:A,ReactCurrentOwner:R};return wt.Children={map:te,forEach:function(I,F,J){te(I,function(){F.apply(this,arguments)},J)},count:function(I){var F=0;return te(I,function(){F++}),F},toArray:function(I){return te(I,function(F){return F})||[]},only:function(I){if(!z(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},wt.Component=j,wt.Fragment=n,wt.Profiler=o,wt.PureComponent=P,wt.StrictMode=r,wt.Suspense=d,wt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=B,wt.cloneElement=function(I,F,J){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var de=b({},I.props),Ee=I.key,ve=I.ref,we=I._owner;if(F!=null){if(F.ref!==void 0&&(ve=F.ref,we=R.current),F.key!==void 0&&(Ee=""+F.key),I.type&&I.type.defaultProps)var _e=I.type.defaultProps;for(fe in F)_.call(F,fe)&&!M.hasOwnProperty(fe)&&(de[fe]=F[fe]===void 0&&_e!==void 0?_e[fe]:F[fe])}var fe=arguments.length-2;if(fe===1)de.children=J;else if(1<fe){_e=Array(fe);for(var Je=0;Je<fe;Je++)_e[Je]=arguments[Je+2];de.children=_e}return{$$typeof:e,type:I.type,key:Ee,ref:ve,props:de,_owner:we}},wt.createContext=function(I){return I={$$typeof:l,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:s,_context:I},I.Consumer=I},wt.createElement=N,wt.createFactory=function(I){var F=N.bind(null,I);return F.type=I,F},wt.createRef=function(){return{current:null}},wt.forwardRef=function(I){return{$$typeof:u,render:I}},wt.isValidElement=z,wt.lazy=function(I){return{$$typeof:h,_payload:{_status:-1,_result:I},_init:V}},wt.memo=function(I,F){return{$$typeof:p,type:I,compare:F===void 0?null:F}},wt.startTransition=function(I){var F=A.transition;A.transition={};try{I()}finally{A.transition=F}},wt.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},wt.useCallback=function(I,F){return O.current.useCallback(I,F)},wt.useContext=function(I){return O.current.useContext(I)},wt.useDebugValue=function(){},wt.useDeferredValue=function(I){return O.current.useDeferredValue(I)},wt.useEffect=function(I,F){return O.current.useEffect(I,F)},wt.useId=function(){return O.current.useId()},wt.useImperativeHandle=function(I,F,J){return O.current.useImperativeHandle(I,F,J)},wt.useInsertionEffect=function(I,F){return O.current.useInsertionEffect(I,F)},wt.useLayoutEffect=function(I,F){return O.current.useLayoutEffect(I,F)},wt.useMemo=function(I,F){return O.current.useMemo(I,F)},wt.useReducer=function(I,F,J){return O.current.useReducer(I,F,J)},wt.useRef=function(I){return O.current.useRef(I)},wt.useState=function(I){return O.current.useState(I)},wt.useSyncExternalStore=function(I,F,J){return O.current.useSyncExternalStore(I,F,J)},wt.useTransition=function(){return O.current.useTransition()},wt.version="18.2.0",wt}var Db;function xv(){return Db||(Db=1,Mm.exports=j_()),Mm.exports}/**
|
|
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 Ib;function C_(){if(Ib)return Nc;Ib=1;var e=xv(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function l(u,d,p){var h,m={},y=null,x=null;p!==void 0&&(y=""+p),d.key!==void 0&&(y=""+d.key),d.ref!==void 0&&(x=d.ref);for(h in d)r.call(d,h)&&!s.hasOwnProperty(h)&&(m[h]=d[h]);if(u&&u.defaultProps)for(h in d=u.defaultProps,d)m[h]===void 0&&(m[h]=d[h]);return{$$typeof:t,type:u,key:y,ref:x,props:m,_owner:o.current}}return Nc.Fragment=n,Nc.jsx=l,Nc.jsxs=l,Nc}var Nb;function E_(){return Nb||(Nb=1,Am.exports=C_()),Am.exports}var i=E_(),Vo=function(){return Vo=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Vo.apply(this,arguments)};function Wj(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 k_(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var g=xv();const gn=yv(g),Hj=Vj({__proto__:null,default:gn},[g]);var uf="right-scroll-bar-position",df="width-before-scroll-bar",T_="with-scroll-bars-hidden",P_="--removed-body-scroll-bar-size";function Om(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function R_(e,t){var n=g.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 __=typeof window<"u"?g.useLayoutEffect:g.useEffect,Ab=new WeakMap;function D_(e,t){var n=R_(null,function(r){return e.forEach(function(o){return Om(o,r)})});return __(function(){var r=Ab.get(n);if(r){var o=new Set(r),s=new Set(e),l=n.current;o.forEach(function(u){s.has(u)||Om(u,null)}),s.forEach(function(u){o.has(u)||Om(u,l)})}Ab.set(n,e)},[e]),n}function I_(e){return e}function N_(e,t){t===void 0&&(t=I_);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(s){var l=t(s,r);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(s){for(r=!0;n.length;){var l=n;n=[],l.forEach(s)}n={push:function(u){return s(u)},filter:function(){return n}}},assignMedium:function(s){r=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(s),l=n}var d=function(){var h=l;l=[],h.forEach(s)},p=function(){return Promise.resolve().then(d)};p(),n={push:function(h){l.push(h),p()},filter:function(h){return l=l.filter(h),n}}}};return o}function A_(e){e===void 0&&(e={});var t=N_(null);return t.options=Vo({async:!0,ssr:!1},e),t}var qj=function(e){var t=e.sideCar,n=Wj(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 g.createElement(r,Vo({},n))};qj.isSideCarExport=!0;function M_(e,t){return e.useMedium(t),qj}var Gj=A_(),Lm=function(){},Gf=g.forwardRef(function(e,t){var n=g.useRef(null),r=g.useState({onScrollCapture:Lm,onWheelCapture:Lm,onTouchMoveCapture:Lm}),o=r[0],s=r[1],l=e.forwardProps,u=e.children,d=e.className,p=e.removeScrollBar,h=e.enabled,m=e.shards,y=e.sideCar,x=e.noIsolation,b=e.inert,w=e.allowPinchZoom,j=e.as,T=j===void 0?"div":j,P=e.gapMode,k=Wj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=y,_=D_([n,t]),R=Vo(Vo({},k),o);return g.createElement(g.Fragment,null,h&&g.createElement(E,{sideCar:Gj,removeScrollBar:p,shards:m,noIsolation:x,inert:b,setCallbacks:s,allowPinchZoom:!!w,lockRef:n,gapMode:P}),l?g.cloneElement(g.Children.only(u),Vo(Vo({},R),{ref:_})):g.createElement(T,Vo({},R,{className:d,ref:_}),u))});Gf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Gf.classNames={fullWidth:df,zeroRight:uf};var O_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function L_(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=O_();return t&&e.setAttribute("nonce",t),e}function $_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function F_(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var z_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=L_())&&($_(t,n),F_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},B_=function(){var e=z_();return function(t,n){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Qj=function(){var e=B_(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},U_={left:0,top:0,right:0,gap:0},$m=function(e){return parseInt(e||"",10)||0},V_=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[$m(n),$m(r),$m(o)]},W_=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return U_;var t=V_(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])}},H_=Qj(),gl="data-scroll-locked",q_=function(e,t,n,r){var o=e.left,s=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
18
|
-
.`.concat(T_,` {
|
|
19
|
-
overflow: hidden `).concat(r,`;
|
|
20
|
-
padding-right: `).concat(u,"px ").concat(r,`;
|
|
21
|
-
}
|
|
22
|
-
body[`).concat(gl,`] {
|
|
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(s,`px;
|
|
28
|
-
padding-right: `).concat(l,`px;
|
|
29
|
-
margin-left:0;
|
|
30
|
-
margin-top:0;
|
|
31
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
32
|
-
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.`).concat(uf,` {
|
|
36
|
-
right: `).concat(u,"px ").concat(r,`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.`).concat(df,` {
|
|
40
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.`).concat(uf," .").concat(uf,` {
|
|
44
|
-
right: 0 `).concat(r,`;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.`).concat(df," .").concat(df,` {
|
|
48
|
-
margin-right: 0 `).concat(r,`;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
body[`).concat(gl,`] {
|
|
52
|
-
`).concat(P_,": ").concat(u,`px;
|
|
53
|
-
}
|
|
54
|
-
`)},Mb=function(){var e=parseInt(document.body.getAttribute(gl)||"0",10);return isFinite(e)?e:0},G_=function(){g.useEffect(function(){return document.body.setAttribute(gl,(Mb()+1).toString()),function(){var e=Mb()-1;e<=0?document.body.removeAttribute(gl):document.body.setAttribute(gl,e.toString())}},[])},Q_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;G_();var s=g.useMemo(function(){return W_(o)},[o]);return g.createElement(H_,{styles:q_(s,!t,o,n?"":"!important")})},Tg=!1;if(typeof window<"u")try{var qd=Object.defineProperty({},"passive",{get:function(){return Tg=!0,!0}});window.addEventListener("test",qd,qd),window.removeEventListener("test",qd,qd)}catch{Tg=!1}var el=Tg?{passive:!1}:!1,K_=function(e){return e.tagName==="TEXTAREA"},Kj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!K_(e)&&n[t]==="visible")},Y_=function(e){return Kj(e,"overflowY")},X_=function(e){return Kj(e,"overflowX")},Ob=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Yj(e,r);if(o){var s=Xj(e,r),l=s[1],u=s[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},J_=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Z_=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Yj=function(e,t){return e==="v"?Y_(t):X_(t)},Xj=function(e,t){return e==="v"?J_(t):Z_(t)},eD=function(e,t){return e==="h"&&t==="rtl"?-1:1},tD=function(e,t,n,r,o){var s=eD(e,window.getComputedStyle(t).direction),l=s*r,u=n.target,d=t.contains(u),p=!1,h=l>0,m=0,y=0;do{var x=Xj(e,u),b=x[0],w=x[1],j=x[2],T=w-j-s*b;(b||T)&&Yj(e,u)&&(m+=T,y+=b),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(h&&(Math.abs(m)<1||!o)||!h&&(Math.abs(y)<1||!o))&&(p=!0),p},Gd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Lb=function(e){return[e.deltaX,e.deltaY]},$b=function(e){return e&&"current"in e?e.current:e},nD=function(e,t){return e[0]===t[0]&&e[1]===t[1]},rD=function(e){return`
|
|
55
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
56
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
57
|
-
`)},oD=0,tl=[];function iD(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),o=g.useState(oD++)[0],s=g.useState(Qj)[0],l=g.useRef(e);g.useEffect(function(){l.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=k_([e.lockRef.current],(e.shards||[]).map($b),!0).filter(Boolean);return w.forEach(function(j){return j.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var u=g.useCallback(function(w,j){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!l.current.allowPinchZoom;var T=Gd(w),P=n.current,k="deltaX"in w?w.deltaX:P[0]-T[0],E="deltaY"in w?w.deltaY:P[1]-T[1],_,R=w.target,M=Math.abs(k)>Math.abs(E)?"h":"v";if("touches"in w&&M==="h"&&R.type==="range")return!1;var N=Ob(M,R);if(!N)return!0;if(N?_=M:(_=M==="v"?"h":"v",N=Ob(M,R)),!N)return!1;if(!r.current&&"changedTouches"in w&&(k||E)&&(r.current=_),!_)return!0;var L=r.current||_;return tD(L,j,w,L==="h"?k:E,!0)},[]),d=g.useCallback(function(w){var j=w;if(!(!tl.length||tl[tl.length-1]!==s)){var T="deltaY"in j?Lb(j):Gd(j),P=t.current.filter(function(_){return _.name===j.type&&(_.target===j.target||j.target===_.shadowParent)&&nD(_.delta,T)})[0];if(P&&P.should){j.cancelable&&j.preventDefault();return}if(!P){var k=(l.current.shards||[]).map($b).filter(Boolean).filter(function(_){return _.contains(j.target)}),E=k.length>0?u(j,k[0]):!l.current.noIsolation;E&&j.cancelable&&j.preventDefault()}}},[]),p=g.useCallback(function(w,j,T,P){var k={name:w,delta:j,target:T,should:P,shadowParent:sD(T)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(E){return E!==k})},1)},[]),h=g.useCallback(function(w){n.current=Gd(w),r.current=void 0},[]),m=g.useCallback(function(w){p(w.type,Lb(w),w.target,u(w,e.lockRef.current))},[]),y=g.useCallback(function(w){p(w.type,Gd(w),w.target,u(w,e.lockRef.current))},[]);g.useEffect(function(){return tl.push(s),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:y}),document.addEventListener("wheel",d,el),document.addEventListener("touchmove",d,el),document.addEventListener("touchstart",h,el),function(){tl=tl.filter(function(w){return w!==s}),document.removeEventListener("wheel",d,el),document.removeEventListener("touchmove",d,el),document.removeEventListener("touchstart",h,el)}},[]);var x=e.removeScrollBar,b=e.inert;return g.createElement(g.Fragment,null,b?g.createElement(s,{styles:rD(o)}):null,x?g.createElement(Q_,{gapMode:e.gapMode}):null)}function sD(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const aD=M_(Gj,iD);var wl=g.forwardRef(function(e,t){return g.createElement(Gf,Vo({},e,{ref:t,sideCar:aD}))});wl.classNames=Gf.classNames;function Gt(e){return Object.keys(e)}function Fm(e){return e&&typeof e=="object"&&!Array.isArray(e)}function bv(e,t){const n={...e},r=t;return Fm(e)&&Fm(t)&&Object.keys(t).forEach(o=>{Fm(r[o])&&o in e?n[o]=bv(n[o],r[o]):n[o]=r[o]}),n}function lD(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function cD(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 Qc(e){const t=cD(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 zm(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function Jj(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?zm(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(s=>n(s)).join(",");if(r.includes(" "))return r.split(" ").map(s=>n(s)).join(" ");if(r.includes(e))return t?zm(r):r;const o=r.replace("px","");if(!Number.isNaN(Number(o))){const s=`${Number(o)/16}${e}`;return t?zm(s):s}}return r}return n}const oe=Jj("rem",{shouldScale:!0}),vf=Jj("em");function gs(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function Zj(e){if(typeof e=="number")return!0;if(typeof e=="string"){if(e.startsWith("calc(")||e.startsWith("var(")||e.includes(" ")&&e.trim()!=="")return!0;const t=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return e.trim().split(/\s+/).every(r=>t.test(r))}return!1}function Ti(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==g.Fragment:!1}function hr(e){const t=g.createContext(null);return[({children:o,value:s})=>i.jsx(t.Provider,{value:s,children:o}),()=>{const o=g.useContext(t);if(o===null)throw new Error(e);return o}]}function vs(e=null){const t=g.createContext(e);return[({children:o,value:s})=>i.jsx(t.Provider,{value:s,children:o}),()=>g.useContext(t)]}function Fb(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function yf(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function uD(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 dD(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 fD(e,t,n){return yf(e,n)===yf(t,n)}function eC({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:o=!1,dir:s="rtl",orientation:l}){return u=>{var b;n==null||n(u);const d=Array.from(((b=yf(u.currentTarget,e))==null?void 0:b.querySelectorAll(t))||[]).filter(w=>fD(u.currentTarget,w,e)),p=d.findIndex(w=>u.currentTarget===w),h=dD(p,d,r),m=uD(p,d,r),y=s==="rtl"?m:h,x=s==="rtl"?h:m;switch(u.key){case"ArrowRight":{l==="horizontal"&&(u.stopPropagation(),u.preventDefault(),d[y].focus(),o&&d[y].click());break}case"ArrowLeft":{l==="horizontal"&&(u.stopPropagation(),u.preventDefault(),d[x].focus(),o&&d[x].click());break}case"ArrowUp":{l==="vertical"&&(u.stopPropagation(),u.preventDefault(),d[m].focus(),o&&d[m].click());break}case"ArrowDown":{l==="vertical"&&(u.stopPropagation(),u.preventDefault(),d[h].focus(),o&&d[h].click());break}case"Home":{u.stopPropagation(),u.preventDefault(),!d[0].disabled&&d[0].focus();break}case"End":{u.stopPropagation(),u.preventDefault();const w=d.length-1;!d[w].disabled&&d[w].focus();break}}}}const pD={app:100,modal:200,popover:300,overlay:400,max:9999};function Vr(e){return pD[e]}const xf=()=>{};function hD(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||xf:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function et(e,t="size",n=!0){if(e!==void 0)return Zj(e)?n?oe(e):e:`var(--${t}-${e})`}function Pn(e){return et(e,"mantine-spacing")}function At(e){return e===void 0?"var(--mantine-radius-default)":et(e,"mantine-radius")}function Rn(e){return et(e,"mantine-font-size")}function tC(e){return et(e,"mantine-line-height",!1)}function wv(e){if(e)return et(e,"mantine-shadow",!1)}function Er(e,t){return n=>{e==null||e(n),t==null||t(n)}}function Sv(e,t){return e in t?Qc(t[e]):Qc(e)}function Kc(e,t){const n=e.map(r=>({value:r,px:Sv(r,t)}));return n.sort((r,o)=>r.px-o.px),n}function So(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function mD(e,t,n){var r;return n?Array.from(((r=yf(n,t))==null?void 0:r.querySelectorAll(e))||[]).findIndex(o=>o===n):null}function gD(){const[e,t]=g.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function Ac(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 nC(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function zb(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Gs(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Qf(e,t){const n=Gs(e),r=g.useRef(0);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),g.useCallback((...o)=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>n(...o),t)},[n,t])}const Bb=["mousedown","touchstart"];function vD(e,t,n){const r=g.useRef(null);return g.useEffect(()=>{const o=s=>{const{target:l}=s??{};if(Array.isArray(n)){const u=(l==null?void 0:l.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(l)&&l.tagName!=="HTML";n.every(p=>!!p&&!s.composedPath().includes(p))&&!u&&e()}else r.current&&!r.current.contains(l)&&e()};return(t||Bb).forEach(s=>document.addEventListener(s,o)),()=>{(t||Bb).forEach(s=>document.removeEventListener(s,o))}},[r,e,n]),r}function rC({timeout:e=2e3}={}){const[t,n]=g.useState(null),[r,o]=g.useState(!1),[s,l]=g.useState(null),u=h=>{window.clearTimeout(s),l(window.setTimeout(()=>o(!1),e)),o(h)};return{copy:h=>{"clipboard"in navigator?navigator.clipboard.writeText(h).then(()=>u(!0)).catch(m=>n(m)):n(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{o(!1),n(null),window.clearTimeout(s)},error:t,copied:r}}function yD(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function xD(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function oC(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=g.useState(n?t:xD(e)),s=g.useRef(null);return g.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),o(s.current.matches),yD(s.current,l=>o(l.matches))},[e]),r}function bD(e,t){return oC("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const Ml=typeof document<"u"?g.useLayoutEffect:g.useEffect;function bi(e,t){const n=g.useRef(!1);g.useEffect(()=>()=>{n.current=!1},[]),g.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function iC({opened:e,shouldReturnFocus:t=!0}){const n=g.useRef(null),r=()=>{var o;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((o=n.current)==null||o.focus({preventScroll:!0}))};return bi(()=>{let o=-1;const s=l=>{l.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",s),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",s)}},[e,t]),r}const wD=/input|select|textarea|button|object/,sC="a, input, select, textarea, button, object, [tabindex]";function SD(e){return e.style.display==="none"}function jD(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(SD(n))return!1;n=n.parentNode}return!0}function aC(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function Pg(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(aC(e));return(wD.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&jD(e)}function lC(e){const t=aC(e);return(Number.isNaN(t)||t>=0)&&Pg(e)}function CD(e){return Array.from(e.querySelectorAll(sC)).filter(lC)}function ED(e,t){const n=CD(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();let s=r===o.activeElement||e===o.activeElement;const l=o.activeElement;if(l.tagName==="INPUT"&&l.getAttribute("type")==="radio"&&(s=n.filter(h=>h.getAttribute("type")==="radio"&&h.getAttribute("name")===l.getAttribute("name")).includes(r)),!s)return;t.preventDefault();const d=n[t.shiftKey?n.length-1:0];d&&d.focus()}function kD(e=!0){const t=g.useRef(null),n=o=>{let s=o.querySelector("[data-autofocus]");if(!s){const l=Array.from(o.querySelectorAll(sC));s=l.find(lC)||l.find(Pg)||null,!s&&Pg(o)&&(s=o)}s&&s.focus({preventScroll:!0})},r=g.useCallback(o=>{e&&o!==null&&t.current!==o&&(o?(setTimeout(()=>{o.getRootNode()&&n(o)}),t.current=o):t.current=null)},[e]);return g.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const o=s=>{s.key==="Tab"&&t.current&&ED(t.current,s)};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e]),r}const TD=e=>(e+1)%1e6;function PD(){const[,e]=g.useReducer(TD,0);return e}const RD=gn.useId||(()=>{});function _D(){const e=RD();return e?`mantine-${e.replace(/:/g,"")}`:""}function mr(e){const t=_D(),[n,r]=g.useState(t);return Ml(()=>{r(nC())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function cC(e,t,n){g.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function Kf(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function DD(...e){return t=>{e.forEach(n=>Kf(n,t))}}function In(...e){return g.useCallback(DD(...e),e)}function Wn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,s]=g.useState(t!==void 0?t:n),l=(u,...d)=>{s(u),r==null||r(u,...d)};return e!==void 0?[e,r,!0]:[o,l,!1]}function os(e,t){const n=t-e+1;return Array.from({length:n},(r,o)=>o+e)}const Qd="dots";function ID({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:o=1,onChange:s}){const l=Math.max(Math.trunc(e),0),[u,d]=Wn({value:r,onChange:s,defaultValue:o,finalValue:o}),p=w=>{w<=0?d(1):w>l?d(l):d(w)},h=()=>p(u+1),m=()=>p(u-1),y=()=>p(1),x=()=>p(l);return{range:g.useMemo(()=>{if(t*2+3+n*2>=l)return os(1,l);const j=Math.max(u-t,n),T=Math.min(u+t,l-n),P=j>n+2,k=T<l-(n+1);if(!P&&k){const E=t*2+n+2;return[...os(1,E),Qd,...os(l-(n-1),l)]}if(P&&!k){const E=n+1+2*t;return[...os(1,n),Qd,...os(l-E,l)]}return[...os(1,n),Qd,...os(j,T),Qd,...os(l-n+1,l)]},[l,t,u]),active:u,setPage:p,next:h,previous:m,first:y,last:x}}function jv(e,t){return oC("(prefers-reduced-motion: reduce)",e,t)}function Yf(e=!1,t){const{onOpen:n,onClose:r}={},[o,s]=g.useState(e),l=g.useCallback(()=>{s(p=>p||(n==null||n(),!0))},[n]),u=g.useCallback(()=>{s(p=>p&&(r==null||r(),!1))},[r]),d=g.useCallback(()=>{o?u():l()},[u,l,o]);return[o,{open:l,close:u,toggle:d}]}function ND(e,t,n={autoInvoke:!1}){const r=g.useRef(null),o=g.useCallback((...l)=>{r.current||(r.current=window.setTimeout(()=>{e(l),r.current=null},t))},[t]),s=g.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return g.useEffect(()=>(n.autoInvoke&&o(),s),[s,o]),{start:o,clear:s}}function AD(e,t,n){const r=g.useRef(null),o=g.useRef(null);return g.useEffect(()=>{const s=typeof n=="function"?n():n;return(s||o.current)&&(r.current=new MutationObserver(e),r.current.observe(s||o.current,t)),()=>{var l;(l=r.current)==null||l.disconnect()}},[e,t]),o}function MD(){const[e,t]=g.useState(!1);return g.useEffect(()=>t(!0),[]),e}var OD={};function uC(){return typeof process<"u"&&OD?"production":"development"}function Xf(e){var n;const t=gn.version;return typeof gn.version!="string"||t.startsWith("18.")?e==null?void 0:e.ref:(n=e==null?void 0:e.props)==null?void 0:n.ref}function dC(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=dC(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function It(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=dC(e))&&(r&&(r+=" "),r+=t);return r}const LD={};function $D(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,o])=>{t[r]?t[r]=It(t[r],o):t[r]=o})}),t}function Jf({theme:e,classNames:t,props:n,stylesCtx:r}){const s=(Array.isArray(t)?t:[t]).map(l=>typeof l=="function"?l(e,n,r):l||LD);return $D(s)}function bf({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((s,l)=>typeof l=="function"?{...s,...l(e,n,r)}:{...s,...l},{})}const Cv=g.createContext(null);function ys(){const e=g.useContext(Cv);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function FD(){return ys().cssVariablesResolver}function zD(){return ys().classNamesPrefix}function Zf(){return ys().getStyleNonce}function BD(){return ys().withStaticClasses}function UD(){return ys().headless}function VD(){var e;return(e=ys().stylesTransform)==null?void 0:e.sx}function WD(){var e;return(e=ys().stylesTransform)==null?void 0:e.styles}function HD(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function qD(e){let t=e.replace("#","");if(t.length===3){const l=t.split("");t=[l[0],l[0],l[1],l[1],l[2],l[2]].join("")}if(t.length===8){const l=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:l}}const n=parseInt(t,16),r=n>>16&255,o=n>>8&255,s=n&255;return{r,g:o,b:s,a:1}}function GD(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 QD(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,s=parseInt(n[3],10)/100,l=n[5]?parseFloat(n[5]):void 0,u=(1-Math.abs(2*s-1))*o,d=r/60,p=u*(1-Math.abs(d%2-1)),h=s-u/2;let m,y,x;return d>=0&&d<1?(m=u,y=p,x=0):d>=1&&d<2?(m=p,y=u,x=0):d>=2&&d<3?(m=0,y=u,x=p):d>=3&&d<4?(m=0,y=p,x=u):d>=4&&d<5?(m=p,y=0,x=u):(m=u,y=0,x=p),{r:Math.round((m+h)*255),g:Math.round((y+h)*255),b:Math.round((x+h)*255),a:l||1}}function Ev(e){return HD(e)?qD(e):e.startsWith("rgb")?GD(e):e.startsWith("hsl")?QD(e):{r:0,g:0,b:0,a:1}}function Kd(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:o,a:s}=Ev(e),l=1-t,u=d=>Math.round(d*l);return`rgba(${u(n)}, ${u(r)}, ${u(o)}, ${s})`}function Yc(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function Bm(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function KD(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function YD(e){if(e.startsWith("oklch("))return(KD(e)||0)/100;const{r:t,g:n,b:r}=Ev(e),o=t/255,s=n/255,l=r/255,u=Bm(o),d=Bm(s),p=Bm(l);return .2126*u+.7152*d+.0722*p}function Mc(e,t=.179){return e.startsWith("var(")?!1:YD(e)>t}function eo({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:Mc(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:Mc(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:Mc(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,o]=e.split("."),s=o?Number(o):void 0,l=r in t.colors;if(l){const u=s!==void 0?t.colors[r][s]:t.colors[r][Yc(t,n||"light")];return{color:r,value:u,shade:s,isThemeColor:l,isLight:Mc(u,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${s}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:l,isLight:Mc(e,t.luminanceThreshold),shade:s,variable:void 0}}function Lt(e,t){const n=eo({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function Rg(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=Lt(n.from,t),o=Lt(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${o} 100%)`}function Jr(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const s=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${s}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:o}=Ev(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const nl=Jr,XD=({color:e,theme:t,variant:n,gradient:r,autoContrast:o})=>{const s=eo({color:e,theme:t}),l=typeof o=="boolean"?o:t.autoContrast;if(n==="filled"){const u=l&&s.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return s.isThemeColor?s.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:u,border:`${oe(1)} solid transparent`}:{background:`var(--mantine-color-${s.color}-${s.shade})`,hover:`var(--mantine-color-${s.color}-${s.shade===9?8:s.shade+1})`,color:u,border:`${oe(1)} solid transparent`}:{background:e,hover:Kd(e,.1),color:u,border:`${oe(1)} solid transparent`}}if(n==="light"){if(s.isThemeColor){if(s.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:`${oe(1)} solid transparent`};const u=t.colors[s.color][s.shade];return{background:Jr(u,.1),hover:Jr(u,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${oe(1)} solid transparent`}}return{background:Jr(e,.1),hover:Jr(e,.12),color:e,border:`${oe(1)} solid transparent`}}if(n==="outline")return s.isThemeColor?s.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${oe(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:Jr(t.colors[s.color][s.shade],.05),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${oe(1)} solid var(--mantine-color-${s.color}-${s.shade})`}:{background:"transparent",hover:Jr(e,.05),color:e,border:`${oe(1)} solid ${e}`};if(n==="subtle"){if(s.isThemeColor){if(s.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${oe(1)} solid transparent`};const u=t.colors[s.color][s.shade];return{background:"transparent",hover:Jr(u,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${oe(1)} solid transparent`}}return{background:"transparent",hover:Jr(e,.12),color:e,border:`${oe(1)} solid transparent`}}return n==="transparent"?s.isThemeColor?s.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${oe(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${oe(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${oe(1)} solid transparent`}:n==="white"?s.isThemeColor?s.shade===void 0?{background:"var(--mantine-color-white)",hover:Kd(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${oe(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Kd(t.white,.01),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${oe(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Kd(t.white,.01),color:e,border:`${oe(1)} solid transparent`}:n==="gradient"?{background:Rg(r,t),hover:Rg(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:`${oe(1)} solid var(--mantine-color-default-border)`}:{}},JD={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"]},Ub="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",kv={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:JD,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:XD,autoContrast:!1,luminanceThreshold:.3,fontFamily:Ub,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:Ub,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:oe(34),lineHeight:"1.3"},h2:{fontSize:oe(26),lineHeight:"1.35"},h3:{fontSize:oe(22),lineHeight:"1.4"},h4:{fontSize:oe(18),lineHeight:"1.45"},h5:{fontSize:oe(16),lineHeight:"1.5"},h6:{fontSize:oe(14),lineHeight:"1.5"}}},fontSizes:{xs:oe(12),sm:oe(14),md:oe(16),lg:oe(18),xl:oe(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:oe(2),sm:oe(4),md:oe(8),lg:oe(16),xl:oe(32)},spacing:{xs:oe(10),sm:oe(12),md:oe(16),lg:oe(20),xl:oe(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${oe(1)} ${oe(3)} rgba(0, 0, 0, 0.05), 0 ${oe(1)} ${oe(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${oe(1)} ${oe(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${oe(10)} ${oe(15)} ${oe(-5)}, rgba(0, 0, 0, 0.04) 0 ${oe(7)} ${oe(7)} ${oe(-5)}`,md:`0 ${oe(1)} ${oe(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${oe(20)} ${oe(25)} ${oe(-5)}, rgba(0, 0, 0, 0.04) 0 ${oe(10)} ${oe(10)} ${oe(-5)}`,lg:`0 ${oe(1)} ${oe(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${oe(28)} ${oe(23)} ${oe(-7)}, rgba(0, 0, 0, 0.04) 0 ${oe(12)} ${oe(12)} ${oe(-7)}`,xl:`0 ${oe(1)} ${oe(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${oe(36)} ${oe(28)} ${oe(-7)}, rgba(0, 0, 0, 0.04) 0 ${oe(17)} ${oe(17)} ${oe(-7)}`},other:{},components:{}};function Vb(e){return e==="auto"||e==="dark"||e==="light"}function ZD({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 Vb(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&&Vb(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const eI="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",Wb="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function Um(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function Hb(e){if(!(e.primaryColor in e.colors))throw new Error(eI);if(typeof e.primaryShade=="object"&&(!Um(e.primaryShade.dark)||!Um(e.primaryShade.light)))throw new Error(Wb);if(typeof e.primaryShade=="number"&&!Um(e.primaryShade))throw new Error(Wb)}function tI(e,t){var r;if(!t)return Hb(e),e;const n=bv(e,t);return t.fontFamily&&!((r=t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),Hb(n),n}const Tv=g.createContext(null),nI=()=>g.useContext(Tv)||kv;function ln(){const e=g.useContext(Tv);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 fC({theme:e,children:t,inherit:n=!0}){const r=nI(),o=g.useMemo(()=>tI(n?r:kv,e),[e,r,n]);return i.jsx(Tv.Provider,{value:o,children:t})}fC.displayName="@mantine/core/MantineThemeProvider";function rI(){const e=ln(),t=Zf(),n=Gt(e.breakpoints).reduce((r,o)=>{const s=e.breakpoints[o].includes("px"),l=Qc(e.breakpoints[o]),u=s?`${l-.1}px`:vf(l-.1),d=s?`${l}px`:vf(l);return`${r}@media (max-width: ${u}) {.mantine-visible-from-${o} {display: none !important;}}@media (min-width: ${d}) {.mantine-hidden-from-${o} {display: none !important;}}`},"");return i.jsx("style",{"data-mantine-styles":"classes",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:n}})}function Vm(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function Oc(e,t){return(Array.isArray(e)?e:[e]).reduce((r,o)=>`${o}{${r}}`,t)}function oI(e,t){const n=Vm(e.variables),r=n?Oc(t,n):"",o=Vm(e.dark),s=Vm(e.light),l=o?Oc(t===":host"?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,o):"",u=s?Oc(t===":host"?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,s):"";return`${r}${l}${u}`}function Pi({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&eo({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function qb(e,t){return Pi({color:e.colors[e.primaryColor][Yc(e,t)],theme:e,autoContrast:null})}function Yd({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:o=!0}){if(!e.colors[t])return{};if(n==="light"){const u=Yc(e,"light"),d={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${u})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${u===9?8:u+1})`,[`--mantine-color-${r}-light`]:nl(e.colors[t][u],.1),[`--mantine-color-${r}-light-hover`]:nl(e.colors[t][u],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${u})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${u})`,[`--mantine-color-${r}-outline-hover`]:nl(e.colors[t][u],.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],...d}:d}const s=Yc(e,"dark"),l={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${s})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${s===9?8:s+1})`,[`--mantine-color-${r}-light`]:nl(e.colors[t][Math.max(0,s-2)],.15),[`--mantine-color-${r}-light-hover`]:nl(e.colors[t][Math.max(0,s-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(s-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(s-4,0)})`,[`--mantine-color-${r}-outline-hover`]:nl(e.colors[t][Math.max(s-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],...l}:l}function iI(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function rl(e,t,n){Gt(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const pC=e=>{const t=Yc(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:oe(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":qb(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":qb(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)"}};rl(r.variables,e.breakpoints,"breakpoint"),rl(r.variables,e.spacing,"spacing"),rl(r.variables,e.fontSizes,"font-size"),rl(r.variables,e.lineHeights,"line-height"),rl(r.variables,e.shadows,"shadow"),rl(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((s,l)=>{r.variables[`--mantine-primary-color-${l}`]=`var(--mantine-color-${e.primaryColor}-${l})`}),Gt(e.colors).forEach(s=>{const l=e.colors[s];if(iI(l)){Object.assign(r.light,Yd({theme:e,name:l.name,color:l.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,Yd({theme:e,name:l.name,color:l.dark,colorScheme:"dark",withColorValues:!0}));return}l.forEach((u,d)=>{r.variables[`--mantine-color-${s}-${d}`]=u}),Object.assign(r.light,Yd({theme:e,color:s,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,Yd({theme:e,color:s,colorScheme:"dark",withColorValues:!1}))});const o=e.headings.sizes;return Gt(o).forEach(s=>{r.variables[`--mantine-${s}-font-size`]=o[s].fontSize,r.variables[`--mantine-${s}-line-height`]=o[s].lineHeight,r.variables[`--mantine-${s}-font-weight`]=o[s].fontWeight||e.headings.fontWeight}),r};function sI({theme:e,generator:t}){const n=pC(e),r=t==null?void 0:t(e);return r?bv(n,r):n}const Wm=pC(kv);function aI(e){const t={variables:{},light:{},dark:{}};return Gt(e.variables).forEach(n=>{Wm.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),Gt(e.light).forEach(n=>{Wm.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),Gt(e.dark).forEach(n=>{Wm.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function lI(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 hC({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=ln(),r=Zf(),o=FD(),s=sI({theme:n,generator:o}),l=e===":root"&&t,u=l?aI(s):s,d=oI(u,e);return d?i.jsx("style",{"data-mantine-styles":!0,nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:`${d}${l?"":lI(e)}`}}):null}hC.displayName="@mantine/CssVariables";function cI(){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 ol(e,t){var o;const n=typeof window<"u"&&"matchMedia"in window&&window.matchMedia("(prefers-color-scheme: dark)").matches,r=e!=="auto"?e:n?"dark":"light";(o=t())==null||o.setAttribute("data-mantine-color-scheme",r)}function uI({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const o=g.useRef(null),[s,l]=g.useState(()=>e.get(t)),u=r||s,d=g.useCallback(h=>{r||(ol(h,n),l(h),e.set(h))},[e.set,u,r]),p=g.useCallback(()=>{l(t),ol(t,n),e.clear()},[e.clear,t]);return g.useEffect(()=>(e.subscribe(d),e.unsubscribe),[e.subscribe,e.unsubscribe]),Ml(()=>{ol(e.get(t),n)},[]),g.useEffect(()=>{var m;if(r)return ol(r,n),()=>{};r===void 0&&ol(s,n),typeof window<"u"&&"matchMedia"in window&&(o.current=window.matchMedia("(prefers-color-scheme: dark)"));const h=y=>{s==="auto"&&ol(y.matches?"dark":"light",n)};return(m=o.current)==null||m.addEventListener("change",h),()=>{var y;return(y=o.current)==null?void 0:y.removeEventListener("change",h)}},[s,r]),{colorScheme:u,setColorScheme:d,clearColorScheme:p}}function dI({respectReducedMotion:e,getRootElement:t}){Ml(()=>{var n;e&&((n=t())==null||n.setAttribute("data-respect-reduced-motion","true"))},[e])}cI();function mC({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:o=!0,deduplicateCssVariables:s=!0,withCssVariables:l=!0,cssVariablesSelector:u=":root",classNamesPrefix:d="mantine",colorSchemeManager:p=ZD(),defaultColorScheme:h="light",getRootElement:m=()=>document.documentElement,cssVariablesResolver:y,forceColorScheme:x,stylesTransform:b}){const{colorScheme:w,setColorScheme:j,clearColorScheme:T}=uI({defaultColorScheme:h,forceColorScheme:x,manager:p,getRootElement:m});return dI({respectReducedMotion:(e==null?void 0:e.respectReducedMotion)||!1,getRootElement:m}),i.jsx(Cv.Provider,{value:{colorScheme:w,setColorScheme:j,clearColorScheme:T,getRootElement:m,classNamesPrefix:d,getStyleNonce:n,cssVariablesResolver:y,cssVariablesSelector:u,withStaticClasses:r,stylesTransform:b},children:i.jsxs(fC,{theme:e,children:[l&&i.jsx(hC,{cssVariablesSelector:u,deduplicateCssVariables:s}),o&&i.jsx(rI,{}),t]})})}mC.displayName="@mantine/core/MantineProvider";function Ol({classNames:e,styles:t,props:n,stylesCtx:r}){const o=ln();return{resolvedClassNames:Jf({theme:o,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:bf({theme:o,styles:t,props:n,stylesCtx:r||void 0})}}const fI={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function pI({theme:e,options:t,unstyled:n}){return It((t==null?void 0:t.focusable)&&!n&&(e.focusClassName||fI[e.focusRing]),(t==null?void 0:t.active)&&!n&&e.activeClassName)}function hI({selector:e,stylesCtx:t,options:n,props:r,theme:o}){return Jf({theme:o,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||r,stylesCtx:t})[e]}function Gb({selector:e,stylesCtx:t,theme:n,classNames:r,props:o}){return Jf({theme:n,classNames:r,props:o,stylesCtx:t})[e]}function mI({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function gI({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function vI({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(o=>`${t}-${o}-${n}`)}function yI({themeName:e,theme:t,selector:n,props:r,stylesCtx:o}){return e.map(s=>{var l,u;return(u=Jf({theme:t,classNames:(l=t.components[s])==null?void 0:l.classNames,props:r,stylesCtx:o}))==null?void 0:u[n]})}function xI({options:e,classes:t,selector:n,unstyled:r}){return e!=null&&e.variant&&!r?t[`${n}--${e.variant}`]:void 0}function bI({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:o,classNames:s,classes:l,unstyled:u,className:d,rootSelector:p,props:h,stylesCtx:m,withStaticClasses:y,headless:x,transformedStyles:b}){return It(pI({theme:e,options:t,unstyled:u||x}),yI({theme:e,themeName:n,selector:r,props:h,stylesCtx:m}),xI({options:t,classes:l,selector:r,unstyled:u}),Gb({selector:r,stylesCtx:m,theme:e,classNames:s,props:h}),Gb({selector:r,stylesCtx:m,theme:e,classNames:b,props:h}),hI({selector:r,stylesCtx:m,options:t,props:h,theme:e}),mI({rootSelector:p,selector:r,className:d}),gI({selector:r,classes:l,unstyled:u||x}),y&&!x&&vI({themeName:n,classNamesPrefix:o,selector:r,withStaticClass:t==null?void 0:t.withStaticClass}),t==null?void 0:t.className)}function wI({theme:e,themeName:t,props:n,stylesCtx:r,selector:o}){return t.map(s=>{var l;return bf({theme:e,styles:(l=e.components[s])==null?void 0:l.styles,props:n,stylesCtx:r})[o]}).reduce((s,l)=>({...s,...l}),{})}function _g({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,..._g({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function SI(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...gs(n[r])}}),t),{})}function jI({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:o,selector:s,themeName:l,headless:u}){var d;return(d=SI([u?{}:t==null?void 0:t(n,r,o),...l.map(p=>{var h,m,y;return(y=(m=(h=n.components)==null?void 0:h[p])==null?void 0:m.vars)==null?void 0:y.call(m,n,r,o)}),e==null?void 0:e(n,r,o)]))==null?void 0:d[s]}function CI({theme:e,themeName:t,selector:n,options:r,props:o,stylesCtx:s,rootSelector:l,styles:u,style:d,vars:p,varsResolver:h,headless:m,withStylesTransform:y}){return{...!y&&wI({theme:e,themeName:t,props:o,stylesCtx:s,selector:n}),...!y&&bf({theme:e,styles:u,props:o,stylesCtx:s})[n],...!y&&bf({theme:e,styles:r==null?void 0:r.styles,props:(r==null?void 0:r.props)||o,stylesCtx:s})[n],...jI({theme:e,props:o,stylesCtx:s,vars:p,varsResolver:h,selector:n,themeName:t,headless:m}),...l===n?_g({style:d,theme:e}):null,..._g({style:r==null?void 0:r.style,theme:e})}}function EI({props:e,stylesCtx:t,themeName:n}){var l;const r=ln(),o=(l=WD())==null?void 0:l();return{getTransformedStyles:u=>o?[...u.map(p=>o(p,{props:e,theme:r,ctx:t})),...n.map(p=>{var h;return o((h=r.components[p])==null?void 0:h.styles,{props:e,theme:r,ctx:t})})].filter(Boolean):[],withStylesTransform:!!o}}function Ne({name:e,classes:t,props:n,stylesCtx:r,className:o,style:s,rootSelector:l="root",unstyled:u,classNames:d,styles:p,vars:h,varsResolver:m}){const y=ln(),x=zD(),b=BD(),w=UD(),j=(Array.isArray(e)?e:[e]).filter(k=>k),{withStylesTransform:T,getTransformedStyles:P}=EI({props:n,stylesCtx:r,themeName:j});return(k,E)=>({className:bI({theme:y,options:E,themeName:j,selector:k,classNamesPrefix:x,classNames:d,classes:t,unstyled:u,className:o,rootSelector:l,props:n,stylesCtx:r,withStaticClasses:b,headless:w,transformedStyles:P([E==null?void 0:E.styles,p])}),style:CI({theme:y,themeName:j,selector:k,options:E,props:n,stylesCtx:r,rootSelector:l,styles:p,style:s,vars:h,varsResolver:m,headless:w,withStylesTransform:T})})}function ma(e,t){return typeof e=="boolean"?e:t.autoContrast}function Qb(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 kI({keepTransitions:e}={}){const t=g.useRef(xf),n=g.useRef(-1),r=g.useContext(Cv),o=Zf(),s=g.useRef(o==null?void 0:o());if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const l=m=>{r.setColorScheme(m),t.current=e?()=>{}:Qb(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var y;(y=t.current)==null||y.call(t)},10)},u=()=>{r.clearColorScheme(),t.current=e?()=>{}:Qb(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var m;(m=t.current)==null||m.call(t)},10)},d=bD("light",{getInitialValueInEffect:!1}),p=r.colorScheme==="auto"?d:r.colorScheme,h=g.useCallback(()=>l(p==="light"?"dark":"light"),[l,p]);return g.useEffect(()=>()=>{var m;(m=t.current)==null||m.call(t),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:l,clearColorScheme:u,toggleColorScheme:h}}function ie(e,t,n){var l;const r=ln(),o=(l=r.components[e])==null?void 0:l.defaultProps,s=typeof o=="function"?o(r):o;return{...t,...s,...gs(n)}}function Hm(e){return Gt(e).reduce((t,n)=>e[n]!==void 0?`${t}${lD(n)}:${e[n]};`:t,"").trim()}function TI({selector:e,styles:t,media:n,container:r}){const o=t?Hm(t):"",s=Array.isArray(n)?n.map(u=>`@media${u.query}{${e}{${Hm(u.styles)}}}`):[],l=Array.isArray(r)?r.map(u=>`@container ${u.query}{${e}{${Hm(u.styles)}}}`):[];return`${o?`${e}{${o}}`:""}${s.join("")}${l.join("")}`.trim()}function ga(e){const t=Zf();return i.jsx("style",{"data-mantine-styles":"inline",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:TI(e)}})}function Ri(e){const{m:t,mx:n,my:r,mt:o,mb:s,ml:l,mr:u,me:d,ms:p,p:h,px:m,py:y,pt:x,pb:b,pl:w,pr:j,pe:T,ps:P,bd:k,bg:E,c:_,opacity:R,ff:M,fz:N,fw:L,lts:z,ta:q,lh:G,fs:Y,tt:Q,td:te,w:V,miw:O,maw:A,h:B,mih:I,mah:F,bgsz:J,bgp:de,bgr:Ee,bga:ve,pos:we,top:_e,left:fe,bottom:Je,right:pt,inset:at,display:St,flex:jt,hiddenFrom:Et,visibleFrom:vt,lightHidden:kt,darkHidden:ce,sx:pe,...Re}=e;return{styleProps:gs({m:t,mx:n,my:r,mt:o,mb:s,ml:l,mr:u,me:d,ms:p,p:h,px:m,py:y,pt:x,pb:b,pl:w,pr:j,pe:T,ps:P,bd:k,bg:E,c:_,opacity:R,ff:M,fz:N,fw:L,lts:z,ta:q,lh:G,fs:Y,tt:Q,td:te,w:V,miw:O,maw:A,h:B,mih:I,mah:F,bgsz:J,bgp:de,bgr:Ee,bga:ve,pos:we,top:_e,left:fe,bottom:Je,right:pt,inset:at,display:St,flex:jt,hiddenFrom:Et,visibleFrom:vt,lightHidden:kt,darkHidden:ce,sx:pe}),rest:Re}}const PI={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bd:{type:"border",property:"border"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"size",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};function Pv(e,t){const n=eo({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 RI(e,t){const n=eo({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:Pv(e,t)}function _I(e,t){if(typeof e=="number")return oe(e);if(typeof e=="string"){const[n,r,...o]=e.split(" ").filter(l=>l.trim()!=="");let s=`${oe(n)}`;return r&&(s+=` ${r}`),o.length>0&&(s+=` ${Pv(o.join(" "),t)}`),s.trim()}return e}const Kb={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 DI(e){return typeof e=="string"&&e in Kb?Kb[e]:e}const II=["h1","h2","h3","h4","h5","h6"];function NI(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&II.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?oe(e):e}function AI(e){return e}const MI=["h1","h2","h3","h4","h5","h6"];function OI(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&MI.includes(e)?`var(--mantine-${e}-line-height)`:e}function LI(e){return typeof e=="number"?oe(e):e}function $I(e,t){if(typeof e=="number")return oe(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return oe(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const qm={color:Pv,textColor:RI,fontSize:NI,spacing:$I,identity:AI,size:LI,lineHeight:OI,fontFamily:DI,border:_I};function Yb(e){return e.replace("(min-width: ","").replace("em)","")}function FI({media:e,...t}){const r=Object.keys(e).sort((o,s)=>Number(Yb(o))-Number(Yb(s))).map(o=>({query:o,styles:e[o]}));return{...t,media:r}}function zI(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function BI(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function UI(e){return typeof e=="object"&&e!==null?Gt(e).filter(t=>t!=="base"):[]}function VI(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function gC({styleProps:e,data:t,theme:n}){return FI(Gt(e).reduce((r,o)=>{if(o==="hiddenFrom"||o==="visibleFrom"||o==="sx")return r;const s=t[o],l=Array.isArray(s.property)?s.property:[s.property],u=BI(e[o]);if(!zI(e[o]))return l.forEach(p=>{r.inlineStyles[p]=qm[s.type](u,n)}),r;r.hasResponsiveStyles=!0;const d=UI(e[o]);return l.forEach(p=>{u&&(r.styles[p]=qm[s.type](u,n)),d.forEach(h=>{const m=`(min-width: ${n.breakpoints[h]})`;r.media[m]={...r.media[m],[p]:qm[s.type](VI(e[o],h),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function fu(){return`__m__-${g.useId().replace(/:/g,"")}`}function vC(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...vC(r,t)}),{}):typeof e=="function"?e(t):e??{}}function yC(e){return e.startsWith("data-")?e:`data-${e}`}function WI(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[yC(n)]=e[n]),t},{})}function xC(e){return e?typeof e=="string"?{[yC(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...xC(n)}),{}):WI(e):null}function Dg(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Dg(r,t)}),{}):typeof e=="function"?e(t):e??{}}function HI({theme:e,style:t,vars:n,styleProps:r}){const o=Dg(t,e),s=Dg(n,e);return{...o,...s,...r}}const bC=g.forwardRef(({component:e,style:t,__vars:n,className:r,variant:o,mod:s,size:l,hiddenFrom:u,visibleFrom:d,lightHidden:p,darkHidden:h,renderRoot:m,__size:y,...x},b)=>{var N;const w=ln(),j=e||"div",{styleProps:T,rest:P}=Ri(x),k=VD(),E=(N=k==null?void 0:k())==null?void 0:N(T.sx),_=fu(),R=gC({styleProps:T,theme:w,data:PI}),M={ref:b,style:HI({theme:w,style:t,vars:n,styleProps:R.inlineStyles}),className:It(r,E,{[_]:R.hasResponsiveStyles,"mantine-light-hidden":p,"mantine-dark-hidden":h,[`mantine-hidden-from-${u}`]:u,[`mantine-visible-from-${d}`]:d}),"data-variant":o,"data-size":Zj(l)?void 0:l||void 0,size:y,...xC(s),...P};return i.jsxs(i.Fragment,{children:[R.hasResponsiveStyles&&i.jsx(ga,{selector:`.${_}`,styles:R.styles,media:R.media}),typeof m=="function"?m(M):i.jsx(j,{...M})]})});bC.displayName="@mantine/core/Box";const se=bC;function wC(e){return e}function ue(e){const t=g.forwardRef(e);return t.extend=wC,t.withProps=n=>{const r=g.forwardRef((o,s)=>i.jsx(t,{...n,...o,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t}function or(e){const t=g.forwardRef(e);return t.withProps=n=>{const r=g.forwardRef((o,s)=>i.jsx(t,{...n,...o,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t.extend=wC,t}const qI=g.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function va(){return g.useContext(qI)}var Gm={exports:{}},Sr={},Qm={exports:{}},Km={};/**
|
|
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
|
-
*/var Xb;function GI(){return Xb||(Xb=1,function(e){function t(A,B){var I=A.length;A.push(B);e:for(;0<I;){var F=I-1>>>1,J=A[F];if(0<o(J,B))A[F]=B,A[I]=J,I=F;else break e}}function n(A){return A.length===0?null:A[0]}function r(A){if(A.length===0)return null;var B=A[0],I=A.pop();if(I!==B){A[0]=I;e:for(var F=0,J=A.length,de=J>>>1;F<de;){var Ee=2*(F+1)-1,ve=A[Ee],we=Ee+1,_e=A[we];if(0>o(ve,I))we<J&&0>o(_e,ve)?(A[F]=_e,A[we]=I,F=we):(A[F]=ve,A[Ee]=I,F=Ee);else if(we<J&&0>o(_e,I))A[F]=_e,A[we]=I,F=we;else break e}}return B}function o(A,B){var I=A.sortIndex-B.sortIndex;return I!==0?I:A.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],p=[],h=1,m=null,y=3,x=!1,b=!1,w=!1,j=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(A){for(var B=n(p);B!==null;){if(B.callback===null)r(p);else if(B.startTime<=A)r(p),B.sortIndex=B.expirationTime,t(d,B);else break;B=n(p)}}function E(A){if(w=!1,k(A),!b)if(n(d)!==null)b=!0,V(_);else{var B=n(p);B!==null&&O(E,B.startTime-A)}}function _(A,B){b=!1,w&&(w=!1,T(N),N=-1),x=!0;var I=y;try{for(k(B),m=n(d);m!==null&&(!(m.expirationTime>B)||A&&!q());){var F=m.callback;if(typeof F=="function"){m.callback=null,y=m.priorityLevel;var J=F(m.expirationTime<=B);B=e.unstable_now(),typeof J=="function"?m.callback=J:m===n(d)&&r(d),k(B)}else r(d);m=n(d)}if(m!==null)var de=!0;else{var Ee=n(p);Ee!==null&&O(E,Ee.startTime-B),de=!1}return de}finally{m=null,y=I,x=!1}}var R=!1,M=null,N=-1,L=5,z=-1;function q(){return!(e.unstable_now()-z<L)}function G(){if(M!==null){var A=e.unstable_now();z=A;var B=!0;try{B=M(!0,A)}finally{B?Y():(R=!1,M=null)}}else R=!1}var Y;if(typeof P=="function")Y=function(){P(G)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,te=Q.port2;Q.port1.onmessage=G,Y=function(){te.postMessage(null)}}else Y=function(){j(G,0)};function V(A){M=A,R||(R=!0,Y())}function O(A,B){N=j(function(){A(e.unstable_now())},B)}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(A){A.callback=null},e.unstable_continueExecution=function(){b||x||(b=!0,V(_))},e.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<A?Math.floor(1e3/A):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(A){switch(y){case 1:case 2:case 3:var B=3;break;default:B=y}var I=y;y=B;try{return A()}finally{y=I}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(A,B){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var I=y;y=A;try{return B()}finally{y=I}},e.unstable_scheduleCallback=function(A,B,I){var F=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?F+I:F):I=F,A){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=I+J,A={id:h++,callback:B,priorityLevel:A,startTime:I,expirationTime:J,sortIndex:-1},I>F?(A.sortIndex=I,t(p,A),n(d)===null&&A===n(p)&&(w?(T(N),N=-1):w=!0,O(E,I-F))):(A.sortIndex=J,t(d,A),b||x||(b=!0,V(_))),A},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(A){var B=y;return function(){var I=y;y=B;try{return A.apply(this,arguments)}finally{y=I}}}}(Km)),Km}var Jb;function QI(){return Jb||(Jb=1,Qm.exports=GI()),Qm.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 Zb;function KI(){if(Zb)return Sr;Zb=1;var e=xv(),t=QI();function n(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,f=1;f<arguments.length;f++)c+="&args[]="+encodeURIComponent(arguments[f]);return"Minified React error #"+a+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,o={};function s(a,c){l(a,c),l(a+"Capture",c)}function l(a,c){for(o[a]=c,a=0;a<c.length;a++)r.add(c[a])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,p=/^[: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]*$/,h={},m={};function y(a){return d.call(m,a)?!0:d.call(h,a)?!1:p.test(a)?m[a]=!0:(h[a]=!0,!1)}function x(a,c,f,v){if(f!==null&&f.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return v?!1:f!==null?!f.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function b(a,c,f,v){if(c===null||typeof c>"u"||x(a,c,f,v))return!0;if(v)return!1;if(f!==null)switch(f.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function w(a,c,f,v,S,C,D){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=v,this.attributeNamespace=S,this.mustUseProperty=f,this.propertyName=a,this.type=c,this.sanitizeURL=C,this.removeEmptyString=D}var j={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){j[a]=new w(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];j[c]=new w(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){j[a]=new w(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){j[a]=new w(a,2,!1,a,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(a){j[a]=new w(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){j[a]=new w(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){j[a]=new w(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){j[a]=new w(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){j[a]=new w(a,5,!1,a.toLowerCase(),null,!1,!1)});var T=/[\-:]([a-z])/g;function P(a){return a[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(a){var c=a.replace(T,P);j[c]=new w(c,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var c=a.replace(T,P);j[c]=new w(c,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var c=a.replace(T,P);j[c]=new w(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){j[a]=new w(a,1,!1,a.toLowerCase(),null,!1,!1)}),j.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){j[a]=new w(a,1,!1,a.toLowerCase(),null,!0,!0)});function k(a,c,f,v){var S=j.hasOwnProperty(c)?j[c]:null;(S!==null?S.type!==0:v||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(b(c,f,S,v)&&(f=null),v||S===null?y(c)&&(f===null?a.removeAttribute(c):a.setAttribute(c,""+f)):S.mustUseProperty?a[S.propertyName]=f===null?S.type===3?!1:"":f:(c=S.attributeName,v=S.attributeNamespace,f===null?a.removeAttribute(c):(S=S.type,f=S===3||S===4&&f===!0?"":""+f,v?a.setAttributeNS(v,c,f):a.setAttribute(c,f))))}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,_=Symbol.for("react.element"),R=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),z=Symbol.for("react.provider"),q=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),A=Symbol.iterator;function B(a){return a===null||typeof a!="object"?null:(a=A&&a[A]||a["@@iterator"],typeof a=="function"?a:null)}var I=Object.assign,F;function J(a){if(F===void 0)try{throw Error()}catch(f){var c=f.stack.trim().match(/\n( *(at )?)/);F=c&&c[1]||""}return`
|
|
77
|
-
`+F+a}var de=!1;function Ee(a,c){if(!a||de)return"";de=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(ne){var v=ne}Reflect.construct(a,[],c)}else{try{c.call()}catch(ne){v=ne}a.call(c.prototype)}else{try{throw Error()}catch(ne){v=ne}a()}}catch(ne){if(ne&&v&&typeof ne.stack=="string"){for(var S=ne.stack.split(`
|
|
78
|
-
`),C=v.stack.split(`
|
|
79
|
-
`),D=S.length-1,$=C.length-1;1<=D&&0<=$&&S[D]!==C[$];)$--;for(;1<=D&&0<=$;D--,$--)if(S[D]!==C[$]){if(D!==1||$!==1)do if(D--,$--,0>$||S[D]!==C[$]){var W=`
|
|
80
|
-
`+S[D].replace(" at new "," at ");return a.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",a.displayName)),W}while(1<=D&&0<=$);break}}}finally{de=!1,Error.prepareStackTrace=f}return(a=a?a.displayName||a.name:"")?J(a):""}function ve(a){switch(a.tag){case 5:return J(a.type);case 16:return J("Lazy");case 13:return J("Suspense");case 19:return J("SuspenseList");case 0:case 2:case 15:return a=Ee(a.type,!1),a;case 11:return a=Ee(a.type.render,!1),a;case 1:return a=Ee(a.type,!0),a;default:return""}}function we(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case M:return"Fragment";case R:return"Portal";case L:return"Profiler";case N:return"StrictMode";case Y:return"Suspense";case Q:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case q:return(a.displayName||"Context")+".Consumer";case z:return(a._context.displayName||"Context")+".Provider";case G:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case te:return c=a.displayName||null,c!==null?c:we(a.type)||"Memo";case V:c=a._payload,a=a._init;try{return we(a(c))}catch{}}return null}function _e(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return we(c);case 8:return c===N?"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 c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function fe(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Je(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function pt(a){var c=Je(a)?"checked":"value",f=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),v=""+a[c];if(!a.hasOwnProperty(c)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var S=f.get,C=f.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return S.call(this)},set:function(D){v=""+D,C.call(this,D)}}),Object.defineProperty(a,c,{enumerable:f.enumerable}),{getValue:function(){return v},setValue:function(D){v=""+D},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function at(a){a._valueTracker||(a._valueTracker=pt(a))}function St(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var f=c.getValue(),v="";return a&&(v=Je(a)?a.checked?"true":"false":a.value),a=v,a!==f?(c.setValue(a),!0):!1}function jt(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Et(a,c){var f=c.checked;return I({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??a._wrapperState.initialChecked})}function vt(a,c){var f=c.defaultValue==null?"":c.defaultValue,v=c.checked!=null?c.checked:c.defaultChecked;f=fe(c.value!=null?c.value:f),a._wrapperState={initialChecked:v,initialValue:f,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function kt(a,c){c=c.checked,c!=null&&k(a,"checked",c,!1)}function ce(a,c){kt(a,c);var f=fe(c.value),v=c.type;if(f!=null)v==="number"?(f===0&&a.value===""||a.value!=f)&&(a.value=""+f):a.value!==""+f&&(a.value=""+f);else if(v==="submit"||v==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?Re(a,c.type,f):c.hasOwnProperty("defaultValue")&&Re(a,c.type,fe(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function pe(a,c,f){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var v=c.type;if(!(v!=="submit"&&v!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,f||c===a.value||(a.value=c),a.defaultValue=c}f=a.name,f!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,f!==""&&(a.name=f)}function Re(a,c,f){(c!=="number"||jt(a.ownerDocument)!==a)&&(f==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+f&&(a.defaultValue=""+f))}var He=Array.isArray;function he(a,c,f,v){if(a=a.options,c){c={};for(var S=0;S<f.length;S++)c["$"+f[S]]=!0;for(f=0;f<a.length;f++)S=c.hasOwnProperty("$"+a[f].value),a[f].selected!==S&&(a[f].selected=S),S&&v&&(a[f].defaultSelected=!0)}else{for(f=""+fe(f),c=null,S=0;S<a.length;S++){if(a[S].value===f){a[S].selected=!0,v&&(a[S].defaultSelected=!0);return}c!==null||a[S].disabled||(c=a[S])}c!==null&&(c.selected=!0)}}function ke(a,c){if(c.dangerouslySetInnerHTML!=null)throw Error(n(91));return I({},c,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function ae(a,c){var f=c.value;if(f==null){if(f=c.children,c=c.defaultValue,f!=null){if(c!=null)throw Error(n(92));if(He(f)){if(1<f.length)throw Error(n(93));f=f[0]}c=f}c==null&&(c=""),f=c}a._wrapperState={initialValue:fe(f)}}function Ae(a,c){var f=fe(c.value),v=fe(c.defaultValue);f!=null&&(f=""+f,f!==a.value&&(a.value=f),c.defaultValue==null&&a.defaultValue!==f&&(a.defaultValue=f)),v!=null&&(a.defaultValue=""+v)}function ut(a){var c=a.textContent;c===a._wrapperState.initialValue&&c!==""&&c!==null&&(a.value=c)}function Mt(a){switch(a){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 bt(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?Mt(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var ht,xn=function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,f,v,S){MSApp.execUnsafeLocalFunction(function(){return a(c,f,v,S)})}:a}(function(a,c){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=c;else{for(ht=ht||document.createElement("div"),ht.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=ht.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function cn(a,c){if(c){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=c;return}}a.textContent=c}var Qn={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},Kn=["Webkit","ms","Moz","O"];Object.keys(Qn).forEach(function(a){Kn.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),Qn[c]=Qn[a]})});function Jo(a,c,f){return c==null||typeof c=="boolean"||c===""?"":f||typeof c!="number"||c===0||Qn.hasOwnProperty(a)&&Qn[a]?(""+c).trim():c+"px"}function Ts(a,c){a=a.style;for(var f in c)if(c.hasOwnProperty(f)){var v=f.indexOf("--")===0,S=Jo(f,c[f],v);f==="float"&&(f="cssFloat"),v?a.setProperty(f,S):a[f]=S}}var Ra=I({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 ir(a,c){if(c){if(Ra[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(n(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(n(61))}if(c.style!=null&&typeof c.style!="object")throw Error(n(62))}}function Io(a,c){if(a.indexOf("-")===-1)return typeof c.is=="string";switch(a){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 No=null;function Zo(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var lo=null,gr=null,sr=null;function $n(a){if(a=yc(a)){if(typeof lo!="function")throw Error(n(280));var c=a.stateNode;c&&(c=ad(c),lo(a.stateNode,a.type,c))}}function _a(a){gr?sr?sr.push(a):sr=[a]:gr=a}function Da(){if(gr){var a=gr,c=sr;if(sr=gr=null,$n(a),c)for(a=0;a<c.length;a++)$n(c[a])}}function ei(a,c){return a(c)}function ti(){}var bn=!1;function Ao(a,c,f){if(bn)return a(c,f);bn=!0;try{return ei(a,c,f)}finally{bn=!1,(gr!==null||sr!==null)&&(ti(),Da())}}function U(a,c){var f=a.stateNode;if(f===null)return null;var v=ad(f);if(v===null)return null;f=v[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(v=!v.disabled)||(a=a.type,v=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!v;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(n(231,c,typeof f));return f}var K=!1;if(u)try{var ee={};Object.defineProperty(ee,"passive",{get:function(){K=!0}}),window.addEventListener("test",ee,ee),window.removeEventListener("test",ee,ee)}catch{K=!1}function le(a,c,f,v,S,C,D,$,W){var ne=Array.prototype.slice.call(arguments,3);try{c.apply(f,ne)}catch(ge){this.onError(ge)}}var De=!1,Ge=null,ot=!1,Me=null,Be={onError:function(a){De=!0,Ge=a}};function Se(a,c,f,v,S,C,D,$,W){De=!1,Ge=null,le.apply(Be,arguments)}function Ke(a,c,f,v,S,C,D,$,W){if(Se.apply(this,arguments),De){if(De){var ne=Ge;De=!1,Ge=null}else throw Error(n(198));ot||(ot=!0,Me=ne)}}function lt(a){var c=a,f=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,c.flags&4098&&(f=c.return),a=c.return;while(a)}return c.tag===3?f:null}function mt(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function wn(a){if(lt(a)!==a)throw Error(n(188))}function Ut(a){var c=a.alternate;if(!c){if(c=lt(a),c===null)throw Error(n(188));return c!==a?null:a}for(var f=a,v=c;;){var S=f.return;if(S===null)break;var C=S.alternate;if(C===null){if(v=S.return,v!==null){f=v;continue}break}if(S.child===C.child){for(C=S.child;C;){if(C===f)return wn(S),a;if(C===v)return wn(S),c;C=C.sibling}throw Error(n(188))}if(f.return!==v.return)f=S,v=C;else{for(var D=!1,$=S.child;$;){if($===f){D=!0,f=S,v=C;break}if($===v){D=!0,v=S,f=C;break}$=$.sibling}if(!D){for($=C.child;$;){if($===f){D=!0,f=C,v=S;break}if($===v){D=!0,v=C,f=S;break}$=$.sibling}if(!D)throw Error(n(189))}}if(f.alternate!==v)throw Error(n(190))}if(f.tag!==3)throw Error(n(188));return f.stateNode.current===f?a:c}function Tt(a){return a=Ut(a),a!==null?en(a):null}function en(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=en(a);if(c!==null)return c;a=a.sibling}return null}var ni=t.unstable_scheduleCallback,$i=t.unstable_cancelCallback,co=t.unstable_shouldYield,Wr=t.unstable_requestPaint,tn=t.unstable_now,Ps=t.unstable_getCurrentPriorityLevel,uo=t.unstable_ImmediatePriority,Rs=t.unstable_UserBlockingPriority,ri=t.unstable_NormalPriority,Pt=t.unstable_LowPriority,nn=t.unstable_IdlePriority,fo=null,Yn=null;function Sn(a){if(Yn&&typeof Yn.onCommitFiberRoot=="function")try{Yn.onCommitFiberRoot(fo,a,void 0,(a.current.flags&128)===128)}catch{}}var Fn=Math.clz32?Math.clz32:UR,Uu=Math.log,eh=Math.LN2;function UR(a){return a>>>=0,a===0?32:31-(Uu(a)/eh|0)|0}var Vu=64,Wu=4194304;function ec(a){switch(a&-a){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 a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Hu(a,c){var f=a.pendingLanes;if(f===0)return 0;var v=0,S=a.suspendedLanes,C=a.pingedLanes,D=f&268435455;if(D!==0){var $=D&~S;$!==0?v=ec($):(C&=D,C!==0&&(v=ec(C)))}else D=f&~S,D!==0?v=ec(D):C!==0&&(v=ec(C));if(v===0)return 0;if(c!==0&&c!==v&&!(c&S)&&(S=v&-v,C=c&-c,S>=C||S===16&&(C&4194240)!==0))return c;if(v&4&&(v|=f&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=v;0<c;)f=31-Fn(c),S=1<<f,v|=a[f],c&=~S;return v}function VR(a,c){switch(a){case 1:case 2:case 4:return c+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 c+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 WR(a,c){for(var f=a.suspendedLanes,v=a.pingedLanes,S=a.expirationTimes,C=a.pendingLanes;0<C;){var D=31-Fn(C),$=1<<D,W=S[D];W===-1?(!($&f)||$&v)&&(S[D]=VR($,c)):W<=c&&(a.expiredLanes|=$),C&=~$}}function th(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function s0(){var a=Vu;return Vu<<=1,!(Vu&4194240)&&(Vu=64),a}function nh(a){for(var c=[],f=0;31>f;f++)c.push(a);return c}function tc(a,c,f){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-Fn(c),a[c]=f}function HR(a,c){var f=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var v=a.eventTimes;for(a=a.expirationTimes;0<f;){var S=31-Fn(f),C=1<<S;c[S]=0,v[S]=-1,a[S]=-1,f&=~C}}function rh(a,c){var f=a.entangledLanes|=c;for(a=a.entanglements;f;){var v=31-Fn(f),S=1<<v;S&c|a[v]&c&&(a[v]|=c),f&=~S}}var Ft=0;function a0(a){return a&=-a,1<a?4<a?a&268435455?16:536870912:4:1}var l0,oh,c0,u0,d0,ih=!1,qu=[],Fi=null,zi=null,Bi=null,nc=new Map,rc=new Map,Ui=[],qR="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 f0(a,c){switch(a){case"focusin":case"focusout":Fi=null;break;case"dragenter":case"dragleave":zi=null;break;case"mouseover":case"mouseout":Bi=null;break;case"pointerover":case"pointerout":nc.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":rc.delete(c.pointerId)}}function oc(a,c,f,v,S,C){return a===null||a.nativeEvent!==C?(a={blockedOn:c,domEventName:f,eventSystemFlags:v,nativeEvent:C,targetContainers:[S]},c!==null&&(c=yc(c),c!==null&&oh(c)),a):(a.eventSystemFlags|=v,c=a.targetContainers,S!==null&&c.indexOf(S)===-1&&c.push(S),a)}function GR(a,c,f,v,S){switch(c){case"focusin":return Fi=oc(Fi,a,c,f,v,S),!0;case"dragenter":return zi=oc(zi,a,c,f,v,S),!0;case"mouseover":return Bi=oc(Bi,a,c,f,v,S),!0;case"pointerover":var C=S.pointerId;return nc.set(C,oc(nc.get(C)||null,a,c,f,v,S)),!0;case"gotpointercapture":return C=S.pointerId,rc.set(C,oc(rc.get(C)||null,a,c,f,v,S)),!0}return!1}function p0(a){var c=_s(a.target);if(c!==null){var f=lt(c);if(f!==null){if(c=f.tag,c===13){if(c=mt(f),c!==null){a.blockedOn=c,d0(a.priority,function(){c0(f)});return}}else if(c===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Gu(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var f=ah(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(f===null){f=a.nativeEvent;var v=new f.constructor(f.type,f);No=v,f.target.dispatchEvent(v),No=null}else return c=yc(f),c!==null&&oh(c),a.blockedOn=f,!1;c.shift()}return!0}function h0(a,c,f){Gu(a)&&f.delete(c)}function QR(){ih=!1,Fi!==null&&Gu(Fi)&&(Fi=null),zi!==null&&Gu(zi)&&(zi=null),Bi!==null&&Gu(Bi)&&(Bi=null),nc.forEach(h0),rc.forEach(h0)}function ic(a,c){a.blockedOn===c&&(a.blockedOn=null,ih||(ih=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,QR)))}function sc(a){function c(S){return ic(S,a)}if(0<qu.length){ic(qu[0],a);for(var f=1;f<qu.length;f++){var v=qu[f];v.blockedOn===a&&(v.blockedOn=null)}}for(Fi!==null&&ic(Fi,a),zi!==null&&ic(zi,a),Bi!==null&&ic(Bi,a),nc.forEach(c),rc.forEach(c),f=0;f<Ui.length;f++)v=Ui[f],v.blockedOn===a&&(v.blockedOn=null);for(;0<Ui.length&&(f=Ui[0],f.blockedOn===null);)p0(f),f.blockedOn===null&&Ui.shift()}var Ia=E.ReactCurrentBatchConfig,Qu=!0;function KR(a,c,f,v){var S=Ft,C=Ia.transition;Ia.transition=null;try{Ft=1,sh(a,c,f,v)}finally{Ft=S,Ia.transition=C}}function YR(a,c,f,v){var S=Ft,C=Ia.transition;Ia.transition=null;try{Ft=4,sh(a,c,f,v)}finally{Ft=S,Ia.transition=C}}function sh(a,c,f,v){if(Qu){var S=ah(a,c,f,v);if(S===null)Ch(a,c,v,Ku,f),f0(a,v);else if(GR(S,a,c,f,v))v.stopPropagation();else if(f0(a,v),c&4&&-1<qR.indexOf(a)){for(;S!==null;){var C=yc(S);if(C!==null&&l0(C),C=ah(a,c,f,v),C===null&&Ch(a,c,v,Ku,f),C===S)break;S=C}S!==null&&v.stopPropagation()}else Ch(a,c,v,null,f)}}var Ku=null;function ah(a,c,f,v){if(Ku=null,a=Zo(v),a=_s(a),a!==null)if(c=lt(a),c===null)a=null;else if(f=c.tag,f===13){if(a=mt(c),a!==null)return a;a=null}else if(f===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null);return Ku=a,null}function m0(a){switch(a){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(Ps()){case uo:return 1;case Rs:return 4;case ri:case Pt:return 16;case nn:return 536870912;default:return 16}default:return 16}}var Vi=null,lh=null,Yu=null;function g0(){if(Yu)return Yu;var a,c=lh,f=c.length,v,S="value"in Vi?Vi.value:Vi.textContent,C=S.length;for(a=0;a<f&&c[a]===S[a];a++);var D=f-a;for(v=1;v<=D&&c[f-v]===S[C-v];v++);return Yu=S.slice(a,1<v?1-v:void 0)}function Xu(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function Ju(){return!0}function v0(){return!1}function Nr(a){function c(f,v,S,C,D){this._reactName=f,this._targetInst=S,this.type=v,this.nativeEvent=C,this.target=D,this.currentTarget=null;for(var $ in a)a.hasOwnProperty($)&&(f=a[$],this[$]=f?f(C):C[$]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?Ju:v0,this.isPropagationStopped=v0,this}return I(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Ju)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Ju)},persist:function(){},isPersistent:Ju}),c}var Na={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ch=Nr(Na),ac=I({},Na,{view:0,detail:0}),XR=Nr(ac),uh,dh,lc,Zu=I({},ac,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ph,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==lc&&(lc&&a.type==="mousemove"?(uh=a.screenX-lc.screenX,dh=a.screenY-lc.screenY):dh=uh=0,lc=a),uh)},movementY:function(a){return"movementY"in a?a.movementY:dh}}),y0=Nr(Zu),JR=I({},Zu,{dataTransfer:0}),ZR=Nr(JR),e2=I({},ac,{relatedTarget:0}),fh=Nr(e2),t2=I({},Na,{animationName:0,elapsedTime:0,pseudoElement:0}),n2=Nr(t2),r2=I({},Na,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),o2=Nr(r2),i2=I({},Na,{data:0}),x0=Nr(i2),s2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a2={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"},l2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function c2(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=l2[a])?!!c[a]:!1}function ph(){return c2}var u2=I({},ac,{key:function(a){if(a.key){var c=s2[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=Xu(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?a2[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ph,charCode:function(a){return a.type==="keypress"?Xu(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Xu(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),d2=Nr(u2),f2=I({},Zu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),b0=Nr(f2),p2=I({},ac,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ph}),h2=Nr(p2),m2=I({},Na,{propertyName:0,elapsedTime:0,pseudoElement:0}),g2=Nr(m2),v2=I({},Zu,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),y2=Nr(v2),x2=[9,13,27,32],hh=u&&"CompositionEvent"in window,cc=null;u&&"documentMode"in document&&(cc=document.documentMode);var b2=u&&"TextEvent"in window&&!cc,w0=u&&(!hh||cc&&8<cc&&11>=cc),S0=" ",j0=!1;function C0(a,c){switch(a){case"keyup":return x2.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function E0(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Aa=!1;function w2(a,c){switch(a){case"compositionend":return E0(c);case"keypress":return c.which!==32?null:(j0=!0,S0);case"textInput":return a=c.data,a===S0&&j0?null:a;default:return null}}function S2(a,c){if(Aa)return a==="compositionend"||!hh&&C0(a,c)?(a=g0(),Yu=lh=Vi=null,Aa=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return w0&&c.locale!=="ko"?null:c.data;default:return null}}var j2={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 k0(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!j2[a.type]:c==="textarea"}function T0(a,c,f,v){_a(v),c=od(c,"onChange"),0<c.length&&(f=new ch("onChange","change",null,f,v),a.push({event:f,listeners:c}))}var uc=null,dc=null;function C2(a){H0(a,0)}function ed(a){var c=Fa(a);if(St(c))return a}function E2(a,c){if(a==="change")return c}var P0=!1;if(u){var mh;if(u){var gh="oninput"in document;if(!gh){var R0=document.createElement("div");R0.setAttribute("oninput","return;"),gh=typeof R0.oninput=="function"}mh=gh}else mh=!1;P0=mh&&(!document.documentMode||9<document.documentMode)}function _0(){uc&&(uc.detachEvent("onpropertychange",D0),dc=uc=null)}function D0(a){if(a.propertyName==="value"&&ed(dc)){var c=[];T0(c,dc,a,Zo(a)),Ao(C2,c)}}function k2(a,c,f){a==="focusin"?(_0(),uc=c,dc=f,uc.attachEvent("onpropertychange",D0)):a==="focusout"&&_0()}function T2(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return ed(dc)}function P2(a,c){if(a==="click")return ed(c)}function R2(a,c){if(a==="input"||a==="change")return ed(c)}function _2(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var po=typeof Object.is=="function"?Object.is:_2;function fc(a,c){if(po(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var f=Object.keys(a),v=Object.keys(c);if(f.length!==v.length)return!1;for(v=0;v<f.length;v++){var S=f[v];if(!d.call(c,S)||!po(a[S],c[S]))return!1}return!0}function I0(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function N0(a,c){var f=I0(a);a=0;for(var v;f;){if(f.nodeType===3){if(v=a+f.textContent.length,a<=c&&v>=c)return{node:f,offset:c-a};a=v}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=I0(f)}}function A0(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?A0(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function M0(){for(var a=window,c=jt();c instanceof a.HTMLIFrameElement;){try{var f=typeof c.contentWindow.location.href=="string"}catch{f=!1}if(f)a=c.contentWindow;else break;c=jt(a.document)}return c}function vh(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function D2(a){var c=M0(),f=a.focusedElem,v=a.selectionRange;if(c!==f&&f&&f.ownerDocument&&A0(f.ownerDocument.documentElement,f)){if(v!==null&&vh(f)){if(c=v.start,a=v.end,a===void 0&&(a=c),"selectionStart"in f)f.selectionStart=c,f.selectionEnd=Math.min(a,f.value.length);else if(a=(c=f.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var S=f.textContent.length,C=Math.min(v.start,S);v=v.end===void 0?C:Math.min(v.end,S),!a.extend&&C>v&&(S=v,v=C,C=S),S=N0(f,C);var D=N0(f,v);S&&D&&(a.rangeCount!==1||a.anchorNode!==S.node||a.anchorOffset!==S.offset||a.focusNode!==D.node||a.focusOffset!==D.offset)&&(c=c.createRange(),c.setStart(S.node,S.offset),a.removeAllRanges(),C>v?(a.addRange(c),a.extend(D.node,D.offset)):(c.setEnd(D.node,D.offset),a.addRange(c)))}}for(c=[],a=f;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<c.length;f++)a=c[f],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var I2=u&&"documentMode"in document&&11>=document.documentMode,Ma=null,yh=null,pc=null,xh=!1;function O0(a,c,f){var v=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;xh||Ma==null||Ma!==jt(v)||(v=Ma,"selectionStart"in v&&vh(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),pc&&fc(pc,v)||(pc=v,v=od(yh,"onSelect"),0<v.length&&(c=new ch("onSelect","select",null,c,f),a.push({event:c,listeners:v}),c.target=Ma)))}function td(a,c){var f={};return f[a.toLowerCase()]=c.toLowerCase(),f["Webkit"+a]="webkit"+c,f["Moz"+a]="moz"+c,f}var Oa={animationend:td("Animation","AnimationEnd"),animationiteration:td("Animation","AnimationIteration"),animationstart:td("Animation","AnimationStart"),transitionend:td("Transition","TransitionEnd")},bh={},L0={};u&&(L0=document.createElement("div").style,"AnimationEvent"in window||(delete Oa.animationend.animation,delete Oa.animationiteration.animation,delete Oa.animationstart.animation),"TransitionEvent"in window||delete Oa.transitionend.transition);function nd(a){if(bh[a])return bh[a];if(!Oa[a])return a;var c=Oa[a],f;for(f in c)if(c.hasOwnProperty(f)&&f in L0)return bh[a]=c[f];return a}var $0=nd("animationend"),F0=nd("animationiteration"),z0=nd("animationstart"),B0=nd("transitionend"),U0=new Map,V0="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 Wi(a,c){U0.set(a,c),s(c,[a])}for(var wh=0;wh<V0.length;wh++){var Sh=V0[wh],N2=Sh.toLowerCase(),A2=Sh[0].toUpperCase()+Sh.slice(1);Wi(N2,"on"+A2)}Wi($0,"onAnimationEnd"),Wi(F0,"onAnimationIteration"),Wi(z0,"onAnimationStart"),Wi("dblclick","onDoubleClick"),Wi("focusin","onFocus"),Wi("focusout","onBlur"),Wi(B0,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hc="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(" "),M2=new Set("cancel close invalid load scroll toggle".split(" ").concat(hc));function W0(a,c,f){var v=a.type||"unknown-event";a.currentTarget=f,Ke(v,c,void 0,a),a.currentTarget=null}function H0(a,c){c=(c&4)!==0;for(var f=0;f<a.length;f++){var v=a[f],S=v.event;v=v.listeners;e:{var C=void 0;if(c)for(var D=v.length-1;0<=D;D--){var $=v[D],W=$.instance,ne=$.currentTarget;if($=$.listener,W!==C&&S.isPropagationStopped())break e;W0(S,$,ne),C=W}else for(D=0;D<v.length;D++){if($=v[D],W=$.instance,ne=$.currentTarget,$=$.listener,W!==C&&S.isPropagationStopped())break e;W0(S,$,ne),C=W}}}if(ot)throw a=Me,ot=!1,Me=null,a}function rn(a,c){var f=c[_h];f===void 0&&(f=c[_h]=new Set);var v=a+"__bubble";f.has(v)||(q0(c,a,2,!1),f.add(v))}function jh(a,c,f){var v=0;c&&(v|=4),q0(f,a,v,c)}var rd="_reactListening"+Math.random().toString(36).slice(2);function mc(a){if(!a[rd]){a[rd]=!0,r.forEach(function(f){f!=="selectionchange"&&(M2.has(f)||jh(f,!1,a),jh(f,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[rd]||(c[rd]=!0,jh("selectionchange",!1,c))}}function q0(a,c,f,v){switch(m0(c)){case 1:var S=KR;break;case 4:S=YR;break;default:S=sh}f=S.bind(null,c,f,a),S=void 0,!K||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(S=!0),v?S!==void 0?a.addEventListener(c,f,{capture:!0,passive:S}):a.addEventListener(c,f,!0):S!==void 0?a.addEventListener(c,f,{passive:S}):a.addEventListener(c,f,!1)}function Ch(a,c,f,v,S){var C=v;if(!(c&1)&&!(c&2)&&v!==null)e:for(;;){if(v===null)return;var D=v.tag;if(D===3||D===4){var $=v.stateNode.containerInfo;if($===S||$.nodeType===8&&$.parentNode===S)break;if(D===4)for(D=v.return;D!==null;){var W=D.tag;if((W===3||W===4)&&(W=D.stateNode.containerInfo,W===S||W.nodeType===8&&W.parentNode===S))return;D=D.return}for(;$!==null;){if(D=_s($),D===null)return;if(W=D.tag,W===5||W===6){v=C=D;continue e}$=$.parentNode}}v=v.return}Ao(function(){var ne=C,ge=Zo(f),ye=[];e:{var me=U0.get(a);if(me!==void 0){var Oe=ch,We=a;switch(a){case"keypress":if(Xu(f)===0)break e;case"keydown":case"keyup":Oe=d2;break;case"focusin":We="focus",Oe=fh;break;case"focusout":We="blur",Oe=fh;break;case"beforeblur":case"afterblur":Oe=fh;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Oe=y0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Oe=ZR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Oe=h2;break;case $0:case F0:case z0:Oe=n2;break;case B0:Oe=g2;break;case"scroll":Oe=XR;break;case"wheel":Oe=y2;break;case"copy":case"cut":case"paste":Oe=o2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Oe=b0}var Qe=(c&4)!==0,kn=!Qe&&a==="scroll",X=Qe?me!==null?me+"Capture":null:me;Qe=[];for(var H=ne,Z;H!==null;){Z=H;var je=Z.stateNode;if(Z.tag===5&&je!==null&&(Z=je,X!==null&&(je=U(H,X),je!=null&&Qe.push(gc(H,je,Z)))),kn)break;H=H.return}0<Qe.length&&(me=new Oe(me,We,null,f,ge),ye.push({event:me,listeners:Qe}))}}if(!(c&7)){e:{if(me=a==="mouseover"||a==="pointerover",Oe=a==="mouseout"||a==="pointerout",me&&f!==No&&(We=f.relatedTarget||f.fromElement)&&(_s(We)||We[oi]))break e;if((Oe||me)&&(me=ge.window===ge?ge:(me=ge.ownerDocument)?me.defaultView||me.parentWindow:window,Oe?(We=f.relatedTarget||f.toElement,Oe=ne,We=We?_s(We):null,We!==null&&(kn=lt(We),We!==kn||We.tag!==5&&We.tag!==6)&&(We=null)):(Oe=null,We=ne),Oe!==We)){if(Qe=y0,je="onMouseLeave",X="onMouseEnter",H="mouse",(a==="pointerout"||a==="pointerover")&&(Qe=b0,je="onPointerLeave",X="onPointerEnter",H="pointer"),kn=Oe==null?me:Fa(Oe),Z=We==null?me:Fa(We),me=new Qe(je,H+"leave",Oe,f,ge),me.target=kn,me.relatedTarget=Z,je=null,_s(ge)===ne&&(Qe=new Qe(X,H+"enter",We,f,ge),Qe.target=Z,Qe.relatedTarget=kn,je=Qe),kn=je,Oe&&We)t:{for(Qe=Oe,X=We,H=0,Z=Qe;Z;Z=La(Z))H++;for(Z=0,je=X;je;je=La(je))Z++;for(;0<H-Z;)Qe=La(Qe),H--;for(;0<Z-H;)X=La(X),Z--;for(;H--;){if(Qe===X||X!==null&&Qe===X.alternate)break t;Qe=La(Qe),X=La(X)}Qe=null}else Qe=null;Oe!==null&&G0(ye,me,Oe,Qe,!1),We!==null&&kn!==null&&G0(ye,kn,We,Qe,!0)}}e:{if(me=ne?Fa(ne):window,Oe=me.nodeName&&me.nodeName.toLowerCase(),Oe==="select"||Oe==="input"&&me.type==="file")var Xe=E2;else if(k0(me))if(P0)Xe=R2;else{Xe=T2;var nt=k2}else(Oe=me.nodeName)&&Oe.toLowerCase()==="input"&&(me.type==="checkbox"||me.type==="radio")&&(Xe=P2);if(Xe&&(Xe=Xe(a,ne))){T0(ye,Xe,f,ge);break e}nt&&nt(a,me,ne),a==="focusout"&&(nt=me._wrapperState)&&nt.controlled&&me.type==="number"&&Re(me,"number",me.value)}switch(nt=ne?Fa(ne):window,a){case"focusin":(k0(nt)||nt.contentEditable==="true")&&(Ma=nt,yh=ne,pc=null);break;case"focusout":pc=yh=Ma=null;break;case"mousedown":xh=!0;break;case"contextmenu":case"mouseup":case"dragend":xh=!1,O0(ye,f,ge);break;case"selectionchange":if(I2)break;case"keydown":case"keyup":O0(ye,f,ge)}var rt;if(hh)e:{switch(a){case"compositionstart":var ct="onCompositionStart";break e;case"compositionend":ct="onCompositionEnd";break e;case"compositionupdate":ct="onCompositionUpdate";break e}ct=void 0}else Aa?C0(a,f)&&(ct="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(ct="onCompositionStart");ct&&(w0&&f.locale!=="ko"&&(Aa||ct!=="onCompositionStart"?ct==="onCompositionEnd"&&Aa&&(rt=g0()):(Vi=ge,lh="value"in Vi?Vi.value:Vi.textContent,Aa=!0)),nt=od(ne,ct),0<nt.length&&(ct=new x0(ct,a,null,f,ge),ye.push({event:ct,listeners:nt}),rt?ct.data=rt:(rt=E0(f),rt!==null&&(ct.data=rt)))),(rt=b2?w2(a,f):S2(a,f))&&(ne=od(ne,"onBeforeInput"),0<ne.length&&(ge=new x0("onBeforeInput","beforeinput",null,f,ge),ye.push({event:ge,listeners:ne}),ge.data=rt))}H0(ye,c)})}function gc(a,c,f){return{instance:a,listener:c,currentTarget:f}}function od(a,c){for(var f=c+"Capture",v=[];a!==null;){var S=a,C=S.stateNode;S.tag===5&&C!==null&&(S=C,C=U(a,f),C!=null&&v.unshift(gc(a,C,S)),C=U(a,c),C!=null&&v.push(gc(a,C,S))),a=a.return}return v}function La(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function G0(a,c,f,v,S){for(var C=c._reactName,D=[];f!==null&&f!==v;){var $=f,W=$.alternate,ne=$.stateNode;if(W!==null&&W===v)break;$.tag===5&&ne!==null&&($=ne,S?(W=U(f,C),W!=null&&D.unshift(gc(f,W,$))):S||(W=U(f,C),W!=null&&D.push(gc(f,W,$)))),f=f.return}D.length!==0&&a.push({event:c,listeners:D})}var O2=/\r\n?/g,L2=/\u0000|\uFFFD/g;function Q0(a){return(typeof a=="string"?a:""+a).replace(O2,`
|
|
81
|
-
`).replace(L2,"")}function id(a,c,f){if(c=Q0(c),Q0(a)!==c&&f)throw Error(n(425))}function sd(){}var Eh=null,kh=null;function Th(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Ph=typeof setTimeout=="function"?setTimeout:void 0,$2=typeof clearTimeout=="function"?clearTimeout:void 0,K0=typeof Promise=="function"?Promise:void 0,F2=typeof queueMicrotask=="function"?queueMicrotask:typeof K0<"u"?function(a){return K0.resolve(null).then(a).catch(z2)}:Ph;function z2(a){setTimeout(function(){throw a})}function Rh(a,c){var f=c,v=0;do{var S=f.nextSibling;if(a.removeChild(f),S&&S.nodeType===8)if(f=S.data,f==="/$"){if(v===0){a.removeChild(S),sc(c);return}v--}else f!=="$"&&f!=="$?"&&f!=="$!"||v++;f=S}while(f);sc(c)}function Hi(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return a}function Y0(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"){if(c===0)return a;c--}else f==="/$"&&c++}a=a.previousSibling}return null}var $a=Math.random().toString(36).slice(2),Mo="__reactFiber$"+$a,vc="__reactProps$"+$a,oi="__reactContainer$"+$a,_h="__reactEvents$"+$a,B2="__reactListeners$"+$a,U2="__reactHandles$"+$a;function _s(a){var c=a[Mo];if(c)return c;for(var f=a.parentNode;f;){if(c=f[oi]||f[Mo]){if(f=c.alternate,c.child!==null||f!==null&&f.child!==null)for(a=Y0(a);a!==null;){if(f=a[Mo])return f;a=Y0(a)}return c}a=f,f=a.parentNode}return null}function yc(a){return a=a[Mo]||a[oi],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function Fa(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function ad(a){return a[vc]||null}var Dh=[],za=-1;function qi(a){return{current:a}}function on(a){0>za||(a.current=Dh[za],Dh[za]=null,za--)}function Yt(a,c){za++,Dh[za]=a.current,a.current=c}var Gi={},Xn=qi(Gi),vr=qi(!1),Ds=Gi;function Ba(a,c){var f=a.type.contextTypes;if(!f)return Gi;var v=a.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===c)return v.__reactInternalMemoizedMaskedChildContext;var S={},C;for(C in f)S[C]=c[C];return v&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=S),S}function yr(a){return a=a.childContextTypes,a!=null}function ld(){on(vr),on(Xn)}function X0(a,c,f){if(Xn.current!==Gi)throw Error(n(168));Yt(Xn,c),Yt(vr,f)}function J0(a,c,f){var v=a.stateNode;if(c=c.childContextTypes,typeof v.getChildContext!="function")return f;v=v.getChildContext();for(var S in v)if(!(S in c))throw Error(n(108,_e(a)||"Unknown",S));return I({},f,v)}function cd(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Gi,Ds=Xn.current,Yt(Xn,a),Yt(vr,vr.current),!0}function Z0(a,c,f){var v=a.stateNode;if(!v)throw Error(n(169));f?(a=J0(a,c,Ds),v.__reactInternalMemoizedMergedChildContext=a,on(vr),on(Xn),Yt(Xn,a)):on(vr),Yt(vr,f)}var ii=null,ud=!1,Ih=!1;function e1(a){ii===null?ii=[a]:ii.push(a)}function V2(a){ud=!0,e1(a)}function Qi(){if(!Ih&&ii!==null){Ih=!0;var a=0,c=Ft;try{var f=ii;for(Ft=1;a<f.length;a++){var v=f[a];do v=v(!0);while(v!==null)}ii=null,ud=!1}catch(S){throw ii!==null&&(ii=ii.slice(a+1)),ni(uo,Qi),S}finally{Ft=c,Ih=!1}}return null}var Ua=[],Va=0,dd=null,fd=0,Hr=[],qr=0,Is=null,si=1,ai="";function Ns(a,c){Ua[Va++]=fd,Ua[Va++]=dd,dd=a,fd=c}function t1(a,c,f){Hr[qr++]=si,Hr[qr++]=ai,Hr[qr++]=Is,Is=a;var v=si;a=ai;var S=32-Fn(v)-1;v&=~(1<<S),f+=1;var C=32-Fn(c)+S;if(30<C){var D=S-S%5;C=(v&(1<<D)-1).toString(32),v>>=D,S-=D,si=1<<32-Fn(c)+S|f<<S|v,ai=C+a}else si=1<<C|f<<S|v,ai=a}function Nh(a){a.return!==null&&(Ns(a,1),t1(a,1,0))}function Ah(a){for(;a===dd;)dd=Ua[--Va],Ua[Va]=null,fd=Ua[--Va],Ua[Va]=null;for(;a===Is;)Is=Hr[--qr],Hr[qr]=null,ai=Hr[--qr],Hr[qr]=null,si=Hr[--qr],Hr[qr]=null}var Ar=null,Mr=null,un=!1,ho=null;function n1(a,c){var f=Yr(5,null,null,0);f.elementType="DELETED",f.stateNode=c,f.return=a,c=a.deletions,c===null?(a.deletions=[f],a.flags|=16):c.push(f)}function r1(a,c){switch(a.tag){case 5:var f=a.type;return c=c.nodeType!==1||f.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(a.stateNode=c,Ar=a,Mr=Hi(c.firstChild),!0):!1;case 6:return c=a.pendingProps===""||c.nodeType!==3?null:c,c!==null?(a.stateNode=c,Ar=a,Mr=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(f=Is!==null?{id:si,overflow:ai}:null,a.memoizedState={dehydrated:c,treeContext:f,retryLane:1073741824},f=Yr(18,null,null,0),f.stateNode=c,f.return=a,a.child=f,Ar=a,Mr=null,!0):!1;default:return!1}}function Mh(a){return(a.mode&1)!==0&&(a.flags&128)===0}function Oh(a){if(un){var c=Mr;if(c){var f=c;if(!r1(a,c)){if(Mh(a))throw Error(n(418));c=Hi(f.nextSibling);var v=Ar;c&&r1(a,c)?n1(v,f):(a.flags=a.flags&-4097|2,un=!1,Ar=a)}}else{if(Mh(a))throw Error(n(418));a.flags=a.flags&-4097|2,un=!1,Ar=a}}}function o1(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;Ar=a}function pd(a){if(a!==Ar)return!1;if(!un)return o1(a),un=!0,!1;var c;if((c=a.tag!==3)&&!(c=a.tag!==5)&&(c=a.type,c=c!=="head"&&c!=="body"&&!Th(a.type,a.memoizedProps)),c&&(c=Mr)){if(Mh(a))throw i1(),Error(n(418));for(;c;)n1(a,c),c=Hi(c.nextSibling)}if(o1(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,c=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"){if(c===0){Mr=Hi(a.nextSibling);break e}c--}else f!=="$"&&f!=="$!"&&f!=="$?"||c++}a=a.nextSibling}Mr=null}}else Mr=Ar?Hi(a.stateNode.nextSibling):null;return!0}function i1(){for(var a=Mr;a;)a=Hi(a.nextSibling)}function Wa(){Mr=Ar=null,un=!1}function Lh(a){ho===null?ho=[a]:ho.push(a)}var W2=E.ReactCurrentBatchConfig;function mo(a,c){if(a&&a.defaultProps){c=I({},c),a=a.defaultProps;for(var f in a)c[f]===void 0&&(c[f]=a[f]);return c}return c}var hd=qi(null),md=null,Ha=null,$h=null;function Fh(){$h=Ha=md=null}function zh(a){var c=hd.current;on(hd),a._currentValue=c}function Bh(a,c,f){for(;a!==null;){var v=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,v!==null&&(v.childLanes|=c)):v!==null&&(v.childLanes&c)!==c&&(v.childLanes|=c),a===f)break;a=a.return}}function qa(a,c){md=a,$h=Ha=null,a=a.dependencies,a!==null&&a.firstContext!==null&&(a.lanes&c&&(xr=!0),a.firstContext=null)}function Gr(a){var c=a._currentValue;if($h!==a)if(a={context:a,memoizedValue:c,next:null},Ha===null){if(md===null)throw Error(n(308));Ha=a,md.dependencies={lanes:0,firstContext:a}}else Ha=Ha.next=a;return c}var As=null;function Uh(a){As===null?As=[a]:As.push(a)}function s1(a,c,f,v){var S=c.interleaved;return S===null?(f.next=f,Uh(c)):(f.next=S.next,S.next=f),c.interleaved=f,li(a,v)}function li(a,c){a.lanes|=c;var f=a.alternate;for(f!==null&&(f.lanes|=c),f=a,a=a.return;a!==null;)a.childLanes|=c,f=a.alternate,f!==null&&(f.childLanes|=c),f=a,a=a.return;return f.tag===3?f.stateNode:null}var Ki=!1;function Vh(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function a1(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function ci(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function Yi(a,c,f){var v=a.updateQueue;if(v===null)return null;if(v=v.shared,_t&2){var S=v.pending;return S===null?c.next=c:(c.next=S.next,S.next=c),v.pending=c,li(a,f)}return S=v.interleaved,S===null?(c.next=c,Uh(v)):(c.next=S.next,S.next=c),v.interleaved=c,li(a,f)}function gd(a,c,f){if(c=c.updateQueue,c!==null&&(c=c.shared,(f&4194240)!==0)){var v=c.lanes;v&=a.pendingLanes,f|=v,c.lanes=f,rh(a,f)}}function l1(a,c){var f=a.updateQueue,v=a.alternate;if(v!==null&&(v=v.updateQueue,f===v)){var S=null,C=null;if(f=f.firstBaseUpdate,f!==null){do{var D={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};C===null?S=C=D:C=C.next=D,f=f.next}while(f!==null);C===null?S=C=c:C=C.next=c}else S=C=c;f={baseState:v.baseState,firstBaseUpdate:S,lastBaseUpdate:C,shared:v.shared,effects:v.effects},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=c}function vd(a,c,f,v){var S=a.updateQueue;Ki=!1;var C=S.firstBaseUpdate,D=S.lastBaseUpdate,$=S.shared.pending;if($!==null){S.shared.pending=null;var W=$,ne=W.next;W.next=null,D===null?C=ne:D.next=ne,D=W;var ge=a.alternate;ge!==null&&(ge=ge.updateQueue,$=ge.lastBaseUpdate,$!==D&&($===null?ge.firstBaseUpdate=ne:$.next=ne,ge.lastBaseUpdate=W))}if(C!==null){var ye=S.baseState;D=0,ge=ne=W=null,$=C;do{var me=$.lane,Oe=$.eventTime;if((v&me)===me){ge!==null&&(ge=ge.next={eventTime:Oe,lane:0,tag:$.tag,payload:$.payload,callback:$.callback,next:null});e:{var We=a,Qe=$;switch(me=c,Oe=f,Qe.tag){case 1:if(We=Qe.payload,typeof We=="function"){ye=We.call(Oe,ye,me);break e}ye=We;break e;case 3:We.flags=We.flags&-65537|128;case 0:if(We=Qe.payload,me=typeof We=="function"?We.call(Oe,ye,me):We,me==null)break e;ye=I({},ye,me);break e;case 2:Ki=!0}}$.callback!==null&&$.lane!==0&&(a.flags|=64,me=S.effects,me===null?S.effects=[$]:me.push($))}else Oe={eventTime:Oe,lane:me,tag:$.tag,payload:$.payload,callback:$.callback,next:null},ge===null?(ne=ge=Oe,W=ye):ge=ge.next=Oe,D|=me;if($=$.next,$===null){if($=S.shared.pending,$===null)break;me=$,$=me.next,me.next=null,S.lastBaseUpdate=me,S.shared.pending=null}}while(!0);if(ge===null&&(W=ye),S.baseState=W,S.firstBaseUpdate=ne,S.lastBaseUpdate=ge,c=S.shared.interleaved,c!==null){S=c;do D|=S.lane,S=S.next;while(S!==c)}else C===null&&(S.shared.lanes=0);Ls|=D,a.lanes=D,a.memoizedState=ye}}function c1(a,c,f){if(a=c.effects,c.effects=null,a!==null)for(c=0;c<a.length;c++){var v=a[c],S=v.callback;if(S!==null){if(v.callback=null,v=f,typeof S!="function")throw Error(n(191,S));S.call(v)}}}var u1=new e.Component().refs;function Wh(a,c,f,v){c=a.memoizedState,f=f(v,c),f=f==null?c:I({},c,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var yd={isMounted:function(a){return(a=a._reactInternals)?lt(a)===a:!1},enqueueSetState:function(a,c,f){a=a._reactInternals;var v=lr(),S=es(a),C=ci(v,S);C.payload=c,f!=null&&(C.callback=f),c=Yi(a,C,S),c!==null&&(yo(c,a,S,v),gd(c,a,S))},enqueueReplaceState:function(a,c,f){a=a._reactInternals;var v=lr(),S=es(a),C=ci(v,S);C.tag=1,C.payload=c,f!=null&&(C.callback=f),c=Yi(a,C,S),c!==null&&(yo(c,a,S,v),gd(c,a,S))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var f=lr(),v=es(a),S=ci(f,v);S.tag=2,c!=null&&(S.callback=c),c=Yi(a,S,v),c!==null&&(yo(c,a,v,f),gd(c,a,v))}};function d1(a,c,f,v,S,C,D){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(v,C,D):c.prototype&&c.prototype.isPureReactComponent?!fc(f,v)||!fc(S,C):!0}function f1(a,c,f){var v=!1,S=Gi,C=c.contextType;return typeof C=="object"&&C!==null?C=Gr(C):(S=yr(c)?Ds:Xn.current,v=c.contextTypes,C=(v=v!=null)?Ba(a,S):Gi),c=new c(f,C),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=yd,a.stateNode=c,c._reactInternals=a,v&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=S,a.__reactInternalMemoizedMaskedChildContext=C),c}function p1(a,c,f,v){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(f,v),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(f,v),c.state!==a&&yd.enqueueReplaceState(c,c.state,null)}function Hh(a,c,f,v){var S=a.stateNode;S.props=f,S.state=a.memoizedState,S.refs=u1,Vh(a);var C=c.contextType;typeof C=="object"&&C!==null?S.context=Gr(C):(C=yr(c)?Ds:Xn.current,S.context=Ba(a,C)),S.state=a.memoizedState,C=c.getDerivedStateFromProps,typeof C=="function"&&(Wh(a,c,C,f),S.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(c=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),c!==S.state&&yd.enqueueReplaceState(S,S.state,null),vd(a,f,S,v),S.state=a.memoizedState),typeof S.componentDidMount=="function"&&(a.flags|=4194308)}function xc(a,c,f){if(a=f.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(n(309));var v=f.stateNode}if(!v)throw Error(n(147,a));var S=v,C=""+a;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===C?c.ref:(c=function(D){var $=S.refs;$===u1&&($=S.refs={}),D===null?delete $[C]:$[C]=D},c._stringRef=C,c)}if(typeof a!="string")throw Error(n(284));if(!f._owner)throw Error(n(290,a))}return a}function xd(a,c){throw a=Object.prototype.toString.call(c),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a))}function h1(a){var c=a._init;return c(a._payload)}function m1(a){function c(X,H){if(a){var Z=X.deletions;Z===null?(X.deletions=[H],X.flags|=16):Z.push(H)}}function f(X,H){if(!a)return null;for(;H!==null;)c(X,H),H=H.sibling;return null}function v(X,H){for(X=new Map;H!==null;)H.key!==null?X.set(H.key,H):X.set(H.index,H),H=H.sibling;return X}function S(X,H){return X=ns(X,H),X.index=0,X.sibling=null,X}function C(X,H,Z){return X.index=Z,a?(Z=X.alternate,Z!==null?(Z=Z.index,Z<H?(X.flags|=2,H):Z):(X.flags|=2,H)):(X.flags|=1048576,H)}function D(X){return a&&X.alternate===null&&(X.flags|=2),X}function $(X,H,Z,je){return H===null||H.tag!==6?(H=Pm(Z,X.mode,je),H.return=X,H):(H=S(H,Z),H.return=X,H)}function W(X,H,Z,je){var Xe=Z.type;return Xe===M?ge(X,H,Z.props.children,je,Z.key):H!==null&&(H.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===V&&h1(Xe)===H.type)?(je=S(H,Z.props),je.ref=xc(X,H,Z),je.return=X,je):(je=$d(Z.type,Z.key,Z.props,null,X.mode,je),je.ref=xc(X,H,Z),je.return=X,je)}function ne(X,H,Z,je){return H===null||H.tag!==4||H.stateNode.containerInfo!==Z.containerInfo||H.stateNode.implementation!==Z.implementation?(H=Rm(Z,X.mode,je),H.return=X,H):(H=S(H,Z.children||[]),H.return=X,H)}function ge(X,H,Z,je,Xe){return H===null||H.tag!==7?(H=Bs(Z,X.mode,je,Xe),H.return=X,H):(H=S(H,Z),H.return=X,H)}function ye(X,H,Z){if(typeof H=="string"&&H!==""||typeof H=="number")return H=Pm(""+H,X.mode,Z),H.return=X,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case _:return Z=$d(H.type,H.key,H.props,null,X.mode,Z),Z.ref=xc(X,null,H),Z.return=X,Z;case R:return H=Rm(H,X.mode,Z),H.return=X,H;case V:var je=H._init;return ye(X,je(H._payload),Z)}if(He(H)||B(H))return H=Bs(H,X.mode,Z,null),H.return=X,H;xd(X,H)}return null}function me(X,H,Z,je){var Xe=H!==null?H.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number")return Xe!==null?null:$(X,H,""+Z,je);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case _:return Z.key===Xe?W(X,H,Z,je):null;case R:return Z.key===Xe?ne(X,H,Z,je):null;case V:return Xe=Z._init,me(X,H,Xe(Z._payload),je)}if(He(Z)||B(Z))return Xe!==null?null:ge(X,H,Z,je,null);xd(X,Z)}return null}function Oe(X,H,Z,je,Xe){if(typeof je=="string"&&je!==""||typeof je=="number")return X=X.get(Z)||null,$(H,X,""+je,Xe);if(typeof je=="object"&&je!==null){switch(je.$$typeof){case _:return X=X.get(je.key===null?Z:je.key)||null,W(H,X,je,Xe);case R:return X=X.get(je.key===null?Z:je.key)||null,ne(H,X,je,Xe);case V:var nt=je._init;return Oe(X,H,Z,nt(je._payload),Xe)}if(He(je)||B(je))return X=X.get(Z)||null,ge(H,X,je,Xe,null);xd(H,je)}return null}function We(X,H,Z,je){for(var Xe=null,nt=null,rt=H,ct=H=0,Un=null;rt!==null&&ct<Z.length;ct++){rt.index>ct?(Un=rt,rt=null):Un=rt.sibling;var Nt=me(X,rt,Z[ct],je);if(Nt===null){rt===null&&(rt=Un);break}a&&rt&&Nt.alternate===null&&c(X,rt),H=C(Nt,H,ct),nt===null?Xe=Nt:nt.sibling=Nt,nt=Nt,rt=Un}if(ct===Z.length)return f(X,rt),un&&Ns(X,ct),Xe;if(rt===null){for(;ct<Z.length;ct++)rt=ye(X,Z[ct],je),rt!==null&&(H=C(rt,H,ct),nt===null?Xe=rt:nt.sibling=rt,nt=rt);return un&&Ns(X,ct),Xe}for(rt=v(X,rt);ct<Z.length;ct++)Un=Oe(rt,X,ct,Z[ct],je),Un!==null&&(a&&Un.alternate!==null&&rt.delete(Un.key===null?ct:Un.key),H=C(Un,H,ct),nt===null?Xe=Un:nt.sibling=Un,nt=Un);return a&&rt.forEach(function(rs){return c(X,rs)}),un&&Ns(X,ct),Xe}function Qe(X,H,Z,je){var Xe=B(Z);if(typeof Xe!="function")throw Error(n(150));if(Z=Xe.call(Z),Z==null)throw Error(n(151));for(var nt=Xe=null,rt=H,ct=H=0,Un=null,Nt=Z.next();rt!==null&&!Nt.done;ct++,Nt=Z.next()){rt.index>ct?(Un=rt,rt=null):Un=rt.sibling;var rs=me(X,rt,Nt.value,je);if(rs===null){rt===null&&(rt=Un);break}a&&rt&&rs.alternate===null&&c(X,rt),H=C(rs,H,ct),nt===null?Xe=rs:nt.sibling=rs,nt=rs,rt=Un}if(Nt.done)return f(X,rt),un&&Ns(X,ct),Xe;if(rt===null){for(;!Nt.done;ct++,Nt=Z.next())Nt=ye(X,Nt.value,je),Nt!==null&&(H=C(Nt,H,ct),nt===null?Xe=Nt:nt.sibling=Nt,nt=Nt);return un&&Ns(X,ct),Xe}for(rt=v(X,rt);!Nt.done;ct++,Nt=Z.next())Nt=Oe(rt,X,ct,Nt.value,je),Nt!==null&&(a&&Nt.alternate!==null&&rt.delete(Nt.key===null?ct:Nt.key),H=C(Nt,H,ct),nt===null?Xe=Nt:nt.sibling=Nt,nt=Nt);return a&&rt.forEach(function(S_){return c(X,S_)}),un&&Ns(X,ct),Xe}function kn(X,H,Z,je){if(typeof Z=="object"&&Z!==null&&Z.type===M&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case _:e:{for(var Xe=Z.key,nt=H;nt!==null;){if(nt.key===Xe){if(Xe=Z.type,Xe===M){if(nt.tag===7){f(X,nt.sibling),H=S(nt,Z.props.children),H.return=X,X=H;break e}}else if(nt.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===V&&h1(Xe)===nt.type){f(X,nt.sibling),H=S(nt,Z.props),H.ref=xc(X,nt,Z),H.return=X,X=H;break e}f(X,nt);break}else c(X,nt);nt=nt.sibling}Z.type===M?(H=Bs(Z.props.children,X.mode,je,Z.key),H.return=X,X=H):(je=$d(Z.type,Z.key,Z.props,null,X.mode,je),je.ref=xc(X,H,Z),je.return=X,X=je)}return D(X);case R:e:{for(nt=Z.key;H!==null;){if(H.key===nt)if(H.tag===4&&H.stateNode.containerInfo===Z.containerInfo&&H.stateNode.implementation===Z.implementation){f(X,H.sibling),H=S(H,Z.children||[]),H.return=X,X=H;break e}else{f(X,H);break}else c(X,H);H=H.sibling}H=Rm(Z,X.mode,je),H.return=X,X=H}return D(X);case V:return nt=Z._init,kn(X,H,nt(Z._payload),je)}if(He(Z))return We(X,H,Z,je);if(B(Z))return Qe(X,H,Z,je);xd(X,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"?(Z=""+Z,H!==null&&H.tag===6?(f(X,H.sibling),H=S(H,Z),H.return=X,X=H):(f(X,H),H=Pm(Z,X.mode,je),H.return=X,X=H),D(X)):f(X,H)}return kn}var Ga=m1(!0),g1=m1(!1),bc={},Oo=qi(bc),wc=qi(bc),Sc=qi(bc);function Ms(a){if(a===bc)throw Error(n(174));return a}function qh(a,c){switch(Yt(Sc,c),Yt(wc,a),Yt(Oo,bc),a=c.nodeType,a){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:bt(null,"");break;default:a=a===8?c.parentNode:c,c=a.namespaceURI||null,a=a.tagName,c=bt(c,a)}on(Oo),Yt(Oo,c)}function Qa(){on(Oo),on(wc),on(Sc)}function v1(a){Ms(Sc.current);var c=Ms(Oo.current),f=bt(c,a.type);c!==f&&(Yt(wc,a),Yt(Oo,f))}function Gh(a){wc.current===a&&(on(Oo),on(wc))}var hn=qi(0);function bd(a){for(var c=a;c!==null;){if(c.tag===13){var f=c.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if(c.flags&128)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Qh=[];function Kh(){for(var a=0;a<Qh.length;a++)Qh[a]._workInProgressVersionPrimary=null;Qh.length=0}var wd=E.ReactCurrentDispatcher,Yh=E.ReactCurrentBatchConfig,Os=0,mn=null,An=null,zn=null,Sd=!1,jc=!1,Cc=0,H2=0;function Jn(){throw Error(n(321))}function Xh(a,c){if(c===null)return!1;for(var f=0;f<c.length&&f<a.length;f++)if(!po(a[f],c[f]))return!1;return!0}function Jh(a,c,f,v,S,C){if(Os=C,mn=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,wd.current=a===null||a.memoizedState===null?K2:Y2,a=f(v,S),jc){C=0;do{if(jc=!1,Cc=0,25<=C)throw Error(n(301));C+=1,zn=An=null,c.updateQueue=null,wd.current=X2,a=f(v,S)}while(jc)}if(wd.current=Ed,c=An!==null&&An.next!==null,Os=0,zn=An=mn=null,Sd=!1,c)throw Error(n(300));return a}function Zh(){var a=Cc!==0;return Cc=0,a}function Lo(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zn===null?mn.memoizedState=zn=a:zn=zn.next=a,zn}function Qr(){if(An===null){var a=mn.alternate;a=a!==null?a.memoizedState:null}else a=An.next;var c=zn===null?mn.memoizedState:zn.next;if(c!==null)zn=c,An=a;else{if(a===null)throw Error(n(310));An=a,a={memoizedState:An.memoizedState,baseState:An.baseState,baseQueue:An.baseQueue,queue:An.queue,next:null},zn===null?mn.memoizedState=zn=a:zn=zn.next=a}return zn}function Ec(a,c){return typeof c=="function"?c(a):c}function em(a){var c=Qr(),f=c.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=a;var v=An,S=v.baseQueue,C=f.pending;if(C!==null){if(S!==null){var D=S.next;S.next=C.next,C.next=D}v.baseQueue=S=C,f.pending=null}if(S!==null){C=S.next,v=v.baseState;var $=D=null,W=null,ne=C;do{var ge=ne.lane;if((Os&ge)===ge)W!==null&&(W=W.next={lane:0,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),v=ne.hasEagerState?ne.eagerState:a(v,ne.action);else{var ye={lane:ge,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null};W===null?($=W=ye,D=v):W=W.next=ye,mn.lanes|=ge,Ls|=ge}ne=ne.next}while(ne!==null&&ne!==C);W===null?D=v:W.next=$,po(v,c.memoizedState)||(xr=!0),c.memoizedState=v,c.baseState=D,c.baseQueue=W,f.lastRenderedState=v}if(a=f.interleaved,a!==null){S=a;do C=S.lane,mn.lanes|=C,Ls|=C,S=S.next;while(S!==a)}else S===null&&(f.lanes=0);return[c.memoizedState,f.dispatch]}function tm(a){var c=Qr(),f=c.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=a;var v=f.dispatch,S=f.pending,C=c.memoizedState;if(S!==null){f.pending=null;var D=S=S.next;do C=a(C,D.action),D=D.next;while(D!==S);po(C,c.memoizedState)||(xr=!0),c.memoizedState=C,c.baseQueue===null&&(c.baseState=C),f.lastRenderedState=C}return[C,v]}function y1(){}function x1(a,c){var f=mn,v=Qr(),S=c(),C=!po(v.memoizedState,S);if(C&&(v.memoizedState=S,xr=!0),v=v.queue,nm(S1.bind(null,f,v,a),[a]),v.getSnapshot!==c||C||zn!==null&&zn.memoizedState.tag&1){if(f.flags|=2048,kc(9,w1.bind(null,f,v,S,c),void 0,null),Bn===null)throw Error(n(349));Os&30||b1(f,c,S)}return S}function b1(a,c,f){a.flags|=16384,a={getSnapshot:c,value:f},c=mn.updateQueue,c===null?(c={lastEffect:null,stores:null},mn.updateQueue=c,c.stores=[a]):(f=c.stores,f===null?c.stores=[a]:f.push(a))}function w1(a,c,f,v){c.value=f,c.getSnapshot=v,j1(c)&&C1(a)}function S1(a,c,f){return f(function(){j1(c)&&C1(a)})}function j1(a){var c=a.getSnapshot;a=a.value;try{var f=c();return!po(a,f)}catch{return!0}}function C1(a){var c=li(a,1);c!==null&&yo(c,a,1,-1)}function E1(a){var c=Lo();return typeof a=="function"&&(a=a()),c.memoizedState=c.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ec,lastRenderedState:a},c.queue=a,a=a.dispatch=Q2.bind(null,mn,a),[c.memoizedState,a]}function kc(a,c,f,v){return a={tag:a,create:c,destroy:f,deps:v,next:null},c=mn.updateQueue,c===null?(c={lastEffect:null,stores:null},mn.updateQueue=c,c.lastEffect=a.next=a):(f=c.lastEffect,f===null?c.lastEffect=a.next=a:(v=f.next,f.next=a,a.next=v,c.lastEffect=a)),a}function k1(){return Qr().memoizedState}function jd(a,c,f,v){var S=Lo();mn.flags|=a,S.memoizedState=kc(1|c,f,void 0,v===void 0?null:v)}function Cd(a,c,f,v){var S=Qr();v=v===void 0?null:v;var C=void 0;if(An!==null){var D=An.memoizedState;if(C=D.destroy,v!==null&&Xh(v,D.deps)){S.memoizedState=kc(c,f,C,v);return}}mn.flags|=a,S.memoizedState=kc(1|c,f,C,v)}function T1(a,c){return jd(8390656,8,a,c)}function nm(a,c){return Cd(2048,8,a,c)}function P1(a,c){return Cd(4,2,a,c)}function R1(a,c){return Cd(4,4,a,c)}function _1(a,c){if(typeof c=="function")return a=a(),c(a),function(){c(null)};if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function D1(a,c,f){return f=f!=null?f.concat([a]):null,Cd(4,4,_1.bind(null,c,a),f)}function rm(){}function I1(a,c){var f=Qr();c=c===void 0?null:c;var v=f.memoizedState;return v!==null&&c!==null&&Xh(c,v[1])?v[0]:(f.memoizedState=[a,c],a)}function N1(a,c){var f=Qr();c=c===void 0?null:c;var v=f.memoizedState;return v!==null&&c!==null&&Xh(c,v[1])?v[0]:(a=a(),f.memoizedState=[a,c],a)}function A1(a,c,f){return Os&21?(po(f,c)||(f=s0(),mn.lanes|=f,Ls|=f,a.baseState=!0),c):(a.baseState&&(a.baseState=!1,xr=!0),a.memoizedState=f)}function q2(a,c){var f=Ft;Ft=f!==0&&4>f?f:4,a(!0);var v=Yh.transition;Yh.transition={};try{a(!1),c()}finally{Ft=f,Yh.transition=v}}function M1(){return Qr().memoizedState}function G2(a,c,f){var v=es(a);if(f={lane:v,action:f,hasEagerState:!1,eagerState:null,next:null},O1(a))L1(c,f);else if(f=s1(a,c,f,v),f!==null){var S=lr();yo(f,a,v,S),$1(f,c,v)}}function Q2(a,c,f){var v=es(a),S={lane:v,action:f,hasEagerState:!1,eagerState:null,next:null};if(O1(a))L1(c,S);else{var C=a.alternate;if(a.lanes===0&&(C===null||C.lanes===0)&&(C=c.lastRenderedReducer,C!==null))try{var D=c.lastRenderedState,$=C(D,f);if(S.hasEagerState=!0,S.eagerState=$,po($,D)){var W=c.interleaved;W===null?(S.next=S,Uh(c)):(S.next=W.next,W.next=S),c.interleaved=S;return}}catch{}finally{}f=s1(a,c,S,v),f!==null&&(S=lr(),yo(f,a,v,S),$1(f,c,v))}}function O1(a){var c=a.alternate;return a===mn||c!==null&&c===mn}function L1(a,c){jc=Sd=!0;var f=a.pending;f===null?c.next=c:(c.next=f.next,f.next=c),a.pending=c}function $1(a,c,f){if(f&4194240){var v=c.lanes;v&=a.pendingLanes,f|=v,c.lanes=f,rh(a,f)}}var Ed={readContext:Gr,useCallback:Jn,useContext:Jn,useEffect:Jn,useImperativeHandle:Jn,useInsertionEffect:Jn,useLayoutEffect:Jn,useMemo:Jn,useReducer:Jn,useRef:Jn,useState:Jn,useDebugValue:Jn,useDeferredValue:Jn,useTransition:Jn,useMutableSource:Jn,useSyncExternalStore:Jn,useId:Jn,unstable_isNewReconciler:!1},K2={readContext:Gr,useCallback:function(a,c){return Lo().memoizedState=[a,c===void 0?null:c],a},useContext:Gr,useEffect:T1,useImperativeHandle:function(a,c,f){return f=f!=null?f.concat([a]):null,jd(4194308,4,_1.bind(null,c,a),f)},useLayoutEffect:function(a,c){return jd(4194308,4,a,c)},useInsertionEffect:function(a,c){return jd(4,2,a,c)},useMemo:function(a,c){var f=Lo();return c=c===void 0?null:c,a=a(),f.memoizedState=[a,c],a},useReducer:function(a,c,f){var v=Lo();return c=f!==void 0?f(c):c,v.memoizedState=v.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},v.queue=a,a=a.dispatch=G2.bind(null,mn,a),[v.memoizedState,a]},useRef:function(a){var c=Lo();return a={current:a},c.memoizedState=a},useState:E1,useDebugValue:rm,useDeferredValue:function(a){return Lo().memoizedState=a},useTransition:function(){var a=E1(!1),c=a[0];return a=q2.bind(null,a[1]),Lo().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,f){var v=mn,S=Lo();if(un){if(f===void 0)throw Error(n(407));f=f()}else{if(f=c(),Bn===null)throw Error(n(349));Os&30||b1(v,c,f)}S.memoizedState=f;var C={value:f,getSnapshot:c};return S.queue=C,T1(S1.bind(null,v,C,a),[a]),v.flags|=2048,kc(9,w1.bind(null,v,C,f,c),void 0,null),f},useId:function(){var a=Lo(),c=Bn.identifierPrefix;if(un){var f=ai,v=si;f=(v&~(1<<32-Fn(v)-1)).toString(32)+f,c=":"+c+"R"+f,f=Cc++,0<f&&(c+="H"+f.toString(32)),c+=":"}else f=H2++,c=":"+c+"r"+f.toString(32)+":";return a.memoizedState=c},unstable_isNewReconciler:!1},Y2={readContext:Gr,useCallback:I1,useContext:Gr,useEffect:nm,useImperativeHandle:D1,useInsertionEffect:P1,useLayoutEffect:R1,useMemo:N1,useReducer:em,useRef:k1,useState:function(){return em(Ec)},useDebugValue:rm,useDeferredValue:function(a){var c=Qr();return A1(c,An.memoizedState,a)},useTransition:function(){var a=em(Ec)[0],c=Qr().memoizedState;return[a,c]},useMutableSource:y1,useSyncExternalStore:x1,useId:M1,unstable_isNewReconciler:!1},X2={readContext:Gr,useCallback:I1,useContext:Gr,useEffect:nm,useImperativeHandle:D1,useInsertionEffect:P1,useLayoutEffect:R1,useMemo:N1,useReducer:tm,useRef:k1,useState:function(){return tm(Ec)},useDebugValue:rm,useDeferredValue:function(a){var c=Qr();return An===null?c.memoizedState=a:A1(c,An.memoizedState,a)},useTransition:function(){var a=tm(Ec)[0],c=Qr().memoizedState;return[a,c]},useMutableSource:y1,useSyncExternalStore:x1,useId:M1,unstable_isNewReconciler:!1};function Ka(a,c){try{var f="",v=c;do f+=ve(v),v=v.return;while(v);var S=f}catch(C){S=`
|
|
82
|
-
Error generating stack: `+C.message+`
|
|
83
|
-
`+C.stack}return{value:a,source:c,stack:S,digest:null}}function om(a,c,f){return{value:a,source:null,stack:f??null,digest:c??null}}function im(a,c){try{console.error(c.value)}catch(f){setTimeout(function(){throw f})}}var J2=typeof WeakMap=="function"?WeakMap:Map;function F1(a,c,f){f=ci(-1,f),f.tag=3,f.payload={element:null};var v=c.value;return f.callback=function(){Id||(Id=!0,bm=v),im(a,c)},f}function z1(a,c,f){f=ci(-1,f),f.tag=3;var v=a.type.getDerivedStateFromError;if(typeof v=="function"){var S=c.value;f.payload=function(){return v(S)},f.callback=function(){im(a,c)}}var C=a.stateNode;return C!==null&&typeof C.componentDidCatch=="function"&&(f.callback=function(){im(a,c),typeof v!="function"&&(Ji===null?Ji=new Set([this]):Ji.add(this));var D=c.stack;this.componentDidCatch(c.value,{componentStack:D!==null?D:""})}),f}function B1(a,c,f){var v=a.pingCache;if(v===null){v=a.pingCache=new J2;var S=new Set;v.set(c,S)}else S=v.get(c),S===void 0&&(S=new Set,v.set(c,S));S.has(f)||(S.add(f),a=f_.bind(null,a,c,f),c.then(a,a))}function U1(a){do{var c;if((c=a.tag===13)&&(c=a.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return a;a=a.return}while(a!==null);return null}function V1(a,c,f,v,S){return a.mode&1?(a.flags|=65536,a.lanes=S,a):(a===c?a.flags|=65536:(a.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(c=ci(-1,1),c.tag=2,Yi(f,c,1))),f.lanes|=1),a)}var Z2=E.ReactCurrentOwner,xr=!1;function ar(a,c,f,v){c.child=a===null?g1(c,null,f,v):Ga(c,a.child,f,v)}function W1(a,c,f,v,S){f=f.render;var C=c.ref;return qa(c,S),v=Jh(a,c,f,v,C,S),f=Zh(),a!==null&&!xr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~S,ui(a,c,S)):(un&&f&&Nh(c),c.flags|=1,ar(a,c,v,S),c.child)}function H1(a,c,f,v,S){if(a===null){var C=f.type;return typeof C=="function"&&!Tm(C)&&C.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(c.tag=15,c.type=C,q1(a,c,C,v,S)):(a=$d(f.type,null,v,c,c.mode,S),a.ref=c.ref,a.return=c,c.child=a)}if(C=a.child,!(a.lanes&S)){var D=C.memoizedProps;if(f=f.compare,f=f!==null?f:fc,f(D,v)&&a.ref===c.ref)return ui(a,c,S)}return c.flags|=1,a=ns(C,v),a.ref=c.ref,a.return=c,c.child=a}function q1(a,c,f,v,S){if(a!==null){var C=a.memoizedProps;if(fc(C,v)&&a.ref===c.ref)if(xr=!1,c.pendingProps=v=C,(a.lanes&S)!==0)a.flags&131072&&(xr=!0);else return c.lanes=a.lanes,ui(a,c,S)}return sm(a,c,f,v,S)}function G1(a,c,f){var v=c.pendingProps,S=v.children,C=a!==null?a.memoizedState:null;if(v.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Yt(Xa,Or),Or|=f;else{if(!(f&1073741824))return a=C!==null?C.baseLanes|f:f,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:a,cachePool:null,transitions:null},c.updateQueue=null,Yt(Xa,Or),Or|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},v=C!==null?C.baseLanes:f,Yt(Xa,Or),Or|=v}else C!==null?(v=C.baseLanes|f,c.memoizedState=null):v=f,Yt(Xa,Or),Or|=v;return ar(a,c,S,f),c.child}function Q1(a,c){var f=c.ref;(a===null&&f!==null||a!==null&&a.ref!==f)&&(c.flags|=512,c.flags|=2097152)}function sm(a,c,f,v,S){var C=yr(f)?Ds:Xn.current;return C=Ba(c,C),qa(c,S),f=Jh(a,c,f,v,C,S),v=Zh(),a!==null&&!xr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~S,ui(a,c,S)):(un&&v&&Nh(c),c.flags|=1,ar(a,c,f,S),c.child)}function K1(a,c,f,v,S){if(yr(f)){var C=!0;cd(c)}else C=!1;if(qa(c,S),c.stateNode===null)Td(a,c),f1(c,f,v),Hh(c,f,v,S),v=!0;else if(a===null){var D=c.stateNode,$=c.memoizedProps;D.props=$;var W=D.context,ne=f.contextType;typeof ne=="object"&&ne!==null?ne=Gr(ne):(ne=yr(f)?Ds:Xn.current,ne=Ba(c,ne));var ge=f.getDerivedStateFromProps,ye=typeof ge=="function"||typeof D.getSnapshotBeforeUpdate=="function";ye||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||($!==v||W!==ne)&&p1(c,D,v,ne),Ki=!1;var me=c.memoizedState;D.state=me,vd(c,v,D,S),W=c.memoizedState,$!==v||me!==W||vr.current||Ki?(typeof ge=="function"&&(Wh(c,f,ge,v),W=c.memoizedState),($=Ki||d1(c,f,$,v,me,W,ne))?(ye||typeof D.UNSAFE_componentWillMount!="function"&&typeof D.componentWillMount!="function"||(typeof D.componentWillMount=="function"&&D.componentWillMount(),typeof D.UNSAFE_componentWillMount=="function"&&D.UNSAFE_componentWillMount()),typeof D.componentDidMount=="function"&&(c.flags|=4194308)):(typeof D.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=v,c.memoizedState=W),D.props=v,D.state=W,D.context=ne,v=$):(typeof D.componentDidMount=="function"&&(c.flags|=4194308),v=!1)}else{D=c.stateNode,a1(a,c),$=c.memoizedProps,ne=c.type===c.elementType?$:mo(c.type,$),D.props=ne,ye=c.pendingProps,me=D.context,W=f.contextType,typeof W=="object"&&W!==null?W=Gr(W):(W=yr(f)?Ds:Xn.current,W=Ba(c,W));var Oe=f.getDerivedStateFromProps;(ge=typeof Oe=="function"||typeof D.getSnapshotBeforeUpdate=="function")||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||($!==ye||me!==W)&&p1(c,D,v,W),Ki=!1,me=c.memoizedState,D.state=me,vd(c,v,D,S);var We=c.memoizedState;$!==ye||me!==We||vr.current||Ki?(typeof Oe=="function"&&(Wh(c,f,Oe,v),We=c.memoizedState),(ne=Ki||d1(c,f,ne,v,me,We,W)||!1)?(ge||typeof D.UNSAFE_componentWillUpdate!="function"&&typeof D.componentWillUpdate!="function"||(typeof D.componentWillUpdate=="function"&&D.componentWillUpdate(v,We,W),typeof D.UNSAFE_componentWillUpdate=="function"&&D.UNSAFE_componentWillUpdate(v,We,W)),typeof D.componentDidUpdate=="function"&&(c.flags|=4),typeof D.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof D.componentDidUpdate!="function"||$===a.memoizedProps&&me===a.memoizedState||(c.flags|=4),typeof D.getSnapshotBeforeUpdate!="function"||$===a.memoizedProps&&me===a.memoizedState||(c.flags|=1024),c.memoizedProps=v,c.memoizedState=We),D.props=v,D.state=We,D.context=W,v=ne):(typeof D.componentDidUpdate!="function"||$===a.memoizedProps&&me===a.memoizedState||(c.flags|=4),typeof D.getSnapshotBeforeUpdate!="function"||$===a.memoizedProps&&me===a.memoizedState||(c.flags|=1024),v=!1)}return am(a,c,f,v,C,S)}function am(a,c,f,v,S,C){Q1(a,c);var D=(c.flags&128)!==0;if(!v&&!D)return S&&Z0(c,f,!1),ui(a,c,C);v=c.stateNode,Z2.current=c;var $=D&&typeof f.getDerivedStateFromError!="function"?null:v.render();return c.flags|=1,a!==null&&D?(c.child=Ga(c,a.child,null,C),c.child=Ga(c,null,$,C)):ar(a,c,$,C),c.memoizedState=v.state,S&&Z0(c,f,!0),c.child}function Y1(a){var c=a.stateNode;c.pendingContext?X0(a,c.pendingContext,c.pendingContext!==c.context):c.context&&X0(a,c.context,!1),qh(a,c.containerInfo)}function X1(a,c,f,v,S){return Wa(),Lh(S),c.flags|=256,ar(a,c,f,v),c.child}var lm={dehydrated:null,treeContext:null,retryLane:0};function cm(a){return{baseLanes:a,cachePool:null,transitions:null}}function J1(a,c,f){var v=c.pendingProps,S=hn.current,C=!1,D=(c.flags&128)!==0,$;if(($=D)||($=a!==null&&a.memoizedState===null?!1:(S&2)!==0),$?(C=!0,c.flags&=-129):(a===null||a.memoizedState!==null)&&(S|=1),Yt(hn,S&1),a===null)return Oh(c),a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?(c.mode&1?a.data==="$!"?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(D=v.children,a=v.fallback,C?(v=c.mode,C=c.child,D={mode:"hidden",children:D},!(v&1)&&C!==null?(C.childLanes=0,C.pendingProps=D):C=Fd(D,v,0,null),a=Bs(a,v,f,null),C.return=c,a.return=c,C.sibling=a,c.child=C,c.child.memoizedState=cm(f),c.memoizedState=lm,a):um(c,D));if(S=a.memoizedState,S!==null&&($=S.dehydrated,$!==null))return e_(a,c,D,v,$,S,f);if(C){C=v.fallback,D=c.mode,S=a.child,$=S.sibling;var W={mode:"hidden",children:v.children};return!(D&1)&&c.child!==S?(v=c.child,v.childLanes=0,v.pendingProps=W,c.deletions=null):(v=ns(S,W),v.subtreeFlags=S.subtreeFlags&14680064),$!==null?C=ns($,C):(C=Bs(C,D,f,null),C.flags|=2),C.return=c,v.return=c,v.sibling=C,c.child=v,v=C,C=c.child,D=a.child.memoizedState,D=D===null?cm(f):{baseLanes:D.baseLanes|f,cachePool:null,transitions:D.transitions},C.memoizedState=D,C.childLanes=a.childLanes&~f,c.memoizedState=lm,v}return C=a.child,a=C.sibling,v=ns(C,{mode:"visible",children:v.children}),!(c.mode&1)&&(v.lanes=f),v.return=c,v.sibling=null,a!==null&&(f=c.deletions,f===null?(c.deletions=[a],c.flags|=16):f.push(a)),c.child=v,c.memoizedState=null,v}function um(a,c){return c=Fd({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function kd(a,c,f,v){return v!==null&&Lh(v),Ga(c,a.child,null,f),a=um(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function e_(a,c,f,v,S,C,D){if(f)return c.flags&256?(c.flags&=-257,v=om(Error(n(422))),kd(a,c,D,v)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(C=v.fallback,S=c.mode,v=Fd({mode:"visible",children:v.children},S,0,null),C=Bs(C,S,D,null),C.flags|=2,v.return=c,C.return=c,v.sibling=C,c.child=v,c.mode&1&&Ga(c,a.child,null,D),c.child.memoizedState=cm(D),c.memoizedState=lm,C);if(!(c.mode&1))return kd(a,c,D,null);if(S.data==="$!"){if(v=S.nextSibling&&S.nextSibling.dataset,v)var $=v.dgst;return v=$,C=Error(n(419)),v=om(C,v,void 0),kd(a,c,D,v)}if($=(D&a.childLanes)!==0,xr||$){if(v=Bn,v!==null){switch(D&-D){case 4:S=2;break;case 16:S=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:S=32;break;case 536870912:S=268435456;break;default:S=0}S=S&(v.suspendedLanes|D)?0:S,S!==0&&S!==C.retryLane&&(C.retryLane=S,li(a,S),yo(v,a,S,-1))}return km(),v=om(Error(n(421))),kd(a,c,D,v)}return S.data==="$?"?(c.flags|=128,c.child=a.child,c=p_.bind(null,a),S._reactRetry=c,null):(a=C.treeContext,Mr=Hi(S.nextSibling),Ar=c,un=!0,ho=null,a!==null&&(Hr[qr++]=si,Hr[qr++]=ai,Hr[qr++]=Is,si=a.id,ai=a.overflow,Is=c),c=um(c,v.children),c.flags|=4096,c)}function Z1(a,c,f){a.lanes|=c;var v=a.alternate;v!==null&&(v.lanes|=c),Bh(a.return,c,f)}function dm(a,c,f,v,S){var C=a.memoizedState;C===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:v,tail:f,tailMode:S}:(C.isBackwards=c,C.rendering=null,C.renderingStartTime=0,C.last=v,C.tail=f,C.tailMode=S)}function eb(a,c,f){var v=c.pendingProps,S=v.revealOrder,C=v.tail;if(ar(a,c,v.children,f),v=hn.current,v&2)v=v&1|2,c.flags|=128;else{if(a!==null&&a.flags&128)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Z1(a,f,c);else if(a.tag===19)Z1(a,f,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}v&=1}if(Yt(hn,v),!(c.mode&1))c.memoizedState=null;else switch(S){case"forwards":for(f=c.child,S=null;f!==null;)a=f.alternate,a!==null&&bd(a)===null&&(S=f),f=f.sibling;f=S,f===null?(S=c.child,c.child=null):(S=f.sibling,f.sibling=null),dm(c,!1,S,f,C);break;case"backwards":for(f=null,S=c.child,c.child=null;S!==null;){if(a=S.alternate,a!==null&&bd(a)===null){c.child=S;break}a=S.sibling,S.sibling=f,f=S,S=a}dm(c,!0,f,null,C);break;case"together":dm(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Td(a,c){!(c.mode&1)&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function ui(a,c,f){if(a!==null&&(c.dependencies=a.dependencies),Ls|=c.lanes,!(f&c.childLanes))return null;if(a!==null&&c.child!==a.child)throw Error(n(153));if(c.child!==null){for(a=c.child,f=ns(a,a.pendingProps),c.child=f,f.return=c;a.sibling!==null;)a=a.sibling,f=f.sibling=ns(a,a.pendingProps),f.return=c;f.sibling=null}return c.child}function t_(a,c,f){switch(c.tag){case 3:Y1(c),Wa();break;case 5:v1(c);break;case 1:yr(c.type)&&cd(c);break;case 4:qh(c,c.stateNode.containerInfo);break;case 10:var v=c.type._context,S=c.memoizedProps.value;Yt(hd,v._currentValue),v._currentValue=S;break;case 13:if(v=c.memoizedState,v!==null)return v.dehydrated!==null?(Yt(hn,hn.current&1),c.flags|=128,null):f&c.child.childLanes?J1(a,c,f):(Yt(hn,hn.current&1),a=ui(a,c,f),a!==null?a.sibling:null);Yt(hn,hn.current&1);break;case 19:if(v=(f&c.childLanes)!==0,a.flags&128){if(v)return eb(a,c,f);c.flags|=128}if(S=c.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),Yt(hn,hn.current),v)break;return null;case 22:case 23:return c.lanes=0,G1(a,c,f)}return ui(a,c,f)}var tb,fm,nb,rb;tb=function(a,c){for(var f=c.child;f!==null;){if(f.tag===5||f.tag===6)a.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},fm=function(){},nb=function(a,c,f,v){var S=a.memoizedProps;if(S!==v){a=c.stateNode,Ms(Oo.current);var C=null;switch(f){case"input":S=Et(a,S),v=Et(a,v),C=[];break;case"select":S=I({},S,{value:void 0}),v=I({},v,{value:void 0}),C=[];break;case"textarea":S=ke(a,S),v=ke(a,v),C=[];break;default:typeof S.onClick!="function"&&typeof v.onClick=="function"&&(a.onclick=sd)}ir(f,v);var D;f=null;for(ne in S)if(!v.hasOwnProperty(ne)&&S.hasOwnProperty(ne)&&S[ne]!=null)if(ne==="style"){var $=S[ne];for(D in $)$.hasOwnProperty(D)&&(f||(f={}),f[D]="")}else ne!=="dangerouslySetInnerHTML"&&ne!=="children"&&ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&ne!=="autoFocus"&&(o.hasOwnProperty(ne)?C||(C=[]):(C=C||[]).push(ne,null));for(ne in v){var W=v[ne];if($=S!=null?S[ne]:void 0,v.hasOwnProperty(ne)&&W!==$&&(W!=null||$!=null))if(ne==="style")if($){for(D in $)!$.hasOwnProperty(D)||W&&W.hasOwnProperty(D)||(f||(f={}),f[D]="");for(D in W)W.hasOwnProperty(D)&&$[D]!==W[D]&&(f||(f={}),f[D]=W[D])}else f||(C||(C=[]),C.push(ne,f)),f=W;else ne==="dangerouslySetInnerHTML"?(W=W?W.__html:void 0,$=$?$.__html:void 0,W!=null&&$!==W&&(C=C||[]).push(ne,W)):ne==="children"?typeof W!="string"&&typeof W!="number"||(C=C||[]).push(ne,""+W):ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&(o.hasOwnProperty(ne)?(W!=null&&ne==="onScroll"&&rn("scroll",a),C||$===W||(C=[])):(C=C||[]).push(ne,W))}f&&(C=C||[]).push("style",f);var ne=C;(c.updateQueue=ne)&&(c.flags|=4)}},rb=function(a,c,f,v){f!==v&&(c.flags|=4)};function Tc(a,c){if(!un)switch(a.tailMode){case"hidden":c=a.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var v=null;f!==null;)f.alternate!==null&&(v=f),f=f.sibling;v===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:v.sibling=null}}function Zn(a){var c=a.alternate!==null&&a.alternate.child===a.child,f=0,v=0;if(c)for(var S=a.child;S!==null;)f|=S.lanes|S.childLanes,v|=S.subtreeFlags&14680064,v|=S.flags&14680064,S.return=a,S=S.sibling;else for(S=a.child;S!==null;)f|=S.lanes|S.childLanes,v|=S.subtreeFlags,v|=S.flags,S.return=a,S=S.sibling;return a.subtreeFlags|=v,a.childLanes=f,c}function n_(a,c,f){var v=c.pendingProps;switch(Ah(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zn(c),null;case 1:return yr(c.type)&&ld(),Zn(c),null;case 3:return v=c.stateNode,Qa(),on(vr),on(Xn),Kh(),v.pendingContext&&(v.context=v.pendingContext,v.pendingContext=null),(a===null||a.child===null)&&(pd(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,ho!==null&&(jm(ho),ho=null))),fm(a,c),Zn(c),null;case 5:Gh(c);var S=Ms(Sc.current);if(f=c.type,a!==null&&c.stateNode!=null)nb(a,c,f,v,S),a.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!v){if(c.stateNode===null)throw Error(n(166));return Zn(c),null}if(a=Ms(Oo.current),pd(c)){v=c.stateNode,f=c.type;var C=c.memoizedProps;switch(v[Mo]=c,v[vc]=C,a=(c.mode&1)!==0,f){case"dialog":rn("cancel",v),rn("close",v);break;case"iframe":case"object":case"embed":rn("load",v);break;case"video":case"audio":for(S=0;S<hc.length;S++)rn(hc[S],v);break;case"source":rn("error",v);break;case"img":case"image":case"link":rn("error",v),rn("load",v);break;case"details":rn("toggle",v);break;case"input":vt(v,C),rn("invalid",v);break;case"select":v._wrapperState={wasMultiple:!!C.multiple},rn("invalid",v);break;case"textarea":ae(v,C),rn("invalid",v)}ir(f,C),S=null;for(var D in C)if(C.hasOwnProperty(D)){var $=C[D];D==="children"?typeof $=="string"?v.textContent!==$&&(C.suppressHydrationWarning!==!0&&id(v.textContent,$,a),S=["children",$]):typeof $=="number"&&v.textContent!==""+$&&(C.suppressHydrationWarning!==!0&&id(v.textContent,$,a),S=["children",""+$]):o.hasOwnProperty(D)&&$!=null&&D==="onScroll"&&rn("scroll",v)}switch(f){case"input":at(v),pe(v,C,!0);break;case"textarea":at(v),ut(v);break;case"select":case"option":break;default:typeof C.onClick=="function"&&(v.onclick=sd)}v=S,c.updateQueue=v,v!==null&&(c.flags|=4)}else{D=S.nodeType===9?S:S.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=Mt(f)),a==="http://www.w3.org/1999/xhtml"?f==="script"?(a=D.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof v.is=="string"?a=D.createElement(f,{is:v.is}):(a=D.createElement(f),f==="select"&&(D=a,v.multiple?D.multiple=!0:v.size&&(D.size=v.size))):a=D.createElementNS(a,f),a[Mo]=c,a[vc]=v,tb(a,c,!1,!1),c.stateNode=a;e:{switch(D=Io(f,v),f){case"dialog":rn("cancel",a),rn("close",a),S=v;break;case"iframe":case"object":case"embed":rn("load",a),S=v;break;case"video":case"audio":for(S=0;S<hc.length;S++)rn(hc[S],a);S=v;break;case"source":rn("error",a),S=v;break;case"img":case"image":case"link":rn("error",a),rn("load",a),S=v;break;case"details":rn("toggle",a),S=v;break;case"input":vt(a,v),S=Et(a,v),rn("invalid",a);break;case"option":S=v;break;case"select":a._wrapperState={wasMultiple:!!v.multiple},S=I({},v,{value:void 0}),rn("invalid",a);break;case"textarea":ae(a,v),S=ke(a,v),rn("invalid",a);break;default:S=v}ir(f,S),$=S;for(C in $)if($.hasOwnProperty(C)){var W=$[C];C==="style"?Ts(a,W):C==="dangerouslySetInnerHTML"?(W=W?W.__html:void 0,W!=null&&xn(a,W)):C==="children"?typeof W=="string"?(f!=="textarea"||W!=="")&&cn(a,W):typeof W=="number"&&cn(a,""+W):C!=="suppressContentEditableWarning"&&C!=="suppressHydrationWarning"&&C!=="autoFocus"&&(o.hasOwnProperty(C)?W!=null&&C==="onScroll"&&rn("scroll",a):W!=null&&k(a,C,W,D))}switch(f){case"input":at(a),pe(a,v,!1);break;case"textarea":at(a),ut(a);break;case"option":v.value!=null&&a.setAttribute("value",""+fe(v.value));break;case"select":a.multiple=!!v.multiple,C=v.value,C!=null?he(a,!!v.multiple,C,!1):v.defaultValue!=null&&he(a,!!v.multiple,v.defaultValue,!0);break;default:typeof S.onClick=="function"&&(a.onclick=sd)}switch(f){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}}v&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Zn(c),null;case 6:if(a&&c.stateNode!=null)rb(a,c,a.memoizedProps,v);else{if(typeof v!="string"&&c.stateNode===null)throw Error(n(166));if(f=Ms(Sc.current),Ms(Oo.current),pd(c)){if(v=c.stateNode,f=c.memoizedProps,v[Mo]=c,(C=v.nodeValue!==f)&&(a=Ar,a!==null))switch(a.tag){case 3:id(v.nodeValue,f,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&id(v.nodeValue,f,(a.mode&1)!==0)}C&&(c.flags|=4)}else v=(f.nodeType===9?f:f.ownerDocument).createTextNode(v),v[Mo]=c,c.stateNode=v}return Zn(c),null;case 13:if(on(hn),v=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(un&&Mr!==null&&c.mode&1&&!(c.flags&128))i1(),Wa(),c.flags|=98560,C=!1;else if(C=pd(c),v!==null&&v.dehydrated!==null){if(a===null){if(!C)throw Error(n(318));if(C=c.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(n(317));C[Mo]=c}else Wa(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;Zn(c),C=!1}else ho!==null&&(jm(ho),ho=null),C=!0;if(!C)return c.flags&65536?c:null}return c.flags&128?(c.lanes=f,c):(v=v!==null,v!==(a!==null&&a.memoizedState!==null)&&v&&(c.child.flags|=8192,c.mode&1&&(a===null||hn.current&1?Mn===0&&(Mn=3):km())),c.updateQueue!==null&&(c.flags|=4),Zn(c),null);case 4:return Qa(),fm(a,c),a===null&&mc(c.stateNode.containerInfo),Zn(c),null;case 10:return zh(c.type._context),Zn(c),null;case 17:return yr(c.type)&&ld(),Zn(c),null;case 19:if(on(hn),C=c.memoizedState,C===null)return Zn(c),null;if(v=(c.flags&128)!==0,D=C.rendering,D===null)if(v)Tc(C,!1);else{if(Mn!==0||a!==null&&a.flags&128)for(a=c.child;a!==null;){if(D=bd(a),D!==null){for(c.flags|=128,Tc(C,!1),v=D.updateQueue,v!==null&&(c.updateQueue=v,c.flags|=4),c.subtreeFlags=0,v=f,f=c.child;f!==null;)C=f,a=v,C.flags&=14680066,D=C.alternate,D===null?(C.childLanes=0,C.lanes=a,C.child=null,C.subtreeFlags=0,C.memoizedProps=null,C.memoizedState=null,C.updateQueue=null,C.dependencies=null,C.stateNode=null):(C.childLanes=D.childLanes,C.lanes=D.lanes,C.child=D.child,C.subtreeFlags=0,C.deletions=null,C.memoizedProps=D.memoizedProps,C.memoizedState=D.memoizedState,C.updateQueue=D.updateQueue,C.type=D.type,a=D.dependencies,C.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),f=f.sibling;return Yt(hn,hn.current&1|2),c.child}a=a.sibling}C.tail!==null&&tn()>Ja&&(c.flags|=128,v=!0,Tc(C,!1),c.lanes=4194304)}else{if(!v)if(a=bd(D),a!==null){if(c.flags|=128,v=!0,f=a.updateQueue,f!==null&&(c.updateQueue=f,c.flags|=4),Tc(C,!0),C.tail===null&&C.tailMode==="hidden"&&!D.alternate&&!un)return Zn(c),null}else 2*tn()-C.renderingStartTime>Ja&&f!==1073741824&&(c.flags|=128,v=!0,Tc(C,!1),c.lanes=4194304);C.isBackwards?(D.sibling=c.child,c.child=D):(f=C.last,f!==null?f.sibling=D:c.child=D,C.last=D)}return C.tail!==null?(c=C.tail,C.rendering=c,C.tail=c.sibling,C.renderingStartTime=tn(),c.sibling=null,f=hn.current,Yt(hn,v?f&1|2:f&1),c):(Zn(c),null);case 22:case 23:return Em(),v=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==v&&(c.flags|=8192),v&&c.mode&1?Or&1073741824&&(Zn(c),c.subtreeFlags&6&&(c.flags|=8192)):Zn(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function r_(a,c){switch(Ah(c),c.tag){case 1:return yr(c.type)&&ld(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return Qa(),on(vr),on(Xn),Kh(),a=c.flags,a&65536&&!(a&128)?(c.flags=a&-65537|128,c):null;case 5:return Gh(c),null;case 13:if(on(hn),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(n(340));Wa()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return on(hn),null;case 4:return Qa(),null;case 10:return zh(c.type._context),null;case 22:case 23:return Em(),null;case 24:return null;default:return null}}var Pd=!1,er=!1,o_=typeof WeakSet=="function"?WeakSet:Set,Ue=null;function Ya(a,c){var f=a.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(v){jn(a,c,v)}else f.current=null}function pm(a,c,f){try{f()}catch(v){jn(a,c,v)}}var ob=!1;function i_(a,c){if(Eh=Qu,a=M0(),vh(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var v=f.getSelection&&f.getSelection();if(v&&v.rangeCount!==0){f=v.anchorNode;var S=v.anchorOffset,C=v.focusNode;v=v.focusOffset;try{f.nodeType,C.nodeType}catch{f=null;break e}var D=0,$=-1,W=-1,ne=0,ge=0,ye=a,me=null;t:for(;;){for(var Oe;ye!==f||S!==0&&ye.nodeType!==3||($=D+S),ye!==C||v!==0&&ye.nodeType!==3||(W=D+v),ye.nodeType===3&&(D+=ye.nodeValue.length),(Oe=ye.firstChild)!==null;)me=ye,ye=Oe;for(;;){if(ye===a)break t;if(me===f&&++ne===S&&($=D),me===C&&++ge===v&&(W=D),(Oe=ye.nextSibling)!==null)break;ye=me,me=ye.parentNode}ye=Oe}f=$===-1||W===-1?null:{start:$,end:W}}else f=null}f=f||{start:0,end:0}}else f=null;for(kh={focusedElem:a,selectionRange:f},Qu=!1,Ue=c;Ue!==null;)if(c=Ue,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,Ue=a;else for(;Ue!==null;){c=Ue;try{var We=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(We!==null){var Qe=We.memoizedProps,kn=We.memoizedState,X=c.stateNode,H=X.getSnapshotBeforeUpdate(c.elementType===c.type?Qe:mo(c.type,Qe),kn);X.__reactInternalSnapshotBeforeUpdate=H}break;case 3:var Z=c.stateNode.containerInfo;Z.nodeType===1?Z.textContent="":Z.nodeType===9&&Z.documentElement&&Z.removeChild(Z.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(je){jn(c,c.return,je)}if(a=c.sibling,a!==null){a.return=c.return,Ue=a;break}Ue=c.return}return We=ob,ob=!1,We}function Pc(a,c,f){var v=c.updateQueue;if(v=v!==null?v.lastEffect:null,v!==null){var S=v=v.next;do{if((S.tag&a)===a){var C=S.destroy;S.destroy=void 0,C!==void 0&&pm(c,f,C)}S=S.next}while(S!==v)}}function Rd(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var f=c=c.next;do{if((f.tag&a)===a){var v=f.create;f.destroy=v()}f=f.next}while(f!==c)}}function hm(a){var c=a.ref;if(c!==null){var f=a.stateNode;switch(a.tag){case 5:a=f;break;default:a=f}typeof c=="function"?c(a):c.current=a}}function ib(a){var c=a.alternate;c!==null&&(a.alternate=null,ib(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[Mo],delete c[vc],delete c[_h],delete c[B2],delete c[U2])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function sb(a){return a.tag===5||a.tag===3||a.tag===4}function ab(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||sb(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function mm(a,c,f){var v=a.tag;if(v===5||v===6)a=a.stateNode,c?f.nodeType===8?f.parentNode.insertBefore(a,c):f.insertBefore(a,c):(f.nodeType===8?(c=f.parentNode,c.insertBefore(a,f)):(c=f,c.appendChild(a)),f=f._reactRootContainer,f!=null||c.onclick!==null||(c.onclick=sd));else if(v!==4&&(a=a.child,a!==null))for(mm(a,c,f),a=a.sibling;a!==null;)mm(a,c,f),a=a.sibling}function gm(a,c,f){var v=a.tag;if(v===5||v===6)a=a.stateNode,c?f.insertBefore(a,c):f.appendChild(a);else if(v!==4&&(a=a.child,a!==null))for(gm(a,c,f),a=a.sibling;a!==null;)gm(a,c,f),a=a.sibling}var Hn=null,go=!1;function Xi(a,c,f){for(f=f.child;f!==null;)lb(a,c,f),f=f.sibling}function lb(a,c,f){if(Yn&&typeof Yn.onCommitFiberUnmount=="function")try{Yn.onCommitFiberUnmount(fo,f)}catch{}switch(f.tag){case 5:er||Ya(f,c);case 6:var v=Hn,S=go;Hn=null,Xi(a,c,f),Hn=v,go=S,Hn!==null&&(go?(a=Hn,f=f.stateNode,a.nodeType===8?a.parentNode.removeChild(f):a.removeChild(f)):Hn.removeChild(f.stateNode));break;case 18:Hn!==null&&(go?(a=Hn,f=f.stateNode,a.nodeType===8?Rh(a.parentNode,f):a.nodeType===1&&Rh(a,f),sc(a)):Rh(Hn,f.stateNode));break;case 4:v=Hn,S=go,Hn=f.stateNode.containerInfo,go=!0,Xi(a,c,f),Hn=v,go=S;break;case 0:case 11:case 14:case 15:if(!er&&(v=f.updateQueue,v!==null&&(v=v.lastEffect,v!==null))){S=v=v.next;do{var C=S,D=C.destroy;C=C.tag,D!==void 0&&(C&2||C&4)&&pm(f,c,D),S=S.next}while(S!==v)}Xi(a,c,f);break;case 1:if(!er&&(Ya(f,c),v=f.stateNode,typeof v.componentWillUnmount=="function"))try{v.props=f.memoizedProps,v.state=f.memoizedState,v.componentWillUnmount()}catch($){jn(f,c,$)}Xi(a,c,f);break;case 21:Xi(a,c,f);break;case 22:f.mode&1?(er=(v=er)||f.memoizedState!==null,Xi(a,c,f),er=v):Xi(a,c,f);break;default:Xi(a,c,f)}}function cb(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var f=a.stateNode;f===null&&(f=a.stateNode=new o_),c.forEach(function(v){var S=h_.bind(null,a,v);f.has(v)||(f.add(v),v.then(S,S))})}}function vo(a,c){var f=c.deletions;if(f!==null)for(var v=0;v<f.length;v++){var S=f[v];try{var C=a,D=c,$=D;e:for(;$!==null;){switch($.tag){case 5:Hn=$.stateNode,go=!1;break e;case 3:Hn=$.stateNode.containerInfo,go=!0;break e;case 4:Hn=$.stateNode.containerInfo,go=!0;break e}$=$.return}if(Hn===null)throw Error(n(160));lb(C,D,S),Hn=null,go=!1;var W=S.alternate;W!==null&&(W.return=null),S.return=null}catch(ne){jn(S,c,ne)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)ub(c,a),c=c.sibling}function ub(a,c){var f=a.alternate,v=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(vo(c,a),$o(a),v&4){try{Pc(3,a,a.return),Rd(3,a)}catch(Qe){jn(a,a.return,Qe)}try{Pc(5,a,a.return)}catch(Qe){jn(a,a.return,Qe)}}break;case 1:vo(c,a),$o(a),v&512&&f!==null&&Ya(f,f.return);break;case 5:if(vo(c,a),$o(a),v&512&&f!==null&&Ya(f,f.return),a.flags&32){var S=a.stateNode;try{cn(S,"")}catch(Qe){jn(a,a.return,Qe)}}if(v&4&&(S=a.stateNode,S!=null)){var C=a.memoizedProps,D=f!==null?f.memoizedProps:C,$=a.type,W=a.updateQueue;if(a.updateQueue=null,W!==null)try{$==="input"&&C.type==="radio"&&C.name!=null&&kt(S,C),Io($,D);var ne=Io($,C);for(D=0;D<W.length;D+=2){var ge=W[D],ye=W[D+1];ge==="style"?Ts(S,ye):ge==="dangerouslySetInnerHTML"?xn(S,ye):ge==="children"?cn(S,ye):k(S,ge,ye,ne)}switch($){case"input":ce(S,C);break;case"textarea":Ae(S,C);break;case"select":var me=S._wrapperState.wasMultiple;S._wrapperState.wasMultiple=!!C.multiple;var Oe=C.value;Oe!=null?he(S,!!C.multiple,Oe,!1):me!==!!C.multiple&&(C.defaultValue!=null?he(S,!!C.multiple,C.defaultValue,!0):he(S,!!C.multiple,C.multiple?[]:"",!1))}S[vc]=C}catch(Qe){jn(a,a.return,Qe)}}break;case 6:if(vo(c,a),$o(a),v&4){if(a.stateNode===null)throw Error(n(162));S=a.stateNode,C=a.memoizedProps;try{S.nodeValue=C}catch(Qe){jn(a,a.return,Qe)}}break;case 3:if(vo(c,a),$o(a),v&4&&f!==null&&f.memoizedState.isDehydrated)try{sc(c.containerInfo)}catch(Qe){jn(a,a.return,Qe)}break;case 4:vo(c,a),$o(a);break;case 13:vo(c,a),$o(a),S=a.child,S.flags&8192&&(C=S.memoizedState!==null,S.stateNode.isHidden=C,!C||S.alternate!==null&&S.alternate.memoizedState!==null||(xm=tn())),v&4&&cb(a);break;case 22:if(ge=f!==null&&f.memoizedState!==null,a.mode&1?(er=(ne=er)||ge,vo(c,a),er=ne):vo(c,a),$o(a),v&8192){if(ne=a.memoizedState!==null,(a.stateNode.isHidden=ne)&&!ge&&a.mode&1)for(Ue=a,ge=a.child;ge!==null;){for(ye=Ue=ge;Ue!==null;){switch(me=Ue,Oe=me.child,me.tag){case 0:case 11:case 14:case 15:Pc(4,me,me.return);break;case 1:Ya(me,me.return);var We=me.stateNode;if(typeof We.componentWillUnmount=="function"){v=me,f=me.return;try{c=v,We.props=c.memoizedProps,We.state=c.memoizedState,We.componentWillUnmount()}catch(Qe){jn(v,f,Qe)}}break;case 5:Ya(me,me.return);break;case 22:if(me.memoizedState!==null){pb(ye);continue}}Oe!==null?(Oe.return=me,Ue=Oe):pb(ye)}ge=ge.sibling}e:for(ge=null,ye=a;;){if(ye.tag===5){if(ge===null){ge=ye;try{S=ye.stateNode,ne?(C=S.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none"):($=ye.stateNode,W=ye.memoizedProps.style,D=W!=null&&W.hasOwnProperty("display")?W.display:null,$.style.display=Jo("display",D))}catch(Qe){jn(a,a.return,Qe)}}}else if(ye.tag===6){if(ge===null)try{ye.stateNode.nodeValue=ne?"":ye.memoizedProps}catch(Qe){jn(a,a.return,Qe)}}else if((ye.tag!==22&&ye.tag!==23||ye.memoizedState===null||ye===a)&&ye.child!==null){ye.child.return=ye,ye=ye.child;continue}if(ye===a)break e;for(;ye.sibling===null;){if(ye.return===null||ye.return===a)break e;ge===ye&&(ge=null),ye=ye.return}ge===ye&&(ge=null),ye.sibling.return=ye.return,ye=ye.sibling}}break;case 19:vo(c,a),$o(a),v&4&&cb(a);break;case 21:break;default:vo(c,a),$o(a)}}function $o(a){var c=a.flags;if(c&2){try{e:{for(var f=a.return;f!==null;){if(sb(f)){var v=f;break e}f=f.return}throw Error(n(160))}switch(v.tag){case 5:var S=v.stateNode;v.flags&32&&(cn(S,""),v.flags&=-33);var C=ab(a);gm(a,C,S);break;case 3:case 4:var D=v.stateNode.containerInfo,$=ab(a);mm(a,$,D);break;default:throw Error(n(161))}}catch(W){jn(a,a.return,W)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function s_(a,c,f){Ue=a,db(a)}function db(a,c,f){for(var v=(a.mode&1)!==0;Ue!==null;){var S=Ue,C=S.child;if(S.tag===22&&v){var D=S.memoizedState!==null||Pd;if(!D){var $=S.alternate,W=$!==null&&$.memoizedState!==null||er;$=Pd;var ne=er;if(Pd=D,(er=W)&&!ne)for(Ue=S;Ue!==null;)D=Ue,W=D.child,D.tag===22&&D.memoizedState!==null?hb(S):W!==null?(W.return=D,Ue=W):hb(S);for(;C!==null;)Ue=C,db(C),C=C.sibling;Ue=S,Pd=$,er=ne}fb(a)}else S.subtreeFlags&8772&&C!==null?(C.return=S,Ue=C):fb(a)}}function fb(a){for(;Ue!==null;){var c=Ue;if(c.flags&8772){var f=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:er||Rd(5,c);break;case 1:var v=c.stateNode;if(c.flags&4&&!er)if(f===null)v.componentDidMount();else{var S=c.elementType===c.type?f.memoizedProps:mo(c.type,f.memoizedProps);v.componentDidUpdate(S,f.memoizedState,v.__reactInternalSnapshotBeforeUpdate)}var C=c.updateQueue;C!==null&&c1(c,C,v);break;case 3:var D=c.updateQueue;if(D!==null){if(f=null,c.child!==null)switch(c.child.tag){case 5:f=c.child.stateNode;break;case 1:f=c.child.stateNode}c1(c,D,f)}break;case 5:var $=c.stateNode;if(f===null&&c.flags&4){f=$;var W=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":W.autoFocus&&f.focus();break;case"img":W.src&&(f.src=W.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var ne=c.alternate;if(ne!==null){var ge=ne.memoizedState;if(ge!==null){var ye=ge.dehydrated;ye!==null&&sc(ye)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}er||c.flags&512&&hm(c)}catch(me){jn(c,c.return,me)}}if(c===a){Ue=null;break}if(f=c.sibling,f!==null){f.return=c.return,Ue=f;break}Ue=c.return}}function pb(a){for(;Ue!==null;){var c=Ue;if(c===a){Ue=null;break}var f=c.sibling;if(f!==null){f.return=c.return,Ue=f;break}Ue=c.return}}function hb(a){for(;Ue!==null;){var c=Ue;try{switch(c.tag){case 0:case 11:case 15:var f=c.return;try{Rd(4,c)}catch(W){jn(c,f,W)}break;case 1:var v=c.stateNode;if(typeof v.componentDidMount=="function"){var S=c.return;try{v.componentDidMount()}catch(W){jn(c,S,W)}}var C=c.return;try{hm(c)}catch(W){jn(c,C,W)}break;case 5:var D=c.return;try{hm(c)}catch(W){jn(c,D,W)}}}catch(W){jn(c,c.return,W)}if(c===a){Ue=null;break}var $=c.sibling;if($!==null){$.return=c.return,Ue=$;break}Ue=c.return}}var a_=Math.ceil,_d=E.ReactCurrentDispatcher,vm=E.ReactCurrentOwner,Kr=E.ReactCurrentBatchConfig,_t=0,Bn=null,_n=null,qn=0,Or=0,Xa=qi(0),Mn=0,Rc=null,Ls=0,Dd=0,ym=0,_c=null,br=null,xm=0,Ja=1/0,di=null,Id=!1,bm=null,Ji=null,Nd=!1,Zi=null,Ad=0,Dc=0,wm=null,Md=-1,Od=0;function lr(){return _t&6?tn():Md!==-1?Md:Md=tn()}function es(a){return a.mode&1?_t&2&&qn!==0?qn&-qn:W2.transition!==null?(Od===0&&(Od=s0()),Od):(a=Ft,a!==0||(a=window.event,a=a===void 0?16:m0(a.type)),a):1}function yo(a,c,f,v){if(50<Dc)throw Dc=0,wm=null,Error(n(185));tc(a,f,v),(!(_t&2)||a!==Bn)&&(a===Bn&&(!(_t&2)&&(Dd|=f),Mn===4&&ts(a,qn)),wr(a,v),f===1&&_t===0&&!(c.mode&1)&&(Ja=tn()+500,ud&&Qi()))}function wr(a,c){var f=a.callbackNode;WR(a,c);var v=Hu(a,a===Bn?qn:0);if(v===0)f!==null&&$i(f),a.callbackNode=null,a.callbackPriority=0;else if(c=v&-v,a.callbackPriority!==c){if(f!=null&&$i(f),c===1)a.tag===0?V2(gb.bind(null,a)):e1(gb.bind(null,a)),F2(function(){!(_t&6)&&Qi()}),f=null;else{switch(a0(v)){case 1:f=uo;break;case 4:f=Rs;break;case 16:f=ri;break;case 536870912:f=nn;break;default:f=ri}f=Cb(f,mb.bind(null,a))}a.callbackPriority=c,a.callbackNode=f}}function mb(a,c){if(Md=-1,Od=0,_t&6)throw Error(n(327));var f=a.callbackNode;if(Za()&&a.callbackNode!==f)return null;var v=Hu(a,a===Bn?qn:0);if(v===0)return null;if(v&30||v&a.expiredLanes||c)c=Ld(a,v);else{c=v;var S=_t;_t|=2;var C=yb();(Bn!==a||qn!==c)&&(di=null,Ja=tn()+500,Fs(a,c));do try{u_();break}catch($){vb(a,$)}while(!0);Fh(),_d.current=C,_t=S,_n!==null?c=0:(Bn=null,qn=0,c=Mn)}if(c!==0){if(c===2&&(S=th(a),S!==0&&(v=S,c=Sm(a,S))),c===1)throw f=Rc,Fs(a,0),ts(a,v),wr(a,tn()),f;if(c===6)ts(a,v);else{if(S=a.current.alternate,!(v&30)&&!l_(S)&&(c=Ld(a,v),c===2&&(C=th(a),C!==0&&(v=C,c=Sm(a,C))),c===1))throw f=Rc,Fs(a,0),ts(a,v),wr(a,tn()),f;switch(a.finishedWork=S,a.finishedLanes=v,c){case 0:case 1:throw Error(n(345));case 2:zs(a,br,di);break;case 3:if(ts(a,v),(v&130023424)===v&&(c=xm+500-tn(),10<c)){if(Hu(a,0)!==0)break;if(S=a.suspendedLanes,(S&v)!==v){lr(),a.pingedLanes|=a.suspendedLanes&S;break}a.timeoutHandle=Ph(zs.bind(null,a,br,di),c);break}zs(a,br,di);break;case 4:if(ts(a,v),(v&4194240)===v)break;for(c=a.eventTimes,S=-1;0<v;){var D=31-Fn(v);C=1<<D,D=c[D],D>S&&(S=D),v&=~C}if(v=S,v=tn()-v,v=(120>v?120:480>v?480:1080>v?1080:1920>v?1920:3e3>v?3e3:4320>v?4320:1960*a_(v/1960))-v,10<v){a.timeoutHandle=Ph(zs.bind(null,a,br,di),v);break}zs(a,br,di);break;case 5:zs(a,br,di);break;default:throw Error(n(329))}}}return wr(a,tn()),a.callbackNode===f?mb.bind(null,a):null}function Sm(a,c){var f=_c;return a.current.memoizedState.isDehydrated&&(Fs(a,c).flags|=256),a=Ld(a,c),a!==2&&(c=br,br=f,c!==null&&jm(c)),a}function jm(a){br===null?br=a:br.push.apply(br,a)}function l_(a){for(var c=a;;){if(c.flags&16384){var f=c.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var v=0;v<f.length;v++){var S=f[v],C=S.getSnapshot;S=S.value;try{if(!po(C(),S))return!1}catch{return!1}}}if(f=c.child,c.subtreeFlags&16384&&f!==null)f.return=c,c=f;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function ts(a,c){for(c&=~ym,c&=~Dd,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var f=31-Fn(c),v=1<<f;a[f]=-1,c&=~v}}function gb(a){if(_t&6)throw Error(n(327));Za();var c=Hu(a,0);if(!(c&1))return wr(a,tn()),null;var f=Ld(a,c);if(a.tag!==0&&f===2){var v=th(a);v!==0&&(c=v,f=Sm(a,v))}if(f===1)throw f=Rc,Fs(a,0),ts(a,c),wr(a,tn()),f;if(f===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,zs(a,br,di),wr(a,tn()),null}function Cm(a,c){var f=_t;_t|=1;try{return a(c)}finally{_t=f,_t===0&&(Ja=tn()+500,ud&&Qi())}}function $s(a){Zi!==null&&Zi.tag===0&&!(_t&6)&&Za();var c=_t;_t|=1;var f=Kr.transition,v=Ft;try{if(Kr.transition=null,Ft=1,a)return a()}finally{Ft=v,Kr.transition=f,_t=c,!(_t&6)&&Qi()}}function Em(){Or=Xa.current,on(Xa)}function Fs(a,c){a.finishedWork=null,a.finishedLanes=0;var f=a.timeoutHandle;if(f!==-1&&(a.timeoutHandle=-1,$2(f)),_n!==null)for(f=_n.return;f!==null;){var v=f;switch(Ah(v),v.tag){case 1:v=v.type.childContextTypes,v!=null&&ld();break;case 3:Qa(),on(vr),on(Xn),Kh();break;case 5:Gh(v);break;case 4:Qa();break;case 13:on(hn);break;case 19:on(hn);break;case 10:zh(v.type._context);break;case 22:case 23:Em()}f=f.return}if(Bn=a,_n=a=ns(a.current,null),qn=Or=c,Mn=0,Rc=null,ym=Dd=Ls=0,br=_c=null,As!==null){for(c=0;c<As.length;c++)if(f=As[c],v=f.interleaved,v!==null){f.interleaved=null;var S=v.next,C=f.pending;if(C!==null){var D=C.next;C.next=S,v.next=D}f.pending=v}As=null}return a}function vb(a,c){do{var f=_n;try{if(Fh(),wd.current=Ed,Sd){for(var v=mn.memoizedState;v!==null;){var S=v.queue;S!==null&&(S.pending=null),v=v.next}Sd=!1}if(Os=0,zn=An=mn=null,jc=!1,Cc=0,vm.current=null,f===null||f.return===null){Mn=1,Rc=c,_n=null;break}e:{var C=a,D=f.return,$=f,W=c;if(c=qn,$.flags|=32768,W!==null&&typeof W=="object"&&typeof W.then=="function"){var ne=W,ge=$,ye=ge.tag;if(!(ge.mode&1)&&(ye===0||ye===11||ye===15)){var me=ge.alternate;me?(ge.updateQueue=me.updateQueue,ge.memoizedState=me.memoizedState,ge.lanes=me.lanes):(ge.updateQueue=null,ge.memoizedState=null)}var Oe=U1(D);if(Oe!==null){Oe.flags&=-257,V1(Oe,D,$,C,c),Oe.mode&1&&B1(C,ne,c),c=Oe,W=ne;var We=c.updateQueue;if(We===null){var Qe=new Set;Qe.add(W),c.updateQueue=Qe}else We.add(W);break e}else{if(!(c&1)){B1(C,ne,c),km();break e}W=Error(n(426))}}else if(un&&$.mode&1){var kn=U1(D);if(kn!==null){!(kn.flags&65536)&&(kn.flags|=256),V1(kn,D,$,C,c),Lh(Ka(W,$));break e}}C=W=Ka(W,$),Mn!==4&&(Mn=2),_c===null?_c=[C]:_c.push(C),C=D;do{switch(C.tag){case 3:C.flags|=65536,c&=-c,C.lanes|=c;var X=F1(C,W,c);l1(C,X);break e;case 1:$=W;var H=C.type,Z=C.stateNode;if(!(C.flags&128)&&(typeof H.getDerivedStateFromError=="function"||Z!==null&&typeof Z.componentDidCatch=="function"&&(Ji===null||!Ji.has(Z)))){C.flags|=65536,c&=-c,C.lanes|=c;var je=z1(C,$,c);l1(C,je);break e}}C=C.return}while(C!==null)}bb(f)}catch(Xe){c=Xe,_n===f&&f!==null&&(_n=f=f.return);continue}break}while(!0)}function yb(){var a=_d.current;return _d.current=Ed,a===null?Ed:a}function km(){(Mn===0||Mn===3||Mn===2)&&(Mn=4),Bn===null||!(Ls&268435455)&&!(Dd&268435455)||ts(Bn,qn)}function Ld(a,c){var f=_t;_t|=2;var v=yb();(Bn!==a||qn!==c)&&(di=null,Fs(a,c));do try{c_();break}catch(S){vb(a,S)}while(!0);if(Fh(),_t=f,_d.current=v,_n!==null)throw Error(n(261));return Bn=null,qn=0,Mn}function c_(){for(;_n!==null;)xb(_n)}function u_(){for(;_n!==null&&!co();)xb(_n)}function xb(a){var c=jb(a.alternate,a,Or);a.memoizedProps=a.pendingProps,c===null?bb(a):_n=c,vm.current=null}function bb(a){var c=a;do{var f=c.alternate;if(a=c.return,c.flags&32768){if(f=r_(f,c),f!==null){f.flags&=32767,_n=f;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Mn=6,_n=null;return}}else if(f=n_(f,c,Or),f!==null){_n=f;return}if(c=c.sibling,c!==null){_n=c;return}_n=c=a}while(c!==null);Mn===0&&(Mn=5)}function zs(a,c,f){var v=Ft,S=Kr.transition;try{Kr.transition=null,Ft=1,d_(a,c,f,v)}finally{Kr.transition=S,Ft=v}return null}function d_(a,c,f,v){do Za();while(Zi!==null);if(_t&6)throw Error(n(327));f=a.finishedWork;var S=a.finishedLanes;if(f===null)return null;if(a.finishedWork=null,a.finishedLanes=0,f===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var C=f.lanes|f.childLanes;if(HR(a,C),a===Bn&&(_n=Bn=null,qn=0),!(f.subtreeFlags&2064)&&!(f.flags&2064)||Nd||(Nd=!0,Cb(ri,function(){return Za(),null})),C=(f.flags&15990)!==0,f.subtreeFlags&15990||C){C=Kr.transition,Kr.transition=null;var D=Ft;Ft=1;var $=_t;_t|=4,vm.current=null,i_(a,f),ub(f,a),D2(kh),Qu=!!Eh,kh=Eh=null,a.current=f,s_(f),Wr(),_t=$,Ft=D,Kr.transition=C}else a.current=f;if(Nd&&(Nd=!1,Zi=a,Ad=S),C=a.pendingLanes,C===0&&(Ji=null),Sn(f.stateNode),wr(a,tn()),c!==null)for(v=a.onRecoverableError,f=0;f<c.length;f++)S=c[f],v(S.value,{componentStack:S.stack,digest:S.digest});if(Id)throw Id=!1,a=bm,bm=null,a;return Ad&1&&a.tag!==0&&Za(),C=a.pendingLanes,C&1?a===wm?Dc++:(Dc=0,wm=a):Dc=0,Qi(),null}function Za(){if(Zi!==null){var a=a0(Ad),c=Kr.transition,f=Ft;try{if(Kr.transition=null,Ft=16>a?16:a,Zi===null)var v=!1;else{if(a=Zi,Zi=null,Ad=0,_t&6)throw Error(n(331));var S=_t;for(_t|=4,Ue=a.current;Ue!==null;){var C=Ue,D=C.child;if(Ue.flags&16){var $=C.deletions;if($!==null){for(var W=0;W<$.length;W++){var ne=$[W];for(Ue=ne;Ue!==null;){var ge=Ue;switch(ge.tag){case 0:case 11:case 15:Pc(8,ge,C)}var ye=ge.child;if(ye!==null)ye.return=ge,Ue=ye;else for(;Ue!==null;){ge=Ue;var me=ge.sibling,Oe=ge.return;if(ib(ge),ge===ne){Ue=null;break}if(me!==null){me.return=Oe,Ue=me;break}Ue=Oe}}}var We=C.alternate;if(We!==null){var Qe=We.child;if(Qe!==null){We.child=null;do{var kn=Qe.sibling;Qe.sibling=null,Qe=kn}while(Qe!==null)}}Ue=C}}if(C.subtreeFlags&2064&&D!==null)D.return=C,Ue=D;else e:for(;Ue!==null;){if(C=Ue,C.flags&2048)switch(C.tag){case 0:case 11:case 15:Pc(9,C,C.return)}var X=C.sibling;if(X!==null){X.return=C.return,Ue=X;break e}Ue=C.return}}var H=a.current;for(Ue=H;Ue!==null;){D=Ue;var Z=D.child;if(D.subtreeFlags&2064&&Z!==null)Z.return=D,Ue=Z;else e:for(D=H;Ue!==null;){if($=Ue,$.flags&2048)try{switch($.tag){case 0:case 11:case 15:Rd(9,$)}}catch(Xe){jn($,$.return,Xe)}if($===D){Ue=null;break e}var je=$.sibling;if(je!==null){je.return=$.return,Ue=je;break e}Ue=$.return}}if(_t=S,Qi(),Yn&&typeof Yn.onPostCommitFiberRoot=="function")try{Yn.onPostCommitFiberRoot(fo,a)}catch{}v=!0}return v}finally{Ft=f,Kr.transition=c}}return!1}function wb(a,c,f){c=Ka(f,c),c=F1(a,c,1),a=Yi(a,c,1),c=lr(),a!==null&&(tc(a,1,c),wr(a,c))}function jn(a,c,f){if(a.tag===3)wb(a,a,f);else for(;c!==null;){if(c.tag===3){wb(c,a,f);break}else if(c.tag===1){var v=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(Ji===null||!Ji.has(v))){a=Ka(f,a),a=z1(c,a,1),c=Yi(c,a,1),a=lr(),c!==null&&(tc(c,1,a),wr(c,a));break}}c=c.return}}function f_(a,c,f){var v=a.pingCache;v!==null&&v.delete(c),c=lr(),a.pingedLanes|=a.suspendedLanes&f,Bn===a&&(qn&f)===f&&(Mn===4||Mn===3&&(qn&130023424)===qn&&500>tn()-xm?Fs(a,0):ym|=f),wr(a,c)}function Sb(a,c){c===0&&(a.mode&1?(c=Wu,Wu<<=1,!(Wu&130023424)&&(Wu=4194304)):c=1);var f=lr();a=li(a,c),a!==null&&(tc(a,c,f),wr(a,f))}function p_(a){var c=a.memoizedState,f=0;c!==null&&(f=c.retryLane),Sb(a,f)}function h_(a,c){var f=0;switch(a.tag){case 13:var v=a.stateNode,S=a.memoizedState;S!==null&&(f=S.retryLane);break;case 19:v=a.stateNode;break;default:throw Error(n(314))}v!==null&&v.delete(c),Sb(a,f)}var jb;jb=function(a,c,f){if(a!==null)if(a.memoizedProps!==c.pendingProps||vr.current)xr=!0;else{if(!(a.lanes&f)&&!(c.flags&128))return xr=!1,t_(a,c,f);xr=!!(a.flags&131072)}else xr=!1,un&&c.flags&1048576&&t1(c,fd,c.index);switch(c.lanes=0,c.tag){case 2:var v=c.type;Td(a,c),a=c.pendingProps;var S=Ba(c,Xn.current);qa(c,f),S=Jh(null,c,v,a,S,f);var C=Zh();return c.flags|=1,typeof S=="object"&&S!==null&&typeof S.render=="function"&&S.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,yr(v)?(C=!0,cd(c)):C=!1,c.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,Vh(c),S.updater=yd,c.stateNode=S,S._reactInternals=c,Hh(c,v,a,f),c=am(null,c,v,!0,C,f)):(c.tag=0,un&&C&&Nh(c),ar(null,c,S,f),c=c.child),c;case 16:v=c.elementType;e:{switch(Td(a,c),a=c.pendingProps,S=v._init,v=S(v._payload),c.type=v,S=c.tag=g_(v),a=mo(v,a),S){case 0:c=sm(null,c,v,a,f);break e;case 1:c=K1(null,c,v,a,f);break e;case 11:c=W1(null,c,v,a,f);break e;case 14:c=H1(null,c,v,mo(v.type,a),f);break e}throw Error(n(306,v,""))}return c;case 0:return v=c.type,S=c.pendingProps,S=c.elementType===v?S:mo(v,S),sm(a,c,v,S,f);case 1:return v=c.type,S=c.pendingProps,S=c.elementType===v?S:mo(v,S),K1(a,c,v,S,f);case 3:e:{if(Y1(c),a===null)throw Error(n(387));v=c.pendingProps,C=c.memoizedState,S=C.element,a1(a,c),vd(c,v,null,f);var D=c.memoizedState;if(v=D.element,C.isDehydrated)if(C={element:v,isDehydrated:!1,cache:D.cache,pendingSuspenseBoundaries:D.pendingSuspenseBoundaries,transitions:D.transitions},c.updateQueue.baseState=C,c.memoizedState=C,c.flags&256){S=Ka(Error(n(423)),c),c=X1(a,c,v,f,S);break e}else if(v!==S){S=Ka(Error(n(424)),c),c=X1(a,c,v,f,S);break e}else for(Mr=Hi(c.stateNode.containerInfo.firstChild),Ar=c,un=!0,ho=null,f=g1(c,null,v,f),c.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(Wa(),v===S){c=ui(a,c,f);break e}ar(a,c,v,f)}c=c.child}return c;case 5:return v1(c),a===null&&Oh(c),v=c.type,S=c.pendingProps,C=a!==null?a.memoizedProps:null,D=S.children,Th(v,S)?D=null:C!==null&&Th(v,C)&&(c.flags|=32),Q1(a,c),ar(a,c,D,f),c.child;case 6:return a===null&&Oh(c),null;case 13:return J1(a,c,f);case 4:return qh(c,c.stateNode.containerInfo),v=c.pendingProps,a===null?c.child=Ga(c,null,v,f):ar(a,c,v,f),c.child;case 11:return v=c.type,S=c.pendingProps,S=c.elementType===v?S:mo(v,S),W1(a,c,v,S,f);case 7:return ar(a,c,c.pendingProps,f),c.child;case 8:return ar(a,c,c.pendingProps.children,f),c.child;case 12:return ar(a,c,c.pendingProps.children,f),c.child;case 10:e:{if(v=c.type._context,S=c.pendingProps,C=c.memoizedProps,D=S.value,Yt(hd,v._currentValue),v._currentValue=D,C!==null)if(po(C.value,D)){if(C.children===S.children&&!vr.current){c=ui(a,c,f);break e}}else for(C=c.child,C!==null&&(C.return=c);C!==null;){var $=C.dependencies;if($!==null){D=C.child;for(var W=$.firstContext;W!==null;){if(W.context===v){if(C.tag===1){W=ci(-1,f&-f),W.tag=2;var ne=C.updateQueue;if(ne!==null){ne=ne.shared;var ge=ne.pending;ge===null?W.next=W:(W.next=ge.next,ge.next=W),ne.pending=W}}C.lanes|=f,W=C.alternate,W!==null&&(W.lanes|=f),Bh(C.return,f,c),$.lanes|=f;break}W=W.next}}else if(C.tag===10)D=C.type===c.type?null:C.child;else if(C.tag===18){if(D=C.return,D===null)throw Error(n(341));D.lanes|=f,$=D.alternate,$!==null&&($.lanes|=f),Bh(D,f,c),D=C.sibling}else D=C.child;if(D!==null)D.return=C;else for(D=C;D!==null;){if(D===c){D=null;break}if(C=D.sibling,C!==null){C.return=D.return,D=C;break}D=D.return}C=D}ar(a,c,S.children,f),c=c.child}return c;case 9:return S=c.type,v=c.pendingProps.children,qa(c,f),S=Gr(S),v=v(S),c.flags|=1,ar(a,c,v,f),c.child;case 14:return v=c.type,S=mo(v,c.pendingProps),S=mo(v.type,S),H1(a,c,v,S,f);case 15:return q1(a,c,c.type,c.pendingProps,f);case 17:return v=c.type,S=c.pendingProps,S=c.elementType===v?S:mo(v,S),Td(a,c),c.tag=1,yr(v)?(a=!0,cd(c)):a=!1,qa(c,f),f1(c,v,S),Hh(c,v,S,f),am(null,c,v,!0,a,f);case 19:return eb(a,c,f);case 22:return G1(a,c,f)}throw Error(n(156,c.tag))};function Cb(a,c){return ni(a,c)}function m_(a,c,f,v){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yr(a,c,f,v){return new m_(a,c,f,v)}function Tm(a){return a=a.prototype,!(!a||!a.isReactComponent)}function g_(a){if(typeof a=="function")return Tm(a)?1:0;if(a!=null){if(a=a.$$typeof,a===G)return 11;if(a===te)return 14}return 2}function ns(a,c){var f=a.alternate;return f===null?(f=Yr(a.tag,c,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=c,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&14680064,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,c=a.dependencies,f.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f}function $d(a,c,f,v,S,C){var D=2;if(v=a,typeof a=="function")Tm(a)&&(D=1);else if(typeof a=="string")D=5;else e:switch(a){case M:return Bs(f.children,S,C,c);case N:D=8,S|=8;break;case L:return a=Yr(12,f,c,S|2),a.elementType=L,a.lanes=C,a;case Y:return a=Yr(13,f,c,S),a.elementType=Y,a.lanes=C,a;case Q:return a=Yr(19,f,c,S),a.elementType=Q,a.lanes=C,a;case O:return Fd(f,S,C,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case z:D=10;break e;case q:D=9;break e;case G:D=11;break e;case te:D=14;break e;case V:D=16,v=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return c=Yr(D,f,c,S),c.elementType=a,c.type=v,c.lanes=C,c}function Bs(a,c,f,v){return a=Yr(7,a,v,c),a.lanes=f,a}function Fd(a,c,f,v){return a=Yr(22,a,v,c),a.elementType=O,a.lanes=f,a.stateNode={isHidden:!1},a}function Pm(a,c,f){return a=Yr(6,a,null,c),a.lanes=f,a}function Rm(a,c,f){return c=Yr(4,a.children!==null?a.children:[],a.key,c),c.lanes=f,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function v_(a,c,f,v,S){this.tag=c,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=nh(0),this.expirationTimes=nh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nh(0),this.identifierPrefix=v,this.onRecoverableError=S,this.mutableSourceEagerHydrationData=null}function _m(a,c,f,v,S,C,D,$,W){return a=new v_(a,c,f,$,W),c===1?(c=1,C===!0&&(c|=8)):c=0,C=Yr(3,null,null,c),a.current=C,C.stateNode=a,C.memoizedState={element:v,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vh(C),a}function y_(a,c,f){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:v==null?null:""+v,children:a,containerInfo:c,implementation:f}}function Eb(a){if(!a)return Gi;a=a._reactInternals;e:{if(lt(a)!==a||a.tag!==1)throw Error(n(170));var c=a;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(yr(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(n(171))}if(a.tag===1){var f=a.type;if(yr(f))return J0(a,f,c)}return c}function kb(a,c,f,v,S,C,D,$,W){return a=_m(f,v,!0,a,S,C,D,$,W),a.context=Eb(null),f=a.current,v=lr(),S=es(f),C=ci(v,S),C.callback=c??null,Yi(f,C,S),a.current.lanes=S,tc(a,S,v),wr(a,v),a}function zd(a,c,f,v){var S=c.current,C=lr(),D=es(S);return f=Eb(f),c.context===null?c.context=f:c.pendingContext=f,c=ci(C,D),c.payload={element:a},v=v===void 0?null:v,v!==null&&(c.callback=v),a=Yi(S,c,D),a!==null&&(yo(a,S,D,C),gd(a,S,D)),D}function Bd(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function Tb(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<c?f:c}}function Dm(a,c){Tb(a,c),(a=a.alternate)&&Tb(a,c)}var Pb=typeof reportError=="function"?reportError:function(a){console.error(a)};function Im(a){this._internalRoot=a}Ud.prototype.render=Im.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(n(409));zd(a,c,null,null)},Ud.prototype.unmount=Im.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;$s(function(){zd(null,a,null,null)}),c[oi]=null}};function Ud(a){this._internalRoot=a}Ud.prototype.unstable_scheduleHydration=function(a){if(a){var c=u0();a={blockedOn:null,target:a,priority:c};for(var f=0;f<Ui.length&&c!==0&&c<Ui[f].priority;f++);Ui.splice(f,0,a),f===0&&p0(a)}};function Nm(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function Vd(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function Rb(){}function x_(a,c,f,v,S){if(S){if(typeof v=="function"){var C=v;v=function(){var ne=Bd(D);C.call(ne)}}var D=kb(c,v,a,0,null,!1,!1,"",Rb);return a._reactRootContainer=D,a[oi]=D.current,mc(a.nodeType===8?a.parentNode:a),$s(),D}for(;S=a.lastChild;)a.removeChild(S);if(typeof v=="function"){var $=v;v=function(){var ne=Bd(W);$.call(ne)}}var W=_m(a,0,!1,null,null,!1,!1,"",Rb);return a._reactRootContainer=W,a[oi]=W.current,mc(a.nodeType===8?a.parentNode:a),$s(function(){zd(c,W,f,v)}),W}function Wd(a,c,f,v,S){var C=f._reactRootContainer;if(C){var D=C;if(typeof S=="function"){var $=S;S=function(){var W=Bd(D);$.call(W)}}zd(c,D,a,S)}else D=x_(f,c,a,S,v);return Bd(D)}l0=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var f=ec(c.pendingLanes);f!==0&&(rh(c,f|1),wr(c,tn()),!(_t&6)&&(Ja=tn()+500,Qi()))}break;case 13:$s(function(){var v=li(a,1);if(v!==null){var S=lr();yo(v,a,1,S)}}),Dm(a,1)}},oh=function(a){if(a.tag===13){var c=li(a,134217728);if(c!==null){var f=lr();yo(c,a,134217728,f)}Dm(a,134217728)}},c0=function(a){if(a.tag===13){var c=es(a),f=li(a,c);if(f!==null){var v=lr();yo(f,a,c,v)}Dm(a,c)}},u0=function(){return Ft},d0=function(a,c){var f=Ft;try{return Ft=a,c()}finally{Ft=f}},lo=function(a,c,f){switch(c){case"input":if(ce(a,f),c=f.name,f.type==="radio"&&c!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<f.length;c++){var v=f[c];if(v!==a&&v.form===a.form){var S=ad(v);if(!S)throw Error(n(90));St(v),ce(v,S)}}}break;case"textarea":Ae(a,f);break;case"select":c=f.value,c!=null&&he(a,!!f.multiple,c,!1)}},ei=Cm,ti=$s;var b_={usingClientEntryPoint:!1,Events:[yc,Fa,ad,_a,Da,Cm]},Ic={findFiberByHostInstance:_s,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},w_={bundleType:Ic.bundleType,version:Ic.version,rendererPackageName:Ic.rendererPackageName,rendererConfig:Ic.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=Tt(a),a===null?null:a.stateNode},findFiberByHostInstance:Ic.findFiberByHostInstance,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 Hd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hd.isDisabled&&Hd.supportsFiber)try{fo=Hd.inject(w_),Yn=Hd}catch{}}return Sr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=b_,Sr.createPortal=function(a,c){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Nm(c))throw Error(n(200));return y_(a,c,null,f)},Sr.createRoot=function(a,c){if(!Nm(a))throw Error(n(299));var f=!1,v="",S=Pb;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(v=c.identifierPrefix),c.onRecoverableError!==void 0&&(S=c.onRecoverableError)),c=_m(a,1,!1,null,null,f,!1,v,S),a[oi]=c.current,mc(a.nodeType===8?a.parentNode:a),new Im(c)},Sr.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=Tt(c),a=a===null?null:a.stateNode,a},Sr.flushSync=function(a){return $s(a)},Sr.hydrate=function(a,c,f){if(!Vd(c))throw Error(n(200));return Wd(null,a,c,!0,f)},Sr.hydrateRoot=function(a,c,f){if(!Nm(a))throw Error(n(405));var v=f!=null&&f.hydratedSources||null,S=!1,C="",D=Pb;if(f!=null&&(f.unstable_strictMode===!0&&(S=!0),f.identifierPrefix!==void 0&&(C=f.identifierPrefix),f.onRecoverableError!==void 0&&(D=f.onRecoverableError)),c=kb(c,null,a,1,f??null,S,!1,C,D),a[oi]=c.current,mc(a),v)for(a=0;a<v.length;a++)f=v[a],S=f._getVersion,S=S(f._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[f,S]:c.mutableSourceEagerHydrationData.push(f,S);return new Ud(c)},Sr.render=function(a,c,f){if(!Vd(c))throw Error(n(200));return Wd(null,a,c,!1,f)},Sr.unmountComponentAtNode=function(a){if(!Vd(a))throw Error(n(40));return a._reactRootContainer?($s(function(){Wd(null,null,a,!1,function(){a._reactRootContainer=null,a[oi]=null})}),!0):!1},Sr.unstable_batchedUpdates=Cm,Sr.unstable_renderSubtreeIntoContainer=function(a,c,f,v){if(!Vd(f))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return Wd(a,c,f,!1,v)},Sr.version="18.2.0-next-9e3b772b8-20220608",Sr}var ew;function SC(){if(ew)return Gm.exports;ew=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Gm.exports=KI(),Gm.exports}var ep=SC();const pl=yv(ep),YI=Vj({__proto__:null,default:pl},[ep]),[XI,ro]=hr("ScrollArea.Root component was not found in tree");function Sl(e,t){const n=Gs(t);Ml(()=>{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 JI=g.forwardRef((e,t)=>{const{style:n,...r}=e,o=ro(),[s,l]=g.useState(0),[u,d]=g.useState(0),p=!!(s&&u);return Sl(o.scrollbarX,()=>{var m;const h=((m=o.scrollbarX)==null?void 0:m.offsetHeight)||0;o.onCornerHeightChange(h),d(h)}),Sl(o.scrollbarY,()=>{var m;const h=((m=o.scrollbarY)==null?void 0:m.offsetWidth)||0;o.onCornerWidthChange(h),l(h)}),p?i.jsx("div",{...r,ref:t,style:{...n,width:s,height:u}}):null}),ZI=g.forwardRef((e,t)=>{const n=ro(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?i.jsx(JI,{...e,ref:t}):null}),eN={scrollHideDelay:1e3,type:"hover"},jC=g.forwardRef((e,t)=>{const n=ie("ScrollAreaRoot",eN,e),{type:r,scrollHideDelay:o,scrollbars:s,...l}=n,[u,d]=g.useState(null),[p,h]=g.useState(null),[m,y]=g.useState(null),[x,b]=g.useState(null),[w,j]=g.useState(null),[T,P]=g.useState(0),[k,E]=g.useState(0),[_,R]=g.useState(!1),[M,N]=g.useState(!1),L=In(t,z=>d(z));return i.jsx(XI,{value:{type:r,scrollHideDelay:o,scrollArea:u,viewport:p,onViewportChange:h,content:m,onContentChange:y,scrollbarX:x,onScrollbarXChange:b,scrollbarXEnabled:_,onScrollbarXEnabledChange:R,scrollbarY:w,onScrollbarYChange:j,scrollbarYEnabled:M,onScrollbarYEnabledChange:N,onCornerWidthChange:P,onCornerHeightChange:E},children:i.jsx(se,{...l,ref:L,__vars:{"--sa-corner-width":s!=="xy"?"0px":`${T}px`,"--sa-corner-height":s!=="xy"?"0px":`${k}px`}})})});jC.displayName="@mantine/core/ScrollAreaRoot";function CC(e,t){const n=e/t;return Number.isNaN(n)?0:n}function tp(e){const t=CC(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function EC(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 tN(e,[t,n]){return Math.min(n,Math.max(t,e))}function tw(e,t,n="ltr"){const r=tp(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,l=t.content-t.viewport,u=s-r,d=n==="ltr"?[0,l]:[l*-1,0],p=tN(e,d);return EC([0,l],[0,u])(p)}function nN(e,t,n,r="ltr"){const o=tp(n),s=o/2,l=t||s,u=o-l,d=n.scrollbar.paddingStart+l,p=n.scrollbar.size-n.scrollbar.paddingEnd-u,h=n.content-n.viewport,m=r==="ltr"?[0,h]:[h*-1,0];return EC([d,p],m)(e)}function kC(e,t){return e>0&&e<t}function us(e){return e?parseInt(e,10):0}function na(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e==null||e(r),(n===!1||!r.defaultPrevented)&&(t==null||t(r))}}const[rN,TC]=hr("ScrollAreaScrollbar was not found in tree"),PC=g.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:p,onResize:h,...m}=e,y=ro(),[x,b]=g.useState(null),w=In(t,N=>b(N)),j=g.useRef(null),T=g.useRef(""),{viewport:P}=y,k=n.content-n.viewport,E=Gs(p),_=Gs(u),R=Qf(h,10),M=N=>{if(j.current){const L=N.clientX-j.current.left,z=N.clientY-j.current.top;d({x:L,y:z})}};return g.useEffect(()=>{const N=L=>{const z=L.target;(x==null?void 0:x.contains(z))&&E(L,k)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[P,x,k,E]),g.useEffect(_,[n,_]),Sl(x,R),Sl(y.content,R),i.jsx(rN,{value:{scrollbar:x,hasThumb:r,onThumbChange:Gs(o),onThumbPointerUp:Gs(s),onThumbPositionChange:_,onThumbPointerDown:Gs(l)},children:i.jsx("div",{...m,ref:w,"data-mantine-scrollbar":!0,style:{position:"absolute",...m.style},onPointerDown:na(e.onPointerDown,N=>{N.preventDefault(),N.button===0&&(N.target.setPointerCapture(N.pointerId),j.current=x.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",M(N))}),onPointerMove:na(e.onPointerMove,M),onPointerUp:na(e.onPointerUp,N=>{N.preventDefault();const L=N.target;L.hasPointerCapture(N.pointerId)&&L.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=T.current,j.current=null})})})}),RC=g.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...s}=e,l=ro(),[u,d]=g.useState(),p=g.useRef(null),h=In(t,p,l.onScrollbarXChange);return g.useEffect(()=>{p.current&&d(getComputedStyle(p.current))},[p]),i.jsx(PC,{"data-orientation":"horizontal",...s,ref:h,sizes:n,style:{...o,"--sa-thumb-width":`${tp(n)}px`},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,y)=>{if(l.viewport){const x=l.viewport.scrollLeft+m.deltaX;e.onWheelScroll(x),kC(x,y)&&m.preventDefault()}},onResize:()=>{p.current&&l.viewport&&u&&r({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:us(u.paddingLeft),paddingEnd:us(u.paddingRight)}})}})});RC.displayName="@mantine/core/ScrollAreaScrollbarX";const _C=g.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...s}=e,l=ro(),[u,d]=g.useState(),p=g.useRef(null),h=In(t,p,l.onScrollbarYChange);return g.useEffect(()=>{p.current&&d(window.getComputedStyle(p.current))},[]),i.jsx(PC,{...s,"data-orientation":"vertical",ref:h,sizes:n,style:{"--sa-thumb-height":`${tp(n)}px`,...o},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,y)=>{if(l.viewport){const x=l.viewport.scrollTop+m.deltaY;e.onWheelScroll(x),kC(x,y)&&m.preventDefault()}},onResize:()=>{p.current&&l.viewport&&u&&r({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:us(u.paddingTop),paddingEnd:us(u.paddingBottom)}})}})});_C.displayName="@mantine/core/ScrollAreaScrollbarY";const np=g.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:o}=va(),s=ro(),l=g.useRef(null),u=g.useRef(0),[d,p]=g.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=CC(d.viewport,d.content),m={...r,sizes:d,onSizesChange:p,hasThumb:h>0&&h<1,onThumbChange:x=>{l.current=x},onThumbPointerUp:()=>{u.current=0},onThumbPointerDown:x=>{u.current=x}},y=(x,b)=>nN(x,u.current,d,b);return n==="horizontal"?i.jsx(RC,{...m,ref:t,onThumbPositionChange:()=>{if(s.viewport&&l.current){const x=s.viewport.scrollLeft,b=tw(x,d,o);l.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:x=>{s.viewport&&(s.viewport.scrollLeft=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollLeft=y(x,o))}}):n==="vertical"?i.jsx(_C,{...m,ref:t,onThumbPositionChange:()=>{if(s.viewport&&l.current){const x=s.viewport.scrollTop,b=tw(x,d);d.scrollbar.size===0?l.current.style.setProperty("--thumb-opacity","0"):l.current.style.setProperty("--thumb-opacity","1"),l.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:x=>{s.viewport&&(s.viewport.scrollTop=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollTop=y(x))}}):null});np.displayName="@mantine/core/ScrollAreaScrollbarVisible";const Rv=g.forwardRef((e,t)=>{const n=ro(),{forceMount:r,...o}=e,[s,l]=g.useState(!1),u=e.orientation==="horizontal",d=Qf(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;l(u?p:h)}},10);return Sl(n.viewport,d),Sl(n.content,d),r||s?i.jsx(np,{"data-state":s?"visible":"hidden",...o,ref:t}):null});Rv.displayName="@mantine/core/ScrollAreaScrollbarAuto";const DC=g.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ro(),[s,l]=g.useState(!1);return g.useEffect(()=>{const{scrollArea:u}=o;let d=0;if(u){const p=()=>{window.clearTimeout(d),l(!0)},h=()=>{d=window.setTimeout(()=>l(!1),o.scrollHideDelay)};return u.addEventListener("pointerenter",p),u.addEventListener("pointerleave",h),()=>{window.clearTimeout(d),u.removeEventListener("pointerenter",p),u.removeEventListener("pointerleave",h)}}},[o.scrollArea,o.scrollHideDelay]),n||s?i.jsx(Rv,{"data-state":s?"visible":"hidden",...r,ref:t}):null});DC.displayName="@mantine/core/ScrollAreaScrollbarHover";const oN=g.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ro(),s=e.orientation==="horizontal",[l,u]=g.useState("hidden"),d=Qf(()=>u("idle"),100);return g.useEffect(()=>{if(l==="idle"){const p=window.setTimeout(()=>u("hidden"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[l,o.scrollHideDelay]),g.useEffect(()=>{const{viewport:p}=o,h=s?"scrollLeft":"scrollTop";if(p){let m=p[h];const y=()=>{const x=p[h];m!==x&&(u("scrolling"),d()),m=x};return p.addEventListener("scroll",y),()=>p.removeEventListener("scroll",y)}},[o.viewport,s,d]),n||l!=="hidden"?i.jsx(np,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:na(e.onPointerEnter,()=>u("interacting")),onPointerLeave:na(e.onPointerLeave,()=>u("idle"))}):null}),Ig=g.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ro(),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:l}=o,u=e.orientation==="horizontal";return g.useEffect(()=>(u?s(!0):l(!0),()=>{u?s(!1):l(!1)}),[u,s,l]),o.type==="hover"?i.jsx(DC,{...r,ref:t,forceMount:n}):o.type==="scroll"?i.jsx(oN,{...r,ref:t,forceMount:n}):o.type==="auto"?i.jsx(Rv,{...r,ref:t,forceMount:n}):o.type==="always"?i.jsx(np,{...r,ref:t}):null});Ig.displayName="@mantine/core/ScrollAreaScrollbar";function iN(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},l=n.left!==s.left,u=n.top!==s.top;(l||u)&&t(),n=s,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)}const IC=g.forwardRef((e,t)=>{const{style:n,...r}=e,o=ro(),s=TC(),{onThumbPositionChange:l}=s,u=In(t,h=>s.onThumbChange(h)),d=g.useRef(void 0),p=Qf(()=>{d.current&&(d.current(),d.current=void 0)},100);return g.useEffect(()=>{const{viewport:h}=o;if(h){const m=()=>{if(p(),!d.current){const y=iN(h,l);d.current=y,l()}};return l(),h.addEventListener("scroll",m),()=>h.removeEventListener("scroll",m)}},[o.viewport,p,l]),i.jsx("div",{"data-state":s.hasThumb?"visible":"hidden",...r,ref:u,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:na(e.onPointerDownCapture,h=>{const y=h.target.getBoundingClientRect(),x=h.clientX-y.left,b=h.clientY-y.top;s.onThumbPointerDown({x,y:b})}),onPointerUp:na(e.onPointerUp,s.onThumbPointerUp)})});IC.displayName="@mantine/core/ScrollAreaThumb";const Ng=g.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=TC();return n||o.hasThumb?i.jsx(IC,{ref:t,...r}):null});Ng.displayName="@mantine/core/ScrollAreaThumb";const NC=g.forwardRef(({children:e,style:t,...n},r)=>{const o=ro(),s=In(r,o.onViewportChange);return i.jsx(se,{...n,ref:s,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t},children:i.jsx("div",{style:{minWidth:"100%",display:"table"},ref:o.onContentChange,children:e})})});NC.displayName="@mantine/core/ScrollAreaViewport";var _v={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const AC={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},sN=(e,{scrollbarSize:t})=>({root:{"--scrollarea-scrollbar-size":oe(t)}}),oo=ue((e,t)=>{const n=ie("ScrollArea",AC,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,scrollbarSize:d,vars:p,type:h,scrollHideDelay:m,viewportProps:y,viewportRef:x,onScrollPositionChange:b,children:w,offsetScrollbars:j,scrollbars:T,onBottomReached:P,onTopReached:k,...E}=n,[_,R]=g.useState(!1),M=Ne({name:"ScrollArea",props:n,classes:_v,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:p,varsResolver:sN});return i.jsxs(jC,{type:h==="never"?"always":h,scrollHideDelay:m,ref:t,scrollbars:T,...M("root"),...E,children:[i.jsx(NC,{...y,...M("viewport",{style:y==null?void 0:y.style}),ref:x,"data-offset-scrollbars":j===!0?"xy":j||void 0,"data-scrollbars":T||void 0,onScroll:N=>{var G;(G=y==null?void 0:y.onScroll)==null||G.call(y,N),b==null||b({x:N.currentTarget.scrollLeft,y:N.currentTarget.scrollTop});const{scrollTop:L,scrollHeight:z,clientHeight:q}=N.currentTarget;L-(z-q)>=0&&(P==null||P()),L===0&&(k==null||k())},children:w}),(T==="xy"||T==="x")&&i.jsx(Ig,{...M("scrollbar"),orientation:"horizontal","data-hidden":h==="never"||void 0,forceMount:!0,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),children:i.jsx(Ng,{...M("thumb")})}),(T==="xy"||T==="y")&&i.jsx(Ig,{...M("scrollbar"),orientation:"vertical","data-hidden":h==="never"||void 0,forceMount:!0,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),children:i.jsx(Ng,{...M("thumb")})}),i.jsx(ZI,{...M("corner"),"data-hovered":_||void 0,"data-hidden":h==="never"||void 0})]})});oo.displayName="@mantine/core/ScrollArea";const rp=ue((e,t)=>{const{children:n,classNames:r,styles:o,scrollbarSize:s,scrollHideDelay:l,type:u,dir:d,offsetScrollbars:p,viewportRef:h,onScrollPositionChange:m,unstyled:y,variant:x,viewportProps:b,scrollbars:w,style:j,vars:T,onBottomReached:P,onTopReached:k,...E}=ie("ScrollAreaAutosize",AC,e);return i.jsx(se,{...E,ref:t,style:[{display:"flex",overflow:"auto"},j],children:i.jsx(se,{style:{display:"flex",flexDirection:"column",flex:1},children:i.jsx(oo,{classNames:r,styles:o,scrollHideDelay:l,scrollbarSize:s,type:u,dir:d,offsetScrollbars:p,viewportRef:h,onScrollPositionChange:m,unstyled:y,variant:x,viewportProps:b,vars:T,scrollbars:w,onBottomReached:P,onTopReached:k,children:n})})})});oo.classes=_v;rp.displayName="@mantine/core/ScrollAreaAutosize";rp.classes=_v;oo.Autosize=rp;var MC={root:"m_87cf2631"};const aN={__staticSelector:"UnstyledButton"},Gn=or((e,t)=>{const n=ie("UnstyledButton",aN,e),{className:r,component:o="button",__staticSelector:s,unstyled:l,classNames:u,styles:d,style:p,...h}=n,m=Ne({name:s,props:n,classes:MC,className:r,style:p,classNames:u,styles:d,unstyled:l});return i.jsx(se,{...m("root",{focusable:!0}),component:o,ref:t,type:o==="button"?"button":void 0,...h})});Gn.classes=MC;Gn.displayName="@mantine/core/UnstyledButton";var OC={root:"m_515a97f8"};const lN={},Dv=ue((e,t)=>{const n=ie("VisuallyHidden",lN,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,...p}=n,h=Ne({name:"VisuallyHidden",classes:OC,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u});return i.jsx(se,{component:"span",ref:t,...h("root"),...p})});Dv.classes=OC;Dv.displayName="@mantine/core/VisuallyHidden";var LC={root:"m_1b7284a3"};const cN={},uN=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:At(t),"--paper-shadow":wv(n)}}),kr=or((e,t)=>{const n=ie("Paper",cN,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,withBorder:d,vars:p,radius:h,shadow:m,variant:y,mod:x,...b}=n,w=Ne({name:"Paper",props:n,classes:LC,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:p,varsResolver:uN});return i.jsx(se,{ref:t,mod:[{"data-with-border":d},x],...w("root"),variant:y,...b})});kr.classes=LC;kr.displayName="@mantine/core/Paper";function op(){return typeof window<"u"}function Ll(e){return $C(e)?(e.nodeName||"").toLowerCase():"#document"}function Tr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Xo(e){var t;return(t=($C(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function $C(e){return op()?e instanceof Node||e instanceof Tr(e).Node:!1}function sn(e){return op()?e instanceof Element||e instanceof Tr(e).Element:!1}function zr(e){return op()?e instanceof HTMLElement||e instanceof Tr(e).HTMLElement:!1}function Ag(e){return!op()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Tr(e).ShadowRoot}function pu(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=to(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function dN(e){return["table","td","th"].includes(Ll(e))}function ip(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Iv(e){const t=sp(),n=sn(e)?to(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function fN(e){let t=wi(e);for(;zr(t)&&!ps(t);){if(Iv(t))return t;if(ip(t))return null;t=wi(t)}return null}function sp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ps(e){return["html","body","#document"].includes(Ll(e))}function to(e){return Tr(e).getComputedStyle(e)}function ap(e){return sn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wi(e){if(Ll(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ag(e)&&e.host||Xo(e);return Ag(t)?t.host:t}function FC(e){const t=wi(e);return ps(t)?e.ownerDocument?e.ownerDocument.body:e.body:zr(t)&&pu(t)?t:FC(t)}function yi(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=FC(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),l=Tr(o);if(s){const u=Mg(l);return t.concat(l,l.visualViewport||[],pu(o)?o:[],u&&n?yi(u):[])}return t.concat(o,yi(o,[],n))}function Mg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nw(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 Xc(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ag(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function zC(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function BC(){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 pN(e){return gN()?!1:!rw()&&e.width===0&&e.height===0||rw()&&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 hN(){return/apple/i.test(navigator.vendor)}function rw(){const e=/android/i;return e.test(zC())||e.test(BC())}function mN(){return zC().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function gN(){return BC().includes("jsdom/")}function Og(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function vN(e){return"nativeEvent"in e}function yN(e){return e.matches("html,body")}function Js(e){return(e==null?void 0:e.ownerDocument)||document}function Ym(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 dl(e){return"composedPath"in e?e.composedPath()[0]:e.target}const xN="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function bN(e){return zr(e)&&e.matches(xN)}const Eo=Math.min,tr=Math.max,wf=Math.round,Xd=Math.floor,Ho=e=>({x:e,y:e}),wN={left:"right",right:"left",bottom:"top",top:"bottom"},SN={start:"end",end:"start"};function Lg(e,t,n){return tr(e,Eo(t,n))}function Si(e,t){return typeof e=="function"?e(t):e}function ko(e){return e.split("-")[0]}function $l(e){return e.split("-")[1]}function Nv(e){return e==="x"?"y":"x"}function Av(e){return e==="y"?"height":"width"}function ji(e){return["top","bottom"].includes(ko(e))?"y":"x"}function Mv(e){return Nv(ji(e))}function jN(e,t,n){n===void 0&&(n=!1);const r=$l(e),o=Mv(e),s=Av(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(l=Sf(l)),[l,Sf(l)]}function CN(e){const t=Sf(e);return[$g(e),t,$g(t)]}function $g(e){return e.replace(/start|end/g,t=>SN[t])}function EN(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:l;default:return[]}}function kN(e,t,n,r){const o=$l(e);let s=EN(ko(e),n==="start",r);return o&&(s=s.map(l=>l+"-"+o),t&&(s=s.concat(s.map($g)))),s}function Sf(e){return e.replace(/left|right|bottom|top/g,t=>wN[t])}function TN(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ov(e){return typeof e!="number"?TN(e):{top:e,right:e,bottom:e,left:e}}function jl(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 ow(e,t,n){let{reference:r,floating:o}=e;const s=ji(t),l=Mv(t),u=Av(l),d=ko(t),p=s==="y",h=r.x+r.width/2-o.width/2,m=r.y+r.height/2-o.height/2,y=r[u]/2-o[u]/2;let x;switch(d){case"top":x={x:h,y:r.y-o.height};break;case"bottom":x={x:h,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:m};break;case"left":x={x:r.x-o.width,y:m};break;default:x={x:r.x,y:r.y}}switch($l(t)){case"start":x[l]-=y*(n&&p?-1:1);break;case"end":x[l]+=y*(n&&p?-1:1);break}return x}const PN=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:l}=n,u=s.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let p=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:m}=ow(p,r,d),y=r,x={},b=0;for(let w=0;w<u.length;w++){const{name:j,fn:T}=u[w],{x:P,y:k,data:E,reset:_}=await T({x:h,y:m,initialPlacement:r,placement:y,strategy:o,middlewareData:x,rects:p,platform:l,elements:{reference:e,floating:t}});h=P??h,m=k??m,x={...x,[j]:{...x[j],...E}},_&&b<=50&&(b++,typeof _=="object"&&(_.placement&&(y=_.placement),_.rects&&(p=_.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:o}):_.rects),{x:h,y:m}=ow(p,y,d)),w=-1)}return{x:h,y:m,placement:y,strategy:o,middlewareData:x}};async function Lv(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:l,elements:u,strategy:d}=e,{boundary:p="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:y=!1,padding:x=0}=Si(t,e),b=Ov(x),j=u[y?m==="floating"?"reference":"floating":m],T=jl(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(j)))==null||n?j:j.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(u.floating)),boundary:p,rootBoundary:h,strategy:d})),P=m==="floating"?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u.floating)),E=await(s.isElement==null?void 0:s.isElement(k))?await(s.getScale==null?void 0:s.getScale(k))||{x:1,y:1}:{x:1,y:1},_=jl(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:P,offsetParent:k,strategy:d}):P);return{top:(T.top-_.top+b.top)/E.y,bottom:(_.bottom-T.bottom+b.bottom)/E.y,left:(T.left-_.left+b.left)/E.x,right:(_.right-T.right+b.right)/E.x}}const RN=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:l,elements:u,middlewareData:d}=t,{element:p,padding:h=0}=Si(e,t)||{};if(p==null)return{};const m=Ov(h),y={x:n,y:r},x=Mv(o),b=Av(x),w=await l.getDimensions(p),j=x==="y",T=j?"top":"left",P=j?"bottom":"right",k=j?"clientHeight":"clientWidth",E=s.reference[b]+s.reference[x]-y[x]-s.floating[b],_=y[x]-s.reference[x],R=await(l.getOffsetParent==null?void 0:l.getOffsetParent(p));let M=R?R[k]:0;(!M||!await(l.isElement==null?void 0:l.isElement(R)))&&(M=u.floating[k]||s.floating[b]);const N=E/2-_/2,L=M/2-w[b]/2-1,z=Eo(m[T],L),q=Eo(m[P],L),G=z,Y=M-w[b]-q,Q=M/2-w[b]/2+N,te=Lg(G,Q,Y),V=!d.arrow&&$l(o)!=null&&Q!==te&&s.reference[b]/2-(Q<G?z:q)-w[b]/2<0,O=V?Q<G?Q-G:Q-Y:0;return{[x]:y[x]+O,data:{[x]:te,centerOffset:Q-te-O,...V&&{alignmentOffset:O}},reset:V}}}),_N=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:l,initialPlacement:u,platform:d,elements:p}=t,{mainAxis:h=!0,crossAxis:m=!0,fallbackPlacements:y,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...j}=Si(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const T=ko(o),P=ji(u),k=ko(u)===u,E=await(d.isRTL==null?void 0:d.isRTL(p.floating)),_=y||(k||!w?[Sf(u)]:CN(u)),R=b!=="none";!y&&R&&_.push(...kN(u,w,b,E));const M=[u,..._],N=await Lv(t,j),L=[];let z=((r=s.flip)==null?void 0:r.overflows)||[];if(h&&L.push(N[T]),m){const Q=jN(o,l,E);L.push(N[Q[0]],N[Q[1]])}if(z=[...z,{placement:o,overflows:L}],!L.every(Q=>Q<=0)){var q,G;const Q=(((q=s.flip)==null?void 0:q.index)||0)+1,te=M[Q];if(te)return{data:{index:Q,overflows:z},reset:{placement:te}};let V=(G=z.filter(O=>O.overflows[0]<=0).sort((O,A)=>O.overflows[1]-A.overflows[1])[0])==null?void 0:G.placement;if(!V)switch(x){case"bestFit":{var Y;const O=(Y=z.filter(A=>{if(R){const B=ji(A.placement);return B===P||B==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(B=>B>0).reduce((B,I)=>B+I,0)]).sort((A,B)=>A[1]-B[1])[0])==null?void 0:Y[0];O&&(V=O);break}case"initialPlacement":V=u;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function UC(e){const t=Eo(...e.map(s=>s.left)),n=Eo(...e.map(s=>s.top)),r=tr(...e.map(s=>s.right)),o=tr(...e.map(s=>s.bottom));return{x:t,y:n,width:r-t,height:o-n}}function DN(e){const t=e.slice().sort((o,s)=>o.y-s.y),n=[];let r=null;for(let o=0;o<t.length;o++){const s=t[o];!r||s.y-r.y>r.height/2?n.push([s]):n[n.length-1].push(s),r=s}return n.map(o=>jl(UC(o)))}const IN=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:s,strategy:l}=t,{padding:u=2,x:d,y:p}=Si(e,t),h=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),m=DN(h),y=jl(UC(h)),x=Ov(u);function b(){if(m.length===2&&m[0].left>m[1].right&&d!=null&&p!=null)return m.find(j=>d>j.left-x.left&&d<j.right+x.right&&p>j.top-x.top&&p<j.bottom+x.bottom)||y;if(m.length>=2){if(ji(n)==="y"){const z=m[0],q=m[m.length-1],G=ko(n)==="top",Y=z.top,Q=q.bottom,te=G?z.left:q.left,V=G?z.right:q.right,O=V-te,A=Q-Y;return{top:Y,bottom:Q,left:te,right:V,width:O,height:A,x:te,y:Y}}const j=ko(n)==="left",T=tr(...m.map(z=>z.right)),P=Eo(...m.map(z=>z.left)),k=m.filter(z=>j?z.left===P:z.right===T),E=k[0].top,_=k[k.length-1].bottom,R=P,M=T,N=M-R,L=_-E;return{top:E,bottom:_,left:R,right:M,width:N,height:L,x:R,y:E}}return y}const w=await s.getElementRects({reference:{getBoundingClientRect:b},floating:r.floating,strategy:l});return o.reference.x!==w.reference.x||o.reference.y!==w.reference.y||o.reference.width!==w.reference.width||o.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}};async function NN(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=ko(n),u=$l(n),d=ji(n)==="y",p=["left","top"].includes(l)?-1:1,h=s&&d?-1:1,m=Si(t,e);let{mainAxis:y,crossAxis:x,alignmentAxis:b}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof b=="number"&&(x=u==="end"?b*-1:b),d?{x:x*h,y:y*p}:{x:y*p,y:x*h}}const AN=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:l,middlewareData:u}=t,d=await NN(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:o+d.x,y:s+d.y,data:{...d,placement:l}}}}},MN=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:l=!1,limiter:u={fn:j=>{let{x:T,y:P}=j;return{x:T,y:P}}},...d}=Si(e,t),p={x:n,y:r},h=await Lv(t,d),m=ji(ko(o)),y=Nv(m);let x=p[y],b=p[m];if(s){const j=y==="y"?"top":"left",T=y==="y"?"bottom":"right",P=x+h[j],k=x-h[T];x=Lg(P,x,k)}if(l){const j=m==="y"?"top":"left",T=m==="y"?"bottom":"right",P=b+h[j],k=b-h[T];b=Lg(P,b,k)}const w=u.fn({...t,[y]:x,[m]:b});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[y]:s,[m]:l}}}}}},ON=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:p=!0}=Si(e,t),h={x:n,y:r},m=ji(o),y=Nv(m);let x=h[y],b=h[m];const w=Si(u,t),j=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(d){const k=y==="y"?"height":"width",E=s.reference[y]-s.floating[k]+j.mainAxis,_=s.reference[y]+s.reference[k]-j.mainAxis;x<E?x=E:x>_&&(x=_)}if(p){var T,P;const k=y==="y"?"width":"height",E=["top","left"].includes(ko(o)),_=s.reference[m]-s.floating[k]+(E&&((T=l.offset)==null?void 0:T[m])||0)+(E?0:j.crossAxis),R=s.reference[m]+s.reference[k]+(E?0:((P=l.offset)==null?void 0:P[m])||0)-(E?j.crossAxis:0);b<_?b=_:b>R&&(b=R)}return{[y]:x,[m]:b}}}},LN=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:l,elements:u}=t,{apply:d=()=>{},...p}=Si(e,t),h=await Lv(t,p),m=ko(o),y=$l(o),x=ji(o)==="y",{width:b,height:w}=s.floating;let j,T;m==="top"||m==="bottom"?(j=m,T=y===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(T=m,j=y==="end"?"top":"bottom");const P=w-h.top-h.bottom,k=b-h.left-h.right,E=Eo(w-h[j],P),_=Eo(b-h[T],k),R=!t.middlewareData.shift;let M=E,N=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(N=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=P),R&&!y){const z=tr(h.left,0),q=tr(h.right,0),G=tr(h.top,0),Y=tr(h.bottom,0);x?N=b-2*(z!==0||q!==0?z+q:tr(h.left,h.right)):M=w-2*(G!==0||Y!==0?G+Y:tr(h.top,h.bottom))}await d({...t,availableWidth:N,availableHeight:M});const L=await l.getDimensions(u.floating);return b!==L.width||w!==L.height?{reset:{rects:!0}}:{}}}};function VC(e){const t=to(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=zr(e),s=o?e.offsetWidth:n,l=o?e.offsetHeight:r,u=wf(n)!==s||wf(r)!==l;return u&&(n=s,r=l),{width:n,height:r,$:u}}function $v(e){return sn(e)?e:e.contextElement}function vl(e){const t=$v(e);if(!zr(t))return Ho(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=VC(t);let l=(s?wf(n.width):n.width)/r,u=(s?wf(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const $N=Ho(0);function WC(e){const t=Tr(e);return!sp()||!t.visualViewport?$N:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function FN(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Tr(e)?!1:t}function ra(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=$v(e);let l=Ho(1);t&&(r?sn(r)&&(l=vl(r)):l=vl(e));const u=FN(s,n,r)?WC(s):Ho(0);let d=(o.left+u.x)/l.x,p=(o.top+u.y)/l.y,h=o.width/l.x,m=o.height/l.y;if(s){const y=Tr(s),x=r&&sn(r)?Tr(r):r;let b=y,w=Mg(b);for(;w&&r&&x!==b;){const j=vl(w),T=w.getBoundingClientRect(),P=to(w),k=T.left+(w.clientLeft+parseFloat(P.paddingLeft))*j.x,E=T.top+(w.clientTop+parseFloat(P.paddingTop))*j.y;d*=j.x,p*=j.y,h*=j.x,m*=j.y,d+=k,p+=E,b=Tr(w),w=Mg(b)}}return jl({width:h,height:m,x:d,y:p})}function Fv(e,t){const n=ap(e).scrollLeft;return t?t.left+n:ra(Xo(e)).left+n}function HC(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Fv(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function zN(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",l=Xo(r),u=t?ip(t.floating):!1;if(r===l||u&&s)return n;let d={scrollLeft:0,scrollTop:0},p=Ho(1);const h=Ho(0),m=zr(r);if((m||!m&&!s)&&((Ll(r)!=="body"||pu(l))&&(d=ap(r)),zr(r))){const x=ra(r);p=vl(r),h.x=x.x+r.clientLeft,h.y=x.y+r.clientTop}const y=l&&!m&&!s?HC(l,d,!0):Ho(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-d.scrollLeft*p.x+h.x+y.x,y:n.y*p.y-d.scrollTop*p.y+h.y+y.y}}function BN(e){return Array.from(e.getClientRects())}function UN(e){const t=Xo(e),n=ap(e),r=e.ownerDocument.body,o=tr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=tr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Fv(e);const u=-n.scrollTop;return to(r).direction==="rtl"&&(l+=tr(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:l,y:u}}function VN(e,t){const n=Tr(e),r=Xo(e),o=n.visualViewport;let s=r.clientWidth,l=r.clientHeight,u=0,d=0;if(o){s=o.width,l=o.height;const p=sp();(!p||p&&t==="fixed")&&(u=o.offsetLeft,d=o.offsetTop)}return{width:s,height:l,x:u,y:d}}function WN(e,t){const n=ra(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=zr(e)?vl(e):Ho(1),l=e.clientWidth*s.x,u=e.clientHeight*s.y,d=o*s.x,p=r*s.y;return{width:l,height:u,x:d,y:p}}function iw(e,t,n){let r;if(t==="viewport")r=VN(e,n);else if(t==="document")r=UN(Xo(e));else if(sn(t))r=WN(t,n);else{const o=WC(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return jl(r)}function qC(e,t){const n=wi(e);return n===t||!sn(n)||ps(n)?!1:to(n).position==="fixed"||qC(n,t)}function HN(e,t){const n=t.get(e);if(n)return n;let r=yi(e,[],!1).filter(u=>sn(u)&&Ll(u)!=="body"),o=null;const s=to(e).position==="fixed";let l=s?wi(e):e;for(;sn(l)&&!ps(l);){const u=to(l),d=Iv(l);!d&&u.position==="fixed"&&(o=null),(s?!d&&!o:!d&&u.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||pu(l)&&!d&&qC(e,l))?r=r.filter(h=>h!==l):o=u,l=wi(l)}return t.set(e,r),r}function qN(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?ip(t)?[]:HN(t,this._c):[].concat(n),r],u=l[0],d=l.reduce((p,h)=>{const m=iw(t,h,o);return p.top=tr(m.top,p.top),p.right=Eo(m.right,p.right),p.bottom=Eo(m.bottom,p.bottom),p.left=tr(m.left,p.left),p},iw(t,u,o));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function GN(e){const{width:t,height:n}=VC(e);return{width:t,height:n}}function QN(e,t,n){const r=zr(t),o=Xo(t),s=n==="fixed",l=ra(e,!0,s,t);let u={scrollLeft:0,scrollTop:0};const d=Ho(0);if(r||!r&&!s)if((Ll(t)!=="body"||pu(o))&&(u=ap(t)),r){const y=ra(t,!0,s,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else o&&(d.x=Fv(o));const p=o&&!r&&!s?HC(o,u):Ho(0),h=l.left+u.scrollLeft-d.x-p.x,m=l.top+u.scrollTop-d.y-p.y;return{x:h,y:m,width:l.width,height:l.height}}function Xm(e){return to(e).position==="static"}function sw(e,t){if(!zr(e)||to(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Xo(e)===n&&(n=n.ownerDocument.body),n}function GC(e,t){const n=Tr(e);if(ip(e))return n;if(!zr(e)){let o=wi(e);for(;o&&!ps(o);){if(sn(o)&&!Xm(o))return o;o=wi(o)}return n}let r=sw(e,t);for(;r&&dN(r)&&Xm(r);)r=sw(r,t);return r&&ps(r)&&Xm(r)&&!Iv(r)?n:r||fN(e)||n}const KN=async function(e){const t=this.getOffsetParent||GC,n=this.getDimensions,r=await n(e.floating);return{reference:QN(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function YN(e){return to(e).direction==="rtl"}const XN={convertOffsetParentRelativeRectToViewportRelativeRect:zN,getDocumentElement:Xo,getClippingRect:qN,getOffsetParent:GC,getElementRects:KN,getClientRects:BN,getDimensions:GN,getScale:vl,isElement:sn,isRTL:YN};function JN(e,t){let n=null,r;const o=Xo(e);function s(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),s();const{left:p,top:h,width:m,height:y}=e.getBoundingClientRect();if(u||t(),!m||!y)return;const x=Xd(h),b=Xd(o.clientWidth-(p+m)),w=Xd(o.clientHeight-(h+y)),j=Xd(p),P={rootMargin:-x+"px "+-b+"px "+-w+"px "+-j+"px",threshold:tr(0,Eo(1,d))||1};let k=!0;function E(_){const R=_[0].intersectionRatio;if(R!==d){if(!k)return l();R?l(!1,R):r=setTimeout(()=>{l(!1,1e-7)},1e3)}k=!1}try{n=new IntersectionObserver(E,{...P,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,P)}n.observe(e)}return l(!0),s}function ZN(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,p=$v(e),h=o||s?[...p?yi(p):[],...yi(t)]:[];h.forEach(T=>{o&&T.addEventListener("scroll",n,{passive:!0}),s&&T.addEventListener("resize",n)});const m=p&&u?JN(p,n):null;let y=-1,x=null;l&&(x=new ResizeObserver(T=>{let[P]=T;P&&P.target===p&&x&&(x.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var k;(k=x)==null||k.observe(t)})),n()}),p&&!d&&x.observe(p),x.observe(t));let b,w=d?ra(e):null;d&&j();function j(){const T=ra(e);w&&(T.x!==w.x||T.y!==w.y||T.width!==w.width||T.height!==w.height)&&n(),w=T,b=requestAnimationFrame(j)}return n(),()=>{var T;h.forEach(P=>{o&&P.removeEventListener("scroll",n),s&&P.removeEventListener("resize",n)}),m==null||m(),(T=x)==null||T.disconnect(),x=null,d&&cancelAnimationFrame(b)}}const eA=AN,tA=MN,nA=_N,rA=LN,aw=RN,oA=IN,iA=ON,sA=(e,t,n)=>{const r=new Map,o={platform:XN,...n},s={...o.platform,_c:r};return PN(e,t,{...o,platform:s})};var ff=typeof document<"u"?g.useLayoutEffect:g.useEffect;function jf(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(!jf(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 s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!jf(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function QC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lw(e,t){const n=QC(e);return Math.round(t*n)/n}function Jm(e){const t=g.useRef(e);return ff(()=>{t.current=e}),t}function aA(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:l}={},transform:u=!0,whileElementsMounted:d,open:p}=e,[h,m]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,x]=g.useState(r);jf(y,r)||x(r);const[b,w]=g.useState(null),[j,T]=g.useState(null),P=g.useCallback(A=>{A!==R.current&&(R.current=A,w(A))},[]),k=g.useCallback(A=>{A!==M.current&&(M.current=A,T(A))},[]),E=s||b,_=l||j,R=g.useRef(null),M=g.useRef(null),N=g.useRef(h),L=d!=null,z=Jm(d),q=Jm(o),G=Jm(p),Y=g.useCallback(()=>{if(!R.current||!M.current)return;const A={placement:t,strategy:n,middleware:y};q.current&&(A.platform=q.current),sA(R.current,M.current,A).then(B=>{const I={...B,isPositioned:G.current!==!1};Q.current&&!jf(N.current,I)&&(N.current=I,ep.flushSync(()=>{m(I)}))})},[y,t,n,q,G]);ff(()=>{p===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,m(A=>({...A,isPositioned:!1})))},[p]);const Q=g.useRef(!1);ff(()=>(Q.current=!0,()=>{Q.current=!1}),[]),ff(()=>{if(E&&(R.current=E),_&&(M.current=_),E&&_){if(z.current)return z.current(E,_,Y);Y()}},[E,_,Y,z,L]);const te=g.useMemo(()=>({reference:R,floating:M,setReference:P,setFloating:k}),[P,k]),V=g.useMemo(()=>({reference:E,floating:_}),[E,_]),O=g.useMemo(()=>{const A={position:n,left:0,top:0};if(!V.floating)return A;const B=lw(V.floating,h.x),I=lw(V.floating,h.y);return u?{...A,transform:"translate("+B+"px, "+I+"px)",...QC(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:I}},[n,u,V.floating,h.x,h.y]);return g.useMemo(()=>({...h,update:Y,refs:te,elements:V,floatingStyles:O}),[h,Y,te,V,O])}const lA=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?aw({element:r.current,padding:o}).fn(n):{}:r?aw({element:r,padding:o}).fn(n):{}}}},KC=(e,t)=>({...eA(e),options:[e,t]}),zv=(e,t)=>({...tA(e),options:[e,t]}),cw=(e,t)=>({...iA(e),options:[e,t]}),Cf=(e,t)=>({...nA(e),options:[e,t]}),cA=(e,t)=>({...rA(e),options:[e,t]}),Hc=(e,t)=>({...oA(e),options:[e,t]}),YC=(e,t)=>({...lA(e),options:[e,t]}),XC={...Hj},uA=XC.useInsertionEffect,dA=uA||(e=>e());function vi(e){const t=g.useRef(()=>{});return dA(()=>{t.current=e}),g.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 qo=typeof document<"u"?g.useLayoutEffect:g.useEffect;let uw=!1,fA=0;const dw=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+fA++;function pA(){const[e,t]=g.useState(()=>uw?dw():void 0);return qo(()=>{e==null&&t(dw())},[]),g.useEffect(()=>{uw=!0},[]),e}const hA=XC.useId,JC=hA||pA;function mA(){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 gA=g.createContext(null),vA=g.createContext(null),Bv=()=>{var e;return((e=g.useContext(gA))==null?void 0:e.id)||null},Uv=()=>g.useContext(vA);function Vv(e){return"data-floating-ui-"+e}function Zm(e){const t=g.useRef(e);return qo(()=>{t.current=e}),t}const fw=Vv("safe-polygon");function pf(e,t,n){return n&&!Og(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function yA(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:l}=e,{enabled:u=!0,delay:d=0,handleClose:p=null,mouseOnly:h=!1,restMs:m=0,move:y=!0}=t,x=Uv(),b=Bv(),w=Zm(p),j=Zm(d),T=Zm(n),P=g.useRef(),k=g.useRef(-1),E=g.useRef(),_=g.useRef(-1),R=g.useRef(!0),M=g.useRef(!1),N=g.useRef(()=>{}),L=g.useRef(!1),z=g.useCallback(()=>{var O;const A=(O=o.current.openEvent)==null?void 0:O.type;return(A==null?void 0:A.includes("mouse"))&&A!=="mousedown"},[o]);g.useEffect(()=>{if(!u)return;function O(A){let{open:B}=A;B||(clearTimeout(k.current),clearTimeout(_.current),R.current=!0,L.current=!1)}return s.on("openchange",O),()=>{s.off("openchange",O)}},[u,s]),g.useEffect(()=>{if(!u||!w.current||!n)return;function O(B){z()&&r(!1,B,"hover")}const A=Js(l.floating).documentElement;return A.addEventListener("mouseleave",O),()=>{A.removeEventListener("mouseleave",O)}},[l.floating,n,r,u,w,z]);const q=g.useCallback(function(O,A,B){A===void 0&&(A=!0),B===void 0&&(B="hover");const I=pf(j.current,"close",P.current);I&&!E.current?(clearTimeout(k.current),k.current=window.setTimeout(()=>r(!1,O,B),I)):A&&(clearTimeout(k.current),r(!1,O,B))},[j,r]),G=vi(()=>{N.current(),E.current=void 0}),Y=vi(()=>{if(M.current){const O=Js(l.floating).body;O.style.pointerEvents="",O.removeAttribute(fw),M.current=!1}}),Q=vi(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);g.useEffect(()=>{if(!u)return;function O(F){if(clearTimeout(k.current),R.current=!1,h&&!Og(P.current)||m>0&&!pf(j.current,"open"))return;const J=pf(j.current,"open",P.current);J?k.current=window.setTimeout(()=>{T.current||r(!0,F,"hover")},J):n||r(!0,F,"hover")}function A(F){if(Q())return;N.current();const J=Js(l.floating);if(clearTimeout(_.current),L.current=!1,w.current&&o.current.floatingContext){n||clearTimeout(k.current),E.current=w.current({...o.current.floatingContext,tree:x,x:F.clientX,y:F.clientY,onClose(){Y(),G(),Q()||q(F,!0,"safe-polygon")}});const Ee=E.current;J.addEventListener("mousemove",Ee),N.current=()=>{J.removeEventListener("mousemove",Ee)};return}(P.current==="touch"?!Xc(l.floating,F.relatedTarget):!0)&&q(F)}function B(F){Q()||o.current.floatingContext&&(w.current==null||w.current({...o.current.floatingContext,tree:x,x:F.clientX,y:F.clientY,onClose(){Y(),G(),Q()||q(F)}})(F))}if(sn(l.domReference)){var I;const F=l.domReference;return n&&F.addEventListener("mouseleave",B),(I=l.floating)==null||I.addEventListener("mouseleave",B),y&&F.addEventListener("mousemove",O,{once:!0}),F.addEventListener("mouseenter",O),F.addEventListener("mouseleave",A),()=>{var J;n&&F.removeEventListener("mouseleave",B),(J=l.floating)==null||J.removeEventListener("mouseleave",B),y&&F.removeEventListener("mousemove",O),F.removeEventListener("mouseenter",O),F.removeEventListener("mouseleave",A)}}},[l,u,e,h,m,y,q,G,Y,r,n,T,x,j,w,o,Q]),qo(()=>{var O;if(u&&n&&(O=w.current)!=null&&O.__options.blockPointerEvents&&z()){M.current=!0;const B=l.floating;if(sn(l.domReference)&&B){var A;const I=Js(l.floating).body;I.setAttribute(fw,"");const F=l.domReference,J=x==null||(A=x.nodesRef.current.find(de=>de.id===b))==null||(A=A.context)==null?void 0:A.elements.floating;return J&&(J.style.pointerEvents=""),I.style.pointerEvents="none",F.style.pointerEvents="auto",B.style.pointerEvents="auto",()=>{I.style.pointerEvents="",F.style.pointerEvents="",B.style.pointerEvents=""}}}},[u,n,b,l,x,w,z]),qo(()=>{n||(P.current=void 0,L.current=!1,G(),Y())},[n,G,Y]),g.useEffect(()=>()=>{G(),clearTimeout(k.current),clearTimeout(_.current),Y()},[u,l.domReference,G,Y]);const te=g.useMemo(()=>{function O(A){P.current=A.pointerType}return{onPointerDown:O,onPointerEnter:O,onMouseMove(A){const{nativeEvent:B}=A;function I(){!R.current&&!T.current&&r(!0,B,"hover")}h&&!Og(P.current)||n||m===0||L.current&&A.movementX**2+A.movementY**2<2||(clearTimeout(_.current),P.current==="touch"?I():(L.current=!0,_.current=window.setTimeout(I,m)))}}},[h,r,n,T,m]),V=g.useMemo(()=>({onMouseEnter(){clearTimeout(k.current)},onMouseLeave(O){Q()||q(O.nativeEvent,!1)}}),[q,Q]);return g.useMemo(()=>u?{reference:te,floating:V}:{},[u,te,V])}const Fg=()=>{},ZC=g.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Fg,setState:Fg,isInstantPhase:!1}),eE=()=>g.useContext(ZC);function xA(e){const{children:t,delay:n,timeoutMs:r=0}=e,[o,s]=g.useReducer((d,p)=>({...d,...p}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),l=g.useRef(null),u=g.useCallback(d=>{s({currentId:d})},[]);return qo(()=>{o.currentId?l.current===null?l.current=o.currentId:o.isInstantPhase||s({isInstantPhase:!0}):(o.isInstantPhase&&s({isInstantPhase:!1}),l.current=null)},[o.currentId,o.isInstantPhase]),g.createElement(ZC.Provider,{value:g.useMemo(()=>({...o,setState:s,setCurrentId:u}),[o,u])},t)}function bA(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:s,enabled:l=!0}=t,u=s??o,d=eE(),{currentId:p,setCurrentId:h,initialDelay:m,setState:y,timeoutMs:x}=d;return qo(()=>{l&&p&&(y({delay:{open:1,close:pf(m,"close")}}),p!==u&&r(!1))},[l,u,r,y,p,m]),qo(()=>{function b(){r(!1),y({delay:m,currentId:null})}if(l&&p&&!n&&p===u){if(x){const w=window.setTimeout(b,x);return()=>{clearTimeout(w)}}b()}},[l,n,y,p,u,r,m,x]),qo(()=>{l&&(h===Fg||!n||h(u))},[l,n,h,u]),d}function eg(e,t){let n=e.filter(o=>{var s;return o.parentId===t&&((s=o.context)==null?void 0:s.open)}),r=n;for(;r.length;)r=e.filter(o=>{var s;return(s=r)==null?void 0:s.some(l=>{var u;return o.parentId===l.id&&((u=o.context)==null?void 0:u.open)})}),n=n.concat(r);return n}const wA="data-floating-ui-focusable",SA={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},jA={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},pw=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 CA(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:l=!0,escapeKey:u=!0,outsidePress:d=!0,outsidePressEvent:p="pointerdown",referencePress:h=!1,referencePressEvent:m="pointerdown",ancestorScroll:y=!1,bubbles:x,capture:b}=t,w=Uv(),j=vi(typeof d=="function"?d:()=>!1),T=typeof d=="function"?j:d,P=g.useRef(!1),k=g.useRef(!1),{escapeKey:E,outsidePress:_}=pw(x),{escapeKey:R,outsidePress:M}=pw(b),N=g.useRef(!1),L=vi(te=>{var V;if(!n||!l||!u||te.key!=="Escape"||N.current)return;const O=(V=s.current.floatingContext)==null?void 0:V.nodeId,A=w?eg(w.nodesRef.current,O):[];if(!E&&(te.stopPropagation(),A.length>0)){let B=!0;if(A.forEach(I=>{var F;if((F=I.context)!=null&&F.open&&!I.context.dataRef.current.__escapeKeyBubbles){B=!1;return}}),!B)return}r(!1,vN(te)?te.nativeEvent:te,"escape-key")}),z=vi(te=>{var V;const O=()=>{var A;L(te),(A=dl(te))==null||A.removeEventListener("keydown",O)};(V=dl(te))==null||V.addEventListener("keydown",O)}),q=vi(te=>{var V;const O=P.current;P.current=!1;const A=k.current;if(k.current=!1,p==="click"&&A||O||typeof T=="function"&&!T(te))return;const B=dl(te),I="["+Vv("inert")+"]",F=Js(o.floating).querySelectorAll(I);let J=sn(B)?B:null;for(;J&&!ps(J);){const we=wi(J);if(ps(we)||!sn(we))break;J=we}if(F.length&&sn(B)&&!yN(B)&&!Xc(B,o.floating)&&Array.from(F).every(we=>!Xc(J,we)))return;if(zr(B)&&Q){const we=B.clientWidth>0&&B.scrollWidth>B.clientWidth,_e=B.clientHeight>0&&B.scrollHeight>B.clientHeight;let fe=_e&&te.offsetX>B.clientWidth;if(_e&&to(B).direction==="rtl"&&(fe=te.offsetX<=B.offsetWidth-B.clientWidth),fe||we&&te.offsetY>B.clientHeight)return}const de=(V=s.current.floatingContext)==null?void 0:V.nodeId,Ee=w&&eg(w.nodesRef.current,de).some(we=>{var _e;return Ym(te,(_e=we.context)==null?void 0:_e.elements.floating)});if(Ym(te,o.floating)||Ym(te,o.domReference)||Ee)return;const ve=w?eg(w.nodesRef.current,de):[];if(ve.length>0){let we=!0;if(ve.forEach(_e=>{var fe;if((fe=_e.context)!=null&&fe.open&&!_e.context.dataRef.current.__outsidePressBubbles){we=!1;return}}),!we)return}r(!1,te,"outside-press")}),G=vi(te=>{var V;const O=()=>{var A;q(te),(A=dl(te))==null||A.removeEventListener(p,O)};(V=dl(te))==null||V.addEventListener(p,O)});g.useEffect(()=>{if(!n||!l)return;s.current.__escapeKeyBubbles=E,s.current.__outsidePressBubbles=_;let te=-1;function V(F){r(!1,F,"ancestor-scroll")}function O(){window.clearTimeout(te),N.current=!0}function A(){te=window.setTimeout(()=>{N.current=!1},sp()?5:0)}const B=Js(o.floating);u&&(B.addEventListener("keydown",R?z:L,R),B.addEventListener("compositionstart",O),B.addEventListener("compositionend",A)),T&&B.addEventListener(p,M?G:q,M);let I=[];return y&&(sn(o.domReference)&&(I=yi(o.domReference)),sn(o.floating)&&(I=I.concat(yi(o.floating))),!sn(o.reference)&&o.reference&&o.reference.contextElement&&(I=I.concat(yi(o.reference.contextElement)))),I=I.filter(F=>{var J;return F!==((J=B.defaultView)==null?void 0:J.visualViewport)}),I.forEach(F=>{F.addEventListener("scroll",V,{passive:!0})}),()=>{u&&(B.removeEventListener("keydown",R?z:L,R),B.removeEventListener("compositionstart",O),B.removeEventListener("compositionend",A)),T&&B.removeEventListener(p,M?G:q,M),I.forEach(F=>{F.removeEventListener("scroll",V)}),window.clearTimeout(te)}},[s,o,u,T,p,n,r,y,l,E,_,L,R,z,q,M,G]),g.useEffect(()=>{P.current=!1},[T,p]);const Y=g.useMemo(()=>({onKeyDown:L,[SA[m]]:te=>{h&&r(!1,te.nativeEvent,"reference-press")}}),[L,r,h,m]),Q=g.useMemo(()=>({onKeyDown:L,onMouseDown(){k.current=!0},onMouseUp(){k.current=!0},[jA[p]]:()=>{P.current=!0}}),[L,p]);return g.useMemo(()=>l?{reference:Y,floating:Q}:{},[l,Y,Q])}function EA(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=JC(),s=g.useRef({}),[l]=g.useState(()=>mA()),u=Bv()!=null,[d,p]=g.useState(r.reference),h=vi((x,b,w)=>{s.current.openEvent=x?b:void 0,l.emit("openchange",{open:x,event:b,reason:w,nested:u}),n==null||n(x,b,w)}),m=g.useMemo(()=>({setPositionReference:p}),[]),y=g.useMemo(()=>({reference:d||r.reference||null,floating:r.floating||null,domReference:r.reference}),[d,r.reference,r.floating]);return g.useMemo(()=>({dataRef:s,open:t,onOpenChange:h,elements:y,events:l,floatingId:o,refs:m}),[t,h,y,l,o,m])}function Wv(e){e===void 0&&(e={});const{nodeId:t}=e,n=EA({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,l]=g.useState(null),[u,d]=g.useState(null),h=(o==null?void 0:o.domReference)||s,m=g.useRef(null),y=Uv();qo(()=>{h&&(m.current=h)},[h]);const x=aA({...e,elements:{...o,...u&&{reference:u}}}),b=g.useCallback(k=>{const E=sn(k)?{getBoundingClientRect:()=>k.getBoundingClientRect(),contextElement:k}:k;d(E),x.refs.setReference(E)},[x.refs]),w=g.useCallback(k=>{(sn(k)||k===null)&&(m.current=k,l(k)),(sn(x.refs.reference.current)||x.refs.reference.current===null||k!==null&&!sn(k))&&x.refs.setReference(k)},[x.refs]),j=g.useMemo(()=>({...x.refs,setReference:w,setPositionReference:b,domReference:m}),[x.refs,w,b]),T=g.useMemo(()=>({...x.elements,domReference:h}),[x.elements,h]),P=g.useMemo(()=>({...x,...r,refs:j,elements:T,nodeId:t}),[x,j,T,t,r]);return qo(()=>{r.dataRef.current.floatingContext=P;const k=y==null?void 0:y.nodesRef.current.find(E=>E.id===t);k&&(k.context=P)}),g.useMemo(()=>({...x,context:P,refs:j,elements:T}),[x,j,T,P])}function kA(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:l}=e,{enabled:u=!0,visibleOnly:d=!0}=t,p=g.useRef(!1),h=g.useRef(),m=g.useRef(!0);g.useEffect(()=>{if(!u)return;const x=Tr(l.domReference);function b(){!n&&zr(l.domReference)&&l.domReference===nw(Js(l.domReference))&&(p.current=!0)}function w(){m.current=!0}return x.addEventListener("blur",b),x.addEventListener("keydown",w,!0),()=>{x.removeEventListener("blur",b),x.removeEventListener("keydown",w,!0)}},[l.domReference,n,u]),g.useEffect(()=>{if(!u)return;function x(b){let{reason:w}=b;(w==="reference-press"||w==="escape-key")&&(p.current=!0)}return o.on("openchange",x),()=>{o.off("openchange",x)}},[o,u]),g.useEffect(()=>()=>{clearTimeout(h.current)},[]);const y=g.useMemo(()=>({onPointerDown(x){pN(x.nativeEvent)||(m.current=!1)},onMouseLeave(){p.current=!1},onFocus(x){if(p.current)return;const b=dl(x.nativeEvent);if(d&&sn(b))try{if(hN()&&mN())throw Error();if(!b.matches(":focus-visible"))return}catch{if(!m.current&&!bN(b))return}r(!0,x.nativeEvent,"focus")},onBlur(x){p.current=!1;const b=x.relatedTarget,w=x.nativeEvent,j=sn(b)&&b.hasAttribute(Vv("focus-guard"))&&b.getAttribute("data-type")==="outside";h.current=window.setTimeout(()=>{var T;const P=nw(l.domReference?l.domReference.ownerDocument:document);!b&&P===l.domReference||Xc((T=s.current.floatingContext)==null?void 0:T.refs.floating.current,P)||Xc(l.domReference,P)||j||r(!1,w,"focus")})}}),[s,l.domReference,r,d]);return g.useMemo(()=>u?{reference:y}:{},[u,y])}const hw="active",mw="selected";function tg(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[hw]:l,[mw]:u,...d}=e;s=d}return{...n==="floating"&&{tabIndex:-1,[wA]:""},...s,...t.map(l=>{const u=l?l[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((l,u)=>(u&&Object.entries(u).forEach(d=>{let[p,h]=d;if(!(o&&[hw,mw].includes(p)))if(p.indexOf("on")===0){if(r.has(p)||r.set(p,[]),typeof h=="function"){var m;(m=r.get(p))==null||m.push(h),l[p]=function(){for(var y,x=arguments.length,b=new Array(x),w=0;w<x;w++)b[w]=arguments[w];return(y=r.get(p))==null?void 0:y.map(j=>j(...b)).find(j=>j!==void 0)}}}else l[p]=h}),l),{})}}function TA(e){e===void 0&&(e=[]);const t=e.map(u=>u==null?void 0:u.reference),n=e.map(u=>u==null?void 0:u.floating),r=e.map(u=>u==null?void 0:u.item),o=g.useCallback(u=>tg(u,e,"reference"),t),s=g.useCallback(u=>tg(u,e,"floating"),n),l=g.useCallback(u=>tg(u,e,"item"),r);return g.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:l}),[o,s,l])}const PA=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function RA(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:s=!0,role:l="dialog"}=t,u=(n=PA.get(l))!=null?n:l,d=JC(),h=Bv()!=null,m=g.useMemo(()=>u==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":u==="alertdialog"?"dialog":u,"aria-controls":r?o:void 0,...u==="listbox"&&{role:"combobox"},...u==="menu"&&{id:d},...u==="menu"&&h&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[u,o,h,r,d,l]),y=g.useMemo(()=>{const b={id:o,...u&&{role:u}};return u==="tooltip"||l==="label"?b:{...b,...u==="menu"&&{"aria-labelledby":d}}},[u,o,d,l]),x=g.useCallback(b=>{let{active:w,selected:j}=b;const T={role:"option",...w&&{id:o+"-option"}};switch(l){case"select":return{...T,"aria-selected":w&&j};case"combobox":return{...T,...w&&{"aria-selected":!0}}}return{}},[o,l]);return g.useMemo(()=>s?{reference:m,floating:y,item:x}:{},[s,m,y,x])}function tE(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 gw(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function vw(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 _A={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function DA({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:s,arrowY:l,dir:u}){const[d,p="center"]=e.split("-"),h={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[_A[d]]:r},m=-t/2;return d==="left"?{...h,...gw(p,l,n,o),right:m,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:d==="right"?{...h,...gw(p,l,n,o),left:m,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:d==="top"?{...h,...vw(p,s,n,o,u),bottom:m,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:d==="bottom"?{...h,...vw(p,s,n,o,u),top:m,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const Hv=g.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,visible:s,arrowX:l,arrowY:u,style:d,...p},h)=>{const{dir:m}=va();return s?i.jsx("div",{...p,ref:h,style:{...d,...DA({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,dir:m,arrowX:l,arrowY:u})}}):null});Hv.displayName="@mantine/core/FloatingArrow";const[IA,nE]=hr("Popover component was not found in the tree");function lp({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const o=kD(t),s=In(o,r);return Ti(e)?g.cloneElement(e,{[n]:s}):e}function rE(e){return i.jsx(Dv,{tabIndex:-1,"data-autofocus":!0,...e})}lp.displayName="@mantine/core/FocusTrap";rE.displayName="@mantine/core/FocusTrapInitialFocus";lp.InitialFocus=rE;function NA(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 AA={},oE=g.forwardRef((e,t)=>{const{children:n,target:r,...o}=ie("Portal",AA,e),[s,l]=g.useState(!1),u=g.useRef(null);return Ml(()=>(l(!0),u.current=r?typeof r=="string"?document.querySelector(r):r:NA(o),Kf(t,u.current),!r&&u.current&&document.body.appendChild(u.current),()=>{!r&&u.current&&document.body.removeChild(u.current)}),[r]),!s||!u.current?null:ep.createPortal(i.jsx(i.Fragment,{children:n}),u.current)});oE.displayName="@mantine/core/Portal";function ya({withinPortal:e=!0,children:t,...n}){return e?i.jsx(oE,{...n,children:t}):i.jsx(i.Fragment,{children:t})}ya.displayName="@mantine/core/OptionalPortal";const Lc=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${oe(e==="bottom"?10:-10)})`},transitionProperty:"transform, opacity"}),Jd={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${oe(30)}`},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${oe(-30)}`},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${oe(30)}`},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${oe(-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(${oe(-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(${oe(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(${oe(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${oe(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:{...Lc("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...Lc("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...Lc("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...Lc("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...Lc("top"),common:{transformOrigin:"top right"}}},yw={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function MA({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in Jd?{transitionProperty:Jd[e].transitionProperty,...o,...Jd[e].common,...Jd[e][yw[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[yw[t]]}}function OA({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:s,onEntered:l,onExited:u,enterDelay:d,exitDelay:p}){const h=ln(),m=jv(),y=h.respectReducedMotion?m:!1,[x,b]=g.useState(y?0:e),[w,j]=g.useState(r?"entered":"exited"),T=g.useRef(-1),P=g.useRef(-1),k=g.useRef(-1),E=R=>{const M=R?o:s,N=R?l:u;window.clearTimeout(T.current);const L=y?0:R?e:t;b(L),L===0?(typeof M=="function"&&M(),typeof N=="function"&&N(),j(R?"entered":"exited")):k.current=requestAnimationFrame(()=>{pl.flushSync(()=>{j(R?"pre-entering":"pre-exiting")}),k.current=requestAnimationFrame(()=>{typeof M=="function"&&M(),j(R?"entering":"exiting"),T.current=window.setTimeout(()=>{typeof N=="function"&&N(),j(R?"entered":"exited")},L)})})},_=R=>{if(window.clearTimeout(P.current),typeof(R?d:p)!="number"){E(R);return}P.current=window.setTimeout(()=>{E(R)},R?d:p)};return bi(()=>{_(r)},[r]),g.useEffect(()=>()=>{window.clearTimeout(T.current),cancelAnimationFrame(k.current)},[]),{transitionDuration:x,transitionStatus:w,transitionTimingFunction:n||"ease"}}function _i({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:o,children:s,timingFunction:l="ease",onExit:u,onEntered:d,onEnter:p,onExited:h,enterDelay:m,exitDelay:y}){const{transitionDuration:x,transitionStatus:b,transitionTimingFunction:w}=OA({mounted:o,exitDuration:r,duration:n,timingFunction:l,onExit:u,onEntered:d,onEnter:p,onExited:h,enterDelay:m,exitDelay:y});return x===0?o?i.jsx(i.Fragment,{children:s({})}):e?s({display:"none"}):null:b==="exited"?e?s({display:"none"}):null:i.jsx(i.Fragment,{children:s(MA({transition:t,duration:x,state:b,timingFunction:w}))})}_i.displayName="@mantine/core/Transition";var iE={dropdown:"m_38a85659",arrow:"m_a31dc6c1"};const LA={},qv=ue((e,t)=>{var j,T,P,k;const n=ie("PopoverDropdown",LA,e),{className:r,style:o,vars:s,children:l,onKeyDownCapture:u,variant:d,classNames:p,styles:h,...m}=n,y=nE(),x=iC({opened:y.opened,shouldReturnFocus:y.returnFocus}),b=y.withRoles?{"aria-labelledby":y.getTargetId(),id:y.getDropdownId(),role:"dialog",tabIndex:-1}:{},w=In(t,y.floating);return y.disabled?null:i.jsx(ya,{...y.portalProps,withinPortal:y.withinPortal,children:i.jsx(_i,{mounted:y.opened,...y.transitionProps,transition:((j=y.transitionProps)==null?void 0:j.transition)||"fade",duration:((T=y.transitionProps)==null?void 0:T.duration)??150,keepMounted:y.keepMounted,exitDuration:typeof((P=y.transitionProps)==null?void 0:P.exitDuration)=="number"?y.transitionProps.exitDuration:(k=y.transitionProps)==null?void 0:k.duration,children:E=>i.jsx(lp,{active:y.trapFocus&&y.opened,innerRef:w,children:i.jsxs(se,{...b,...m,variant:d,onKeyDownCapture:hD(y.onClose,{active:y.closeOnEscape,onTrigger:x,onKeyDown:u}),"data-position":y.placement,"data-fixed":y.floatingStrategy==="fixed"||void 0,...y.getStyles("dropdown",{className:r,props:n,classNames:p,styles:h,style:[{...E,zIndex:y.zIndex,top:y.y??0,left:y.x??0,width:y.width==="target"?void 0:oe(y.width)},y.resolvedStyles.dropdown,h==null?void 0:h.dropdown,o]}),children:[l,i.jsx(Hv,{ref:y.arrowRef,arrowX:y.arrowX,arrowY:y.arrowY,visible:y.withArrow,position:y.placement,arrowSize:y.arrowSize,arrowRadius:y.arrowRadius,arrowOffset:y.arrowOffset,arrowPosition:y.arrowPosition,...y.getStyles("arrow",{props:n,classNames:p,styles:h})})]})})})})});qv.classes=iE;qv.displayName="@mantine/core/PopoverDropdown";const $A={refProp:"ref",popupType:"dialog"},sE=ue((e,t)=>{const{children:n,refProp:r,popupType:o,...s}=ie("PopoverTarget",$A,e);if(!Ti(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 l=s,u=nE(),d=In(u.reference,Xf(n),t),p=u.withRoles?{"aria-haspopup":o,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:u.getTargetId()}:{};return g.cloneElement(n,{...l,...p,...u.targetProps,className:It(u.targetProps.className,l.className,n.props.className),[r]:d,...u.controlled?null:{onClick:u.onToggle}})});sE.displayName="@mantine/core/PopoverTarget";function aE({opened:e,floating:t,position:n,positionDependencies:r}){const[o,s]=g.useState(0);g.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current&&e)return ZN(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),bi(()=>{t.update()},r),bi(()=>{s(l=>l+1)},[e])}function FA(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 zA(e,t){const n=FA(e.middlewares),r=[KC(e.offset)];return n.shift&&r.push(zv(typeof n.shift=="boolean"?{limiter:cw(),padding:5}:{limiter:cw(),padding:5,...n.shift})),n.flip&&r.push(typeof n.flip=="boolean"?Cf():Cf(n.flip)),n.inline&&r.push(typeof n.inline=="boolean"?Hc():Hc(n.inline)),r.push(YC({element:e.arrowRef,padding:e.arrowOffset})),(n.size||e.width==="target")&&r.push(cA({...typeof n.size=="boolean"?{}:n.size,apply({rects:o,availableWidth:s,availableHeight:l,...u}){var h;const p=((h=t().refs.floating.current)==null?void 0:h.style)??{};n.size&&(typeof n.size=="object"&&n.size.apply?n.size.apply({rects:o,availableWidth:s,availableHeight:l,...u}):Object.assign(p,{maxWidth:`${s}px`,maxHeight:`${l}px`})),e.width==="target"&&Object.assign(p,{width:`${o.reference.width}px`})}})),r}function BA(e){const[t,n]=Wn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=g.useRef(t),o=()=>{t&&n(!1)},s=()=>n(!t),l=Wv({strategy:e.strategy,placement:e.position,middleware:zA(e,()=>l)});return aE({opened:t,position:e.position,positionDependencies:e.positionDependencies||[],floating:l}),bi(()=>{var u;(u=e.onPositionChange)==null||u.call(e,l.placement)},[l.placement]),bi(()=>{var u,d;t!==r.current&&(t?(d=e.onOpen)==null||d.call(e):(u=e.onClose)==null||u.call(e)),r.current=t},[t,e.onClose,e.onOpen]),{floating:l,controlled:typeof e.opened=="boolean",opened:t,onClose:o,onToggle:s}}const UA={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:Vr("popover"),__staticSelector:"Popover",width:"max-content"},VA=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:At(t),"--popover-shadow":wv(n)}});function Ro(e){var ke,ae,Ae,ut,Mt,bt;const t=ie("Popover",UA,e),{children:n,position:r,offset:o,onPositionChange:s,positionDependencies:l,opened:u,transitionProps:d,onExitTransitionEnd:p,onEnterTransitionEnd:h,width:m,middlewares:y,withArrow:x,arrowSize:b,arrowOffset:w,arrowRadius:j,arrowPosition:T,unstyled:P,classNames:k,styles:E,closeOnClickOutside:_,withinPortal:R,portalProps:M,closeOnEscape:N,clickOutsideEvents:L,trapFocus:z,onClose:q,onOpen:G,onChange:Y,zIndex:Q,radius:te,shadow:V,id:O,defaultOpened:A,__staticSelector:B,withRoles:I,disabled:F,returnFocus:J,variant:de,keepMounted:Ee,vars:ve,floatingStrategy:we,..._e}=t,fe=Ne({name:B,props:t,classes:iE,classNames:k,styles:E,unstyled:P,rootSelector:"dropdown",vars:ve,varsResolver:VA}),{resolvedStyles:Je}=Ol({classNames:k,styles:E,props:t}),pt=g.useRef(null),[at,St]=g.useState(null),[jt,Et]=g.useState(null),{dir:vt}=va(),kt=mr(O),ce=BA({middlewares:y,width:m,position:tE(vt,r),offset:typeof o=="number"?o+(x?b/2:0):o,arrowRef:pt,arrowOffset:w,onPositionChange:s,positionDependencies:l,opened:u,defaultOpened:A,onChange:Y,onOpen:G,onClose:q,strategy:we});vD(()=>_&&ce.onClose(),L,[at,jt]);const pe=g.useCallback(ht=>{St(ht),ce.floating.refs.setReference(ht)},[ce.floating.refs.setReference]),Re=g.useCallback(ht=>{Et(ht),ce.floating.refs.setFloating(ht)},[ce.floating.refs.setFloating]),He=g.useCallback(()=>{var ht;(ht=d==null?void 0:d.onExited)==null||ht.call(d),p==null||p()},[d==null?void 0:d.onExited,p]),he=g.useCallback(()=>{var ht;(ht=d==null?void 0:d.onEntered)==null||ht.call(d),h==null||h()},[d==null?void 0:d.onEntered,h]);return i.jsx(IA,{value:{returnFocus:J,disabled:F,controlled:ce.controlled,reference:pe,floating:Re,x:ce.floating.x,y:ce.floating.y,arrowX:(Ae=(ae=(ke=ce.floating)==null?void 0:ke.middlewareData)==null?void 0:ae.arrow)==null?void 0:Ae.x,arrowY:(bt=(Mt=(ut=ce.floating)==null?void 0:ut.middlewareData)==null?void 0:Mt.arrow)==null?void 0:bt.y,opened:ce.opened,arrowRef:pt,transitionProps:{...d,onExited:He,onEntered:he},width:m,withArrow:x,arrowSize:b,arrowOffset:w,arrowRadius:j,arrowPosition:T,placement:ce.floating.placement,trapFocus:z,withinPortal:R,portalProps:M,zIndex:Q,radius:te,shadow:V,closeOnEscape:N,onClose:ce.onClose,onToggle:ce.onToggle,getTargetId:()=>`${kt}-target`,getDropdownId:()=>`${kt}-dropdown`,withRoles:I,targetProps:_e,__staticSelector:B,classNames:k,styles:E,unstyled:P,variant:de,keepMounted:Ee,getStyles:fe,resolvedStyles:Je,floatingStrategy:we},children:n})}Ro.Target=sE;Ro.Dropdown=qv;Ro.displayName="@mantine/core/Popover";Ro.extend=e=>e;var jo={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 lE=g.forwardRef(({className:e,...t},n)=>i.jsxs(se,{component:"span",className:It(jo.barsLoader,e),...t,ref:n,children:[i.jsx("span",{className:jo.bar}),i.jsx("span",{className:jo.bar}),i.jsx("span",{className:jo.bar})]}));lE.displayName="@mantine/core/Bars";const cE=g.forwardRef(({className:e,...t},n)=>i.jsxs(se,{component:"span",className:It(jo.dotsLoader,e),...t,ref:n,children:[i.jsx("span",{className:jo.dot}),i.jsx("span",{className:jo.dot}),i.jsx("span",{className:jo.dot})]}));cE.displayName="@mantine/core/Dots";const uE=g.forwardRef(({className:e,...t},n)=>i.jsx(se,{component:"span",className:It(jo.ovalLoader,e),...t,ref:n}));uE.displayName="@mantine/core/Oval";const dE={bars:lE,oval:uE,dots:cE},WA={loaders:dE,type:"oval"},HA=(e,{size:t,color:n})=>({root:{"--loader-size":et(t,"loader-size"),"--loader-color":n?Lt(n,e):void 0}}),Rr=ue((e,t)=>{const n=ie("Loader",WA,e),{size:r,color:o,type:s,vars:l,className:u,style:d,classNames:p,styles:h,unstyled:m,loaders:y,variant:x,children:b,...w}=n,j=Ne({name:"Loader",props:n,classes:jo,className:u,style:d,classNames:p,styles:h,unstyled:m,vars:l,varsResolver:HA});return b?i.jsx(se,{...j("root"),ref:t,...w,children:b}):i.jsx(se,{...j("root"),ref:t,component:y[s],variant:x,size:r,...w})});Rr.defaultLoaders=dE;Rr.classes=jo;Rr.displayName="@mantine/core/Loader";var Fl={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const xw={orientation:"horizontal"},qA=(e,{borderWidth:t})=>({group:{"--ai-border-width":oe(t)}}),Gv=ue((e,t)=>{const n=ie("ActionIconGroup",xw,e),{className:r,style:o,classNames:s,styles:l,unstyled:u,orientation:d,vars:p,borderWidth:h,variant:m,mod:y,...x}=ie("ActionIconGroup",xw,e),b=Ne({name:"ActionIconGroup",props:n,classes:Fl,className:r,style:o,classNames:s,styles:l,unstyled:u,vars:p,varsResolver:qA,rootSelector:"group"});return i.jsx(se,{...b("group"),ref:t,variant:m,mod:[{"data-orientation":d},y],role:"group",...x})});Gv.classes=Fl;Gv.displayName="@mantine/core/ActionIconGroup";const bw={},GA=(e,{radius:t,color:n,gradient:r,variant:o,autoContrast:s,size:l})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:s});return{groupSection:{"--section-height":et(l,"section-height"),"--section-padding-x":et(l,"section-padding-x"),"--section-fz":Rn(l),"--section-radius":t===void 0?void 0:At(t),"--section-bg":n||o?u.background:void 0,"--section-color":u.color,"--section-bd":n||o?u.border:void 0}}},Qv=ue((e,t)=>{const n=ie("ActionIconGroupSection",bw,e),{className:r,style:o,classNames:s,styles:l,unstyled:u,vars:d,variant:p,gradient:h,radius:m,autoContrast:y,...x}=ie("ActionIconGroupSection",bw,e),b=Ne({name:"ActionIconGroupSection",props:n,classes:Fl,className:r,style:o,classNames:s,styles:l,unstyled:u,vars:d,varsResolver:GA,rootSelector:"groupSection"});return i.jsx(se,{...b("groupSection"),ref:t,variant:p,...x})});Qv.classes=Fl;Qv.displayName="@mantine/core/ActionIconGroupSection";const QA={},KA=(e,{size:t,radius:n,variant:r,gradient:o,color:s,autoContrast:l})=>{const u=e.variantColorResolver({color:s||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:l});return{root:{"--ai-size":et(t,"ai-size"),"--ai-radius":n===void 0?void 0:At(n),"--ai-bg":s||r?u.background:void 0,"--ai-hover":s||r?u.hover:void 0,"--ai-hover-color":s||r?u.hoverColor:void 0,"--ai-color":u.color,"--ai-bd":s||r?u.border:void 0}}},Cn=or((e,t)=>{const n=ie("ActionIcon",QA,e),{className:r,unstyled:o,variant:s,classNames:l,styles:u,style:d,loading:p,loaderProps:h,size:m,color:y,radius:x,__staticSelector:b,gradient:w,vars:j,children:T,disabled:P,"data-disabled":k,autoContrast:E,mod:_,...R}=n,M=Ne({name:["ActionIcon",b],props:n,className:r,style:d,classes:Fl,classNames:l,styles:u,unstyled:o,vars:j,varsResolver:KA});return i.jsxs(Gn,{...M("root",{active:!P&&!p&&!k}),...R,unstyled:o,variant:s,size:m,disabled:P||p,ref:t,mod:[{loading:p,disabled:P||k},_],children:[i.jsx(_i,{mounted:!!p,transition:"slide-down",duration:150,children:N=>i.jsx(se,{component:"span",...M("loader",{style:N}),"aria-hidden":!0,children:i.jsx(Rr,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...h})})}),i.jsx(se,{component:"span",mod:{loading:p},...M("icon"),children:T})]})});Cn.classes=Fl;Cn.displayName="@mantine/core/ActionIcon";Cn.Group=Gv;Cn.GroupSection=Qv;const fE=g.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...n},r)=>i.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:i.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"})}));fE.displayName="@mantine/core/CloseIcon";var pE={root:"m_86a44da5","root--subtle":"m_220c80f2"};const YA={variant:"subtle"},XA=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":et(t,"cb-size"),"--cb-radius":n===void 0?void 0:At(n),"--cb-icon-size":oe(r)}}),xa=or((e,t)=>{const n=ie("CloseButton",YA,e),{iconSize:r,children:o,vars:s,radius:l,className:u,classNames:d,style:p,styles:h,unstyled:m,"data-disabled":y,disabled:x,variant:b,icon:w,mod:j,...T}=n,P=Ne({name:"CloseButton",props:n,className:u,style:p,classes:pE,classNames:d,styles:h,unstyled:m,vars:s,varsResolver:XA});return i.jsxs(Gn,{ref:t,...T,unstyled:m,variant:b,disabled:x,mod:[{disabled:x||y},j],...P("root",{variant:b,active:!x&&!y}),children:[w||i.jsx(fE,{}),o]})});xa.classes=pE;xa.displayName="@mantine/core/CloseButton";function JA(e){return g.Children.toArray(e).filter(Boolean)}var hE={root:"m_4081bf90"};const ZA={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},e4=(e,{grow:t,preventGrowOverflow:n,gap:r,align:o,justify:s,wrap:l},{childWidth:u})=>({root:{"--group-child-width":t&&n?u:void 0,"--group-gap":Pn(r),"--group-align":o,"--group-justify":s,"--group-wrap":l}}),be=ue((e,t)=>{const n=ie("Group",ZA,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,children:d,gap:p,align:h,justify:m,wrap:y,grow:x,preventGrowOverflow:b,vars:w,variant:j,__size:T,mod:P,...k}=n,E=JA(d),_=E.length,R=Pn(p??"md"),N={childWidth:`calc(${100/_}% - (${R} - ${R} / ${_}))`},L=Ne({name:"Group",props:n,stylesCtx:N,className:o,style:s,classes:hE,classNames:r,styles:l,unstyled:u,vars:w,varsResolver:e4});return i.jsx(se,{...L("root"),ref:t,variant:j,mod:[{grow:x},P],size:T,...k,children:E})});be.classes=hE;be.displayName="@mantine/core/Group";var mE={root:"m_9814e45f"};const t4={zIndex:Vr("modal")},n4=(e,{gradient:t,color:n,backgroundOpacity:r,blur:o,radius:s,zIndex:l})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&Jr(n||"#000",r??.6)||void 0,"--overlay-filter":o?`blur(${oe(o)})`:void 0,"--overlay-radius":s===void 0?void 0:At(s),"--overlay-z-index":l==null?void 0:l.toString()}}),Jc=or((e,t)=>{const n=ie("Overlay",t4,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,fixed:p,center:h,children:m,radius:y,zIndex:x,gradient:b,blur:w,color:j,backgroundOpacity:T,mod:P,...k}=n,E=Ne({name:"Overlay",props:n,classes:mE,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:n4});return i.jsx(se,{ref:t,...E("root"),mod:[{center:h,fixed:p},P],...k,children:m})});Jc.classes=mE;Jc.displayName="@mantine/core/Overlay";const[r4,Di]=hr("ModalBase component was not found in tree");function o4({opened:e,transitionDuration:t}){const[n,r]=g.useState(e),o=g.useRef(-1),l=jv()?0:t;return g.useEffect(()=>(e?(r(!0),window.clearTimeout(o.current)):l===0?r(!1):o.current=window.setTimeout(()=>r(!1),l),()=>window.clearTimeout(o.current)),[e,l]),n}function i4({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:o,onClose:s,returnFocus:l}){const u=mr(e),[d,p]=g.useState(!1),[h,m]=g.useState(!1),y=typeof(t==null?void 0:t.duration)=="number"?t==null?void 0:t.duration:200,x=o4({opened:n,transitionDuration:y});return cC("keydown",b=>{var w;b.key==="Escape"&&o&&n&&((w=b.target)==null?void 0:w.getAttribute("data-mantine-stop-propagation"))!=="true"&&s()},{capture:!0}),iC({opened:n,shouldReturnFocus:r&&l}),{_id:u,titleMounted:d,bodyMounted:h,shouldLockScroll:x,setTitleMounted:p,setBodyMounted:m}}const gE=g.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:o,onExitTransitionEnd:s,onEnterTransitionEnd:l,trapFocus:u,closeOnEscape:d,returnFocus:p,closeOnClickOutside:h,withinPortal:m,portalProps:y,lockScroll:x,children:b,zIndex:w,shadow:j,padding:T,__vars:P,unstyled:k,removeScrollProps:E,..._},R)=>{const{_id:M,titleMounted:N,bodyMounted:L,shouldLockScroll:z,setTitleMounted:q,setBodyMounted:G}=i4({id:r,transitionProps:o,opened:t,trapFocus:u,closeOnEscape:d,onClose:n,returnFocus:p}),{key:Y,...Q}=E||{};return i.jsx(ya,{...y,withinPortal:m,children:i.jsx(r4,{value:{opened:t,onClose:n,closeOnClickOutside:h,onExitTransitionEnd:s,onEnterTransitionEnd:l,transitionProps:{...o,keepMounted:e},getTitleId:()=>`${M}-title`,getBodyId:()=>`${M}-body`,titleMounted:N,bodyMounted:L,setTitleMounted:q,setBodyMounted:G,trapFocus:u,closeOnEscape:d,zIndex:w,unstyled:k},children:i.jsx(wl,{enabled:z&&x,...Q,children:i.jsx(se,{ref:R,..._,__vars:{...P,"--mb-z-index":(w||Vr("modal")).toString(),"--mb-shadow":wv(j),"--mb-padding":Pn(T)},children:b})},Y)})})});gE.displayName="@mantine/core/ModalBase";function s4(){const e=Di();return g.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var Cl={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const vE=g.forwardRef(({className:e,...t},n)=>{const r=s4(),o=Di();return i.jsx(se,{ref:n,...t,id:r,className:It({[Cl.body]:!o.unstyled},e)})});vE.displayName="@mantine/core/ModalBaseBody";const yE=g.forwardRef(({className:e,onClick:t,...n},r)=>{const o=Di();return i.jsx(xa,{ref:r,...n,onClick:s=>{o.onClose(),t==null||t(s)},className:It({[Cl.close]:!o.unstyled},e),unstyled:o.unstyled})});yE.displayName="@mantine/core/ModalBaseCloseButton";const xE=g.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:o,...s},l)=>{const u=Di();return i.jsx(_i,{mounted:u.opened,transition:"pop",...u.transitionProps,onExited:()=>{var d,p,h;(d=u.onExitTransitionEnd)==null||d.call(u),(h=(p=u.transitionProps)==null?void 0:p.onExited)==null||h.call(p)},onEntered:()=>{var d,p,h;(d=u.onEnterTransitionEnd)==null||d.call(u),(h=(p=u.transitionProps)==null?void 0:p.onEntered)==null||h.call(p)},...e,children:d=>i.jsx("div",{...n,className:It({[Cl.inner]:!u.unstyled},n.className),children:i.jsx(lp,{active:u.opened&&u.trapFocus,innerRef:l,children:i.jsx(kr,{...s,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":u.bodyMounted?u.getBodyId():void 0,"aria-labelledby":u.titleMounted?u.getTitleId():void 0,style:[o,d],className:It({[Cl.content]:!u.unstyled},t),unstyled:u.unstyled,children:s.children})})})})});xE.displayName="@mantine/core/ModalBaseContent";const bE=g.forwardRef(({className:e,...t},n)=>{const r=Di();return i.jsx(se,{component:"header",ref:n,className:It({[Cl.header]:!r.unstyled},e),...t})});bE.displayName="@mantine/core/ModalBaseHeader";const a4={duration:200,timingFunction:"ease",transition:"fade"};function l4(e){const t=Di();return{...a4,...t.transitionProps,...e}}const wE=g.forwardRef(({onClick:e,transitionProps:t,style:n,visible:r,...o},s)=>{const l=Di(),u=l4(t);return i.jsx(_i,{mounted:r!==void 0?r:l.opened,...u,transition:"fade",children:d=>i.jsx(Jc,{ref:s,fixed:!0,style:[n,d],zIndex:l.zIndex,unstyled:l.unstyled,onClick:p=>{e==null||e(p),l.closeOnClickOutside&&l.onClose()},...o})})});wE.displayName="@mantine/core/ModalBaseOverlay";function c4(){const e=Di();return g.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const SE=g.forwardRef(({className:e,...t},n)=>{const r=c4(),o=Di();return i.jsx(se,{component:"h2",ref:n,className:It({[Cl.title]:!o.unstyled},e),...t,id:r})});SE.displayName="@mantine/core/ModalBaseTitle";function u4({children:e}){return i.jsx(i.Fragment,{children:e})}const[d4,zl]=vs({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var io={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 ww={},f4=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${Rn(t)} - ${oe(2)})`}}),cp=ue((e,t)=>{const n=ie("InputDescription",ww,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,size:p,__staticSelector:h,__inheritStyles:m=!0,variant:y,...x}=ie("InputDescription",ww,n),b=zl(),w=Ne({name:["InputWrapper",h],props:n,classes:io,className:o,style:s,classNames:r,styles:l,unstyled:u,rootSelector:"description",vars:d,varsResolver:f4}),j=m&&(b==null?void 0:b.getStyles)||w;return i.jsx(se,{component:"p",ref:t,variant:y,size:p,...j("description",b!=null&&b.getStyles?{className:o,style:s}:void 0),...x})});cp.classes=io;cp.displayName="@mantine/core/InputDescription";const p4={},h4=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${Rn(t)} - ${oe(2)})`}}),up=ue((e,t)=>{const n=ie("InputError",p4,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,size:p,__staticSelector:h,__inheritStyles:m=!0,variant:y,...x}=n,b=Ne({name:["InputWrapper",h],props:n,classes:io,className:o,style:s,classNames:r,styles:l,unstyled:u,rootSelector:"error",vars:d,varsResolver:h4}),w=zl(),j=m&&(w==null?void 0:w.getStyles)||b;return i.jsx(se,{component:"p",ref:t,variant:y,size:p,...j("error",w!=null&&w.getStyles?{className:o,style:s}:void 0),...x})});up.classes=io;up.displayName="@mantine/core/InputError";const Sw={labelElement:"label"},m4=(e,{size:t})=>({label:{"--input-label-size":Rn(t),"--input-asterisk-color":void 0}}),hu=ue((e,t)=>{const n=ie("InputLabel",Sw,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,labelElement:p,size:h,required:m,htmlFor:y,onMouseDown:x,children:b,__staticSelector:w,variant:j,mod:T,...P}=ie("InputLabel",Sw,n),k=Ne({name:["InputWrapper",w],props:n,classes:io,className:o,style:s,classNames:r,styles:l,unstyled:u,rootSelector:"label",vars:d,varsResolver:m4}),E=zl(),_=(E==null?void 0:E.getStyles)||k;return i.jsxs(se,{..._("label",E!=null&&E.getStyles?{className:o,style:s}:void 0),component:p,variant:j,size:h,ref:t,htmlFor:p==="label"?y:void 0,mod:[{required:m},T],onMouseDown:R=>{x==null||x(R),!R.defaultPrevented&&R.detail>1&&R.preventDefault()},...P,children:[b,m&&i.jsx("span",{..._("required"),"aria-hidden":!0,children:" *"})]})});hu.classes=io;hu.displayName="@mantine/core/InputLabel";const jw={},Kv=ue((e,t)=>{const n=ie("InputPlaceholder",jw,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,__staticSelector:p,variant:h,error:m,mod:y,...x}=ie("InputPlaceholder",jw,n),b=Ne({name:["InputPlaceholder",p],props:n,classes:io,className:o,style:s,classNames:r,styles:l,unstyled:u,rootSelector:"placeholder"});return i.jsx(se,{...b("placeholder"),mod:[{error:!!m},y],component:"span",variant:h,ref:t,...x})});Kv.classes=io;Kv.displayName="@mantine/core/InputPlaceholder";function g4(e,{hasDescription:t,hasError:n}){const r=e.findIndex(d=>d==="input"),o=e.slice(0,r),s=e.slice(r+1),l=t&&o.includes("description")||n&&o.includes("error");return{offsetBottom:t&&s.includes("description")||n&&s.includes("error"),offsetTop:l}}const v4={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},y4=(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)} - ${oe(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${Rn(t)} - ${oe(2)})`}}),Yv=ue((e,t)=>{const n=ie("InputWrapper",v4,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,size:p,variant:h,__staticSelector:m,inputContainer:y,inputWrapperOrder:x,label:b,error:w,description:j,labelProps:T,descriptionProps:P,errorProps:k,labelElement:E,children:_,withAsterisk:R,id:M,required:N,__stylesApiProps:L,mod:z,...q}=n,G=Ne({name:["InputWrapper",m],props:L||n,classes:io,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:y4}),Y={size:p,variant:h,__staticSelector:m},Q=mr(M),te=typeof R=="boolean"?R:N,V=(k==null?void 0:k.id)||`${Q}-error`,O=(P==null?void 0:P.id)||`${Q}-description`,A=Q,B=!!w&&typeof w!="boolean",I=!!j,F=`${B?V:""} ${I?O:""}`,J=F.trim().length>0?F.trim():void 0,de=(T==null?void 0:T.id)||`${Q}-label`,Ee=b&&i.jsx(hu,{labelElement:E,id:de,htmlFor:A,required:te,...Y,...T,children:b},"label"),ve=I&&i.jsx(cp,{...P,...Y,size:(P==null?void 0:P.size)||Y.size,id:(P==null?void 0:P.id)||O,children:j},"description"),we=i.jsx(g.Fragment,{children:y(_)},"input"),_e=B&&g.createElement(up,{...k,...Y,size:(k==null?void 0:k.size)||Y.size,key:"error",id:(k==null?void 0:k.id)||V},w),fe=x.map(Je=>{switch(Je){case"label":return Ee;case"input":return we;case"description":return ve;case"error":return _e;default:return null}});return i.jsx(d4,{value:{getStyles:G,describedBy:J,inputId:A,labelId:de,...g4(x,{hasDescription:I,hasError:B})},children:i.jsx(se,{ref:t,variant:h,size:p,mod:[{error:!!w},z],...G("root"),...q,children:fe})})});Yv.classes=io;Yv.displayName="@mantine/core/InputWrapper";const x4={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},b4=(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":et(t.size,"input-height"),"--input-fz":Rn(t.size),"--input-radius":t.radius===void 0?void 0:At(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?oe(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?oe(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?et(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),pn=or((e,t)=>{const n=ie("Input",x4,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,required:d,__staticSelector:p,__stylesApiProps:h,size:m,wrapperProps:y,error:x,disabled:b,leftSection:w,leftSectionProps:j,leftSectionWidth:T,rightSection:P,rightSectionProps:k,rightSectionWidth:E,rightSectionPointerEvents:_,leftSectionPointerEvents:R,variant:M,vars:N,pointer:L,multiline:z,radius:q,id:G,withAria:Y,withErrorStyles:Q,mod:te,inputSize:V,...O}=n,{styleProps:A,rest:B}=Ri(O),I=zl(),F={offsetBottom:I==null?void 0:I.offsetBottom,offsetTop:I==null?void 0:I.offsetTop},J=Ne({name:["Input",p],props:h||n,classes:io,className:o,style:s,classNames:r,styles:l,unstyled:u,stylesCtx:F,rootSelector:"wrapper",vars:N,varsResolver:b4}),de=Y?{required:d,disabled:b,"aria-invalid":!!x,"aria-describedby":I==null?void 0:I.describedBy,id:(I==null?void 0:I.inputId)||G}:{};return i.jsxs(se,{...J("wrapper"),...A,...y,mod:[{error:!!x&&Q,pointer:L,disabled:b,multiline:z,"data-with-right-section":!!P,"data-with-left-section":!!w},te],variant:M,size:m,children:[w&&i.jsx("div",{...j,"data-position":"left",...J("section",{className:j==null?void 0:j.className,style:j==null?void 0:j.style}),children:w}),i.jsx(se,{component:"input",...B,...de,ref:t,required:d,mod:{disabled:b,error:!!x&&Q},variant:M,__size:V,...J("input")}),P&&i.jsx("div",{...k,"data-position":"right",...J("section",{className:k==null?void 0:k.className,style:k==null?void 0:k.style}),children:P})]})});pn.classes=io;pn.Wrapper=Yv;pn.Label=hu;pn.Error=up;pn.Description=cp;pn.Placeholder=Kv;pn.displayName="@mantine/core/Input";function w4(e,t,n){const r=ie(e,t,n),{label:o,description:s,error:l,required:u,classNames:d,styles:p,className:h,unstyled:m,__staticSelector:y,__stylesApiProps:x,errorProps:b,labelProps:w,descriptionProps:j,wrapperProps:T,id:P,size:k,style:E,inputContainer:_,inputWrapperOrder:R,withAsterisk:M,variant:N,vars:L,mod:z,...q}=r,{styleProps:G,rest:Y}=Ri(q),Q={label:o,description:s,error:l,required:u,classNames:d,className:h,__staticSelector:y,__stylesApiProps:x||r,errorProps:b,labelProps:w,descriptionProps:j,unstyled:m,styles:p,size:k,style:E,inputContainer:_,inputWrapperOrder:R,withAsterisk:M,variant:N,id:P,mod:z,...T};return{...Y,classNames:d,styles:p,unstyled:m,wrapperProps:{...Q,...G},inputProps:{required:u,classNames:d,styles:p,unstyled:m,size:k,__staticSelector:y,__stylesApiProps:x||r,error:l,variant:N,id:P}}}const S4={__staticSelector:"InputBase",withAria:!0},Dr=or((e,t)=>{const{inputProps:n,wrapperProps:r,...o}=w4("InputBase",S4,e);return i.jsx(pn.Wrapper,{...r,children:i.jsx(pn,{...n,...o,ref:t})})});Dr.classes={...pn.classes,...pn.Wrapper.classes};Dr.displayName="@mantine/core/InputBase";const j4={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 jE={root:"m_8bffd616"};const C4={},oa=or((e,t)=>{const n=ie("Flex",C4,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,gap:p,rowGap:h,columnGap:m,align:y,justify:x,wrap:b,direction:w,...j}=n,T=Ne({name:"Flex",classes:jE,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d}),P=ln(),k=fu(),E=gC({styleProps:{gap:p,rowGap:h,columnGap:m,align:y,justify:x,wrap:b,direction:w},theme:P,data:j4});return i.jsxs(i.Fragment,{children:[E.hasResponsiveStyles&&i.jsx(ga,{selector:`.${k}`,styles:E.styles,media:E.media}),i.jsx(se,{ref:t,...T("root",{className:k,style:gs(E.inlineStyles)}),...j})]})});oa.classes=jE;oa.displayName="@mantine/core/Flex";function E4(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 k4({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const o=g.useRef(-1),[s,l]=g.useState(!1),[u,d]=g.useState(typeof r=="boolean"?r:!1),p=()=>{if(!e||!t||!n.current)return;const x=e.getBoundingClientRect(),b=t.getBoundingClientRect(),w=window.getComputedStyle(e),j=window.getComputedStyle(t),T=us(w.borderTopWidth)+us(j.borderTopWidth),P=us(w.borderLeftWidth)+us(j.borderLeftWidth),k={top:x.top-b.top-T,left:x.left-b.left-P,width:x.width,height:x.height};n.current.style.transform=`translateY(${k.top}px) translateX(${k.left}px)`,n.current.style.width=`${k.width}px`,n.current.style.height=`${k.height}px`},h=()=>{window.clearTimeout(o.current),n.current&&(n.current.style.transitionDuration="0ms"),p(),o.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},m=g.useRef(null),y=g.useRef(null);return g.useEffect(()=>{if(p(),e)return m.current=new ResizeObserver(h),m.current.observe(e),t&&(y.current=new ResizeObserver(h),y.current.observe(t)),()=>{var x,b;(x=m.current)==null||x.disconnect(),(b=y.current)==null||b.disconnect()}},[t,e]),g.useEffect(()=>{if(t){const x=b=>{E4(b.target,t)&&(h(),d(!1))};return t.addEventListener("transitionend",x),()=>{t.removeEventListener("transitionend",x)}}},[t]),ND(()=>{uC()!=="test"&&l(!0)},20,{autoInvoke:!0}),AD(x=>{x.forEach(b=>{b.type==="attributes"&&b.attributeName==="dir"&&h()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:s,hidden:u}}var CE={root:"m_96b553a6"};const T4={},P4=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),Xv=ue((e,t)=>{const n=ie("FloatingIndicator",T4,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,target:p,parent:h,transitionDuration:m,mod:y,displayAfterTransitionEnd:x,...b}=n,w=Ne({name:"FloatingIndicator",classes:CE,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:P4}),j=g.useRef(null),{initialized:T,hidden:P}=k4({target:p,parent:h,ref:j,displayAfterTransitionEnd:x}),k=In(t,j);return!p||!h?null:i.jsx(se,{ref:k,mod:[{initialized:T,hidden:P},y],...w("root"),...b})});Xv.displayName="@mantine/core/FloatingIndicator";Xv.classes=CE;var EE={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 R4={},_4=(e,{radius:t,color:n,variant:r,autoContrast:o})=>{const s=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||"light",autoContrast:o});return{root:{"--alert-radius":t===void 0?void 0:At(t),"--alert-bg":n||r?s.background:void 0,"--alert-color":s.color,"--alert-bd":n||r?s.border:void 0}}},xs=ue((e,t)=>{const n=ie("Alert",R4,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,radius:p,color:h,title:m,children:y,id:x,icon:b,withCloseButton:w,onClose:j,closeButtonLabel:T,variant:P,autoContrast:k,...E}=n,_=Ne({name:"Alert",classes:EE,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:_4}),R=mr(x),M=m&&`${R}-title`||void 0,N=`${R}-body`;return i.jsx(se,{id:R,..._("root",{variant:P}),variant:P,ref:t,...E,role:"alert","aria-describedby":N,"aria-labelledby":M,children:i.jsxs("div",{..._("wrapper"),children:[b&&i.jsx("div",{..._("icon"),children:b}),i.jsxs("div",{..._("body"),children:[m&&i.jsx("div",{..._("title"),"data-with-close-button":w||void 0,children:i.jsx("span",{id:M,..._("label"),children:m})}),y&&i.jsx("div",{id:N,..._("message"),"data-variant":P,children:y})]}),w&&i.jsx(xa,{..._("closeButton"),onClick:j,variant:"transparent",size:16,iconSize:16,"aria-label":T,unstyled:u})]})})});xs.classes=EE;xs.displayName="@mantine/core/Alert";var kE={root:"m_b6d8b162"};function D4(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const I4={inherit:!1},N4=(e,{variant:t,lineClamp:n,gradient:r,size:o,color:s})=>({root:{"--text-fz":Rn(o),"--text-lh":tC(o),"--text-gradient":t==="gradient"?Rg(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":s?Lt(s,e):void 0}}),$e=or((e,t)=>{const n=ie("Text",I4,e),{lineClamp:r,truncate:o,inline:s,inherit:l,gradient:u,span:d,__staticSelector:p,vars:h,className:m,style:y,classNames:x,styles:b,unstyled:w,variant:j,mod:T,size:P,...k}=n,E=Ne({name:["Text",p],props:n,classes:kE,className:m,style:y,classNames:x,styles:b,unstyled:w,vars:h,varsResolver:N4});return i.jsx(se,{...E("root",{focusable:!0}),ref:t,component:d?"span":"p",variant:j,mod:[{"data-truncate":D4(o),"data-line-clamp":typeof r=="number","data-inline":s,"data-inherit":l},T],size:P,...k})});$e.classes=kE;$e.displayName="@mantine/core/Text";var TE={root:"m_849cf0da"};const A4={underline:"hover"},Rt=or((e,t)=>{const{underline:n,className:r,unstyled:o,mod:s,...l}=ie("Anchor",A4,e);return i.jsx($e,{component:"a",ref:t,className:It({[TE.root]:!o},r),...l,mod:[{underline:n},s],__staticSelector:"Anchor",unstyled:o})});Rt.classes=TE;Rt.displayName="@mantine/core/Anchor";const[M4,Bl]=hr("AppShell was not found in tree");var bs={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const O4={},Jv=ue((e,t)=>{const n=ie("AppShellAside",O4,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,withBorder:p,zIndex:h,mod:m,...y}=n,x=Bl();return x.disabled?null:i.jsx(se,{component:"aside",ref:t,mod:[{"with-border":p??x.withBorder},m],...x.getStyles("aside",{className:o,classNames:r,styles:l,style:s}),...y,__vars:{"--app-shell-aside-z-index":`calc(${h??x.zIndex} + 1)`}})});Jv.classes=bs;Jv.displayName="@mantine/core/AppShellAside";const L4={},Zv=ue((e,t)=>{var b;const n=ie("AppShellFooter",L4,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,withBorder:p,zIndex:h,mod:m,...y}=n,x=Bl();return x.disabled?null:i.jsx(se,{component:"footer",ref:t,mod:[{"with-border":p??x.withBorder},m],...x.getStyles("footer",{className:It({[wl.classNames.zeroRight]:x.offsetScrollbars},o),classNames:r,styles:l,style:s}),...y,__vars:{"--app-shell-footer-z-index":(b=h??x.zIndex)==null?void 0:b.toString()}})});Zv.classes=bs;Zv.displayName="@mantine/core/AppShellFooter";const $4={},ey=ue((e,t)=>{var b;const n=ie("AppShellHeader",$4,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,withBorder:p,zIndex:h,mod:m,...y}=n,x=Bl();return x.disabled?null:i.jsx(se,{component:"header",ref:t,mod:[{"with-border":p??x.withBorder},m],...x.getStyles("header",{className:It({[wl.classNames.zeroRight]:x.offsetScrollbars},o),classNames:r,styles:l,style:s}),...y,__vars:{"--app-shell-header-z-index":(b=h??x.zIndex)==null?void 0:b.toString()}})});ey.classes=bs;ey.displayName="@mantine/core/AppShellHeader";const F4={},ty=ue((e,t)=>{const n=ie("AppShellMain",F4,e),{classNames:r,className:o,style:s,styles:l,vars:u,...d}=n,p=Bl();return i.jsx(se,{component:"main",ref:t,...p.getStyles("main",{className:o,style:s,classNames:r,styles:l}),...d})});ty.classes=bs;ty.displayName="@mantine/core/AppShellMain";function mu(e){return typeof e=="object"?e.base:e}function gu(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 vu(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function z4({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:o}){var d,p,h;const s=r==null?void 0:r.width,l="translateX(var(--app-shell-aside-width))",u="translateX(calc(var(--app-shell-aside-width) * -1))";if(r!=null&&r.breakpoint&&!((d=r==null?void 0:r.collapsed)!=null&&d.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"),gu(s)){const m=oe(mu(s));e["--app-shell-aside-width"]=m,e["--app-shell-aside-offset"]=m}if(vu(s)&&(typeof s.base<"u"&&(e["--app-shell-aside-width"]=oe(s.base),e["--app-shell-aside-offset"]=oe(s.base)),Gt(s).forEach(m=>{m!=="base"&&(t[m]=t[m]||{},t[m]["--app-shell-aside-width"]=oe(s[m]),t[m]["--app-shell-aside-offset"]=oe(s[m]))})),(p=r==null?void 0:r.collapsed)!=null&&p.desktop){const m=r.breakpoint;t[m]=t[m]||{},t[m]["--app-shell-aside-transform"]=l,t[m]["--app-shell-aside-transform-rtl"]=u,t[m]["--app-shell-aside-offset"]="0px !important"}if((h=r==null?void 0:r.collapsed)!=null&&h.mobile){const m=Sv(r.breakpoint,o.breakpoints)-.1;n[m]=n[m]||{},n[m]["--app-shell-aside-width"]="100%",n[m]["--app-shell-aside-offset"]="0px",n[m]["--app-shell-aside-transform"]=l,n[m]["--app-shell-aside-transform-rtl"]=u}}function B4({baseStyles:e,minMediaStyles:t,footer:n}){const r=n==null?void 0:n.height,o="translateY(var(--app-shell-footer-height))",s=(n==null?void 0:n.offset)??!0;if(gu(r)){const l=oe(mu(r));e["--app-shell-footer-height"]=l,s&&(e["--app-shell-footer-offset"]=l)}vu(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=oe(r.base),s&&(e["--app-shell-footer-offset"]=oe(r.base))),Gt(r).forEach(l=>{l!=="base"&&(t[l]=t[l]||{},t[l]["--app-shell-footer-height"]=oe(r[l]),s&&(t[l]["--app-shell-footer-offset"]=oe(r[l])))})),n!=null&&n.collapsed&&(e["--app-shell-footer-transform"]=o,e["--app-shell-footer-offset"]="0px !important")}function U4({baseStyles:e,minMediaStyles:t,header:n}){const r=n==null?void 0:n.height,o="translateY(calc(var(--app-shell-header-height) * -1))",s=(n==null?void 0:n.offset)??!0;if(gu(r)){const l=oe(mu(r));e["--app-shell-header-height"]=l,s&&(e["--app-shell-header-offset"]=l)}vu(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=oe(r.base),s&&(e["--app-shell-header-offset"]=oe(r.base))),Gt(r).forEach(l=>{l!=="base"&&(t[l]=t[l]||{},t[l]["--app-shell-header-height"]=oe(r[l]),s&&(t[l]["--app-shell-header-offset"]=oe(r[l])))})),n!=null&&n.collapsed&&(e["--app-shell-header-transform"]=o,e["--app-shell-header-offset"]="0px !important")}function V4({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:o}){var d,p,h;const s=r==null?void 0:r.width,l="translateX(calc(var(--app-shell-navbar-width) * -1))",u="translateX(var(--app-shell-navbar-width))";if(r!=null&&r.breakpoint&&!((d=r==null?void 0:r.collapsed)!=null&&d.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"),gu(s)){const m=oe(mu(s));e["--app-shell-navbar-width"]=m,e["--app-shell-navbar-offset"]=m}if(vu(s)&&(typeof s.base<"u"&&(e["--app-shell-navbar-width"]=oe(s.base),e["--app-shell-navbar-offset"]=oe(s.base)),Gt(s).forEach(m=>{m!=="base"&&(t[m]=t[m]||{},t[m]["--app-shell-navbar-width"]=oe(s[m]),t[m]["--app-shell-navbar-offset"]=oe(s[m]))})),(p=r==null?void 0:r.collapsed)!=null&&p.desktop){const m=r.breakpoint;t[m]=t[m]||{},t[m]["--app-shell-navbar-transform"]=l,t[m]["--app-shell-navbar-transform-rtl"]=u,t[m]["--app-shell-navbar-offset"]="0px !important"}if((h=r==null?void 0:r.collapsed)!=null&&h.mobile){const m=Sv(r.breakpoint,o.breakpoints)-.1;n[m]=n[m]||{},n[m]["--app-shell-navbar-width"]="100%",n[m]["--app-shell-navbar-offset"]="0px",n[m]["--app-shell-navbar-transform"]=l,n[m]["--app-shell-navbar-transform-rtl"]=u}}function ng(e){return Number(e)===0?"0px":Pn(e)}function W4({padding:e,baseStyles:t,minMediaStyles:n}){gu(e)&&(t["--app-shell-padding"]=ng(mu(e))),vu(e)&&(e.base&&(t["--app-shell-padding"]=ng(e.base)),Gt(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=ng(e[r]))}))}function H4({navbar:e,header:t,footer:n,aside:r,padding:o,theme:s}){const l={},u={},d={};V4({baseStyles:d,minMediaStyles:l,maxMediaStyles:u,navbar:e,theme:s}),z4({baseStyles:d,minMediaStyles:l,maxMediaStyles:u,aside:r,theme:s}),U4({baseStyles:d,minMediaStyles:l,header:t}),B4({baseStyles:d,minMediaStyles:l,footer:n}),W4({baseStyles:d,minMediaStyles:l,padding:o});const p=Kc(Gt(l),s.breakpoints).map(y=>({query:`(min-width: ${vf(y.px)})`,styles:l[y.value]})),h=Kc(Gt(u),s.breakpoints).map(y=>({query:`(max-width: ${vf(y.px)})`,styles:u[y.value]})),m=[...p,...h];return{baseStyles:d,media:m}}function q4({navbar:e,header:t,aside:n,footer:r,padding:o}){const s=ln(),l=ys(),{media:u,baseStyles:d}=H4({navbar:e,header:t,footer:r,aside:n,padding:o,theme:s});return i.jsx(ga,{media:u,styles:d,selector:l.cssVariablesSelector})}const G4={},ny=ue((e,t)=>{const n=ie("AppShellNavbar",G4,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,withBorder:p,zIndex:h,mod:m,...y}=n,x=Bl();return x.disabled?null:i.jsx(se,{component:"nav",ref:t,mod:[{"with-border":p??x.withBorder},m],...x.getStyles("navbar",{className:o,classNames:r,styles:l,style:s}),...y,__vars:{"--app-shell-navbar-z-index":`calc(${h??x.zIndex} + 1)`}})});ny.classes=bs;ny.displayName="@mantine/core/AppShellNavbar";const Q4={},ry=or((e,t)=>{const n=ie("AppShellSection",Q4,e),{classNames:r,className:o,style:s,styles:l,vars:u,grow:d,mod:p,...h}=n,m=Bl();return i.jsx(se,{ref:t,mod:[{grow:d},p],...m.getStyles("section",{className:o,style:s,classNames:r,styles:l}),...h})});ry.classes=bs;ry.displayName="@mantine/core/AppShellSection";function K4({transitionDuration:e,disabled:t}){const[n,r]=g.useState(!0),o=g.useRef(-1),s=g.useRef(-1);return cC("resize",()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>g.startTransition(()=>{r(!1)}),200)}),Ml(()=>{r(!0),clearTimeout(s.current),s.current=window.setTimeout(()=>g.startTransition(()=>{r(!1)}),e||0)},[t,e]),n}const Y4={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Vr("app")},X4=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),Pr=ue((e,t)=>{const n=ie("AppShell",Y4,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,navbar:p,withBorder:h,padding:m,transitionDuration:y,transitionTimingFunction:x,header:b,zIndex:w,layout:j,disabled:T,aside:P,footer:k,offsetScrollbars:E=j!=="alt",mod:_,...R}=n,M=Ne({name:"AppShell",classes:bs,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:X4}),N=K4({disabled:T,transitionDuration:y});return i.jsxs(M4,{value:{getStyles:M,withBorder:h,zIndex:w,disabled:T,offsetScrollbars:E},children:[i.jsx(q4,{navbar:p,header:b,aside:P,footer:k,padding:m}),i.jsx(se,{ref:t,...M("root"),mod:[{resizing:N,layout:j,disabled:T},_],...R})]})});Pr.classes=bs;Pr.displayName="@mantine/core/AppShell";Pr.Navbar=ny;Pr.Header=ey;Pr.Main=ty;Pr.Aside=Jv;Pr.Footer=Zv;Pr.Section=ry;function PE(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=>PE(t))}:e}function RE(e){return e?e.map(t=>PE(t)):[]}function _E(e){return e.reduce((t,n)=>"group"in n?{...t,..._E(n.items)}:(t[n.value]=n,t),{})}var _r={dropdown:"m_88b62a41",search:"m_985517d8",options:"m_b2821a6e",option:"m_92253aa5",empty:"m_2530cd1d",header:"m_858f94bd",footer:"m_82b967cb",group:"m_254f3e4f",groupLabel:"m_2bb2e9e5",chevron:"m_2943220b",optionsDropdownOption:"m_390b5f4",optionsDropdownCheckIcon:"m_8ee53fc2"};const J4={error:null},Z4=(e,{size:t})=>({chevron:{"--combobox-chevron-size":et(t,"combobox-chevron-size")}}),dp=ue((e,t)=>{const n=ie("ComboboxChevron",J4,e),{size:r,error:o,style:s,className:l,classNames:u,styles:d,unstyled:p,vars:h,mod:m,...y}=n,x=Ne({name:"ComboboxChevron",classes:_r,props:n,style:s,className:l,classNames:u,styles:d,unstyled:p,vars:h,varsResolver:Z4,rootSelector:"chevron"});return i.jsx(se,{component:"svg",...y,...x("chevron"),size:r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:o},m],ref:t,children:i.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"})})});dp.classes=_r;dp.displayName="@mantine/core/ComboboxChevron";const[e3,so]=hr("Combobox component was not found in tree"),DE=g.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...o},s)=>i.jsx(xa,{ref:s,size:e||"sm",variant:"transparent",tabIndex:-1,"aria-hidden":!0,...o,onMouseDown:l=>{l.preventDefault(),t==null||t(l)},onClick:l=>{r(),n==null||n(l)}}));DE.displayName="@mantine/core/ComboboxClearButton";const t3={},oy=ue((e,t)=>{const{classNames:n,styles:r,className:o,style:s,hidden:l,...u}=ie("ComboboxDropdown",t3,e),d=so();return i.jsx(Ro.Dropdown,{...u,ref:t,role:"presentation","data-hidden":l||void 0,...d.getStyles("dropdown",{className:o,style:s,classNames:n,styles:r})})});oy.classes=_r;oy.displayName="@mantine/core/ComboboxDropdown";const n3={refProp:"ref"},IE=ue((e,t)=>{const{children:n,refProp:r}=ie("ComboboxDropdownTarget",n3,e);if(so(),!Ti(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 i.jsx(Ro.Target,{ref:t,refProp:r,children:n})});IE.displayName="@mantine/core/ComboboxDropdownTarget";const r3={},iy=ue((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:l,...u}=ie("ComboboxEmpty",r3,e),d=so();return i.jsx(se,{ref:t,...d.getStyles("empty",{className:r,classNames:n,styles:s,style:o}),...u})});iy.classes=_r;iy.displayName="@mantine/core/ComboboxEmpty";function sy({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:o,autoComplete:s}){const l=so(),[u,d]=g.useState(null),p=m=>{if(e==null||e(m),!l.readOnly&&t){if(m.nativeEvent.isComposing)return;if(m.nativeEvent.code==="ArrowDown"&&(m.preventDefault(),l.store.dropdownOpened?d(l.store.selectNextOption()):(l.store.openDropdown("keyboard"),d(l.store.selectActiveOption()),l.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),m.nativeEvent.code==="ArrowUp"&&(m.preventDefault(),l.store.dropdownOpened?d(l.store.selectPreviousOption()):(l.store.openDropdown("keyboard"),d(l.store.selectActiveOption()),l.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),m.nativeEvent.code==="Enter"||m.nativeEvent.code==="NumpadEnter"){if(m.nativeEvent.keyCode===229)return;const y=l.store.getSelectedOptionIndex();l.store.dropdownOpened&&y!==-1?(m.preventDefault(),l.store.clickSelectedOption()):o==="button"&&(m.preventDefault(),l.store.openDropdown("keyboard"))}m.nativeEvent.code==="Escape"&&l.store.closeDropdown("keyboard"),m.nativeEvent.code==="Space"&&o==="button"&&(m.preventDefault(),l.store.toggleDropdown("keyboard"))}};return{...n?{"aria-haspopup":"listbox","aria-expanded":r&&!!(l.store.listId&&l.store.dropdownOpened)||void 0,"aria-controls":l.store.dropdownOpened?l.store.listId:void 0,"aria-activedescendant":l.store.dropdownOpened&&u||void 0,autoComplete:s,"data-expanded":l.store.dropdownOpened||void 0,"data-mantine-stop-propagation":l.store.dropdownOpened||void 0}:{},onKeyDown:p}}const o3={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},NE=ue((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:s,withExpandedAttribute:l,targetType:u,autoComplete:d,...p}=ie("ComboboxEventsTarget",o3,e);if(!Ti(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 h=so(),m=sy({targetType:u,withAriaAttributes:s,withKeyboardNavigation:o,withExpandedAttribute:l,onKeyDown:n.props.onKeyDown,autoComplete:d});return g.cloneElement(n,{...m,...p,[r]:In(t,h.store.targetRef,Xf(n))})});NE.displayName="@mantine/core/ComboboxEventsTarget";const i3={},ay=ue((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:l,...u}=ie("ComboboxFooter",i3,e),d=so();return i.jsx(se,{ref:t,...d.getStyles("footer",{className:r,classNames:n,style:o,styles:s}),...u,onMouseDown:p=>{p.preventDefault()}})});ay.classes=_r;ay.displayName="@mantine/core/ComboboxFooter";const s3={},ly=ue((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:l,children:u,label:d,...p}=ie("ComboboxGroup",s3,e),h=so();return i.jsxs(se,{ref:t,...h.getStyles("group",{className:r,classNames:n,style:o,styles:s}),...p,children:[d&&i.jsx("div",{...h.getStyles("groupLabel",{classNames:n,styles:s}),children:d}),u]})});ly.classes=_r;ly.displayName="@mantine/core/ComboboxGroup";const a3={},cy=ue((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:l,...u}=ie("ComboboxHeader",a3,e),d=so();return i.jsx(se,{ref:t,...d.getStyles("header",{className:r,classNames:n,style:o,styles:s}),...u,onMouseDown:p=>{p.preventDefault()}})});cy.classes=_r;cy.displayName="@mantine/core/ComboboxHeader";function AE({value:e,valuesDivider:t=",",...n}){return i.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}AE.displayName="@mantine/core/ComboboxHiddenInput";const l3={},uy=ue((e,t)=>{const n=ie("ComboboxOption",l3,e),{classNames:r,className:o,style:s,styles:l,vars:u,onClick:d,id:p,active:h,onMouseDown:m,onMouseOver:y,disabled:x,selected:b,mod:w,...j}=n,T=so(),P=g.useId(),k=p||P;return i.jsx(se,{...T.getStyles("option",{className:o,classNames:r,styles:l,style:s}),...j,ref:t,id:k,mod:["combobox-option",{"combobox-active":h,"combobox-disabled":x,"combobox-selected":b},w],role:"option",onClick:E=>{var _;x?E.preventDefault():((_=T.onOptionSubmit)==null||_.call(T,n.value,n),d==null||d(E))},onMouseDown:E=>{E.preventDefault(),m==null||m(E)},onMouseOver:E=>{T.resetSelectionOnOptionHover&&T.store.resetSelectedOption(),y==null||y(E)}})});uy.classes=_r;uy.displayName="@mantine/core/ComboboxOption";const c3={},dy=ue((e,t)=>{const n=ie("ComboboxOptions",c3,e),{classNames:r,className:o,style:s,styles:l,id:u,onMouseDown:d,labelledBy:p,...h}=n,m=so(),y=mr(u);return g.useEffect(()=>{m.store.setListId(y)},[y]),i.jsx(se,{ref:t,...m.getStyles("options",{className:o,style:s,classNames:r,styles:l}),...h,id:y,role:"listbox","aria-labelledby":p,onMouseDown:x=>{x.preventDefault(),d==null||d(x)}})});dy.classes=_r;dy.displayName="@mantine/core/ComboboxOptions";const u3={withAriaAttributes:!0,withKeyboardNavigation:!0},fy=ue((e,t)=>{const n=ie("ComboboxSearch",u3,e),{classNames:r,styles:o,unstyled:s,vars:l,withAriaAttributes:u,onKeyDown:d,withKeyboardNavigation:p,size:h,...m}=n,y=so(),x=y.getStyles("search"),b=sy({targetType:"input",withAriaAttributes:u,withKeyboardNavigation:p,withExpandedAttribute:!1,onKeyDown:d,autoComplete:"off"});return i.jsx(pn,{ref:In(t,y.store.searchRef),classNames:[{input:x.className},r],styles:[{input:x.style},o],size:h||y.size,...b,...m,__staticSelector:"Combobox"})});fy.classes=_r;fy.displayName="@mantine/core/ComboboxSearch";const d3={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},ME=ue((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:s,withExpandedAttribute:l,targetType:u,autoComplete:d,...p}=ie("ComboboxTarget",d3,e);if(!Ti(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 h=so(),m=sy({targetType:u,withAriaAttributes:s,withKeyboardNavigation:o,withExpandedAttribute:l,onKeyDown:n.props.onKeyDown,autoComplete:d}),y=g.cloneElement(n,{...m,...p});return i.jsx(Ro.Target,{ref:In(t,h.store.targetRef),children:y})});ME.displayName="@mantine/core/ComboboxTarget";function f3(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 p3(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 h3(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function yu({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:o,loop:s=!0,scrollBehavior:l="instant"}={}){const[u,d]=Wn({value:t,defaultValue:e,finalValue:!1,onChange:n}),p=g.useRef(null),h=g.useRef(-1),m=g.useRef(null),y=g.useRef(null),x=g.useRef(-1),b=g.useRef(-1),w=g.useRef(-1),j=g.useCallback((V="unknown")=>{u||(d(!0),o==null||o(V))},[d,o,u]),T=g.useCallback((V="unknown")=>{u&&(d(!1),r==null||r(V))},[d,r,u]),P=g.useCallback((V="unknown")=>{u?T(V):j(V)},[T,j,u]),k=g.useCallback(()=>{const V=document.querySelector(`#${p.current} [data-combobox-selected]`);V==null||V.removeAttribute("data-combobox-selected"),V==null||V.removeAttribute("aria-selected")},[]),E=g.useCallback(V=>{const O=document.getElementById(p.current),A=O==null?void 0:O.querySelectorAll("[data-combobox-option]");if(!A)return null;const B=V>=A.length?0:V<0?A.length-1:V;return h.current=B,A!=null&&A[B]&&!A[B].hasAttribute("data-combobox-disabled")?(k(),A[B].setAttribute("data-combobox-selected","true"),A[B].setAttribute("aria-selected","true"),A[B].scrollIntoView({block:"nearest",behavior:l}),A[B].id):null},[l,k]),_=g.useCallback(()=>{const V=document.querySelector(`#${p.current} [data-combobox-active]`);if(V){const O=document.querySelectorAll(`#${p.current} [data-combobox-option]`),A=Array.from(O).findIndex(B=>B===V);return E(A)}return E(0)},[E]),R=g.useCallback(()=>E(p3(h.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),s)),[E,s]),M=g.useCallback(()=>E(f3(h.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),s)),[E,s]),N=g.useCallback(()=>E(h3(document.querySelectorAll(`#${p.current} [data-combobox-option]`))),[E]),L=g.useCallback((V="selected",O)=>{w.current=window.setTimeout(()=>{var I;const A=document.querySelectorAll(`#${p.current} [data-combobox-option]`),B=Array.from(A).findIndex(F=>F.hasAttribute(`data-combobox-${V}`));h.current=B,O!=null&&O.scrollIntoView&&((I=A[B])==null||I.scrollIntoView({block:"nearest",behavior:l}))},0)},[]),z=g.useCallback(()=>{h.current=-1,k()},[k]),q=g.useCallback(()=>{const V=document.querySelectorAll(`#${p.current} [data-combobox-option]`),O=V==null?void 0:V[h.current];O==null||O.click()},[]),G=g.useCallback(V=>{p.current=V},[]),Y=g.useCallback(()=>{x.current=window.setTimeout(()=>m.current.focus(),0)},[]),Q=g.useCallback(()=>{b.current=window.setTimeout(()=>y.current.focus(),0)},[]),te=g.useCallback(()=>h.current,[]);return g.useEffect(()=>()=>{window.clearTimeout(x.current),window.clearTimeout(b.current),window.clearTimeout(w.current)},[]),{dropdownOpened:u,openDropdown:j,closeDropdown:T,toggleDropdown:P,selectedOptionIndex:h.current,getSelectedOptionIndex:te,selectOption:E,selectFirstOption:N,selectActiveOption:_,selectNextOption:R,selectPreviousOption:M,resetSelectedOption:z,updateSelectedOptionIndex:L,listId:p.current,setListId:G,clickSelectedOption:q,searchRef:m,focusSearchInput:Y,targetRef:y,focusTarget:Q}}const m3={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},g3=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":Rn(t),"--combobox-option-padding":et(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:oe(n),"--combobox-option-fz":Rn(t),"--combobox-option-padding":et(t,"combobox-option-padding")}});function st(e){const t=ie("Combobox",m3,e),{classNames:n,styles:r,unstyled:o,children:s,store:l,vars:u,onOptionSubmit:d,onClose:p,size:h,dropdownPadding:m,resetSelectionOnOptionHover:y,__staticSelector:x,readOnly:b,...w}=t,j=yu(),T=l||j,P=Ne({name:x||"Combobox",classes:_r,props:t,classNames:n,styles:r,unstyled:o,vars:u,varsResolver:g3}),k=()=>{p==null||p(),T.closeDropdown()};return i.jsx(e3,{value:{getStyles:P,store:T,onOptionSubmit:d,size:h,resetSelectionOnOptionHover:y,readOnly:b},children:i.jsx(Ro,{opened:T.dropdownOpened,...w,onChange:E=>!E&&k(),withRoles:!1,unstyled:o,children:s})})}const v3=e=>e;st.extend=v3;st.classes=_r;st.displayName="@mantine/core/Combobox";st.Target=ME;st.Dropdown=oy;st.Options=dy;st.Option=uy;st.Search=fy;st.Empty=iy;st.Chevron=dp;st.Footer=ay;st.Header=cy;st.EventsTarget=NE;st.DropdownTarget=IE;st.Group=ly;st.ClearButton=DE;st.HiddenInput=AE;var OE={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const LE=OE,fp=g.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:o,unstyled:s,children:l,label:u,description:d,id:p,disabled:h,error:m,size:y,labelPosition:x="left",bodyElement:b="div",labelElement:w="label",variant:j,style:T,vars:P,mod:k,...E},_)=>{const R=Ne({name:e,props:t,className:n,style:T,classes:OE,classNames:r,styles:o,unstyled:s});return i.jsx(se,{...R("root"),ref:_,__vars:{"--label-fz":Rn(y),"--label-lh":et(y,"label-lh")},mod:[{"label-position":x},k],variant:j,size:y,...E,children:i.jsxs(se,{component:b,htmlFor:b==="label"?p:void 0,...R("body"),children:[l,i.jsxs("div",{...R("labelWrapper"),"data-disabled":h||void 0,children:[u&&i.jsx(se,{component:w,htmlFor:w==="label"?p:void 0,...R("label"),"data-disabled":h||void 0,children:u}),d&&i.jsx(pn.Description,{size:y,__inheritStyles:!1,...R("description"),children:d}),m&&typeof m!="boolean"&&i.jsx(pn.Error,{size:y,__inheritStyles:!1,...R("error"),children:m})]})]})})});fp.displayName="@mantine/core/InlineInput";const $E=g.createContext(null),y3=$E.Provider,FE=()=>g.useContext($E),[x3,b3]=vs();var zE={card:"m_26775b0a"};const w3={withBorder:!0},S3=(e,{radius:t})=>({card:{"--card-radius":At(t)}}),py=ue((e,t)=>{const n=ie("CheckboxCard",w3,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,checked:p,mod:h,withBorder:m,value:y,onClick:x,defaultChecked:b,onChange:w,...j}=n,T=Ne({name:"CheckboxCard",classes:zE,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:S3,rootSelector:"card"}),P=FE(),k=typeof p=="boolean"?p:P?P.value.includes(y||""):void 0,[E,_]=Wn({value:k,defaultValue:b,finalValue:!1,onChange:w});return i.jsx(x3,{value:{checked:E},children:i.jsx(Gn,{ref:t,mod:[{"with-border":m,checked:E},h],...T("card"),...j,role:"checkbox","aria-checked":E,onClick:R=>{x==null||x(R),P==null||P.onChange(y||""),_(!E)}})})});py.displayName="@mantine/core/CheckboxCard";py.classes=zE;function hy({children:e,role:t}){const n=zl();return n?i.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):i.jsx(i.Fragment,{children:e})}const j3={},my=ue((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:s,wrapperProps:l,children:u,readOnly:d,...p}=ie("CheckboxGroup",j3,e),[h,m]=Wn({value:n,defaultValue:r,finalValue:[],onChange:o}),y=x=>{const b=typeof x=="string"?x:x.currentTarget.value;!d&&m(h.includes(b)?h.filter(w=>w!==b):[...h,b])};return i.jsx(y3,{value:{value:h,onChange:y,size:s},children:i.jsx(pn.Wrapper,{size:s,ref:t,...l,...p,labelElement:"div",__staticSelector:"CheckboxGroup",children:i.jsx(hy,{role:"group",children:u})})})});my.classes=pn.Wrapper.classes;my.displayName="@mantine/core/CheckboxGroup";function pp({size:e,style:t,...n}){const r=e!==void 0?{width:oe(e),height:oe(e),...t}:t;return i.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n,children:i.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 BE({indeterminate:e,...t}){return e?i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t,children:i.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):i.jsx(pp,{...t})}var UE={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const C3={icon:BE},E3=(e,{radius:t,color:n,size:r,iconColor:o,variant:s,autoContrast:l})=>{const u=eo({color:n||e.primaryColor,theme:e}),d=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{indicator:{"--checkbox-size":et(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:At(t),"--checkbox-color":s==="outline"?d:Lt(n,e),"--checkbox-icon-color":o?Lt(o,e):ma(l,e)?Pi({color:n,theme:e,autoContrast:l}):void 0}}},gy=ue((e,t)=>{const n=ie("CheckboxIndicator",C3,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,icon:p,indeterminate:h,radius:m,color:y,iconColor:x,autoContrast:b,checked:w,mod:j,variant:T,disabled:P,...k}=n,E=p,_=Ne({name:"CheckboxIndicator",classes:UE,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:E3,rootSelector:"indicator"}),R=b3(),M=typeof w=="boolean"||typeof h=="boolean"?w||h:(R==null?void 0:R.checked)||!1;return i.jsx(se,{ref:t,..._("indicator",{variant:T}),variant:T,mod:[{checked:M,disabled:P},j],...k,children:i.jsx(E,{indeterminate:h,..._("icon")})})});gy.displayName="@mantine/core/CheckboxIndicator";gy.classes=UE;var VE={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const k3={labelPosition:"right",icon:BE},T3=(e,{radius:t,color:n,size:r,iconColor:o,variant:s,autoContrast:l})=>{const u=eo({color:n||e.primaryColor,theme:e}),d=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{root:{"--checkbox-size":et(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:At(t),"--checkbox-color":s==="outline"?d:Lt(n,e),"--checkbox-icon-color":o?Lt(o,e):ma(l,e)?Pi({color:n,theme:e,autoContrast:l}):void 0}}},rr=ue((e,t)=>{const n=ie("Checkbox",k3,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,color:p,label:h,id:m,size:y,radius:x,wrapperProps:b,checked:w,labelPosition:j,description:T,error:P,disabled:k,variant:E,indeterminate:_,icon:R,rootRef:M,iconColor:N,onChange:L,autoContrast:z,mod:q,...G}=n,Y=FE(),Q=y||(Y==null?void 0:Y.size),te=R,V=Ne({name:"Checkbox",props:n,classes:VE,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:T3}),{styleProps:O,rest:A}=Ri(G),B=mr(m),I=Y?{checked:Y.value.includes(A.value),onChange:F=>{Y.onChange(F),L==null||L(F)}}:{};return i.jsx(fp,{...V("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:B,size:Q,labelPosition:j,label:h,description:T,error:P,disabled:k,classNames:r,styles:l,unstyled:u,"data-checked":I.checked||w||void 0,variant:E,ref:M,mod:q,...O,...b,children:i.jsxs(se,{...V("inner"),mod:{"data-label-position":j},children:[i.jsx(se,{component:"input",id:B,ref:t,checked:w,disabled:k,mod:{error:!!P,indeterminate:_},...V("input",{focusable:!0,variant:E}),onChange:L,...A,...I,type:"checkbox"}),i.jsx(te,{indeterminate:_,...V("icon")})]})})});rr.classes={...VE,...LE};rr.displayName="@mantine/core/Checkbox";rr.Group=my;rr.Indicator=gy;rr.Card=py;function El(e){return"group"in e}function WE({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),o=[];for(let s=0;s<e.length;s+=1){const l=e[s];if(o.length===n)return o;El(l)&&o.push({group:l.group,items:WE({options:l.items,search:t,limit:n-o.length})}),El(l)||l.label.toLowerCase().includes(r)&&o.push(l)}return o}function P3(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 HE(e,t=new Set){if(Array.isArray(e))for(const n of e)if(El(n))HE(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 R3(e,t){return Array.isArray(e)?e.includes(t):e===t}function qE({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:o,renderOption:s}){if(!El(e)){const u=R3(n,e.value),d=t&&u&&i.jsx(pp,{className:_r.optionsDropdownCheckIcon}),p=i.jsxs(i.Fragment,{children:[r==="left"&&d,i.jsx("span",{children:e.label}),r==="right"&&d]});return i.jsx(st.Option,{value:e.value,disabled:e.disabled,className:It({[_r.optionsDropdownOption]:!o}),"data-reverse":r==="right"||void 0,"data-checked":u||void 0,"aria-selected":u,active:u,children:typeof s=="function"?s({option:e,checked:u}):p})}const l=e.items.map(u=>i.jsx(qE,{data:u,value:n,unstyled:o,withCheckIcon:t,checkIconPosition:r,renderOption:s},u.value));return i.jsx(st.Group,{label:e.group,children:l})}function _3({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:o,limit:s,maxDropdownHeight:l,withScrollArea:u=!0,filterOptions:d=!0,withCheckIcon:p=!1,value:h,checkIconPosition:m,nothingFoundMessage:y,unstyled:x,labelId:b,renderOption:w,scrollAreaProps:j,"aria-label":T}){HE(e);const k=typeof o=="string"?(r||WE)({options:e,search:d?o:"",limit:s??1/0}):e,E=P3(k),_=k.map(R=>i.jsx(qE,{data:R,withCheckIcon:p,value:h,checkIconPosition:m,unstyled:x,renderOption:w},El(R)?R.group:R.value));return i.jsx(st.Dropdown,{hidden:t||n&&E,children:i.jsxs(st.Options,{labelledBy:b,"aria-label":T,children:[u?i.jsx(oo.Autosize,{mah:l??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...j,children:_}):_,E&&y&&i.jsx(st.Empty,{children:y})]})})}const GE=g.createContext(null),D3=GE.Provider;function I3(){return{withinGroup:!!g.useContext(GE)}}var hp={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const N3={},A3=(e,{spacing:t})=>({group:{"--ag-spacing":Pn(t)}}),vy=ue((e,t)=>{const n=ie("AvatarGroup",N3,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,spacing:p,...h}=n,m=Ne({name:"AvatarGroup",classes:hp,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:A3,rootSelector:"group"});return i.jsx(D3,{value:!0,children:i.jsx(se,{ref:t,...m("group"),...h})})});vy.classes=hp;vy.displayName="@mantine/core/AvatarGroup";function M3(e){return i.jsx("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function QE(e,t=2){const n=e.split(" ");return n.length===1?e.slice(0,t).toUpperCase():n.map(r=>r[0]).slice(0,t).join("").toUpperCase()}function O3(e){let t=0;for(let n=0;n<e.length;n+=1){const r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}const L3=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function $3(e,t=L3){const n=O3(QE(e)),r=Math.abs(n)%t.length;return t[r]}const F3={},z3=(e,{size:t,radius:n,variant:r,gradient:o,color:s,autoContrast:l,name:u,allowedInitialsColors:d})=>{const p=s==="initials"&&typeof u=="string"?$3(u,d):s,h=e.variantColorResolver({color:p||"gray",theme:e,gradient:o,variant:r||"light",autoContrast:l});return{root:{"--avatar-size":et(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:At(n),"--avatar-bg":p||r?h.background:void 0,"--avatar-color":p||r?h.color:void 0,"--avatar-bd":p||r?h.border:void 0}}},ia=or((e,t)=>{const n=ie("Avatar",F3,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,src:p,alt:h,radius:m,color:y,gradient:x,imageProps:b,children:w,autoContrast:j,mod:T,name:P,allowedInitialsColors:k,...E}=n,_=I3(),[R,M]=g.useState(!p),N=Ne({name:"Avatar",props:n,classes:hp,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:z3});return g.useEffect(()=>M(!p),[p]),i.jsx(se,{...N("root"),mod:[{"within-group":_.withinGroup},T],ref:t,...E,children:R?i.jsx("span",{...N("placeholder"),title:h,children:w||typeof P=="string"&&QE(P)||i.jsx(M3,{})}):i.jsx("img",{...b,...N("image"),src:p,alt:h,onError:L=>{var z;M(!0),(z=b==null?void 0:b.onError)==null||z.call(b,L)}})})});ia.classes=hp;ia.displayName="@mantine/core/Avatar";ia.Group=vy;var KE={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const B3={},U3=(e,{radius:t,color:n,gradient:r,variant:o,size:s,autoContrast:l})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:l});return{root:{"--badge-height":et(s,"badge-height"),"--badge-padding-x":et(s,"badge-padding-x"),"--badge-fz":et(s,"badge-fz"),"--badge-radius":t===void 0?void 0:At(t),"--badge-bg":n||o?u.background:void 0,"--badge-color":n||o?u.color:void 0,"--badge-bd":n||o?u.border:void 0,"--badge-dot-color":o==="dot"?Lt(n,e):void 0}}},xu=or((e,t)=>{const n=ie("Badge",B3,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,radius:p,color:h,gradient:m,leftSection:y,rightSection:x,children:b,variant:w,fullWidth:j,autoContrast:T,circle:P,mod:k,...E}=n,_=Ne({name:"Badge",props:n,classes:KE,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:U3});return i.jsxs(se,{variant:w,mod:[{block:j,circle:P,"with-right-section":!!x,"with-left-section":!!y},k],..._("root",{variant:w}),ref:t,...E,children:[y&&i.jsx("span",{..._("section"),"data-position":"left",children:y}),i.jsx("span",{..._("label"),children:b}),x&&i.jsx("span",{..._("section"),"data-position":"right",children:x})]})});xu.classes=KE;xu.displayName="@mantine/core/Badge";var YE={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const V3={iconSize:48},W3=(e,{color:t,iconSize:n,radius:r})=>{const o=eo({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),s=eo({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":Jr(s.value,.07),"--bq-bg-dark":Jr(o.value,.06),"--bq-bd":Lt(t,e),"--bq-icon-size":oe(n),"--bq-radius":At(r)}}},yy=ue((e,t)=>{const n=ie("Blockquote",V3,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,children:p,icon:h,iconSize:m,cite:y,...x}=n,b=Ne({name:"Blockquote",classes:YE,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:W3});return i.jsxs(se,{component:"blockquote",ref:t,...b("root"),...x,children:[h&&i.jsx("span",{...b("icon"),children:h}),p,y&&i.jsx("cite",{...b("cite"),children:y})]})});yy.classes=YE;yy.displayName="@mantine/core/Blockquote";var Ul={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const Cw={orientation:"horizontal"},H3=(e,{borderWidth:t})=>({group:{"--button-border-width":oe(t)}}),xy=ue((e,t)=>{const n=ie("ButtonGroup",Cw,e),{className:r,style:o,classNames:s,styles:l,unstyled:u,orientation:d,vars:p,borderWidth:h,variant:m,mod:y,...x}=ie("ButtonGroup",Cw,e),b=Ne({name:"ButtonGroup",props:n,classes:Ul,className:r,style:o,classNames:s,styles:l,unstyled:u,vars:p,varsResolver:H3,rootSelector:"group"});return i.jsx(se,{...b("group"),ref:t,variant:m,mod:[{"data-orientation":d},y],role:"group",...x})});xy.classes=Ul;xy.displayName="@mantine/core/ButtonGroup";const Ew={},q3=(e,{radius:t,color:n,gradient:r,variant:o,autoContrast:s,size:l})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:s});return{groupSection:{"--section-height":et(l,"section-height"),"--section-padding-x":et(l,"section-padding-x"),"--section-fz":l!=null&&l.includes("compact")?Rn(l.replace("compact-","")):Rn(l),"--section-radius":t===void 0?void 0:At(t),"--section-bg":n||o?u.background:void 0,"--section-color":u.color,"--section-bd":n||o?u.border:void 0}}},by=ue((e,t)=>{const n=ie("ButtonGroupSection",Ew,e),{className:r,style:o,classNames:s,styles:l,unstyled:u,vars:d,variant:p,gradient:h,radius:m,autoContrast:y,...x}=ie("ButtonGroupSection",Ew,e),b=Ne({name:"ButtonGroupSection",props:n,classes:Ul,className:r,style:o,classNames:s,styles:l,unstyled:u,vars:d,varsResolver:q3,rootSelector:"groupSection"});return i.jsx(se,{...b("groupSection"),ref:t,variant:p,...x})});by.classes=Ul;by.displayName="@mantine/core/ButtonGroupSection";const G3={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${oe(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},Q3={},K3=(e,{radius:t,color:n,gradient:r,variant:o,size:s,justify:l,autoContrast:u})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:u});return{root:{"--button-justify":l,"--button-height":et(s,"button-height"),"--button-padding-x":et(s,"button-padding-x"),"--button-fz":s!=null&&s.includes("compact")?Rn(s.replace("compact-","")):Rn(s),"--button-radius":t===void 0?void 0:At(t),"--button-bg":n||o?d.background:void 0,"--button-hover":n||o?d.hover:void 0,"--button-color":d.color,"--button-bd":n||o?d.border:void 0,"--button-hover-color":n||o?d.hoverColor:void 0}}},Pe=or((e,t)=>{const n=ie("Button",Q3,e),{style:r,vars:o,className:s,color:l,disabled:u,children:d,leftSection:p,rightSection:h,fullWidth:m,variant:y,radius:x,loading:b,loaderProps:w,gradient:j,classNames:T,styles:P,unstyled:k,"data-disabled":E,autoContrast:_,mod:R,...M}=n,N=Ne({name:"Button",props:n,classes:Ul,className:s,style:r,classNames:T,styles:P,unstyled:k,vars:o,varsResolver:K3}),L=!!p,z=!!h;return i.jsxs(Gn,{ref:t,...N("root",{active:!u&&!b&&!E}),unstyled:k,variant:y,disabled:u||b,mod:[{disabled:u||E,loading:b,block:m,"with-left-section":L,"with-right-section":z},R],...M,children:[i.jsx(_i,{mounted:!!b,transition:G3,duration:150,children:q=>i.jsx(se,{component:"span",...N("loader",{style:q}),"aria-hidden":!0,children:i.jsx(Rr,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...w})})}),i.jsxs("span",{...N("inner"),children:[p&&i.jsx(se,{component:"span",...N("section"),mod:{position:"left"},children:p}),i.jsx(se,{component:"span",mod:{loading:b},...N("label"),children:d}),h&&i.jsx(se,{component:"span",...N("section"),mod:{position:"right"},children:h})]})]})});Pe.classes=Ul;Pe.displayName="@mantine/core/Button";Pe.Group=xy;Pe.GroupSection=by;var XE={root:"m_4451eb3a"};const Y3={},Vn=or((e,t)=>{const n=ie("Center",Y3,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,inline:p,mod:h,...m}=n,y=Ne({name:"Center",props:n,classes:XE,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d});return i.jsx(se,{ref:t,mod:[{inline:p},h],...y("root"),...m})});Vn.classes=XE;Vn.displayName="@mantine/core/Center";const[X3,J3]=vs(),Z3={};function JE(e){const{value:t,defaultValue:n,onChange:r,multiple:o,children:s}=ie("ChipGroup",Z3,e),[l,u]=Wn({value:t,defaultValue:n,finalValue:o?[]:null,onChange:r}),d=h=>Array.isArray(l)?l.includes(h):h===l,p=h=>{const m=h.currentTarget.value;Array.isArray(l)?u(l.includes(m)?l.filter(y=>y!==m):[...l,m]):u(m)};return i.jsx(X3,{value:{isChipSelected:d,onChange:p,multiple:o},children:s})}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 e9={type:"checkbox"},t9=(e,{size:t,radius:n,variant:r,color:o,autoContrast:s})=>{const l=e.variantColorResolver({color:o||e.primaryColor,theme:e,variant:r||"filled",autoContrast:s});return{root:{"--chip-fz":Rn(t),"--chip-size":et(t,"chip-size"),"--chip-radius":n===void 0?void 0:At(n),"--chip-checked-padding":et(t,"chip-checked-padding"),"--chip-padding":et(t,"chip-padding"),"--chip-icon-size":et(t,"chip-icon-size"),"--chip-bg":o||r?l.background:void 0,"--chip-hover":o||r?l.hover:void 0,"--chip-color":o||r?l.color:void 0,"--chip-bd":o||r?l.border:void 0,"--chip-spacing":et(t,"chip-spacing")}}},Zc=ue((e,t)=>{const n=ie("Chip",e9,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,id:p,checked:h,defaultChecked:m,onChange:y,value:x,wrapperProps:b,type:w,disabled:j,children:T,size:P,variant:k,icon:E,rootRef:_,autoContrast:R,mod:M,...N}=n,L=Ne({name:"Chip",classes:ZE,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:t9}),z=J3(),q=mr(p),{styleProps:G,rest:Y}=Ri(N),[Q,te]=Wn({value:h,defaultValue:m,finalValue:!1,onChange:y}),V=z?{checked:z.isChipSelected(x),onChange:A=>{z.onChange(A),y==null||y(A.currentTarget.checked)},type:z.multiple?"checkbox":"radio"}:{},O=V.checked||Q;return i.jsxs(se,{size:P,variant:k,ref:_,mod:M,...L("root"),...G,...b,children:[i.jsx("input",{type:w,...L("input"),checked:O,onChange:A=>te(A.currentTarget.checked),id:q,disabled:j,ref:t,value:x,...V,...Y}),i.jsxs("label",{htmlFor:q,"data-checked":O||void 0,"data-disabled":j||void 0,...L("label",{variant:k||"filled"}),children:[O&&i.jsx("span",{...L("iconWrapper"),children:E||i.jsx(pp,{...L("checkIcon")})}),i.jsx("span",{children:T})]})]})});Zc.classes=ZE;Zc.displayName="@mantine/core/Chip";Zc.Group=JE;var ek={root:"m_b183c0a2"};const n9={},r9=(e,{color:t})=>({root:{"--code-bg":t?Lt(t,e):void 0}}),wy=ue((e,t)=>{const n=ie("Code",n9,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,color:p,block:h,variant:m,mod:y,...x}=n,b=Ne({name:"Code",props:n,classes:ek,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:r9});return i.jsx(se,{component:h?"pre":"code",variant:m,ref:t,mod:[{block:h},y],...b("root"),...x,dir:"ltr"})});wy.classes=ek;wy.displayName="@mantine/core/Code";var tk={root:"m_7485cace"};const o9={},i9=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:et(t,"container-size")}}),Sy=ue((e,t)=>{const n=ie("Container",o9,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,fluid:p,mod:h,...m}=n,y=Ne({name:"Container",classes:tk,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:i9});return i.jsx(se,{ref:t,mod:[{fluid:p},h],...y("root"),...m})});Sy.classes=tk;Sy.displayName="@mantine/core/Container";const s9={timeout:1e3};function nk(e){const{children:t,timeout:n,value:r,...o}=ie("CopyButton",s9,e),s=rC({timeout:n}),l=()=>s.copy(r);return i.jsx(i.Fragment,{children:t({copy:l,copied:s.copied,...o})})}nk.displayName="@mantine/core/CopyButton";var rk={root:"m_3eebeb36",label:"m_9e365f20"};const a9={orientation:"horizontal"},l9=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?Lt(t,e):void 0,"--divider-border-style":n,"--divider-size":et(r,"divider-size")}}),Dn=ue((e,t)=>{const n=ie("Divider",a9,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,color:p,orientation:h,label:m,labelPosition:y,mod:x,...b}=n,w=Ne({name:"Divider",classes:rk,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:l9});return i.jsx(se,{ref:t,mod:[{orientation:h,"with-label":!!m},x],...w("root"),...b,role:"separator",children:m&&i.jsx(se,{component:"span",mod:{position:y},...w("label"),children:m})})});Dn.classes=rk;Dn.displayName="@mantine/core/Divider";function c9({open:e,close:t,openDelay:n,closeDelay:r}){const o=g.useRef(-1),s=g.useRef(-1),l=()=>{window.clearTimeout(o.current),window.clearTimeout(s.current)},u=()=>{l(),n===0||n===void 0?e():o.current=window.setTimeout(e,n)},d=()=>{l(),r===0||r===void 0?t():s.current=window.setTimeout(t,r)};return g.useEffect(()=>l,[]),{openDropdown:u,closeDropdown:d}}const[kw,ok]=hr("Grid component was not found in tree"),zg=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,Tw=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":zg(e,t),Pw=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},Rw=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function u9({span:e,order:t,offset:n,selector:r}){var x;const o=ln(),s=ok(),l=s.breakpoints||o.breakpoints,d=So(e)===void 0?12:So(e),p=gs({"--col-order":(x=So(t))==null?void 0:x.toString(),"--col-flex-grow":Pw(d,s.grow),"--col-flex-basis":zg(d,s.columns),"--col-width":d==="content"?"auto":void 0,"--col-max-width":Tw(d,s.columns,s.grow),"--col-offset":Rw(So(n),s.columns)}),h=Gt(l).reduce((b,w)=>{var j;return b[w]||(b[w]={}),typeof t=="object"&&t[w]!==void 0&&(b[w]["--col-order"]=(j=t[w])==null?void 0:j.toString()),typeof e=="object"&&e[w]!==void 0&&(b[w]["--col-flex-grow"]=Pw(e[w],s.grow),b[w]["--col-flex-basis"]=zg(e[w],s.columns),b[w]["--col-width"]=e[w]==="content"?"auto":void 0,b[w]["--col-max-width"]=Tw(e[w],s.columns,s.grow)),typeof n=="object"&&n[w]!==void 0&&(b[w]["--col-offset"]=Rw(n[w],s.columns)),b},{}),y=Kc(Gt(h),l).filter(b=>Gt(h[b.value]).length>0).map(b=>({query:s.type==="container"?`mantine-grid (min-width: ${l[b.value]})`:`(min-width: ${l[b.value]})`,styles:h[b.value]}));return i.jsx(ga,{styles:p,media:s.type==="container"?void 0:y,container:s.type==="container"?y:void 0,selector:r})}var jy={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const d9={span:12},Cy=ue((e,t)=>{const n=ie("GridCol",d9,e),{classNames:r,className:o,style:s,styles:l,vars:u,span:d,order:p,offset:h,...m}=n,y=ok(),x=fu();return i.jsxs(i.Fragment,{children:[i.jsx(u9,{selector:`.${x}`,span:d,order:p,offset:h}),i.jsx(se,{ref:t,...y.getStyles("col",{className:It(o,x),style:s,classNames:r,styles:l}),...m})]})});Cy.classes=jy;Cy.displayName="@mantine/core/GridCol";function _w({gutter:e,selector:t,breakpoints:n,type:r}){const o=ln(),s=n||o.breakpoints,l=gs({"--grid-gutter":Pn(So(e))}),u=Gt(s).reduce((h,m)=>(h[m]||(h[m]={}),typeof e=="object"&&e[m]!==void 0&&(h[m]["--grid-gutter"]=Pn(e[m])),h),{}),p=Kc(Gt(u),s).filter(h=>Gt(u[h.value]).length>0).map(h=>({query:r==="container"?`mantine-grid (min-width: ${s[h.value]})`:`(min-width: ${s[h.value]})`,styles:u[h.value]}));return i.jsx(ga,{styles:l,media:r==="container"?void 0:p,container:r==="container"?p:void 0,selector:t})}const f9={gutter:"md",grow:!1,columns:12},p9=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),Fr=ue((e,t)=>{const n=ie("Grid",f9,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,grow:p,gutter:h,columns:m,align:y,justify:x,children:b,breakpoints:w,type:j,...T}=n,P=Ne({name:"Grid",classes:jy,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:p9}),k=fu();return j==="container"&&w?i.jsxs(kw,{value:{getStyles:P,grow:p,columns:m||12,breakpoints:w,type:j},children:[i.jsx(_w,{selector:`.${k}`,...n}),i.jsx("div",{...P("container"),children:i.jsx(se,{ref:t,...P("root",{className:k}),...T,children:i.jsx("div",{...P("inner"),children:b})})})]}):i.jsxs(kw,{value:{getStyles:P,grow:p,columns:m||12,breakpoints:w,type:j},children:[i.jsx(_w,{selector:`.${k}`,...n}),i.jsx(se,{ref:t,...P("root",{className:k}),...T,children:i.jsx("div",{...P("inner"),children:b})})]})});Fr.classes=jy;Fr.displayName="@mantine/core/Grid";Fr.Col=Cy;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)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ef.apply(null,arguments)}function Ey(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}var h9=g.useLayoutEffect,m9=function(t){var n=gn.useRef(t);return h9(function(){n.current=t}),n},Dw=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},g9=function(t,n){var r=gn.useRef();return gn.useCallback(function(o){t.current=o,r.current&&Dw(r.current,null),r.current=n,n&&Dw(n,o)},[n])},Iw={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},v9=function(t){Object.keys(Iw).forEach(function(n){t.style.setProperty(n,Iw[n],"important")})},Nw=v9,cr=null,Aw=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function y9(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),cr||(cr=document.createElement("textarea"),cr.setAttribute("tabindex","-1"),cr.setAttribute("aria-hidden","true"),Nw(cr)),cr.parentNode===null&&document.body.appendChild(cr);var o=e.paddingSize,s=e.borderSize,l=e.sizingStyle,u=l.boxSizing;Object.keys(l).forEach(function(y){var x=y;cr.style[x]=l[x]}),Nw(cr),cr.value=t;var d=Aw(cr,e);cr.value=t,d=Aw(cr,e),cr.value="x";var p=cr.scrollHeight-o,h=p*n;u==="border-box"&&(h=h+o+s),d=Math.max(h,d);var m=p*r;return u==="border-box"&&(m=m+o+s),d=Math.min(m,d),[d,p]}var Mw=function(){},x9=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},b9=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],w9=!!document.documentElement.currentStyle,S9=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=x9(b9,n),o=r.boxSizing;if(o==="")return null;w9&&o==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var s=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),l=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:s,borderSize:l}},j9=S9;function ik(e,t,n){var r=m9(n);g.useLayoutEffect(function(){var o=function(l){return r.current(l)};if(e)return e.addEventListener(t,o),function(){return e.removeEventListener(t,o)}},[])}var C9=function(t){ik(window,"resize",t)},E9=function(t){ik(document.fonts,"loadingdone",t)},k9=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],T9=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,s=t.minRows,l=t.onChange,u=l===void 0?Mw:l,d=t.onHeightChange,p=d===void 0?Mw:d,h=Ey(t,k9),m=h.value!==void 0,y=g.useRef(null),x=g9(y,n),b=g.useRef(0),w=g.useRef(),j=function(){var k=y.current,E=r&&w.current?w.current:j9(k);if(E){w.current=E;var _=y9(E,k.value||k.placeholder||"x",s,o),R=_[0],M=_[1];b.current!==R&&(b.current=R,k.style.setProperty("height",R+"px","important"),p(R,{rowHeight:M}))}},T=function(k){m||j(),u(k)};return g.useLayoutEffect(j),C9(j),E9(j),g.createElement("textarea",Ef({},h,{onChange:T,ref:x}))},P9=g.forwardRef(T9);const R9={},ba=ue((e,t)=>{const{autosize:n,maxRows:r,minRows:o,__staticSelector:s,resize:l,...u}=ie("Textarea",R9,e),d=n&&uC()!=="test",p=d?{maxRows:r,minRows:o}:{};return i.jsx(Dr,{component:d?P9:"textarea",ref:t,...u,__staticSelector:s||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":l},...p})});ba.classes=Dr.classes;ba.displayName="@mantine/core/Textarea";function Ow(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const _9={serialize:JSON.stringify,deserialize:JSON.parse},Vl=ue((e,t)=>{const{value:n,defaultValue:r,onChange:o,formatOnBlur:s,validationError:l,serialize:u,deserialize:d,onFocus:p,onBlur:h,readOnly:m,error:y,...x}=ie("JsonInput",_9,e),[b,w]=Wn({value:n,defaultValue:r,finalValue:"",onChange:o}),[j,T]=g.useState(Ow(b,d)),P=E=>{p==null||p(E),T(!0)},k=E=>{typeof h=="function"&&h(E);const _=Ow(E.currentTarget.value,d);s&&!m&&_&&E.currentTarget.value.trim()!==""&&w(u(d(E.currentTarget.value),null,2)),T(_)};return i.jsx(ba,{value:b,onChange:E=>w(E.currentTarget.value),onFocus:P,onBlur:k,ref:t,readOnly:m,...x,autoComplete:"off",__staticSelector:"JsonInput",error:j?y:l||!0,"data-monospace":!0})});Vl.classes=Dr.classes;Vl.displayName="@mantine/core/JsonInput";const[D9,I9]=hr("List component was not found in tree");var ky={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const N9={},Ty=ue((e,t)=>{const n=ie("ListItem",N9,e),{classNames:r,className:o,style:s,styles:l,vars:u,icon:d,children:p,mod:h,...m}=n,y=I9(),x=d||y.icon,b={classNames:r,styles:l};return i.jsx(se,{...y.getStyles("item",{...b,className:o,style:s}),component:"li",mod:[{"with-icon":!!x,centered:y.center},h],ref:t,...m,children:i.jsxs("div",{...y.getStyles("itemWrapper",b),children:[x&&i.jsx("span",{...y.getStyles("itemIcon",b),children:x}),i.jsx("span",{...y.getStyles("itemLabel",b),children:p})]})})});Ty.classes=ky;Ty.displayName="@mantine/core/ListItem";const A9={type:"unordered"},M9=(e,{size:t,spacing:n})=>({root:{"--list-fz":Rn(t),"--list-lh":tC(t),"--list-spacing":Pn(n)}}),fr=ue((e,t)=>{const n=ie("List",A9,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,children:p,type:h,withPadding:m,icon:y,spacing:x,center:b,listStyleType:w,mod:j,...T}=n,P=Ne({name:"List",classes:ky,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:M9});return i.jsx(D9,{value:{center:b,icon:y,getStyles:P},children:i.jsx(se,{...P("root",{style:{listStyleType:w}}),component:h==="unordered"?"ul":"ol",mod:[{"with-padding":m},j],ref:t,...T,children:p})})});fr.classes=ky;fr.displayName="@mantine/core/List";fr.Item=Ty;var sk={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const Lw={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Vr("overlay")},O9=(e,{zIndex:t})=>({root:{"--lo-z-index":t==null?void 0:t.toString()}}),Py=ue((e,t)=>{const n=ie("LoadingOverlay",Lw,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,transitionProps:p,loaderProps:h,overlayProps:m,visible:y,zIndex:x,...b}=n,w=ln(),j=Ne({name:"LoadingOverlay",classes:sk,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:O9}),T={...Lw.overlayProps,...m};return i.jsx(_i,{transition:"fade",...p,mounted:!!y,children:P=>i.jsxs(se,{...j("root",{style:P}),ref:t,...b,children:[i.jsx(Rr,{...j("loader"),unstyled:u,...h}),i.jsx(Jc,{...T,...j("overlay"),darkHidden:!0,unstyled:u,color:(m==null?void 0:m.color)||w.white}),i.jsx(Jc,{...T,...j("overlay"),lightHidden:!0,unstyled:u,color:(m==null?void 0:m.color)||w.colors.dark[5]})]})})});Py.classes=sk;Py.displayName="@mantine/core/LoadingOverlay";const[L9,bu]=hr("Menu component was not found in the tree");var Wl={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504"};const $9={},Ry=ue((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:l,...u}=ie("MenuDivider",$9,e),d=bu();return i.jsx(se,{ref:t,...d.getStyles("divider",{className:r,style:o,styles:s,classNames:n}),...u})});Ry.classes=Wl;Ry.displayName="@mantine/core/MenuDivider";const F9={},_y=ue((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:l,onMouseEnter:u,onMouseLeave:d,onKeyDown:p,children:h,...m}=ie("MenuDropdown",F9,e),y=g.useRef(null),x=bu(),b=Er(p,T=>{var P,k;(T.key==="ArrowUp"||T.key==="ArrowDown")&&(T.preventDefault(),(k=(P=y.current)==null?void 0:P.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||k.focus())}),w=Er(u,()=>(x.trigger==="hover"||x.trigger==="click-hover")&&x.openDropdown()),j=Er(d,()=>(x.trigger==="hover"||x.trigger==="click-hover")&&x.closeDropdown());return i.jsxs(Ro.Dropdown,{...m,onMouseEnter:w,onMouseLeave:j,role:"menu","aria-orientation":"vertical",ref:In(t,y),...x.getStyles("dropdown",{className:r,style:o,styles:s,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:b,children:[i.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),h]})});_y.classes=Wl;_y.displayName="@mantine/core/MenuDropdown";const z9={},Dy=or((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:l,color:u,closeMenuOnClick:d,leftSection:p,rightSection:h,children:m,disabled:y,...x}=ie("MenuItem",z9,e),b=bu(),w=ln(),{dir:j}=va(),T=g.useRef(null),P=b.getItemIndex(T.current),k=x,E=Er(k.onMouseLeave,()=>b.setHovered(-1)),_=Er(k.onMouseEnter,()=>b.setHovered(b.getItemIndex(T.current))),R=Er(k.onClick,()=>{typeof d=="boolean"?d&&b.closeDropdownImmediately():b.closeOnItemClick&&b.closeDropdownImmediately()}),M=Er(k.onFocus,()=>b.setHovered(b.getItemIndex(T.current))),N=u?w.variantColorResolver({color:u,theme:w,variant:"light"}):void 0,L=u?eo({color:u,theme:w}):null;return i.jsxs(Gn,{...x,unstyled:b.unstyled,tabIndex:b.menuItemTabIndex,onFocus:M,...b.getStyles("item",{className:r,style:o,styles:s,classNames:n}),ref:In(T,t),role:"menuitem",disabled:y,"data-menu-item":!0,"data-disabled":y||void 0,"data-hovered":b.hovered===P?!0:void 0,"data-mantine-stop-propagation":!0,onMouseEnter:_,onMouseLeave:E,onClick:R,onKeyDown:eC({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:b.loop,dir:j,orientation:"vertical",onKeyDown:k.onKeyDown}),__vars:{"--menu-item-color":L!=null&&L.isThemeColor&&(L==null?void 0:L.shade)===void 0?`var(--mantine-color-${L.color}-6)`:N==null?void 0:N.color,"--menu-item-hover":N==null?void 0:N.hover},children:[p&&i.jsx("div",{...b.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"left",children:p}),m&&i.jsx("div",{...b.getStyles("itemLabel",{styles:s,classNames:n}),children:m}),h&&i.jsx("div",{...b.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"right",children:h})]})});Dy.classes=Wl;Dy.displayName="@mantine/core/MenuItem";const B9={},Iy=ue((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:l,...u}=ie("MenuLabel",B9,e),d=bu();return i.jsx(se,{ref:t,...d.getStyles("label",{className:r,style:o,styles:s,classNames:n}),...u})});Iy.classes=Wl;Iy.displayName="@mantine/core/MenuLabel";const U9={refProp:"ref"},ak=g.forwardRef((e,t)=>{const{children:n,refProp:r,...o}=ie("MenuTarget",U9,e);if(!Ti(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 s=bu(),l=n.props,u=Er(l.onClick,()=>{s.trigger==="click"?s.toggleDropdown():s.trigger==="click-hover"&&(s.setOpenedViaClick(!0),s.opened||s.openDropdown())}),d=Er(l.onMouseEnter,()=>(s.trigger==="hover"||s.trigger==="click-hover")&&s.openDropdown()),p=Er(l.onMouseLeave,()=>{(s.trigger==="hover"||s.trigger==="click-hover"&&!s.openedViaClick)&&s.closeDropdown()});return i.jsx(Ro.Target,{refProp:r,popupType:"menu",ref:t,...o,children:g.cloneElement(n,{onClick:u,onMouseEnter:d,onMouseLeave:p,"data-expanded":s.opened?!0:void 0})})});ak.displayName="@mantine/core/MenuTarget";const V9={trapFocus:!0,closeOnItemClick:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function xe(e){const t=ie("Menu",V9,e),{children:n,onOpen:r,onClose:o,opened:s,defaultOpened:l,trapFocus:u,onChange:d,closeOnItemClick:p,loop:h,closeOnEscape:m,trigger:y,openDelay:x,closeDelay:b,classNames:w,styles:j,unstyled:T,variant:P,vars:k,menuItemTabIndex:E,keepMounted:_,...R}=t,M=Ne({name:"Menu",classes:Wl,props:t,classNames:w,styles:j,unstyled:T}),[N,{setHovered:L,resetHovered:z}]=gD(),[q,G]=Wn({value:s,defaultValue:l,finalValue:!1,onChange:d}),[Y,Q]=g.useState(!1),te=()=>{G(!1),Q(!1),q&&(o==null||o())},V=()=>{G(!0),!q&&(r==null||r())},O=()=>{q?te():V()},{openDropdown:A,closeDropdown:B}=c9({open:V,close:te,closeDelay:b,openDelay:x}),I=de=>mD("[data-menu-item]","[data-menu-dropdown]",de),{resolvedClassNames:F,resolvedStyles:J}=Ol({classNames:w,styles:j,props:t});return bi(()=>{z()},[q]),i.jsx(L9,{value:{getStyles:M,opened:q,toggleDropdown:O,getItemIndex:I,hovered:N,setHovered:L,openedViaClick:Y,setOpenedViaClick:Q,closeOnItemClick:p,closeDropdown:y==="click"?te:B,openDropdown:y==="click"?V:A,closeDropdownImmediately:te,loop:h,trigger:y,unstyled:T,menuItemTabIndex:E},children:i.jsx(Ro,{...R,opened:q,onChange:O,defaultOpened:l,trapFocus:_?!1:u,closeOnEscape:m,__staticSelector:"Menu",classNames:F,styles:J,unstyled:T,variant:P,keepMounted:_,children:n})})}xe.extend=e=>e;xe.classes=Wl;xe.displayName="@mantine/core/Menu";xe.Item=Dy;xe.Label=Iy;xe.Dropdown=_y;xe.Target=ak;xe.Divider=Ry;const[W9,Hl]=hr("Modal component was not found in tree");var Ii={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const H9={},mp=ue((e,t)=>{const n=ie("ModalBody",H9,e),{classNames:r,className:o,style:s,styles:l,vars:u,...d}=n,p=Hl();return i.jsx(vE,{ref:t,...p.getStyles("body",{classNames:r,style:s,styles:l,className:o}),...d})});mp.classes=Ii;mp.displayName="@mantine/core/ModalBody";const q9={},gp=ue((e,t)=>{const n=ie("ModalCloseButton",q9,e),{classNames:r,className:o,style:s,styles:l,vars:u,...d}=n,p=Hl();return i.jsx(yE,{ref:t,...p.getStyles("close",{classNames:r,style:s,styles:l,className:o}),...d})});gp.classes=Ii;gp.displayName="@mantine/core/ModalCloseButton";const G9={},vp=ue((e,t)=>{const n=ie("ModalContent",G9,e),{classNames:r,className:o,style:s,styles:l,vars:u,children:d,__hidden:p,...h}=n,m=Hl(),y=m.scrollAreaComponent||u4;return i.jsx(xE,{...m.getStyles("content",{className:o,style:s,styles:l,classNames:r}),innerProps:m.getStyles("inner",{className:o,style:s,styles:l,classNames:r}),"data-full-screen":m.fullScreen||void 0,"data-modal-content":!0,"data-hidden":p||void 0,ref:t,...h,children:i.jsx(y,{style:{maxHeight:m.fullScreen?"100dvh":`calc(100dvh - (${oe(m.yOffset)} * 2))`},children:d})})});vp.classes=Ii;vp.displayName="@mantine/core/ModalContent";const Q9={},yp=ue((e,t)=>{const n=ie("ModalHeader",Q9,e),{classNames:r,className:o,style:s,styles:l,vars:u,...d}=n,p=Hl();return i.jsx(bE,{ref:t,...p.getStyles("header",{classNames:r,style:s,styles:l,className:o}),...d})});yp.classes=Ii;yp.displayName="@mantine/core/ModalHeader";const K9={},xp=ue((e,t)=>{const n=ie("ModalOverlay",K9,e),{classNames:r,className:o,style:s,styles:l,vars:u,...d}=n,p=Hl();return i.jsx(wE,{ref:t,...p.getStyles("overlay",{classNames:r,style:s,styles:l,className:o}),...d})});xp.classes=Ii;xp.displayName="@mantine/core/ModalOverlay";const Y9={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Vr("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},X9=(e,{radius:t,size:n,yOffset:r,xOffset:o})=>({root:{"--modal-radius":t===void 0?void 0:At(t),"--modal-size":et(n,"modal-size"),"--modal-y-offset":oe(r),"--modal-x-offset":oe(o)}}),bp=ue((e,t)=>{const n=ie("ModalRoot",Y9,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,yOffset:p,scrollAreaComponent:h,radius:m,fullScreen:y,centered:x,xOffset:b,__staticSelector:w,...j}=n,T=Ne({name:w,classes:Ii,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:X9});return i.jsx(W9,{value:{yOffset:p,scrollAreaComponent:h,getStyles:T,fullScreen:y},children:i.jsx(gE,{ref:t,...T("root"),"data-full-screen":y||void 0,"data-centered":x||void 0,unstyled:u,...j})})});bp.classes=Ii;bp.displayName="@mantine/core/ModalRoot";const[J9,Z9]=vs();function lk({children:e}){const[t,n]=g.useState([]),[r,o]=g.useState(Vr("modal"));return i.jsx(J9,{value:{stack:t,addModal:(s,l)=>{n(u=>[...new Set([...u,s])]),o(u=>typeof l=="number"&&typeof u=="number"?Math.max(u,l):u)},removeModal:s=>n(l=>l.filter(u=>u!==s)),getZIndex:s=>`calc(${r} + ${t.indexOf(s)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}lk.displayName="@mantine/core/ModalStack";const eM={},wp=ue((e,t)=>{const n=ie("ModalTitle",eM,e),{classNames:r,className:o,style:s,styles:l,vars:u,...d}=n,p=Hl();return i.jsx(SE,{ref:t,...p.getStyles("title",{classNames:r,style:s,styles:l,className:o}),...d})});wp.classes=Ii;wp.displayName="@mantine/core/ModalTitle";const tM={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Vr("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Nn=ue((e,t)=>{const{title:n,withOverlay:r,overlayProps:o,withCloseButton:s,closeButtonProps:l,children:u,radius:d,opened:p,stackId:h,zIndex:m,...y}=ie("Modal",tM,e),x=Z9(),b=!!n||s,w=x&&h?{closeOnEscape:x.currentId===h,trapFocus:x.currentId===h,zIndex:x.getZIndex(h)}:{},j=r===!1?!1:h&&x?x.currentId===h:p;return g.useEffect(()=>{x&&h&&(p?x.addModal(h,m||Vr("modal")):x.removeModal(h))},[p,h,m]),i.jsxs(bp,{ref:t,radius:d,opened:p,zIndex:x&&h?x.getZIndex(h):m,...y,...w,children:[r&&i.jsx(xp,{visible:j,transitionProps:x&&h?{duration:0}:void 0,...o}),i.jsxs(vp,{radius:d,__hidden:x&&h&&p?h!==x.currentId:!1,children:[b&&i.jsxs(yp,{children:[n&&i.jsx(wp,{children:n}),s&&i.jsx(gp,{...l})]}),i.jsx(mp,{children:u})]})]})});Nn.classes=Ii;Nn.displayName="@mantine/core/Modal";Nn.Root=bp;Nn.Overlay=xp;Nn.Content=vp;Nn.Body=mp;Nn.Header=yp;Nn.Title=wp;Nn.CloseButton=gp;Nn.Stack=lk;const[nM,Ny]=vs(),[rM,oM]=vs();var Sp={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const iM={},sM=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?et(t):et(n,"pg-gap")}}),Ay=ue((e,t)=>{const n=ie("PillGroup",iM,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,size:p,disabled:h,...m}=n,y=Ny(),x=(y==null?void 0:y.size)||p||void 0,b=Ne({name:"PillGroup",classes:Sp,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:sM,stylesCtx:{size:x},rootSelector:"group"});return i.jsx(rM,{value:{size:x,disabled:h},children:i.jsx(se,{ref:t,size:x,...b("group"),...m})})});Ay.classes=Sp;Ay.displayName="@mantine/core/PillGroup";const aM={variant:"default"},lM=(e,{radius:t},{size:n})=>({root:{"--pill-fz":et(n,"pill-fz"),"--pill-height":et(n,"pill-height"),"--pill-radius":t===void 0?void 0:At(t)}}),sa=ue((e,t)=>{const n=ie("Pill",aM,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,variant:p,children:h,withRemoveButton:m,onRemove:y,removeButtonProps:x,radius:b,size:w,disabled:j,mod:T,...P}=n,k=oM(),E=Ny(),_=w||(k==null?void 0:k.size)||void 0,R=(E==null?void 0:E.variant)==="filled"?"contrast":p||"default",M=Ne({name:"Pill",classes:Sp,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:lM,stylesCtx:{size:_}});return i.jsxs(se,{component:"span",ref:t,variant:R,size:_,...M("root",{variant:R}),mod:[{"with-remove":m&&!j,disabled:j||(k==null?void 0:k.disabled)},T],...P,children:[i.jsx("span",{...M("label"),children:h}),m&&i.jsx(xa,{variant:"transparent",radius:b,tabIndex:-1,"aria-hidden":!0,unstyled:u,...x,...M("remove",{className:x==null?void 0:x.className,style:x==null?void 0:x.style}),onMouseDown:N=>{var L;N.preventDefault(),N.stopPropagation(),(L=x==null?void 0:x.onMouseDown)==null||L.call(x,N)},onClick:N=>{var L;N.stopPropagation(),y==null||y(),(L=x==null?void 0:x.onClick)==null||L.call(x,N)}})]})});sa.classes=Sp;sa.displayName="@mantine/core/Pill";sa.Group=Ay;var ck={field:"m_45c4369d"};const cM={type:"visible"},My=ue((e,t)=>{const n=ie("PillsInputField",cM,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,type:p,disabled:h,id:m,pointer:y,mod:x,...b}=n,w=Ny(),j=zl(),T=Ne({name:"PillsInputField",classes:ck,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,rootSelector:"field"}),P=h||(w==null?void 0:w.disabled);return i.jsx(se,{component:"input",ref:In(t,w==null?void 0:w.fieldRef),"data-type":p,disabled:P,mod:[{disabled:P,pointer:y},x],...T("field"),...b,id:(j==null?void 0:j.inputId)||m,"aria-invalid":w==null?void 0:w.hasError,"aria-describedby":j==null?void 0:j.describedBy,type:"text",onMouseDown:k=>!y&&k.stopPropagation()})});My.classes=ck;My.displayName="@mantine/core/PillsInputField";const uM={},kl=ue((e,t)=>{const n=ie("PillsInput",uM,e),{children:r,onMouseDown:o,onClick:s,size:l,disabled:u,__staticSelector:d,error:p,variant:h,...m}=n,y=g.useRef(null);return i.jsx(nM,{value:{fieldRef:y,size:l,disabled:u,hasError:!!p,variant:h},children:i.jsx(Dr,{size:l,error:p,variant:h,component:"div",ref:t,onMouseDown:x=>{var b;x.preventDefault(),o==null||o(x),(b=y.current)==null||b.focus()},onClick:x=>{var b;x.preventDefault(),s==null||s(x),(b=y.current)==null||b.focus()},...m,multiline:!0,disabled:u,__staticSelector:d||"PillsInput",withAria:!1,children:r})})});kl.displayName="@mantine/core/PillsInput";kl.Field=My;function dM({data:e,value:t}){const n=t.map(o=>o.trim().toLowerCase());return e.reduce((o,s)=>(El(s)?o.push({group:s.group,items:s.items.filter(l=>n.indexOf(l.value.toLowerCase().trim())===-1)}):n.indexOf(s.value.toLowerCase().trim())===-1&&o.push(s),o),[])}const fM={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},wu=ue((e,t)=>{const n=ie("MultiSelect",fM,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,size:p,value:h,defaultValue:m,onChange:y,onKeyDown:x,variant:b,data:w,dropdownOpened:j,defaultDropdownOpened:T,onDropdownOpen:P,onDropdownClose:k,selectFirstOptionOnChange:E,onOptionSubmit:_,comboboxProps:R,filter:M,limit:N,withScrollArea:L,maxDropdownHeight:z,searchValue:q,defaultSearchValue:G,onSearchChange:Y,readOnly:Q,disabled:te,onFocus:V,onBlur:O,onPaste:A,radius:B,rightSection:I,rightSectionWidth:F,rightSectionPointerEvents:J,rightSectionProps:de,leftSection:Ee,leftSectionWidth:ve,leftSectionPointerEvents:we,leftSectionProps:_e,inputContainer:fe,inputWrapperOrder:Je,withAsterisk:pt,labelProps:at,descriptionProps:St,errorProps:jt,wrapperProps:Et,description:vt,label:kt,error:ce,maxValues:pe,searchable:Re,nothingFoundMessage:He,withCheckIcon:he,checkIconPosition:ke,hidePickedOptions:ae,withErrorStyles:Ae,name:ut,form:Mt,id:bt,clearable:ht,clearButtonProps:xn,hiddenInputProps:cn,placeholder:Qn,hiddenInputValuesDivider:Kn,required:Jo,mod:Ts,renderOption:Ra,onRemove:ir,onClear:Io,scrollAreaProps:No,...Zo}=n,lo=mr(bt),gr=RE(w),sr=_E(gr),$n=yu({opened:j,defaultOpened:T,onDropdownOpen:P,onDropdownClose:()=>{k==null||k(),$n.resetSelectedOption()}}),{styleProps:_a,rest:{type:Da,autoComplete:ei,...ti}}=Ri(Zo),[bn,Ao]=Wn({value:h,defaultValue:m,finalValue:[],onChange:y}),[U,K]=Wn({value:q,defaultValue:G,finalValue:"",onChange:Y}),ee=Ne({name:"MultiSelect",classes:{},props:n,classNames:r,styles:l,unstyled:u}),{resolvedClassNames:le,resolvedStyles:De}=Ol({props:n,styles:l,classNames:r}),Ge=Se=>{x==null||x(Se),Se.key===" "&&!Re&&(Se.preventDefault(),$n.toggleDropdown()),Se.key==="Backspace"&&U.length===0&&bn.length>0&&(ir==null||ir(bn[bn.length-1]),Ao(bn.slice(0,bn.length-1)))},ot=bn.map((Se,Ke)=>{var lt,mt;return i.jsx(sa,{withRemoveButton:!Q&&!((lt=sr[Se])!=null&<.disabled),onRemove:()=>{Ao(bn.filter(wn=>Se!==wn)),ir==null||ir(Se)},unstyled:u,disabled:te,...ee("pill"),children:((mt=sr[Se])==null?void 0:mt.label)||Se},`${Se}-${Ke}`)});g.useEffect(()=>{E&&$n.selectFirstOption()},[E,bn]);const Me=ht&&bn.length>0&&!te&&!Q&&i.jsx(st.ClearButton,{size:p,...xn,onClear:()=>{Io==null||Io(),Ao([]),K("")}}),Be=dM({data:gr,value:bn});return i.jsxs(i.Fragment,{children:[i.jsxs(st,{store:$n,classNames:le,styles:De,unstyled:u,size:p,readOnly:Q,__staticSelector:"MultiSelect",onOptionSubmit:Se=>{_==null||_(Se),K(""),$n.updateSelectedOptionIndex("selected"),bn.includes(sr[Se].value)?(Ao(bn.filter(Ke=>Ke!==sr[Se].value)),ir==null||ir(sr[Se].value)):bn.length<pe&&Ao([...bn,sr[Se].value])},...R,children:[i.jsx(st.DropdownTarget,{children:i.jsx(kl,{..._a,__staticSelector:"MultiSelect",classNames:le,styles:De,unstyled:u,size:p,className:o,style:s,variant:b,disabled:te,radius:B,rightSection:I||Me||i.jsx(st.Chevron,{size:p,error:ce,unstyled:u}),rightSectionPointerEvents:J||(Me?"all":"none"),rightSectionWidth:F,rightSectionProps:de,leftSection:Ee,leftSectionWidth:ve,leftSectionPointerEvents:we,leftSectionProps:_e,inputContainer:fe,inputWrapperOrder:Je,withAsterisk:pt,labelProps:at,descriptionProps:St,errorProps:jt,wrapperProps:Et,description:vt,label:kt,error:ce,multiline:!0,withErrorStyles:Ae,__stylesApiProps:{...n,rightSectionPointerEvents:J||(Me?"all":"none"),multiline:!0},pointer:!Re,onClick:()=>Re?$n.openDropdown():$n.toggleDropdown(),"data-expanded":$n.dropdownOpened||void 0,id:lo,required:Jo,mod:Ts,children:i.jsxs(sa.Group,{disabled:te,unstyled:u,...ee("pillsList"),children:[ot,i.jsx(st.EventsTarget,{autoComplete:ei,children:i.jsx(kl.Field,{...ti,ref:t,id:lo,placeholder:Qn,type:!Re&&!Qn?"hidden":"visible",...ee("inputField"),unstyled:u,onFocus:Se=>{V==null||V(Se),Re&&$n.openDropdown()},onBlur:Se=>{O==null||O(Se),$n.closeDropdown(),K("")},onKeyDown:Ge,value:U,onChange:Se=>{K(Se.currentTarget.value),Re&&$n.openDropdown(),E&&$n.selectFirstOption()},disabled:te,readOnly:Q||!Re,pointer:!Re})})]})})}),i.jsx(_3,{data:ae?Be:gr,hidden:Q||te,filter:M,search:U,limit:N,hiddenWhenEmpty:!He,withScrollArea:L,maxDropdownHeight:z,filterOptions:Re,value:bn,checkIconPosition:ke,withCheckIcon:he,nothingFoundMessage:He,unstyled:u,labelId:kt?`${lo}-label`:void 0,"aria-label":kt?void 0:Zo["aria-label"],renderOption:Ra,scrollAreaProps:No})]}),i.jsx(st.HiddenInput,{name:ut,valuesDivider:Kn,value:bn,form:Mt,disabled:te,...cn})]})});wu.classes={...Dr.classes,...st.classes};wu.displayName="@mantine/core/MultiSelect";function pM(e){return"group"in e}function Oy({data:e}){if(pM(e)){const o=e.items.map(s=>i.jsx(Oy,{data:s},s.value));return i.jsx("optgroup",{label:e.group,children:o})}const{value:t,label:n,...r}=e;return i.jsx("option",{value:e.value,...r,children:e.label},e.value)}Oy.displayName="@mantine/core/NativeSelectOption";const hM={rightSectionPointerEvents:"none"},Zt=ue((e,t)=>{const{data:n,children:r,size:o,error:s,rightSection:l,unstyled:u,...d}=ie("NativeSelect",hM,e),p=RE(n).map((h,m)=>i.jsx(Oy,{data:h},m));return i.jsx(Dr,{component:"select",ref:t,...d,__staticSelector:"NativeSelect",size:o,pointer:!0,error:s,unstyled:u,rightSection:l||i.jsx(dp,{size:o,error:s,unstyled:u}),children:r||p})});Zt.classes=Dr.classes;Zt.displayName="@mantine/core/NativeSelect";var uk={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const mM={withCloseButton:!0},gM=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:At(t),"--notification-color":n?Lt(n,e):void 0}}),Ly=ue((e,t)=>{const n=ie("Notification",mM,e),{className:r,color:o,radius:s,loading:l,withCloseButton:u,withBorder:d,title:p,icon:h,children:m,onClose:y,closeButtonProps:x,classNames:b,style:w,styles:j,unstyled:T,variant:P,vars:k,mod:E,..._}=n,R=Ne({name:"Notification",classes:uk,props:n,className:r,style:w,classNames:b,styles:j,unstyled:T,vars:k,varsResolver:gM});return i.jsxs(se,{...R("root"),mod:[{"data-with-icon":!!h||l,"data-with-border":d},E],ref:t,variant:P,..._,role:"alert",children:[h&&!l&&i.jsx("div",{...R("icon"),children:h}),l&&i.jsx(Rr,{size:28,color:o,...R("loader")}),i.jsxs("div",{...R("body"),children:[p&&i.jsx("div",{...R("title"),children:p}),i.jsx(se,{...R("description"),mod:{"data-with-title":!!p},children:m})]}),u&&i.jsx(xa,{iconSize:16,color:"gray",...x,unstyled:T,onClick:y,...R("closeButton")})]})});Ly.classes=uk;Ly.displayName="@mantine/core/Notification";function dk(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 eu;(function(e){e.event="event",e.props="prop"})(eu||(eu={}));function cs(){}function vM(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(s,l){return s===t[l]})||(t=r,n=e.apply(void 0,r)),n}}function tu(e){return!!(e||"").match(/\d/)}function yl(e){return e==null}function yM(e){return typeof e=="number"&&isNaN(e)}function fk(e){return yl(e)||yM(e)||typeof e=="number"&&!isFinite(e)}function pk(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function xM(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 bM(e,t,n){var r=xM(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 wM(e){var t=g.useRef(e);t.current=e;var n=g.useRef(function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return t.current.apply(t,r)});return n.current}function $y(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var o=e.split("."),s=o[0],l=o[1]||"";return{beforeDecimal:s,afterDecimal:l,hasNegation:n,addNegation:r}}function SM(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 hk(e,t,n){for(var r="",o=n?"0":"",s=0;s<=t-1;s++)r+=e[s]||o;return r}function $w(e,t){return Array(t+1).join(e)}function mk(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),o=r[0],s=r[1];if(s=Number(s),!s)return n+o;o=o.replace(".","");var l=1+s,u=o.length;return l<0?o="0."+$w("0",Math.abs(l))+o:l>=u?o=o+$w("0",l-u):o=(o.substring(0,l)||"0")+"."+o.substring(l),n+o}function Fw(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,o=$y(e),s=o.beforeDecimal,l=o.afterDecimal,u=o.hasNegation,d=parseFloat("0."+(l||"0")),p=l.length<=t?"0."+l:d.toFixed(t),h=p.split("."),m=s;s&&Number(h[0])&&(m=s.split("").reverse().reduce(function(w,j,T){return w.length>T?(Number(w[0])+Number(j)).toString()+w.substring(1,w.length):j+w},h[0]));var y=hk(h[1]||"",t,n),x=u?"-":"",b=r?".":"";return""+x+m+b+y}function Qs(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var gk=vM(function(e,t){for(var n=0,r=0,o=e.length,s=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[s-1-r]&&s-r>n&&o-r>n;)r++;return{from:{start:n,end:o-r},to:{start:n,end:s-r}}}),jM=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function CM(e,t,n){return Math.min(Math.max(e,t),n)}function rg(e){return Math.max(e.selectionStart,e.selectionEnd)}function EM(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function kM(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function TM(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,o=e.formattedValueIndex;return t[r]===n[o]}function PM(e,t,n,r,o,s,l){l===void 0&&(l=TM);var u=o.findIndex(function(E){return E}),d=e.slice(0,u);!t&&!n.startsWith(d)&&(t=d,n=d+n,r=r+d.length);for(var p=n.length,h=e.length,m={},y=new Array(p),x=0;x<p;x++){y[x]=-1;for(var b=0,w=h;b<w;b++){var j=l({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:x,formattedValueIndex:b});if(j&&m[b]!==!0){y[x]=b,m[b]=!0;break}}}for(var T=r;T<p&&(y[T]===-1||!s(n[T]));)T++;var P=T===p||y[T]===-1?h:y[T];for(T=r-1;T>0&&y[T]===-1;)T--;var k=T===-1||y[T]===-1?0:y[T]+1;return k>P?P:r-k<P-r?k:P}function zw(e,t,n,r){var o=e.length;if(t=CM(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 RM(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(tu(e[n])||tu(e[n-1]));return t}function vk(e,t,n,r,o,s){s===void 0&&(s=cs);var l=wM(function(b,w){var j,T;return fk(b)?(T="",j=""):typeof b=="number"||w?(T=typeof b=="number"?mk(b):b,j=r(T)):(T=o(b,void 0),j=r(T)),{formattedValue:j,numAsString:T}}),u=g.useState(function(){return l(yl(e)?t:e,n)}),d=u[0],p=u[1],h=function(b,w){b.formattedValue!==d.formattedValue&&p({formattedValue:b.formattedValue,numAsString:b.value}),s(b,w)},m=e,y=n;yl(e)&&(m=d.numAsString,y=!0);var x=l(m,y);return g.useMemo(function(){p(x)},[x.formattedValue]),[d,h]}function _M(e){return e.replace(/[^0-9]/g,"")}function DM(e){return e}function IM(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,s=e.getInputRef,l=e.format;l===void 0&&(l=DM);var u=e.removeFormatting;u===void 0&&(u=_M);var d=e.defaultValue,p=e.valueIsNumericString,h=e.onValueChange,m=e.isAllowed,y=e.onChange;y===void 0&&(y=cs);var x=e.onKeyDown;x===void 0&&(x=cs);var b=e.onMouseUp;b===void 0&&(b=cs);var w=e.onFocus;w===void 0&&(w=cs);var j=e.onBlur;j===void 0&&(j=cs);var T=e.value,P=e.getCaretBoundary;P===void 0&&(P=RM);var k=e.isValidInputCharacter;k===void 0&&(k=tu);var E=e.isCharacterSame,_=dk(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),R=vk(T,d,!!p,l,u,h),M=R[0],N=M.formattedValue,L=M.numAsString,z=R[1],q=g.useRef(),G=g.useRef({formattedValue:N,numAsString:L}),Y=function(ce,pe){G.current={formattedValue:ce.formattedValue,numAsString:ce.value},z(ce,pe)},Q=g.useState(!1),te=Q[0],V=Q[1],O=g.useRef(null),A=g.useRef({setCaretTimeout:null,focusTimeout:null});g.useEffect(function(){return V(!0),function(){clearTimeout(A.current.setCaretTimeout),clearTimeout(A.current.focusTimeout)}},[]);var B=l,I=function(ce,pe){var Re=parseFloat(pe);return{formattedValue:ce,value:pe,floatValue:isNaN(Re)?void 0:Re}},F=function(ce,pe,Re){ce.selectionStart===0&&ce.selectionEnd===ce.value.length||(Qs(ce,pe),A.current.setCaretTimeout=setTimeout(function(){ce.value===Re&&ce.selectionStart!==pe&&Qs(ce,pe)},0))},J=function(ce,pe,Re){return zw(ce,pe,P(ce),Re)},de=function(ce,pe,Re){var He=P(pe),he=PM(pe,N,ce,Re,He,k,E);return he=zw(pe,he,He),he},Ee=function(ce){var pe=ce.formattedValue;pe===void 0&&(pe="");var Re=ce.input,He=ce.source,he=ce.event,ke=ce.numAsString,ae;if(Re){var Ae=ce.inputValue||Re.value,ut=rg(Re);Re.value=pe,ae=de(Ae,pe,ut),ae!==void 0&&F(Re,ae,pe)}pe!==N&&Y(I(pe,ke),{event:he,source:He})};g.useEffect(function(){var ce=G.current,pe=ce.formattedValue,Re=ce.numAsString;(N!==pe||L!==Re)&&Y(I(N,L),{event:void 0,source:eu.props})},[N,L]);var ve=O.current?rg(O.current):void 0,we=typeof window<"u"?g.useLayoutEffect:g.useEffect;we(function(){var ce=O.current;if(N!==G.current.formattedValue&&ce){var pe=de(G.current.formattedValue,N,ve);ce.value=N,F(ce,pe,N)}},[N]);var _e=function(ce,pe,Re){var He=pe.target,he=q.current?jM(q.current,He.selectionEnd):gk(N,ce),ke=Object.assign(Object.assign({},he),{lastValue:N}),ae=u(ce,ke),Ae=B(ae);if(ae=u(Ae,void 0),m&&!m(I(Ae,ae))){var ut=pe.target,Mt=rg(ut),bt=de(ce,N,Mt);return ut.value=N,F(ut,bt,N),!1}return Ee({formattedValue:Ae,numAsString:ae,inputValue:ce,event:pe,source:Re,input:pe.target}),!0},fe=function(ce,pe){pe===void 0&&(pe=0);var Re=ce.selectionStart,He=ce.selectionEnd;q.current={selectionStart:Re,selectionEnd:He+pe}},Je=function(ce){var pe=ce.target,Re=pe.value,He=_e(Re,ce,eu.event);He&&y(ce),q.current=void 0},pt=function(ce){var pe=ce.target,Re=ce.key,He=pe.selectionStart,he=pe.selectionEnd,ke=pe.value;ke===void 0&&(ke="");var ae;Re==="ArrowLeft"||Re==="Backspace"?ae=Math.max(He-1,0):Re==="ArrowRight"?ae=Math.min(He+1,ke.length):Re==="Delete"&&(ae=He);var Ae=0;Re==="Delete"&&He===he&&(Ae=1);var ut=Re==="ArrowLeft"||Re==="ArrowRight";if(ae===void 0||He!==he&&!ut){x(ce),fe(pe,Ae);return}var Mt=ae;if(ut){var bt=Re==="ArrowLeft"?"left":"right";Mt=J(ke,ae,bt),Mt!==ae&&ce.preventDefault()}else Re==="Delete"&&!k(ke[ae])?Mt=J(ke,ae,"right"):Re==="Backspace"&&!k(ke[ae])&&(Mt=J(ke,ae,"left"));Mt!==ae&&F(pe,Mt,ke),x(ce),fe(pe,Ae)},at=function(ce){var pe=ce.target,Re=function(){var He=pe.selectionStart,he=pe.selectionEnd,ke=pe.value;if(ke===void 0&&(ke=""),He===he){var ae=J(ke,He);ae!==He&&F(pe,ae,ke)}};Re(),requestAnimationFrame(function(){Re()}),b(ce),fe(pe)},St=function(ce){ce.persist&&ce.persist();var pe=ce.target,Re=ce.currentTarget;O.current=pe,A.current.focusTimeout=setTimeout(function(){var He=pe.selectionStart,he=pe.selectionEnd,ke=pe.value;ke===void 0&&(ke="");var ae=J(ke,He);ae!==He&&!(He===0&&he===ke.length)&&F(pe,ae,ke),w(Object.assign(Object.assign({},ce),{currentTarget:Re}))},0)},jt=function(ce){O.current=null,clearTimeout(A.current.focusTimeout),clearTimeout(A.current.setCaretTimeout),j(ce)},Et=te&&EM()?"numeric":void 0,vt=Object.assign({inputMode:Et},_,{type:t,value:N,onChange:Je,onKeyDown:pt,onMouseUp:at,onFocus:St,onBlur:jt});if(n==="text")return o?gn.createElement(gn.Fragment,null,o(N,_)||null):gn.createElement("span",Object.assign({},_,{ref:s}),N);if(r){var kt=r;return gn.createElement(kt,Object.assign({},vt,{ref:s}))}return gn.createElement("input",Object.assign({},vt,{ref:s}))}function Bw(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix;o===void 0&&(o="");var s=t.suffix;s===void 0&&(s="");var l=t.allowNegative,u=t.thousandsGroupStyle;if(u===void 0&&(u="thousand"),e===""||e==="-")return e;var d=jp(t),p=d.thousandSeparator,h=d.decimalSeparator,m=n!==0&&e.indexOf(".")!==-1||n&&r,y=$y(e,l),x=y.beforeDecimal,b=y.afterDecimal,w=y.addNegation;return n!==void 0&&(b=hk(b,n,!!r)),p&&(x=bM(x,p,u)),o&&(x=o+x),s&&(b=b+s),w&&(x="-"+x),e=x+(m&&h||"")+b,e}function jp(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 NM(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),s=r.test(e);return e=e.replace(/-/g,""),o&&!s&&t&&(e="-"+e),e}function AM(e,t){return new RegExp("(^-)|[0-9]|"+pk(e),"g")}function MM(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function OM(e,t,n){var r;t===void 0&&(t=kM(e));var o=n.allowNegative,s=n.prefix;s===void 0&&(s="");var l=n.suffix;l===void 0&&(l="");var u=n.decimalScale,d=t.from,p=t.to,h=p.start,m=p.end,y=jp(n),x=y.allowedDecimalSeparators,b=y.decimalSeparator,w=e[m]===b;if(tu(e)&&(e===s||e===l)&&t.lastValue==="")return e;if(m-h===1&&x.indexOf(e[h])!==-1){var j=u===0?"":b;e=e.substring(0,h)+j+e.substring(h+1,e.length)}var T=function(O,A,B){var I=!1,F=!1;s.startsWith("-")?I=!1:O.startsWith("--")?(I=!1,F=!0):l.startsWith("-")&&O.length===l.length?I=!1:O[0]==="-"&&(I=!0);var J=I?1:0;return F&&(J=2),J&&(O=O.substring(J),A-=J,B-=J),{value:O,start:A,end:B,hasNegation:I}},P=T(e,h,m),k=P.hasNegation;r=P,e=r.value,h=r.start,m=r.end;var E=T(t.lastValue,d.start,d.end),_=E.start,R=E.end,M=E.value,N=e.substring(h,m);e.length&&M.length&&(_>M.length-l.length||R<s.length)&&!(N&&l.startsWith(N))&&(e=M);var L=0;e.startsWith(s)?L+=s.length:h<s.length&&(L=h),e=e.substring(L),m-=L;var z=e.length,q=e.length-l.length;e.endsWith(l)?z=q:(m>q||m>e.length-l.length)&&(z=m),e=e.substring(0,z),e=NM(k?"-"+e:e,o),e=(e.match(AM(b))||[]).join("");var G=e.indexOf(b);e=e.replace(new RegExp(pk(b),"g"),function(O,A){return A===G?".":""});var Y=$y(e,o),Q=Y.beforeDecimal,te=Y.afterDecimal,V=Y.addNegation;return p.end-p.start<d.end-d.start&&Q===""&&w&&!parseFloat(te)&&(e=V?"-":""),e}function LM(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}),s=e[0]==="-";o.fill(!1,0,n.length+(s?1:0));var l=e.length;return o.fill(!1,l-r.length+1,l+1),o}function $M(e){var t=jp(e),n=t.thousandSeparator,r=t.decimalSeparator,o=e.prefix;o===void 0&&(o="");var s=e.allowNegative;if(s===void 0&&(s=!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("-")&&s&&(console.error(`
|
|
88
|
-
Prefix can't start with '-' when allowNegative is true.
|
|
89
|
-
prefix: `+o+`
|
|
90
|
-
allowNegative: `+s+`
|
|
91
|
-
`),s=!1),Object.assign(Object.assign({},e),{allowNegative:s})}function FM(e){e=$M(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,o=e.onKeyDown;o===void 0&&(o=cs);var s=e.onBlur;s===void 0&&(s=cs);var l=e.thousandSeparator,u=e.decimalScale,d=e.fixedDecimalScale,p=e.prefix;p===void 0&&(p="");var h=e.defaultValue,m=e.value,y=e.valueIsNumericString,x=e.onValueChange,b=dk(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),w=jp(e),j=w.decimalSeparator,T=w.allowedDecimalSeparators,P=function(V){return Bw(V,e)},k=function(V,O){return OM(V,O,e)},E=yl(m)?h:m,_=y??MM(E,p,t);yl(m)?yl(h)||(_=_||typeof h=="number"):_=_||typeof m=="number";var R=function(V){return fk(V)?V:(typeof V=="number"&&(V=mk(V)),_&&typeof u=="number"?Fw(V,u,!!d):V)},M=vk(R(m),R(h),!!_,P,k,x),N=M[0],L=N.numAsString,z=N.formattedValue,q=M[1],G=function(V){var O=V.target,A=V.key,B=O.selectionStart,I=O.selectionEnd,F=O.value;if(F===void 0&&(F=""),(A==="Backspace"||A==="Delete")&&I<p.length){V.preventDefault();return}if(B!==I){o(V);return}A==="Backspace"&&F[0]==="-"&&B===p.length+1&&n&&Qs(O,1),u&&d&&(A==="Backspace"&&F[B-1]===j?(Qs(O,B-1),V.preventDefault()):A==="Delete"&&F[B]===j&&V.preventDefault()),T!=null&&T.includes(A)&&F[B]===j&&Qs(O,B+1);var J=l===!0?",":l;A==="Backspace"&&F[B-1]===J&&Qs(O,B-1),A==="Delete"&&F[B]===J&&Qs(O,B+1),o(V)},Y=function(V){var O=L;if(O.match(/\d/g)||(O=""),r||(O=SM(O)),d&&u&&(O=Fw(O,u,d)),O!==L){var A=Bw(O,e);q({formattedValue:A,value:O,floatValue:parseFloat(O)},{event:V,source:eu.event})}s(V)},Q=function(V){return V===j?!0:tu(V)},te=function(V){var O=V.currentValue,A=V.lastValue,B=V.formattedValue,I=V.currentValueIndex,F=V.formattedValueIndex,J=O[I],de=B[F],Ee=gk(A,O),ve=Ee.to,we=function(_e){return k(_e).indexOf(".")+p.length};return m===0&&d&&u&&O[ve.start]===j&&we(O)<I&&we(B)>F?!1:I>=ve.start&&I<ve.end&&T&&T.includes(J)&&de===j?!0:J===de};return Object.assign(Object.assign({},b),{value:z,valueIsNumericString:!1,isValidInputCharacter:Q,isCharacterSame:te,onValueChange:q,format:P,removeFormatting:k,getCaretBoundary:function(V){return LM(V,e)},onKeyDown:G,onBlur:Y})}function zM(e){var t=FM(e);return gn.createElement(IM,Object.assign({},t))}function Uw({direction:e,style:t,...n}){return i.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:i.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 Bg={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const BM=/^(0\.0*|-0(\.0*)?)$/,UM=/^-?0\d+(\.\d+)?\.?$/;function Ug(e){return typeof e=="string"&&e!==""&&!Number.isNaN(Number(e))}function og(e){return typeof e=="number"?e<Number.MAX_SAFE_INTEGER:e===""||Ug(e)&&Number(e)<Number.MAX_SAFE_INTEGER}function VM(e){return e.toString().replace(".","").length}function WM(e,t){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&VM(t)<14&&t!==""}function Vw(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 HM={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},qM=(e,{size:t})=>({controls:{"--ni-chevron-size":et(t,"ni-chevron-size")}}),Fy=ue((e,t)=>{const n=ie("NumberInput",HM,e),{className:r,classNames:o,styles:s,unstyled:l,vars:u,onChange:d,onValueChange:p,value:h,defaultValue:m,max:y,min:x,step:b,hideControls:w,rightSection:j,isAllowed:T,clampBehavior:P,onBlur:k,allowDecimal:E,decimalScale:_,onKeyDown:R,onKeyDownCapture:M,handlersRef:N,startValue:L,disabled:z,rightSectionPointerEvents:q,allowNegative:G,readOnly:Y,size:Q,rightSectionWidth:te,stepHoldInterval:V,stepHoldDelay:O,allowLeadingZeros:A,withKeyboardEvents:B,trimLeadingZeroesOnBlur:I,...F}=n,J=Ne({name:"NumberInput",classes:Bg,props:n,classNames:o,styles:s,unstyled:l,vars:u,varsResolver:qM}),{resolvedClassNames:de,resolvedStyles:Ee}=Ol({classNames:o,styles:s,props:n}),[ve,we]=Wn({value:h,defaultValue:m,finalValue:"",onChange:d}),_e=O!==void 0&&V!==void 0,fe=g.useRef(null),Je=g.useRef(null),pt=g.useRef(0),at=(ae,Ae)=>{Ae.source==="event"&&we(WM(ae.floatValue,ae.value)&&!BM.test(ae.value)&&!(A&&UM.test(ae.value))?ae.floatValue:ae.value),p==null||p(ae,Ae)},St=ae=>{const Ae=String(ae).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return Ae?Math.max(0,(Ae[1]?Ae[1].length:0)-(Ae[2]?+Ae[2]:0)):0},jt=ae=>{fe.current&&typeof ae<"u"&&fe.current.setSelectionRange(ae,ae)},Et=g.useRef(xf);Et.current=()=>{if(!og(ve))return;let ae;const Ae=St(ve),ut=St(b),Mt=Math.max(Ae,ut),bt=10**Mt;if(!Ug(ve)&&(typeof ve!="number"||Number.isNaN(ve)))ae=Ac(L,x,y);else if(y!==void 0){const xn=(Math.round(Number(ve)*bt)+Math.round(b*bt))/bt;ae=xn<=y?xn:y}else ae=(Math.round(Number(ve)*bt)+Math.round(b*bt))/bt;const ht=ae.toFixed(Mt);we(parseFloat(ht)),p==null||p({floatValue:parseFloat(ht),formattedValue:ht,value:ht},{source:"increment"}),setTimeout(()=>{var xn;return jt((xn=fe.current)==null?void 0:xn.value.length)},0)};const vt=g.useRef(xf);vt.current=()=>{if(!og(ve))return;let ae;const Ae=x!==void 0?x:G?Number.MIN_SAFE_INTEGER:0,ut=St(ve),Mt=St(b),bt=Math.max(ut,Mt),ht=10**bt;if(!Ug(ve)&&typeof ve!="number"||Number.isNaN(ve))ae=Ac(L,Ae,y);else{const cn=(Math.round(Number(ve)*ht)-Math.round(b*ht))/ht;ae=Ae!==void 0&&cn<Ae?Ae:cn}const xn=ae.toFixed(bt);we(parseFloat(xn)),p==null||p({floatValue:parseFloat(xn),formattedValue:xn,value:xn},{source:"decrement"}),setTimeout(()=>{var cn;return jt((cn=fe.current)==null?void 0:cn.value.length)},0)};const kt=ae=>{R==null||R(ae),!(Y||!B)&&(ae.key==="ArrowUp"&&(ae.preventDefault(),Et.current()),ae.key==="ArrowDown"&&(ae.preventDefault(),vt.current()))},ce=ae=>{if(M==null||M(ae),ae.key==="Backspace"){const Ae=fe.current;Ae.selectionStart===0&&Ae.selectionStart===Ae.selectionEnd&&(ae.preventDefault(),window.setTimeout(()=>jt(0),0))}};Kf(N,{increment:Et.current,decrement:vt.current});const pe=ae=>{ae?Et.current():vt.current(),pt.current+=1},Re=ae=>{if(pe(ae),_e){const Ae=typeof V=="number"?V:V(pt.current);Je.current=window.setTimeout(()=>Re(ae),Ae)}},He=(ae,Ae)=>{var ut;ae.preventDefault(),(ut=fe.current)==null||ut.focus(),pe(Ae),_e&&(Je.current=window.setTimeout(()=>Re(Ae),O))},he=()=>{Je.current&&window.clearTimeout(Je.current),Je.current=null,pt.current=0},ke=i.jsxs("div",{...J("controls"),children:[i.jsx(Gn,{...J("control"),tabIndex:-1,"aria-hidden":!0,disabled:z||typeof ve=="number"&&y!==void 0&&ve>=y,mod:{direction:"up"},onMouseDown:ae=>ae.preventDefault(),onPointerDown:ae=>{He(ae,!0)},onPointerUp:he,onPointerLeave:he,children:i.jsx(Uw,{direction:"up"})}),i.jsx(Gn,{...J("control"),tabIndex:-1,"aria-hidden":!0,disabled:z||typeof ve=="number"&&x!==void 0&&ve<=x,mod:{direction:"down"},onMouseDown:ae=>ae.preventDefault(),onPointerDown:ae=>{He(ae,!1)},onPointerUp:he,onPointerLeave:he,children:i.jsx(Uw,{direction:"down"})})]});return i.jsx(Dr,{component:zM,allowNegative:G,className:It(Bg.root,r),size:Q,...F,readOnly:Y,disabled:z,value:ve,getInputRef:In(t,fe),onValueChange:at,rightSection:w||Y||!og(ve)?j:j||ke,classNames:de,styles:Ee,unstyled:l,__staticSelector:"NumberInput",decimalScale:E?_:0,onKeyDown:kt,onKeyDownCapture:ce,rightSectionPointerEvents:q??(z?"none":void 0),rightSectionWidth:te??`var(--ni-right-section-width-${Q||"sm"})`,allowLeadingZeros:A,onBlur:ae=>{if(k==null||k(ae),P==="blur"&&typeof ve=="number"&&Ac(ve,x,y)!==ve&&we(Ac(ve,x,y)),I&&typeof ve=="string"&&St(ve)<15){const Ae=ve.replace(/^0+/,""),ut=parseFloat(Ae);we(Number.isNaN(ut)||ut>Number.MAX_SAFE_INTEGER?Ae:Ac(ut,x,y))}},isAllowed:ae=>P==="strict"?T?T(ae)&&Vw(ae.floatValue,x,y):Vw(ae.floatValue,x,y):T?T(ae):!0})});Fy.classes={...Dr.classes,...Bg};Fy.displayName="@mantine/core/NumberInput";const[GM,Cp]=hr("Pagination.Root component was not found in tree");var Su={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const QM={withPadding:!0},ju=ue((e,t)=>{const n=ie("PaginationControl",QM,e),{classNames:r,className:o,style:s,styles:l,vars:u,active:d,disabled:p,withPadding:h,mod:m,...y}=n,x=Cp(),b=p||x.disabled;return i.jsx(Gn,{ref:t,disabled:b,mod:[{active:d,disabled:b,"with-padding":h},m],...x.getStyles("control",{className:o,style:s,classNames:r,styles:l,active:!b}),...y})});ju.classes=Su;ju.displayName="@mantine/core/PaginationControl";function Cu({style:e,children:t,path:n,...r}){return i.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:i.jsx("path",{d:n,fill:"currentColor"})})}const KM=e=>i.jsx(Cu,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),YM=e=>i.jsx(Cu,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),XM=e=>i.jsx(Cu,{...e,path:"M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z"}),JM=e=>i.jsx(Cu,{...e,path:"M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z"}),ZM=e=>i.jsx(Cu,{...e,path:"M2 8c0-.733.6-1.333 1.333-1.333.734 0 1.334.6 1.334 1.333s-.6 1.333-1.334 1.333C2.6 9.333 2 8.733 2 8zm9.333 0c0-.733.6-1.333 1.334-1.333C13.4 6.667 14 7.267 14 8s-.6 1.333-1.333 1.333c-.734 0-1.334-.6-1.334-1.333zM6.667 8c0-.733.6-1.333 1.333-1.333s1.333.6 1.333 1.333S8.733 9.333 8 9.333 6.667 8.733 6.667 8z"}),eO={icon:ZM},Ep=ue((e,t)=>{const n=ie("PaginationDots",eO,e),{classNames:r,className:o,style:s,styles:l,vars:u,icon:d,...p}=n,h=Cp(),m=d;return i.jsx(se,{ref:t,...h.getStyles("dots",{className:o,style:s,styles:l,classNames:r}),...p,children:i.jsx(m,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});Ep.classes=Su;Ep.displayName="@mantine/core/PaginationDots";function kp({icon:e,name:t,action:n,type:r}){const o={icon:e},s=g.forwardRef((l,u)=>{const{icon:d,...p}=ie(t,o,l),h=d,m=Cp(),y=r==="next"?m.active===m.total:m.active===1;return i.jsx(ju,{disabled:m.disabled||y,ref:u,onClick:m[n],withPadding:!1,...p,children:i.jsx(h,{className:"mantine-rotate-rtl",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});return s.displayName=`@mantine/core/${t}`,s}const yk=kp({icon:KM,name:"PaginationNext",action:"onNext",type:"next"}),xk=kp({icon:YM,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),bk=kp({icon:XM,name:"PaginationFirst",action:"onFirst",type:"previous"}),wk=kp({icon:JM,name:"PaginationLast",action:"onLast",type:"next"});function zy({dotsIcon:e}){const t=Cp(),n=t.range.map((r,o)=>{var s,l,u;return r==="dots"?i.jsx(Ep,{icon:e},o):i.jsx(ju,{active:r===t.active,"aria-current":r===t.active?"page":void 0,onClick:()=>t.onChange(r),disabled:t.disabled,...(s=t.getItemProps)==null?void 0:s.call(t,r),children:((u=(l=t.getItemProps)==null?void 0:l.call(t,r))==null?void 0:u.children)??r},o)});return i.jsx(i.Fragment,{children:n})}zy.displayName="@mantine/core/PaginationItems";const tO={siblings:1,boundaries:1},nO=(e,{size:t,radius:n,color:r,autoContrast:o})=>({root:{"--pagination-control-radius":n===void 0?void 0:At(n),"--pagination-control-size":et(t,"pagination-control-size"),"--pagination-control-fz":Rn(t),"--pagination-active-bg":r?Lt(r,e):void 0,"--pagination-active-color":ma(o,e)?Pi({color:r,theme:e,autoContrast:o}):void 0}}),Tp=ue((e,t)=>{const n=ie("PaginationRoot",tO,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,total:p,value:h,defaultValue:m,onChange:y,disabled:x,siblings:b,boundaries:w,color:j,radius:T,onNextPage:P,onPreviousPage:k,onFirstPage:E,onLastPage:_,getItemProps:R,autoContrast:M,...N}=n,L=Ne({name:"Pagination",classes:Su,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:nO}),{range:z,setPage:q,next:G,previous:Y,active:Q,first:te,last:V}=ID({page:h,initialPage:m,onChange:y,total:p,siblings:b,boundaries:w}),O=Er(P,G),A=Er(k,Y),B=Er(E,te),I=Er(_,V);return i.jsx(GM,{value:{total:p,range:z,active:Q,disabled:x,getItemProps:R,onChange:q,onNext:O,onPrevious:A,onFirst:B,onLast:I,getStyles:L},children:i.jsx(se,{ref:t,...L("root"),...N})})});Tp.classes=Su;Tp.displayName="@mantine/core/PaginationRoot";const rO={withControls:!0,siblings:1,boundaries:1,gap:8},_o=ue((e,t)=>{const n=ie("Pagination",rO,e),{withEdges:r,withControls:o,getControlProps:s,nextIcon:l,previousIcon:u,lastIcon:d,firstIcon:p,dotsIcon:h,total:m,gap:y,hideWithOnePage:x,...b}=n;return m<=0||x&&m===1?null:i.jsx(Tp,{ref:t,total:m,...b,children:i.jsxs(be,{gap:y,children:[r&&i.jsx(bk,{icon:p,...s==null?void 0:s("first")}),o&&i.jsx(xk,{icon:u,...s==null?void 0:s("previous")}),i.jsx(zy,{dotsIcon:h}),o&&i.jsx(yk,{icon:l,...s==null?void 0:s("next")}),r&&i.jsx(wk,{icon:d,...s==null?void 0:s("last")})]})})});_o.classes=Su;_o.displayName="@mantine/core/Pagination";_o.Root=Tp;_o.Control=ju;_o.Dots=Ep;_o.First=bk;_o.Last=wk;_o.Next=yk;_o.Previous=xk;_o.Items=zy;const oO=({reveal:e})=>i.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:i.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 Vg={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const iO={visibilityToggleIcon:oO},sO=(e,{size:t})=>({root:{"--psi-icon-size":et(t,"psi-icon-size"),"--psi-button-size":et(t,"psi-button-size")}}),Co=ue((e,t)=>{const n=ie("PasswordInput",iO,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,required:p,error:h,leftSection:m,disabled:y,id:x,variant:b,inputContainer:w,description:j,label:T,size:P,errorProps:k,descriptionProps:E,labelProps:_,withAsterisk:R,inputWrapperOrder:M,wrapperProps:N,radius:L,rightSection:z,rightSectionWidth:q,rightSectionPointerEvents:G,leftSectionWidth:Y,visible:Q,defaultVisible:te,onVisibilityChange:V,visibilityToggleIcon:O,visibilityToggleButtonProps:A,rightSectionProps:B,leftSectionProps:I,leftSectionPointerEvents:F,withErrorStyles:J,mod:de,...Ee}=n,ve=mr(x),[we,_e]=Wn({value:Q,defaultValue:te,finalValue:!1,onChange:V}),fe=()=>_e(!we),Je=Ne({name:"PasswordInput",classes:Vg,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:sO}),{resolvedClassNames:pt,resolvedStyles:at}=Ol({classNames:r,styles:l,props:n}),{styleProps:St,rest:jt}=Ri(Ee),Et=O,vt=i.jsx(Cn,{...Je("visibilityToggle"),disabled:y,radius:L,"aria-hidden":!A,tabIndex:-1,...A,variant:(A==null?void 0:A.variant)??"subtle",color:"gray",unstyled:u,onTouchEnd:kt=>{var ce;kt.preventDefault(),(ce=A==null?void 0:A.onTouchEnd)==null||ce.call(A,kt),fe()},onMouseDown:kt=>{var ce;kt.preventDefault(),(ce=A==null?void 0:A.onMouseDown)==null||ce.call(A,kt),fe()},onKeyDown:kt=>{var ce;(ce=A==null?void 0:A.onKeyDown)==null||ce.call(A,kt),kt.key===" "&&(kt.preventDefault(),fe())},children:i.jsx(Et,{reveal:we})});return i.jsx(pn.Wrapper,{required:p,id:ve,label:T,error:h,description:j,size:P,classNames:pt,styles:at,__staticSelector:"PasswordInput",errorProps:k,descriptionProps:E,unstyled:u,withAsterisk:R,inputWrapperOrder:M,inputContainer:w,variant:b,labelProps:{..._,htmlFor:ve},mod:de,...Je("root"),...St,...N,children:i.jsx(pn,{component:"div",error:h,leftSection:m,size:P,classNames:{...pt,input:It(Vg.input,pt.input)},styles:at,radius:L,disabled:y,__staticSelector:"PasswordInput",rightSectionWidth:q,rightSection:z??vt,variant:b,unstyled:u,leftSectionWidth:Y,rightSectionPointerEvents:G||"all",rightSectionProps:B,leftSectionProps:I,leftSectionPointerEvents:F,withAria:!1,withErrorStyles:J,children:i.jsx("input",{required:p,"data-invalid":!!h||void 0,"data-with-left-section":!!m||void 0,...Je("innerInput"),disabled:y,id:ve,ref:t,...jt,autoComplete:jt.autoComplete||"off",type:we?"text":"password"})})})});Co.classes={...Dr.classes,...Vg};Co.displayName="@mantine/core/PasswordInput";const[aO,Sk]=vs(),[lO,cO]=vs();var jk={card:"m_9dc8ae12"};const uO={withBorder:!0},dO=(e,{radius:t})=>({card:{"--card-radius":At(t)}}),By=ue((e,t)=>{const n=ie("RadioCard",uO,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,checked:p,mod:h,withBorder:m,value:y,onClick:x,name:b,onKeyDown:w,...j}=n,T=Ne({name:"RadioCard",classes:jk,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:dO,rootSelector:"card"}),{dir:P}=va(),k=Sk(),E=typeof p=="boolean"?p:(k==null?void 0:k.value)===y||!1,_=b||(k==null?void 0:k.name),R=M=>{if(w==null||w(M),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(M.nativeEvent.code)){M.preventDefault();const N=Array.from(document.querySelectorAll(`[role="radio"][name="${_||"__mantine"}"]`)),L=N.findIndex(G=>G===M.target),z=L+1>=N.length?0:L+1,q=L-1<0?N.length-1:L-1;M.nativeEvent.code==="ArrowDown"&&(N[z].focus(),N[z].click()),M.nativeEvent.code==="ArrowUp"&&(N[q].focus(),N[q].click()),M.nativeEvent.code==="ArrowLeft"&&(N[P==="ltr"?q:z].focus(),N[P==="ltr"?q:z].click()),M.nativeEvent.code==="ArrowRight"&&(N[P==="ltr"?z:q].focus(),N[P==="ltr"?z:q].click())}};return i.jsx(lO,{value:{checked:E},children:i.jsx(Gn,{ref:t,mod:[{"with-border":m,checked:E},h],...T("card"),...j,role:"radio","aria-checked":E,name:_,onClick:M=>{x==null||x(M),k==null||k.onChange(y||"")},onKeyDown:R})})});By.displayName="@mantine/core/RadioCard";By.classes=jk;const fO={},Uy=ue((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:s,wrapperProps:l,children:u,name:d,readOnly:p,...h}=ie("RadioGroup",fO,e),m=mr(d),[y,x]=Wn({value:n,defaultValue:r,finalValue:"",onChange:o}),b=w=>!p&&x(typeof w=="string"?w:w.currentTarget.value);return i.jsx(aO,{value:{value:y,onChange:b,size:s,name:m},children:i.jsx(pn.Wrapper,{size:s,ref:t,...l,...h,labelElement:"div",__staticSelector:"RadioGroup",children:i.jsx(hy,{role:"radiogroup",children:u})})})});Uy.classes=pn.Wrapper.classes;Uy.displayName="@mantine/core/RadioGroup";function Ck({size:e,style:t,...n}){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:{width:oe(e),height:oe(e),...t},"aria-hidden":!0,...n,children:i.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}var Ek={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const pO={icon:Ck},hO=(e,{radius:t,color:n,size:r,iconColor:o,variant:s,autoContrast:l})=>{const u=eo({color:n||e.primaryColor,theme:e}),d=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{indicator:{"--radio-size":et(r,"radio-size"),"--radio-radius":t===void 0?void 0:At(t),"--radio-color":s==="outline"?d:Lt(n,e),"--radio-icon-size":et(r,"radio-icon-size"),"--radio-icon-color":o?Lt(o,e):ma(l,e)?Pi({color:n,theme:e,autoContrast:l}):void 0}}},Vy=ue((e,t)=>{const n=ie("RadioIndicator",pO,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,icon:p,radius:h,color:m,iconColor:y,autoContrast:x,checked:b,mod:w,variant:j,disabled:T,...P}=n,k=p,E=Ne({name:"RadioIndicator",classes:Ek,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:hO,rootSelector:"indicator"}),_=cO(),R=typeof b=="boolean"?b:(_==null?void 0:_.checked)||!1;return i.jsx(se,{ref:t,...E("indicator",{variant:j}),variant:j,mod:[{checked:R,disabled:T},w],...P,children:i.jsx(k,{...E("icon")})})});Vy.displayName="@mantine/core/RadioIndicator";Vy.classes=Ek;var kk={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const mO={labelPosition:"right"},gO=(e,{size:t,radius:n,color:r,iconColor:o,variant:s,autoContrast:l})=>{const u=eo({color:r||e.primaryColor,theme:e}),d=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{root:{"--radio-size":et(t,"radio-size"),"--radio-radius":n===void 0?void 0:At(n),"--radio-color":s==="outline"?d:Lt(r,e),"--radio-icon-color":o?Lt(o,e):ma(l,e)?Pi({color:r,theme:e,autoContrast:l}):void 0,"--radio-icon-size":et(t,"radio-icon-size")}}},aa=ue((e,t)=>{const n=ie("Radio",mO,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,id:p,size:h,label:m,labelPosition:y,description:x,error:b,radius:w,color:j,variant:T,disabled:P,wrapperProps:k,icon:E=Ck,rootRef:_,iconColor:R,onChange:M,mod:N,...L}=n,z=Ne({name:"Radio",classes:kk,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:gO}),q=Sk(),G=(q==null?void 0:q.size)??h,Y=n.size?h:G,{styleProps:Q,rest:te}=Ri(L),V=mr(p),O=q?{checked:q.value===te.value,name:te.name??q.name,onChange:A=>{q.onChange(A),M==null||M(A)}}:{};return i.jsx(fp,{...z("root"),__staticSelector:"Radio",__stylesApiProps:n,id:V,size:Y,labelPosition:y,label:m,description:x,error:b,disabled:P,classNames:r,styles:l,unstyled:u,"data-checked":O.checked||void 0,variant:T,ref:_,mod:N,...Q,...k,children:i.jsxs(se,{...z("inner"),mod:{"label-position":y},children:[i.jsx(se,{...z("radio",{focusable:!0,variant:T}),onChange:M,...te,...O,component:"input",mod:{error:!!b},ref:t,id:V,disabled:P,type:"radio"}),i.jsx(E,{...z("icon"),"aria-hidden":!0})]})})});aa.classes=kk;aa.displayName="@mantine/core/Radio";aa.Group=Uy;aa.Card=By;aa.Indicator=Vy;const vO={duration:100,transition:"fade"};function yO(e,t){return{...vO,...t,...e}}function xO({offset:e,position:t,defaultOpened:n}){const[r,o]=g.useState(n),s=g.useRef(null),{x:l,y:u,elements:d,refs:p,update:h,placement:m}=Wv({placement:t,middleware:[zv({crossAxis:!0,padding:5,rootBoundary:"document"})]}),y=m.includes("right")?e:t.includes("left")?e*-1:0,x=m.includes("bottom")?e:t.includes("top")?e*-1:0,b=g.useCallback(({clientX:w,clientY:j})=>{p.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:w,y:j,left:w+y,top:j+x,right:w,bottom:j}}})},[d.reference]);return g.useEffect(()=>{if(p.floating.current){const w=s.current;w.addEventListener("mousemove",b);const j=yi(p.floating.current);return j.forEach(T=>{T.addEventListener("scroll",h)}),()=>{w.removeEventListener("mousemove",b),j.forEach(T=>{T.removeEventListener("scroll",h)})}}},[d.reference,p.floating.current,h,b,r]),{handleMouseMove:b,x:l,y:u,opened:r,setOpened:o,boundaryRef:s,floating:p.setFloating}}var Pp={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const bO={refProp:"ref",withinPortal:!0,offset:10,defaultOpened:!1,position:"right",zIndex:Vr("popover")},wO=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:At(t),"--tooltip-bg":n?Lt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),Wy=ue((e,t)=>{const n=ie("TooltipFloating",bO,e),{children:r,refProp:o,withinPortal:s,style:l,className:u,classNames:d,styles:p,unstyled:h,radius:m,color:y,label:x,offset:b,position:w,multiline:j,zIndex:T,disabled:P,defaultOpened:k,variant:E,vars:_,portalProps:R,...M}=n,N=ln(),L=Ne({name:"TooltipFloating",props:n,classes:Pp,className:u,style:l,classNames:d,styles:p,unstyled:h,rootSelector:"tooltip",vars:_,varsResolver:wO}),{handleMouseMove:z,x:q,y:G,opened:Y,boundaryRef:Q,floating:te,setOpened:V}=xO({offset:b,position:w,defaultOpened:k});if(!Ti(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 O=In(Q,Xf(r),t),A=r.props,B=F=>{var J;(J=A.onMouseEnter)==null||J.call(A,F),z(F),V(!0)},I=F=>{var J;(J=A.onMouseLeave)==null||J.call(A,F),V(!1)};return i.jsxs(i.Fragment,{children:[i.jsx(ya,{...R,withinPortal:s,children:i.jsx(se,{...M,...L("tooltip",{style:{...vC(l,N),zIndex:T,display:!P&&Y?"block":"none",top:(G&&Math.round(G))??"",left:(q&&Math.round(q))??""}}),variant:E,ref:te,mod:{multiline:j},children:x})}),g.cloneElement(r,{...A,[o]:O,onMouseEnter:B,onMouseLeave:I})]})});Wy.classes=Pp;Wy.displayName="@mantine/core/TooltipFloating";const Tk=g.createContext(!1),SO=Tk.Provider,jO=()=>g.useContext(Tk),CO={openDelay:0,closeDelay:0};function Hy(e){const{openDelay:t,closeDelay:n,children:r}=ie("TooltipGroup",CO,e);return i.jsx(SO,{value:!0,children:i.jsx(xA,{delay:{open:t,close:n},children:r})})}Hy.displayName="@mantine/core/TooltipGroup";Hy.extend=e=>e;function EO(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 kO(e){const t=EO(e.middlewares),n=[KC(e.offset)];return t.shift&&n.push(zv(typeof t.shift=="boolean"?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip=="boolean"?Cf():Cf(t.flip)),n.push(YC({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline=="boolean"?Hc():Hc(t.inline)):e.inline&&n.push(Hc()),n}function TO(e){var R,M,N;const[t,n]=g.useState(e.defaultOpened),o=typeof e.opened=="boolean"?e.opened:t,s=jO(),l=mr(),{delay:u,currentId:d,setCurrentId:p}=eE(),h=g.useCallback(L=>{n(L),L&&p(l)},[p,l]),{x:m,y,context:x,refs:b,update:w,placement:j,middlewareData:{arrow:{x:T,y:P}={}}}=Wv({strategy:e.strategy,placement:e.position,open:o,onOpenChange:h,middleware:kO(e)});bA(x,{id:l});const{getReferenceProps:k,getFloatingProps:E}=TA([yA(x,{enabled:(R=e.events)==null?void 0:R.hover,delay:s?u:{open:e.openDelay,close:e.closeDelay},mouseOnly:!((M=e.events)!=null&&M.touch)}),kA(x,{enabled:(N=e.events)==null?void 0:N.focus,visibleOnly:!0}),RA(x,{role:"tooltip"}),CA(x,{enabled:typeof e.opened>"u"})]);aE({opened:o,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:b,update:w}}),bi(()=>{var L;(L=e.onPositionChange)==null||L.call(e,j)},[j]);const _=o&&d&&d!==l;return{x:m,y,arrowX:T,arrowY:P,reference:b.setReference,floating:b.setFloating,getFloatingProps:E,getReferenceProps:k,isGroupPhase:_,opened:o,placement:j}}const Ww={position:"top",refProp:"ref",withinPortal:!0,inline:!1,defaultOpened:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:Vr("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},PO=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:At(t),"--tooltip-bg":n?Lt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),wa=ue((e,t)=>{const n=ie("Tooltip",Ww,e),{children:r,position:o,refProp:s,label:l,openDelay:u,closeDelay:d,onPositionChange:p,opened:h,defaultOpened:m,withinPortal:y,radius:x,color:b,classNames:w,styles:j,unstyled:T,style:P,className:k,withArrow:E,arrowSize:_,arrowOffset:R,arrowRadius:M,arrowPosition:N,offset:L,transitionProps:z,multiline:q,events:G,zIndex:Y,disabled:Q,positionDependencies:te,onClick:V,onMouseEnter:O,onMouseLeave:A,inline:B,variant:I,keepMounted:F,vars:J,portalProps:de,mod:Ee,floatingStrategy:ve,middlewares:we,..._e}=ie("Tooltip",Ww,n),{dir:fe}=va(),Je=g.useRef(null),pt=TO({position:tE(fe,o),closeDelay:d,openDelay:u,onPositionChange:p,opened:h,defaultOpened:m,events:G,arrowRef:Je,arrowOffset:R,offset:typeof L=="number"?L+(E?_/2:0):L,positionDependencies:[...te,r],inline:B,strategy:ve,middlewares:we}),at=Ne({name:"Tooltip",props:n,classes:Pp,className:k,style:P,classNames:w,styles:j,unstyled:T,rootSelector:"tooltip",vars:J,varsResolver:PO});if(!Ti(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=In(pt.reference,Xf(r),t),jt=yO(z,{duration:100,transition:"fade"}),Et=r.props;return i.jsxs(i.Fragment,{children:[i.jsx(ya,{...de,withinPortal:y,children:i.jsx(_i,{...jt,keepMounted:F,mounted:!Q&&!!pt.opened,duration:pt.isGroupPhase?10:jt.duration,children:vt=>i.jsxs(se,{..._e,"data-fixed":ve==="fixed"||void 0,variant:I,mod:[{multiline:q},Ee],...pt.getFloatingProps({ref:pt.floating,className:at("tooltip").className,style:{...at("tooltip").style,...vt,zIndex:Y,top:pt.y??0,left:pt.x??0}}),children:[l,i.jsx(Hv,{ref:Je,arrowX:pt.arrowX,arrowY:pt.arrowY,visible:E,position:pt.placement,arrowSize:_,arrowOffset:R,arrowRadius:M,arrowPosition:N,...at("arrow")})]})})}),g.cloneElement(r,pt.getReferenceProps({onClick:V,onMouseEnter:O,onMouseLeave:A,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,[s]:St,className:It(k,Et.className),...Et}))]})});wa.classes=Pp;wa.displayName="@mantine/core/Tooltip";wa.Floating=Wy;wa.Group=Hy;function RO({size:e,thickness:t,sum:n,value:r,root:o,offset:s}){const l=(e*.9-t*2)/2,u=Math.PI*l*2/100,d=o||r===void 0?`${(100-n)*u}, ${n*u}`:`${r*u}, ${(100-r)*u}`;return{strokeWidth:Number.isNaN(t)?12:t,cx:e/2||0,cy:e/2||0,r:l||0,transform:o?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:d,strokeDashoffset:o?0:s||0}}function Pk({size:e,value:t,offset:n,sum:r,thickness:o,root:s,color:l,lineRoundCaps:u,tooltip:d,getStyles:p,display:h,...m}){const y=ln();return i.jsx(wa.Floating,{disabled:!d,label:d,children:i.jsx(se,{component:"circle",...m,...p("curve"),__vars:{"--curve-color":l?Lt(l,y):void 0},fill:"none",strokeLinecap:u?"round":"butt",...RO({sum:r,size:e,thickness:o,value:t,offset:n,root:s})})})}Pk.displayName="@mantine/core/Curve";function _O({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:o}){const s=n.reduce((h,m)=>h+m.value,0),l=Math.PI*((e*.9-t*2)/2)*2;let u=l;const d=[],p=[];for(let h=0;h<n.length;h+=1)d.push({sum:s,offset:u,data:n[h],root:!1}),u-=n[h].value/100*l;if(d.push({sum:s,offset:u,data:{color:o},root:!0}),p.push({...d[d.length-1],lineRoundCaps:!1}),d.length>2){p.push({...d[0],lineRoundCaps:r}),p.push({...d[d.length-2],lineRoundCaps:r});for(let h=1;h<=d.length-3;h+=1)p.push({...d[h],lineRoundCaps:!1})}else p.push({...d[0],lineRoundCaps:r});return p}var Rk={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function DO(e,t){return Math.min(e||12,(t||120)/4)}const IO={size:120,thickness:12},NO=(e,{size:t,thickness:n,transitionDuration:r})=>({root:{"--rp-size":oe(t),"--rp-label-offset":oe(n*2),"--rp-transition-duration":r?`${r}ms`:void 0}}),Rp=ue((e,t)=>{const n=ie("RingProgress",IO,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,label:p,sections:h,size:m,thickness:y,roundCaps:x,rootColor:b,transitionDuration:w,...j}=n,T=Ne({name:"RingProgress",classes:Rk,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:NO}),P=DO(y,m),k=_O({size:m,thickness:P,sections:h,renderRoundedLineCaps:x,rootColor:b}).map(({data:E,sum:_,root:R,lineRoundCaps:M,offset:N},L)=>g.createElement(Pk,{...E,key:L,size:m,thickness:P,sum:_,offset:N,color:E==null?void 0:E.color,root:R,lineRoundCaps:M,getStyles:T}));return i.jsxs(se,{...T("root"),size:m,ref:t,...j,children:[i.jsx("svg",{...T("svg"),children:k}),p&&i.jsx("div",{...T("label"),children:p})]})});Rp.classes=Rk;Rp.displayName="@mantine/core/RingProgress";var _k={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const AO={withItemsBorders:!0},MO=(e,{radius:t,color:n,transitionDuration:r,size:o,transitionTimingFunction:s})=>({root:{"--sc-radius":t===void 0?void 0:At(t),"--sc-color":n?Lt(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":s,"--sc-padding":et(o,"sc-padding"),"--sc-font-size":Rn(o)}}),qy=ue((e,t)=>{var we,_e;const n=ie("SegmentedControl",AO,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,data:p,value:h,defaultValue:m,onChange:y,size:x,name:b,disabled:w,readOnly:j,fullWidth:T,orientation:P,radius:k,color:E,transitionDuration:_,transitionTimingFunction:R,variant:M,autoContrast:N,withItemsBorders:L,mod:z,...q}=n,G=Ne({name:"SegmentedControl",props:n,classes:_k,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:MO}),Y=ln(),Q=p.map(fe=>typeof fe=="string"?{label:fe,value:fe}:fe),te=MD(),[V,O]=g.useState(null),[A,B]=g.useState({}),I=(fe,Je)=>{A[Je]=fe,B(A)},[F,J]=Wn({value:h,defaultValue:m,finalValue:Array.isArray(p)?((we=Q.find(fe=>!fe.disabled))==null?void 0:we.value)??((_e=p[0])==null?void 0:_e.value)??null:null,onChange:y}),de=mr(b),Ee=Q.map(fe=>g.createElement(se,{...G("control"),mod:{active:F===fe.value,orientation:P},key:fe.value},g.createElement("input",{...G("input"),disabled:w||fe.disabled,type:"radio",name:de,value:fe.value,id:`${de}-${fe.value}`,checked:F===fe.value,onChange:()=>!j&&J(fe.value),"data-focus-ring":Y.focusRing,key:`${fe.value}-input`}),g.createElement(se,{component:"label",...G("label"),mod:{active:F===fe.value&&!(w||fe.disabled),disabled:w||fe.disabled,"read-only":j},htmlFor:`${de}-${fe.value}`,ref:Je=>I(Je,fe.value),__vars:{"--sc-label-color":E!==void 0?Pi({color:E,theme:Y,autoContrast:N}):void 0},key:`${fe.value}-label`},i.jsx("span",{...G("innerLabel"),children:fe.label})))),ve=In(t,fe=>O(fe));return p.length===0?null:i.jsxs(se,{...G("root"),variant:M,size:x,ref:ve,mod:[{"full-width":T,orientation:P,initialized:te,"with-items-borders":L},z],...q,role:"radiogroup","data-disabled":w,children:[typeof F=="string"&&i.jsx(Xv,{target:A[F],parent:V,component:"span",transitionDuration:"var(--sc-transition-duration)",...G("indicator")}),Ee]})});qy.classes=_k;qy.displayName="@mantine/core/SegmentedControl";function OO({spacing:e,verticalSpacing:t,cols:n,selector:r}){var h;const o=ln(),s=t===void 0?e:t,l=gs({"--sg-spacing-x":Pn(So(e)),"--sg-spacing-y":Pn(So(s)),"--sg-cols":(h=So(n))==null?void 0:h.toString()}),u=Gt(o.breakpoints).reduce((m,y)=>(m[y]||(m[y]={}),typeof e=="object"&&e[y]!==void 0&&(m[y]["--sg-spacing-x"]=Pn(e[y])),typeof s=="object"&&s[y]!==void 0&&(m[y]["--sg-spacing-y"]=Pn(s[y])),typeof n=="object"&&n[y]!==void 0&&(m[y]["--sg-cols"]=n[y]),m),{}),p=Kc(Gt(u),o.breakpoints).filter(m=>Gt(u[m.value]).length>0).map(m=>({query:`(min-width: ${o.breakpoints[m.value]})`,styles:u[m.value]}));return i.jsx(ga,{styles:l,media:p,selector:r})}function ig(e){return typeof e=="object"&&e!==null?Gt(e):[]}function LO(e){return e.sort((t,n)=>Qc(t)-Qc(n))}function $O({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...ig(e),...ig(t),...ig(n)]));return LO(r)}function FO({spacing:e,verticalSpacing:t,cols:n,selector:r}){var p;const o=t===void 0?e:t,s=gs({"--sg-spacing-x":Pn(So(e)),"--sg-spacing-y":Pn(So(o)),"--sg-cols":(p=So(n))==null?void 0:p.toString()}),l=$O({spacing:e,verticalSpacing:t,cols:n}),u=l.reduce((h,m)=>(h[m]||(h[m]={}),typeof e=="object"&&e[m]!==void 0&&(h[m]["--sg-spacing-x"]=Pn(e[m])),typeof o=="object"&&o[m]!==void 0&&(h[m]["--sg-spacing-y"]=Pn(o[m])),typeof n=="object"&&n[m]!==void 0&&(h[m]["--sg-cols"]=n[m]),h),{}),d=l.map(h=>({query:`simple-grid (min-width: ${h})`,styles:u[h]}));return i.jsx(ga,{styles:s,container:d,selector:r})}var Dk={container:"m_925c2d2c",root:"m_2415a157"};const zO={cols:1,spacing:"md",type:"media"},Gy=ue((e,t)=>{const n=ie("SimpleGrid",zO,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,cols:p,verticalSpacing:h,spacing:m,type:y,...x}=n,b=Ne({name:"SimpleGrid",classes:Dk,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d}),w=fu();return y==="container"?i.jsxs(i.Fragment,{children:[i.jsx(FO,{...n,selector:`.${w}`}),i.jsx("div",{...b("container"),children:i.jsx(se,{ref:t,...b("root",{className:w}),...x})})]}):i.jsxs(i.Fragment,{children:[i.jsx(OO,{...n,selector:`.${w}`}),i.jsx(se,{ref:t,...b("root",{className:w}),...x})]})});Gy.classes=Dk;Gy.displayName="@mantine/core/SimpleGrid";const BO={},_p=ue((e,t)=>{const{w:n,h:r,miw:o,mih:s,...l}=ie("Space",BO,e);return i.jsx(se,{ref:t,...l,w:n,miw:o??n,h:r,mih:s??r})});_p.displayName="@mantine/core/Space";var Ik={root:"m_6d731127"};const UO={gap:"md",align:"stretch",justify:"flex-start"},VO=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":Pn(t),"--stack-align":n,"--stack-justify":r}}),tt=ue((e,t)=>{const n=ie("Stack",UO,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,align:p,justify:h,gap:m,variant:y,...x}=n,b=Ne({name:"Stack",props:n,classes:Ik,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:VO});return i.jsx(se,{ref:t,...b("root"),variant:y,...x})});tt.classes=Ik;tt.displayName="@mantine/core/Stack";const[WO,HO]=hr("Stepper component was not found in tree"),kf=()=>null;kf.displayName="@mantine/core/StepperCompleted";var Qy={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 Zd=(e,t)=>typeof e=="function"?i.jsx(e,{step:t||0}):e,qO={withIcon:!0,allowStepClick:!0,iconPosition:"left"},Ky=ue((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:l,step:u,state:d,color:p,icon:h,completedIcon:m,progressIcon:y,label:x,description:b,withIcon:w,iconSize:j,loading:T,allowStepClick:P,allowStepSelect:k,iconPosition:E,orientation:_,mod:R,...M}=ie("StepperStep",qO,e),N=HO(),L=ln(),z={classNames:n,styles:s},q=d==="stepCompleted"?null:d==="stepProgress"?y:h,G={"data-progress":d==="stepProgress"||void 0,"data-completed":d==="stepCompleted"||void 0};return i.jsxs(Gn,{...N.getStyles("step",{className:r,style:o,variant:N.orientation,...z}),mod:[{"icon-position":E||N.iconPosition,"allow-click":P},R],ref:t,...G,...M,__vars:{"--step-color":p?Lt(p,L):void 0},tabIndex:P?0:-1,children:[w&&i.jsxs("span",{...N.getStyles("stepWrapper",z),children:[i.jsxs("span",{...N.getStyles("stepIcon",z),...G,children:[i.jsx(_i,{mounted:d==="stepCompleted",transition:"pop",duration:200,children:Y=>i.jsx("span",{...N.getStyles("stepCompletedIcon",{style:Y,...z}),children:T?i.jsx(Rr,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...N.getStyles("stepLoader",z)}):Zd(m,u)||i.jsx(pp,{size:"60%"})})}),d!=="stepCompleted"?T?i.jsx(Rr,{...N.getStyles("stepLoader",z),size:"calc(var(--stepper-icon-size) / 2)",color:p}):Zd(q||h,u):null]}),_==="vertical"&&i.jsx("span",{...N.getStyles("verticalSeparator",z),"data-active":d==="stepCompleted"||void 0})]}),(x||b)&&i.jsxs("span",{...N.getStyles("stepBody",z),"data-orientation":N.orientation,"data-icon-position":E||N.iconPosition,children:[x&&i.jsx("span",{...N.getStyles("stepLabel",z),children:Zd(x,u)}),b&&i.jsx("span",{...N.getStyles("stepDescription",z),children:Zd(b,u)})]})]})});Ky.classes=Qy;Ky.displayName="@mantine/core/StepperStep";const GO={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},QO=(e,{color:t,iconSize:n,size:r,contentPadding:o,radius:s,autoContrast:l})=>({root:{"--stepper-color":t?Lt(t,e):void 0,"--stepper-icon-color":ma(l,e)?Pi({color:t,theme:e,autoContrast:l}):void 0,"--stepper-icon-size":n===void 0?et(r,"stepper-icon-size"):oe(n),"--stepper-content-padding":Pn(o),"--stepper-radius":s===void 0?void 0:At(s),"--stepper-fz":Rn(r),"--stepper-spacing":Pn(r)}}),Tl=ue((e,t)=>{var A,B,I;const n=ie("Stepper",GO,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,children:p,onStepClick:h,active:m,icon:y,completedIcon:x,progressIcon:b,color:w,iconSize:j,contentPadding:T,orientation:P,iconPosition:k,size:E,radius:_,allowNextStepsSelect:R,wrap:M,autoContrast:N,...L}=n,z=Ne({name:"Stepper",classes:Qy,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:QO}),q=g.Children.toArray(p),G=q.filter(F=>F.type!==kf),Y=q.find(F=>F.type===kf),Q=G.reduce((F,J,de)=>{const Ee=m===de?"stepProgress":m>de?"stepCompleted":"stepInactive",we=typeof h!="function"?!1:typeof J.props.allowStepSelect=="boolean"?J.props.allowStepSelect:Ee==="stepCompleted"||R;return F.push(g.cloneElement(J,{icon:J.props.icon||y||de+1,key:de,step:de,state:Ee,onClick:()=>we&&(h==null?void 0:h(de)),allowStepClick:we,completedIcon:J.props.completedIcon||x,progressIcon:J.props.progressIcon||b,color:J.props.color||w,iconSize:j,iconPosition:J.props.iconPosition||k,orientation:P})),P==="horizontal"&&de!==G.length-1&&F.push(g.createElement("div",{...z("separator"),"data-active":de<m||void 0,"data-orientation":P,key:`separator-${de}`})),F},[]),te=(B=(A=G[m])==null?void 0:A.props)==null?void 0:B.children,V=(I=Y==null?void 0:Y.props)==null?void 0:I.children,O=m>G.length-1?V:te;return i.jsx(WO,{value:{getStyles:z,orientation:P,iconPosition:k},children:i.jsxs(se,{...z("root"),ref:t,size:E,...L,children:[i.jsx(se,{...z("steps"),mod:{orientation:P,"icon-position":k,wrap:M&&P!=="vertical"},children:Q}),O&&i.jsx("div",{...z("content"),children:O})]})})});Tl.classes=Qy;Tl.displayName="@mantine/core/Stepper";Tl.Completed=kf;Tl.Step=Ky;const Nk=g.createContext(null),KO=Nk.Provider,YO=()=>g.useContext(Nk),XO={},Yy=ue((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:s,wrapperProps:l,children:u,readOnly:d,...p}=ie("SwitchGroup",XO,e),[h,m]=Wn({value:n,defaultValue:r,finalValue:[],onChange:o}),y=x=>{const b=x.currentTarget.value;!d&&m(h.includes(b)?h.filter(w=>w!==b):[...h,b])};return i.jsx(KO,{value:{value:h,onChange:y,size:s},children:i.jsx(pn.Wrapper,{size:s,ref:t,...l,...p,labelElement:"div",__staticSelector:"SwitchGroup",children:i.jsx(hy,{role:"group",children:u})})})});Yy.classes=pn.Wrapper.classes;Yy.displayName="@mantine/core/SwitchGroup";var Ak={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const JO={labelPosition:"right"},ZO=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:At(t),"--switch-height":et(r,"switch-height"),"--switch-width":et(r,"switch-width"),"--switch-thumb-size":et(r,"switch-thumb-size"),"--switch-label-font-size":et(r,"switch-label-font-size"),"--switch-track-label-padding":et(r,"switch-track-label-padding"),"--switch-color":n?Lt(n,e):void 0}}),Eu=ue((e,t)=>{const n=ie("Switch",JO,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,color:p,label:h,offLabel:m,onLabel:y,id:x,size:b,radius:w,wrapperProps:j,thumbIcon:T,checked:P,defaultChecked:k,onChange:E,labelPosition:_,description:R,error:M,disabled:N,variant:L,rootRef:z,mod:q,...G}=n,Y=YO(),Q=b||(Y==null?void 0:Y.size),te=Ne({name:"Switch",props:n,classes:Ak,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:ZO}),{styleProps:V,rest:O}=Ri(G),A=mr(x),B=Y?{checked:Y.value.includes(O.value),onChange:Y.onChange}:{},[I,F]=Wn({value:B.checked??P,defaultValue:k,finalValue:!1});return i.jsxs(fp,{...te("root"),__staticSelector:"Switch",__stylesApiProps:n,id:A,size:Q,labelPosition:_,label:h,description:R,error:M,disabled:N,bodyElement:"label",labelElement:"span",classNames:r,styles:l,unstyled:u,"data-checked":B.checked||P||void 0,variant:L,ref:z,mod:q,...V,...j,children:[i.jsx("input",{...O,disabled:N,checked:I,"data-checked":B.checked||P||void 0,onChange:J=>{var de;Y?(de=B.onChange)==null||de.call(B,J):E==null||E(J),F(J.currentTarget.checked)},id:A,ref:t,type:"checkbox",role:"switch",...te("input")}),i.jsxs(se,{"aria-hidden":"true",mod:{error:M,"label-position":_,"without-labels":!y&&!m},...te("track"),children:[i.jsx(se,{component:"span",mod:"reduce-motion",...te("thumb"),children:T}),i.jsx("span",{...te("trackLabel"),children:I?y:m})]})]})});Eu.classes={...Ak,...LE};Eu.displayName="@mantine/core/Switch";Eu.Group=Yy;const[e5,t5]=hr("Table component was not found in the tree");var ku={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 n5(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 Sa(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=ue((o,s)=>{const l=ie(n,{},o),{classNames:u,className:d,style:p,styles:h,...m}=l,y=t5();return i.jsx(se,{component:e,ref:s,...n5(y,t),...y.getStyles(e,{className:d,classNames:u,style:p,styles:h,props:l}),...m})});return r.displayName=`@mantine/core/${n}`,r.classes=ku,r}const Wg=Sa("th",{columnBorder:!0}),Mk=Sa("td",{columnBorder:!0}),hf=Sa("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),Ok=Sa("thead",{stickyHeader:!0}),Lk=Sa("tbody"),$k=Sa("tfoot"),Fk=Sa("caption",{captionSide:!0});function Xy({data:e}){return i.jsxs(i.Fragment,{children:[e.caption&&i.jsx(Fk,{children:e.caption}),e.head&&i.jsx(Ok,{children:i.jsx(hf,{children:e.head.map((t,n)=>i.jsx(Wg,{children:t},n))})}),e.body&&i.jsx(Lk,{children:e.body.map((t,n)=>i.jsx(hf,{children:t.map((r,o)=>i.jsx(Mk,{children:r},o))},n))}),e.foot&&i.jsx($k,{children:i.jsx(hf,{children:e.foot.map((t,n)=>i.jsx(Wg,{children:t},n))})})]})}Xy.displayName="@mantine/core/TableDataRenderer";const r5={type:"scrollarea"},o5=(e,{minWidth:t,type:n})=>({scrollContainer:{"--table-min-width":oe(t),"--table-overflow":n==="native"?"auto":void 0}}),Jy=ue((e,t)=>{const n=ie("TableScrollContainer",r5,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,children:p,minWidth:h,type:m,...y}=n,x=Ne({name:"TableScrollContainer",classes:ku,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:o5,rootSelector:"scrollContainer"});return i.jsx(se,{component:m==="scrollarea"?oo:"div",...m==="scrollarea"?{offsetScrollbars:"x"}:{},ref:t,...x("scrollContainer"),...y,children:i.jsx("div",{...x("scrollContainerInner"),children:p})})});Jy.classes=ku;Jy.displayName="@mantine/core/TableScrollContainer";const i5={withRowBorders:!0,verticalSpacing:7},s5=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:o,borderColor:s,stripedColor:l,highlightOnHoverColor:u,striped:d,highlightOnHover:p,stickyHeaderOffset:h,stickyHeader:m})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":Pn(r),"--table-vertical-spacing":Pn(o),"--table-border-color":s?Lt(s,e):void 0,"--table-striped-color":d&&l?Lt(l,e):void 0,"--table-highlight-on-hover-color":p&&u?Lt(u,e):void 0,"--table-sticky-header-offset":m?oe(h):void 0}}),Le=ue((e,t)=>{const n=ie("Table",i5,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,horizontalSpacing:p,verticalSpacing:h,captionSide:m,stripedColor:y,highlightOnHoverColor:x,striped:b,highlightOnHover:w,withColumnBorders:j,withRowBorders:T,withTableBorder:P,borderColor:k,layout:E,variant:_,data:R,children:M,stickyHeader:N,stickyHeaderOffset:L,mod:z,tabularNums:q,...G}=n,Y=Ne({name:"Table",props:n,className:o,style:s,classes:ku,classNames:r,styles:l,unstyled:u,rootSelector:"table",vars:d,varsResolver:s5});return i.jsx(e5,{value:{getStyles:Y,stickyHeader:N,striped:b===!0?"odd":b||void 0,highlightOnHover:w,withColumnBorders:j,withRowBorders:T,captionSide:m||"bottom"},children:i.jsx(se,{component:"table",variant:_,ref:t,mod:[{"data-with-table-border":P,"data-tabular-nums":q},z],...Y("table"),...G,children:M||!!R&&i.jsx(Xy,{data:R})})})});Le.classes=ku;Le.displayName="@mantine/core/Table";Le.Td=Mk;Le.Th=Wg;Le.Tr=hf;Le.Thead=Ok;Le.Tbody=Lk;Le.Tfoot=$k;Le.Caption=Fk;Le.ScrollContainer=Jy;Le.DataRenderer=Xy;const[a5,Zy]=hr("Tabs component was not found in the tree");var Tu={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 l5={},ex=ue((e,t)=>{const n=ie("TabsList",l5,e),{children:r,className:o,grow:s,justify:l,classNames:u,styles:d,style:p,mod:h,...m}=n,y=Zy();return i.jsx(se,{...m,...y.getStyles("list",{className:o,style:p,classNames:u,styles:d,props:n,variant:y.variant}),ref:t,role:"tablist",variant:y.variant,mod:[{grow:s,orientation:y.orientation,placement:y.orientation==="vertical"&&y.placement,inverted:y.inverted},h],"aria-orientation":y.orientation,__vars:{"--tabs-justify":l},children:r})});ex.classes=Tu;ex.displayName="@mantine/core/TabsList";const c5={},tx=ue((e,t)=>{const n=ie("TabsPanel",c5,e),{children:r,className:o,value:s,classNames:l,styles:u,style:d,mod:p,keepMounted:h,...m}=n,y=Zy(),x=y.value===s,b=y.keepMounted||h||x?r:null;return i.jsx(se,{...m,...y.getStyles("panel",{className:o,classNames:l,styles:u,style:[d,x?void 0:{display:"none"}],props:n}),ref:t,mod:[{orientation:y.orientation},p],role:"tabpanel",id:y.getPanelId(s),"aria-labelledby":y.getTabId(s),children:b})});tx.classes=Tu;tx.displayName="@mantine/core/TabsPanel";const u5={},nx=ue((e,t)=>{const n=ie("TabsTab",u5,e),{className:r,children:o,rightSection:s,leftSection:l,value:u,onClick:d,onKeyDown:p,disabled:h,color:m,style:y,classNames:x,styles:b,vars:w,mod:j,tabIndex:T,...P}=n,k=ln(),{dir:E}=va(),_=Zy(),R=u===_.value,M=L=>{_.onChange(_.allowTabDeactivation&&u===_.value?null:u),d==null||d(L)},N={classNames:x,styles:b,props:n};return i.jsxs(Gn,{...P,..._.getStyles("tab",{className:r,style:y,variant:_.variant,...N}),disabled:h,unstyled:_.unstyled,variant:_.variant,mod:[{active:R,disabled:h,orientation:_.orientation,inverted:_.inverted,placement:_.orientation==="vertical"&&_.placement},j],ref:t,role:"tab",id:_.getTabId(u),"aria-selected":R,tabIndex:T||R||_.value===null?0:-1,"aria-controls":_.getPanelId(u),onClick:M,__vars:{"--tabs-color":m?Lt(m,k):void 0},onKeyDown:eC({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:_.activateTabWithKeyboard,loop:_.loop,orientation:_.orientation||"horizontal",dir:E,onKeyDown:p}),children:[l&&i.jsx("span",{..._.getStyles("tabSection",N),"data-position":"left",children:l}),o&&i.jsx("span",{..._.getStyles("tabLabel",N),children:o}),s&&i.jsx("span",{..._.getStyles("tabSection",N),"data-position":"right",children:s})]})});nx.classes=Tu;nx.displayName="@mantine/core/TabsTab";const Hw="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",d5={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},f5=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":At(t),"--tabs-color":Lt(n,e),"--tabs-text-color":ma(r,e)?Pi({color:n,theme:e,autoContrast:r}):void 0}}),Dt=ue((e,t)=>{const n=ie("Tabs",d5,e),{defaultValue:r,value:o,onChange:s,orientation:l,children:u,loop:d,id:p,activateTabWithKeyboard:h,allowTabDeactivation:m,variant:y,color:x,radius:b,inverted:w,placement:j,keepMounted:T,classNames:P,styles:k,unstyled:E,className:_,style:R,vars:M,autoContrast:N,mod:L,...z}=n,q=mr(p),[G,Y]=Wn({value:o,defaultValue:r,finalValue:null,onChange:s}),Q=Ne({name:"Tabs",props:n,classes:Tu,className:_,style:R,classNames:P,styles:k,unstyled:E,vars:M,varsResolver:f5});return i.jsx(a5,{value:{placement:j,value:G,orientation:l,id:q,loop:d,activateTabWithKeyboard:h,getTabId:Fb(`${q}-tab`,Hw),getPanelId:Fb(`${q}-panel`,Hw),onChange:Y,allowTabDeactivation:m,variant:y,color:x,radius:b,inverted:w,keepMounted:T,unstyled:E,getStyles:Q},children:i.jsx(se,{ref:t,id:q,variant:y,mod:[{orientation:l,inverted:l==="horizontal"&&w,placement:l==="vertical"&&j},L],...Q("root"),...z,children:u})})});Dt.classes=Tu;Dt.displayName="@mantine/core/Tabs";Dt.Tab=nx;Dt.Panel=tx;Dt.List=ex;const p5={},Fe=ue((e,t)=>{const n=ie("TextInput",p5,e);return i.jsx(Dr,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});Fe.classes=Dr.classes;Fe.displayName="@mantine/core/TextInput";var zk={root:"m_7341320d"};const h5={},m5=(e,{size:t,radius:n,variant:r,gradient:o,color:s,autoContrast:l})=>{const u=e.variantColorResolver({color:s||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:l});return{root:{"--ti-size":et(t,"ti-size"),"--ti-radius":n===void 0?void 0:At(n),"--ti-bg":s||r?u.background:void 0,"--ti-color":s||r?u.color:void 0,"--ti-bd":s||r?u.border:void 0}}},rx=ue((e,t)=>{const n=ie("ThemeIcon",h5,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,autoContrast:p,...h}=n,m=Ne({name:"ThemeIcon",classes:zk,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:m5});return i.jsx(se,{ref:t,...m("root"),...h})});rx.classes=zk;rx.displayName="@mantine/core/ThemeIcon";const g5=["h1","h2","h3","h4","h5","h6"],v5=["xs","sm","md","lg","xl"];function y5(e,t){const n=t!==void 0?t:`h${e}`;return g5.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:v5.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:oe(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var Bk={root:"m_8a5d1357"};const x5={order:1},b5=(e,{order:t,size:n,lineClamp:r,textWrap:o})=>{const s=y5(t,n);return{root:{"--title-fw":s.fontWeight,"--title-lh":s.lineHeight,"--title-fz":s.fontSize,"--title-line-clamp":typeof r=="number"?r.toString():void 0,"--title-text-wrap":o}}},ze=ue((e,t)=>{const n=ie("Title",x5,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,order:d,vars:p,size:h,variant:m,lineClamp:y,textWrap:x,mod:b,...w}=n,j=Ne({name:"Title",props:n,classes:Bk,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:p,varsResolver:b5});return[1,2,3,4,5,6].includes(d)?i.jsx(se,{...j("root"),component:`h${d}`,variant:m,ref:t,mod:[{order:d,"data-line-clamp":typeof y=="number"},b],size:h,...w}):null});ze.classes=Bk;ze.displayName="@mantine/core/Title";function w5(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(s=>s(t))},initialize(o){n||(t=o,n=!0)},subscribe(o){return r.add(o),()=>r.delete(o)}}}function S5(e){return g.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function j5(e,t,n){const r=[],o=[],s={};for(const l of e){const u=l.position||t;s[u]=s[u]||0,s[u]+=1,s[u]<=n?o.push(l):r.push(l)}return{notifications:o,queue:r}}const C5=()=>w5({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),ja=C5(),E5=(e=ja)=>S5(e);function ql(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]),o=j5(r,n.defaultPosition,n.limit);e.setState({notifications:o.notifications,queue:o.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function Ie(e,t=ja){const n=e.id||nC();return ql(t,r=>e.id&&r.some(o=>o.id===e.id)?r:[...r,{...e,id:n}]),n}function Uk(e,t=ja){return ql(t,n=>n.filter(r=>{var o;return r.id===e?((o=r.onClose)==null||o.call(r,r),!1):!0})),e}function Zs(e,t=ja){return ql(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function k5(e=ja){ql(e,()=>[])}function T5(e=ja){ql(e,t=>t.slice(0,e.getState().limit))}const Go={show:Ie,hide:Uk,update:Zs,clean:k5,cleanQueue:T5,updateState:ql};function Hg(e,t){return Hg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Hg(e,t)}function Vk(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Hg(e,t)}var sg={exports:{}},ag,qw;function P5(){if(qw)return ag;qw=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ag=e,ag}var lg,Gw;function R5(){if(Gw)return lg;Gw=1;var e=P5();function t(){}function n(){}return n.resetWarningCache=t,lg=function(){function r(l,u,d,p,h,m){if(m!==e){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}}r.isRequired=r;function o(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},lg}var Qw;function _5(){return Qw||(Qw=1,sg.exports=R5()()),sg.exports}var D5=_5();const Ht=yv(D5),Kw={disabled:!1},Tf=gn.createContext(null);var I5=function(t){return t.scrollTop},Vc="unmounted",Hs="exited",qs="entering",fl="entered",qg="exiting",Ni=function(e){Vk(t,e);function t(r,o){var s;s=e.call(this,r,o)||this;var l=o,u=l&&!l.isMounting?r.enter:r.appear,d;return s.appearStatus=null,r.in?u?(d=Hs,s.appearStatus=qs):d=fl:r.unmountOnExit||r.mountOnEnter?d=Vc:d=Hs,s.state={status:d},s.nextCallback=null,s}t.getDerivedStateFromProps=function(o,s){var l=o.in;return l&&s.status===Vc?{status:Hs}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var s=null;if(o!==this.props){var l=this.state.status;this.props.in?l!==qs&&l!==fl&&(s=qs):(l===qs||l===fl)&&(s=qg)}this.updateStatus(!1,s)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,s,l,u;return s=l=u=o,o!=null&&typeof o!="number"&&(s=o.exit,l=o.enter,u=o.appear!==void 0?o.appear:l),{exit:s,enter:l,appear:u}},n.updateStatus=function(o,s){if(o===void 0&&(o=!1),s!==null)if(this.cancelNextCallback(),s===qs){if(this.props.unmountOnExit||this.props.mountOnEnter){var l=this.props.nodeRef?this.props.nodeRef.current:pl.findDOMNode(this);l&&I5(l)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Hs&&this.setState({status:Vc})},n.performEnter=function(o){var s=this,l=this.props.enter,u=this.context?this.context.isMounting:o,d=this.props.nodeRef?[u]:[pl.findDOMNode(this),u],p=d[0],h=d[1],m=this.getTimeouts(),y=u?m.appear:m.enter;if(!o&&!l||Kw.disabled){this.safeSetState({status:fl},function(){s.props.onEntered(p)});return}this.props.onEnter(p,h),this.safeSetState({status:qs},function(){s.props.onEntering(p,h),s.onTransitionEnd(y,function(){s.safeSetState({status:fl},function(){s.props.onEntered(p,h)})})})},n.performExit=function(){var o=this,s=this.props.exit,l=this.getTimeouts(),u=this.props.nodeRef?void 0:pl.findDOMNode(this);if(!s||Kw.disabled){this.safeSetState({status:Hs},function(){o.props.onExited(u)});return}this.props.onExit(u),this.safeSetState({status:qg},function(){o.props.onExiting(u),o.onTransitionEnd(l.exit,function(){o.safeSetState({status:Hs},function(){o.props.onExited(u)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,s){s=this.setNextCallback(s),this.setState(o,s)},n.setNextCallback=function(o){var s=this,l=!0;return this.nextCallback=function(u){l&&(l=!1,s.nextCallback=null,o(u))},this.nextCallback.cancel=function(){l=!1},this.nextCallback},n.onTransitionEnd=function(o,s){this.setNextCallback(s);var l=this.props.nodeRef?this.props.nodeRef.current:pl.findDOMNode(this),u=o==null&&!this.props.addEndListener;if(!l||u){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var d=this.props.nodeRef?[this.nextCallback]:[l,this.nextCallback],p=d[0],h=d[1];this.props.addEndListener(p,h)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===Vc)return null;var s=this.props,l=s.children;s.in,s.mountOnEnter,s.unmountOnExit,s.appear,s.enter,s.exit,s.timeout,s.addEndListener,s.onEnter,s.onEntering,s.onEntered,s.onExit,s.onExiting,s.onExited,s.nodeRef;var u=Ey(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return gn.createElement(Tf.Provider,{value:null},typeof l=="function"?l(o,u):gn.cloneElement(gn.Children.only(l),u))},t}(gn.Component);Ni.contextType=Tf;Ni.propTypes={};function il(){}Ni.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:il,onEntering:il,onEntered:il,onExit:il,onExiting:il,onExited:il};Ni.UNMOUNTED=Vc;Ni.EXITED=Hs;Ni.ENTERING=qs;Ni.ENTERED=fl;Ni.EXITING=qg;function N5(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ox(e,t){var n=function(s){return t&&g.isValidElement(s)?t(s):s},r=Object.create(null);return e&&g.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function A5(e,t){e=e||{},t=t||{};function n(h){return h in t?t[h]:e[h]}var r=Object.create(null),o=[];for(var s in e)s in t?o.length&&(r[s]=o,o=[]):o.push(s);var l,u={};for(var d in t){if(r[d])for(l=0;l<r[d].length;l++){var p=r[d][l];u[r[d][l]]=n(p)}u[d]=n(d)}for(l=0;l<o.length;l++)u[o[l]]=n(o[l]);return u}function ea(e,t,n){return n[t]!=null?n[t]:e.props[t]}function M5(e,t){return ox(e.children,function(n){return g.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:ea(n,"appear",e),enter:ea(n,"enter",e),exit:ea(n,"exit",e)})})}function O5(e,t,n){var r=ox(e.children),o=A5(t,r);return Object.keys(o).forEach(function(s){var l=o[s];if(g.isValidElement(l)){var u=s in t,d=s in r,p=t[s],h=g.isValidElement(p)&&!p.props.in;d&&(!u||h)?o[s]=g.cloneElement(l,{onExited:n.bind(null,l),in:!0,exit:ea(l,"exit",e),enter:ea(l,"enter",e)}):!d&&u&&!h?o[s]=g.cloneElement(l,{in:!1}):d&&u&&g.isValidElement(p)&&(o[s]=g.cloneElement(l,{onExited:n.bind(null,l),in:p.props.in,exit:ea(l,"exit",e),enter:ea(l,"enter",e)}))}}),o}var L5=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},$5={component:"div",childFactory:function(t){return t}},ss=function(e){Vk(t,e);function t(r,o){var s;s=e.call(this,r,o)||this;var l=s.handleExited.bind(N5(s));return s.state={contextValue:{isMounting:!0},handleExited:l,firstRender:!0},s}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,s){var l=s.children,u=s.handleExited,d=s.firstRender;return{children:d?M5(o,u):O5(o,l,u),firstRender:!1}},n.handleExited=function(o,s){var l=ox(this.props.children);o.key in l||(o.props.onExited&&o.props.onExited(s),this.mounted&&this.setState(function(u){var d=Ef({},u.children);return delete d[o.key],{children:d}}))},n.render=function(){var o=this.props,s=o.component,l=o.childFactory,u=Ey(o,["component","childFactory"]),d=this.state.contextValue,p=L5(this.state.children).map(l);return delete u.appear,delete u.enter,delete u.exit,s===null?gn.createElement(Tf.Provider,{value:d},p):gn.createElement(Tf.Provider,{value:d},gn.createElement(s,u,p))},t}(gn.Component);ss.propTypes={};ss.defaultProps=$5;const Wk=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function F5(e,t){return e.reduce((n,r)=>(n[r.position||t].push(r),n),Wk.reduce((n,r)=>(n[r]=[],n),{}))}const Yw={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},z5={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function B5({state:e,maxHeight:t,position:n,transitionDuration:r}){const[o,s]=n.split("-"),l=s==="center"?`${o}-center`:s,u={opacity:0,maxHeight:t,transform:Yw[l],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"},d={opacity:1,transform:z5[l]},p={opacity:0,maxHeight:0,transform:Yw[l]};return{...u,...{entering:d,entered:d,exiting:p,exited:p}[e]}}function U5(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const Hk=g.forwardRef(({data:e,onHide:t,autoClose:n,...r},o)=>{const{autoClose:s,message:l,...u}=e,d=U5(n,e.autoClose),p=g.useRef(-1),h=()=>window.clearTimeout(p.current),m=()=>{t(e.id),h()},y=()=>{typeof d=="number"&&(p.current=window.setTimeout(m,d))};return g.useEffect(()=>{var x;(x=e.onOpen)==null||x.call(e,e)},[]),g.useEffect(()=>(y(),h),[d]),i.jsx(Ly,{...r,...u,onClose:m,ref:o,onMouseEnter:h,onMouseLeave:y,children:l})});Hk.displayName="@mantine/notifications/NotificationContainer";var qk={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const V5=Ni,W5={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:Vr("overlay"),store:ja,withinPortal:!0},H5=(e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t==null?void 0:t.toString(),"--notifications-container-width":oe(n)}}),Ai=ue((e,t)=>{const n=ie("Notifications",W5,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,position:p,autoClose:h,transitionDuration:m,containerWidth:y,notificationMaxHeight:x,limit:b,zIndex:w,store:j,portalProps:T,withinPortal:P,...k}=n,E=ln(),_=E5(j),R=PD(),M=jv(),N=g.useRef({}),L=g.useRef(0),q=(E.respectReducedMotion?M:!1)?1:m,G=Ne({name:"Notifications",classes:qk,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:H5});g.useEffect(()=>{j==null||j.updateState(te=>({...te,limit:b||5,defaultPosition:p}))},[b,p]),bi(()=>{_.notifications.length>L.current&&setTimeout(()=>R(),0),L.current=_.notifications.length},[_.notifications]);const Y=F5(_.notifications,p),Q=Wk.reduce((te,V)=>(te[V]=Y[V].map(({style:O,...A})=>i.jsx(V5,{timeout:q,onEnter:()=>N.current[A.id].offsetHeight,nodeRef:{current:N.current[A.id]},children:B=>i.jsx(Hk,{ref:I=>{N.current[A.id]=I},data:A,onHide:I=>Uk(I,j),autoClose:h,...G("notification",{style:{...B5({state:B,position:V,transitionDuration:q,maxHeight:x}),...O}})})},A.id)),te),{});return i.jsxs(ya,{withinPortal:P,...T,children:[i.jsx(se,{...G("root"),"data-position":"top-center",ref:t,...k,children:i.jsx(ss,{children:Q["top-center"]})}),i.jsx(se,{...G("root"),"data-position":"top-left",...k,children:i.jsx(ss,{children:Q["top-left"]})}),i.jsx(se,{...G("root",{className:wl.classNames.fullWidth}),"data-position":"top-right",...k,children:i.jsx(ss,{children:Q["top-right"]})}),i.jsx(se,{...G("root",{className:wl.classNames.fullWidth}),"data-position":"bottom-right",...k,children:i.jsx(ss,{children:Q["bottom-right"]})}),i.jsx(se,{...G("root"),"data-position":"bottom-left",...k,children:i.jsx(ss,{children:Q["bottom-left"]})}),i.jsx(se,{...G("root"),"data-position":"bottom-center",...k,children:i.jsx(ss,{children:Q["bottom-center"]})})]})});Ai.classes=qk;Ai.displayName="@mantine/notifications/Notifications";Ai.show=Go.show;Ai.hide=Go.hide;Ai.update=Go.update;Ai.clean=Go.clean;Ai.cleanQueue=Go.cleanQueue;Ai.updateState=Go.updateState;class q5{constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class Pu{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`${this.left.toString()} ${this.operator} ${this.right.toString()}`}}class G5{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,s){const l=o.consumeAndParse(n);return r(s,l)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(o,s,l){const u=o.consumeAndParse(n);return r(s,l,u)},precedence:n})}construct(t){return new Q5(t,this.prefixParselets,this.infixParselets)}}class Q5{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 s=this.consume();o=this.getInfixParselet(s).parse(this,o,s)}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 s=this.peek();throw Error(`Expected ${t} but got "${s.id}" (${s.value}) at line ${s.line} column ${s.column}.`)}if(n&&((o=this.peek())==null?void 0:o.value)!==n){const s=this.peek();throw Error(`Expected "${n}" but got "${s.value}" at line ${s.line} column ${s.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 Dp="http://hl7.org",Gk="ok",K5="created",Y5="gone",X5="not-modified",J5="not-found",Z5="unauthorized",eL="forbidden",tL="accepted",nL={resourceType:"OperationOutcome",id:Gk,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},rL={resourceType:"OperationOutcome",id:J5,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},nu={resourceType:"OperationOutcome",id:Z5,issue:[{severity:"error",code:"login",details:{text:"Unauthorized"}}]},oL={...nu,issue:[...nu.issue,{severity:"error",code:"expired",details:{text:"Token expired"}}]},Xw={...nu,issue:[...nu.issue,{severity:"error",code:"invalid",details:{text:"Token not issued for this audience"}}]},Qk={resourceType:"OperationOutcome",id:eL,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function Qo(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},...t?{expression:[t]}:void 0}]}}function an(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function iL(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function Ip(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function Kk(e){return e.id===Gk||e.id===K5||e.id===X5||e.id===tL}function sL(e){return e.id===Y5}class dt extends Error{constructor(t,n){super(Yk(t)),this.outcome=t,this.cause=n}}function Bt(e){return e instanceof dt?e.outcome:Ip(e)?e:Qo(Ze(e))}function Ze(e){return e?typeof e=="string"?e:e instanceof Error?e.message:Ip(e)?Yk(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function Yk(e){var n;const t=((n=e.issue)==null?void 0:n.map(Xk))??[];return t.length>0?t.join("; "):"Unknown error"}function Xk(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 aL(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 lL(e){const t=Object.create(null);for(const[n,r]of Object.entries(e))t[n]={name:n,type:n,path:n,elements:Object.fromEntries(Object.entries(r.elements).map(([o,s])=>[o,aL(o,s)])),constraints:[],innerTypes:[]};return t}const cL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},uL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},dL={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"}]}}},fL={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"}]}}},pL={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"}]}}},hL={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"}]}}},mL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},gL={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"}]}}},vL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},yL={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"}]}}},xL={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"}]}}},bL={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"}]}}},wL={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"}]}}},SL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{type:[{code:"string"}]},searchParam:{type:[{code:"string"}]},valueSet:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/ValueSet"]}]},code:{max:9007199254740991,type:[{code:"Coding"}]}}},jL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{type:[{code:"string"}]},searchParam:{type:[{code:"string"}]},"value[x]":{type:[{code:"dateTime"},{code:"Period"},{code:"Duration"}]}}},CL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},direction:{min:1,type:[{code:"code"}]}}},EL={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"}]}}},kL={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"]}]}}},TL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{type:[{code:"CodeableConcept"}]},"dose[x]":{type:[{code:"Range"},{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},"rate[x]":{type:[{code:"Ratio"},{code:"Range"},{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},PL={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"}]}}},RL={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"}]}}},_L={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},path:{min:1,type:[{code:"string"}]}}},DL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},discriminator:{max:9007199254740991,type:[{code:"ElementDefinitionSlicingDiscriminator"}]},description:{type:[{code:"string"}]},ordered:{type:[{code:"boolean"}]},rules:{min:1,type:[{code:"code"}]}}},IL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},min:{min:1,type:[{code:"unsignedInt"}]},max:{min:1,type:[{code:"string"}]}}},NL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},code:{min:1,type:[{code:"uri"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition","http://hl7.org/fhir/StructureDefinition/ImplementationGuide"]}]},targetProfile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition","http://hl7.org/fhir/StructureDefinition/ImplementationGuide"]}]},aggregation:{max:9007199254740991,type:[{code:"code"}]},versioning:{type:[{code:"code"}]}}},AL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},label:{min:1,type:[{code:"string"}]},"value[x]":{min:1,type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]}}},ML={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},key:{min:1,type:[{code:"id"}]},requirements:{type:[{code:"string"}]},severity:{min:1,type:[{code:"code"}]},human:{min:1,type:[{code:"string"}]},expression:{type:[{code:"string"}]},xpath:{type:[{code:"string"}]},source:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]}}},OL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},strength:{min:1,type:[{code:"code"}]},description:{type:[{code:"string"}]},valueSet:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/ValueSet"]}]}}},LL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},identity:{min:1,type:[{code:"id"}]},language:{type:[{code:"code"}]},map:{min:1,type:[{code:"string"}]},comment:{type:[{code:"string"}]}}},$L={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"}]}}},FL={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"}]}}},zL={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"}]}}},BL={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"]}]}}},UL={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"}]}}},VL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},versionId:{type:[{code:"id"}]},lastUpdated:{type:[{code:"instant"}]},source:{type:[{code:"uri"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]},security:{max:9007199254740991,type:[{code:"Coding"}]},tag:{max:9007199254740991,type:[{code:"Coding"}]},project:{type:[{code:"uri"}]},author:{type:[{code:"Reference"}]},onBehalfOf:{type:[{code:"Reference"}]},account:{type:[{code:"Reference"}]},accounts:{max:9007199254740991,type:[{code:"Reference"}]},compartment:{max:9007199254740991,type:[{code:"Reference"}]}}},WL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},HL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},qL={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"]}]}}},GL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},QL={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"}]}}},KL={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"}]}}},YL={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"}]}}},XL={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"}]}}},JL={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"]}]}}},ZL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},e$={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"}]}}},t$={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"]}]}}},n$={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"}]}}},r$={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"}]}}},o$={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"}]}}},i$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},lowLimit:{type:[{code:"Quantity"}]},highLimit:{type:[{code:"Quantity"}]}}},s$={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"}]}}},a$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},"bounds[x]":{type:[{code:"Duration"},{code:"Range"},{code:"Period"}]},count:{type:[{code:"positiveInt"}]},countMax:{type:[{code:"positiveInt"}]},duration:{type:[{code:"decimal"}]},durationMax:{type:[{code:"decimal"}]},durationUnit:{type:[{code:"code"}]},frequency:{type:[{code:"positiveInt"}]},frequencyMax:{type:[{code:"positiveInt"}]},period:{type:[{code:"decimal"}]},periodMax:{type:[{code:"decimal"}]},periodUnit:{type:[{code:"code"}]},dayOfWeek:{max:9007199254740991,type:[{code:"code"}]},timeOfDay:{max:9007199254740991,type:[{code:"time"}]},when:{max:9007199254740991,type:[{code:"code"}]},offset:{type:[{code:"unsignedInt"}]}}},l$={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"}]}}},c$={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"]}]}}},u$={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"}]}}},d$={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"}]}}},f$={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"}]}}},p$={Element:cL,BackboneElement:uL,Address:dL,Age:fL,Annotation:pL,Attachment:hL,CodeableConcept:mL,Coding:gL,ContactDetail:vL,ContactPoint:yL,Contributor:xL,Count:bL,DataRequirement:wL,DataRequirementCodeFilter:SL,DataRequirementDateFilter:jL,DataRequirementSort:CL,Distance:EL,Dosage:kL,DosageDoseAndRate:TL,Duration:PL,ElementDefinition:RL,ElementDefinitionSlicingDiscriminator:_L,ElementDefinitionSlicing:DL,ElementDefinitionBase:IL,ElementDefinitionType:NL,ElementDefinitionExample:AL,ElementDefinitionConstraint:ML,ElementDefinitionBinding:OL,ElementDefinitionMapping:LL,Expression:$L,Extension:FL,HumanName:zL,Identifier:BL,MarketingStatus:UL,Meta:VL,Money:WL,Narrative:HL,ParameterDefinition:qL,Period:GL,Population:QL,ProdCharacteristic:KL,ProductShelfLife:YL,Quantity:XL,Range:JL,Ratio:ZL,Reference:e$,RelatedArtifact:t$,SampledData:n$,Signature:r$,SubstanceAmount:o$,SubstanceAmountReferenceRange:i$,Timing:s$,TimingRepeat:a$,TriggerDefinition:l$,UsageContext:c$,MoneyQuantity:u$,SimpleQuantity:d$,IdentityProvider:f$};function h$(e){return new g$(e).parse()}const Pf=lL(p$),ix=Object.create(null),Jw=Object.create(null),m$={"http://hl7.org/fhir/StructureDefinition/MoneyQuantity":"MoneyQuantity","http://hl7.org/fhir/StructureDefinition/SimpleQuantity":"SimpleQuantity","http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition":"ViewDefinition"};function Jk(e){let t;return t=Jw[e],t||(t=Jw[e]=Object.create(null)),t}function Zw(e){var n;const t=Array.isArray(e)?e:((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];for(const r of t)Zk(r)}function Zk(e){var s,l;if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=h$(e),n=m$[e.url];let r,o;n?(r=Pf,o=n):e.url===`http://hl7.org/fhir/StructureDefinition/${e.type}`||e.url===`https://medplum.com/fhir/StructureDefinition/${e.type}`||(s=e.type)!=null&&s.startsWith("http://")||(l=e.type)!=null&&l.startsWith("https://")?(r=Pf,o=e.type):(r=Jk(e.url),o=e.type),r[o]=t;for(const u of t.innerTypes)u.parentType=t,r[u.name]=u;ix[e.url]=t}function eT(e){return!!Pf[e]}function Np(e,t){if(t){const n=Jk(t)[e];if(n)return n}return Pf[e]}function tT(e,t){const n=Np(e,t);if(!n)throw new dt(Qo("Unknown data type: "+e));return n}function sx(e){return!!ix[e]}function Gl(e){return ix[e]}class g${constructor(t){var n;if(!((n=t.snapshot)!=null&&n.element)||t.snapshot.element.length===0)throw new Error(`No snapshot defined for StructureDefinition '${t.name}'`);this.root=t.snapshot.element[0],this.elements=t.snapshot.element.slice(1),this.elementIndex=Object.create(null),this.index=0,this.resourceSchema={name:t.name,path:this.root.path,title:t.title,type:t.type,url:t.url,kind:t.kind,description:x$(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){var n,r,o,s,l;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 u=cg(t,this.slicingContext.path);this.slicingContext.current.elements[u]=this.parseElementDefinition(t)}}else{const u=this.parseElementDefinition(t);this.checkFieldEnter(t,u);let d=this.backboneContext;for(;d;){if((o=t.path)!=null&&o.startsWith(d.path+".")){d.type.elements[cg(t,d.path)]=u;break}d=d.parent}if(!d){const p=cg(t,this.root.path);t.isSummary&&((s=this.resourceSchema.summaryProperties)==null||s.add(p.replace("[x]",""))),u.min>0&&((l=this.resourceSchema.mandatoryProperties)==null||l.add(p.replace("[x]",""))),this.resourceSchema.elements[p]=u}this.checkFieldExit(t)}t=this.next()}return this.checkFieldExit(),this.innerTypes.length>0&&(this.resourceSchema.innerTypes=this.innerTypes),this.resourceSchema}checkFieldEnter(t,n){this.isInnerType(t)&&this.enterInnerType(t),this.slicingContext&&!sl(this.slicingContext.path,t==null?void 0:t.path)&&(this.slicingContext=void 0),t.slicing&&!this.slicingContext&&this.enterSlice(t,n)}enterInnerType(t){var r,o,s;for(;this.backboneContext&&!sl((r=this.backboneContext)==null?void 0:r.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;const n=lS(t);this.backboneContext={type:{name:n,type:n,path:t.path,title:t.label,description:t.definition,elements:{},constraints:this.parseElementDefinition(t).constraints,innerTypes:[]},path:t.path,parent:sl((o=this.backboneContext)==null?void 0:o.path,t.path)?this.backboneContext:(s=this.backboneContext)==null?void 0:s.parent}}enterSlice(t,n){var r,o,s,l;y$(t)&&!((r=this.peek())!=null&&r.sliceName)||(n.slicing={discriminator:(((o=t.slicing)==null?void 0:o.discriminator)??[]).map(u=>{if(u.type!=="value"&&u.type!=="pattern"&&u.type!=="type")throw new Error(`Unsupported slicing discriminator type: ${u.type}`);return{path:u.path,type:u.type}}),slices:[],ordered:((s=t.slicing)==null?void 0:s.ordered)??!1,rule:(l=t.slicing)==null?void 0:l.rules},this.slicingContext={field:n.slicing,path:t.path??""})}checkFieldExit(t=void 0){if(this.backboneContext&&!sl(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&&!sl(this.backboneContext.path,t==null?void 0:t.path));else this.innerTypes.push(this.backboneContext.type),this.backboneContext=void 0}next(){const t=this.peek();if(t)return this.index++,t}peek(){var n,r,o,s,l;const t=this.elements[this.index];if(t){if(this.elementIndex[t.path??""]=t,t.contentReference){const u=t.contentReference.slice(t.contentReference.indexOf("#")+1),d=this.elementIndex[u];return d?{...d,id:t.id,path:t.path,min:t.min??d.min,max:t.max??d.max,base:{path:((n=d.base)==null?void 0:n.path)??u,min:((r=t.base)==null?void 0:r.min)??((o=d.base)==null?void 0:o.min)??d.min,max:((s=t.base)==null?void 0:s.max)??((l=d.base)==null?void 0:l.max)??d.max},contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){var r;const n=this.peek();return!!(sl(t==null?void 0:t.path,n==null?void 0:n.path)&&((r=t.type)!=null&&r.some(o=>["BackboneElement","Element"].includes(o.code))))}parseSliceStart(t){if(!this.slicingContext)throw new Error(`Invalid slice start before discriminator: ${t.sliceName} (${t.id})`);this.slicingContext.current={...this.parseElementDefinition(t),name:t.sliceName??"",definition:t.definition,elements:{}},this.slicingContext.field.slices.push(this.slicingContext.current)}parseElementDefinitionType(t){return(t.type??[]).map(n=>{var o;let r;return(n.code==="BackboneElement"||n.code==="Element")&&(r=lS(t)),r||(r=(o=ws(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 s,l;const n=eS(t.max),r=(s=t.base)!=null&&s.max?eS(t.base.max):n,o={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||((l=t.base)==null?void 0:l.path)||"",min:t.min??0,max:n,isArray:r>1,constraints:(t.constraint??[]).map(u=>({key:u.key??"",severity:u.severity??"error",expression:u.expression??"",description:u.human??""})),type:this.parseElementDefinitionType(t),fixed:tS(Pl(o,"fixed[x]")),pattern:tS(Pl(o,"pattern[x]")),binding:t.binding}}}function eS(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function cg(e,t=""){return v$(e.path,t)}function v$(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function sl(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function tS(e){return Array.isArray(e)&&e.length>0?e[0]:yn(e)?void 0:e}function y$(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 x$(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 b$(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n!=null&&n.withPath?w$:Pl,[o,...s]=t.split(".");let l=[r(e,o,n)];for(const u of s){const d=[];for(const p of l)if(Array.isArray(p))for(const h of p)d.push(r(h,u,n));else(n!=null&&n.withPath&&p&&p.value!==void 0||!(n!=null&&n.withPath)&&p!==void 0)&&d.push(r(p,u,n));l=d}return l}function w$(e,t,n){const r=e.path;return S$(Pl(e,t,n),r,t)}function S$(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,s)=>({...o,path:`${r}${n}[${s}]`})):{...e,path:`${r}${n}`}}const nT={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 j$(e,t,n,r){var l;if(Array.isArray(e))return!1;let o;t.path==="$this"?o=n:o=(r??n.elements)[t.path];const s=n.type;switch(t.type){case"value":case"pattern":if(!e||!o)return!1;if(o.pattern)return cx(e,o.pattern);if(o.fixed)return hs(e,o.fixed);if(((l=o.binding)==null?void 0:l.strength)==="required"&&o.binding.valueSet)return!0;break;case"type":return!e||!(s!=null&&s.length)?!1:s.some(u=>u.code===e.type)}return!1}function Ye(e){return[{type:re.boolean,value:e}]}function no(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:re.integer,value:e}:typeof e=="number"?{type:re.decimal,value:e}:typeof e=="boolean"?{type:re.boolean,value:e}:typeof e=="string"?{type:re.string,value:e}:Zr(e)?{type:re.Quantity,value:e}:Mi(e)?{type:e.resourceType,value:e}:dT(e)?{type:re.CodeableConcept,value:e}:uT(e)?{type:re.Coding,value:e}:{type:re.BackboneElement,value:e}}function Wo(e){return e.length===0?!1:!!e[0].value}function Ci(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 Pl(e,t,n){if(!e.value)return;const r=Ca(e.type,t,n==null?void 0:n.profileUrl);return r?rT(e,t,r):Ru(e,t)}function rT(e,t,n){const r=e.value,o=n.type;if(!o||o.length===0)return;let s,l="undefined",u;const d=n.path.lastIndexOf("."),p=n.path.substring(d+1);for(const h of o){const m=p.replace("[x]",Ln(h.code));if(s=r[m],u=r["_"+m],s!==void 0||u!==void 0){l=h.code;break}}if(u)if(Array.isArray(s)){s=s.slice();for(let h=0;h<Math.max(s.length,u.length);h++)s[h]=iS(s[h],u[h])}else s=iS(s,u);if(!yn(s))return(l==="Element"||l==="BackboneElement")&&(l=n.type[0].code),Array.isArray(s)?s.map(h=>nS(h,l)):nS(s,l)}function nS(e,t){return t==="Resource"&&Mi(e)&&(t=e.resourceType),{type:t,value:e}}function Ru(e,t){const n=e.value;if(!n||typeof n!="object")return;let r;if(t in n){const o=n[t];Array.isArray(o)?r=o.map(no):r=no(o)}else{const o=t.endsWith("[x]")?t.substring(0,t.length-3):t;for(const s of Object.values(re)){const l=o+Ln(s);if(l in n){const u=n[l];Array.isArray(u)?r=u.map(d=>({type:s,value:d})):r={type:s,value:u};break}}}if(Array.isArray(r)){if(r.length===0||yn(r[0]))return}else if(yn(r))return;return r}function oT(e){const t=[];for(const n of e){let r=!1;for(const o of t)if(Wo(ax(n,o))){r=!0;break}r||t.push(n)}return t}function C$(e){return Ye(!Wo(e))}function E$(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Ye(!1):Ye(e.every((n,r)=>Wo(ax(n,t[r]))))}function k$(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Ye(!0):Ye(e.some((n,r)=>!Wo(ax(n,t[r]))))}function ax(e,t){var o,s;const n=(o=e.value)==null?void 0:o.valueOf(),r=(s=t.value)==null?void 0:s.valueOf();return typeof n=="number"&&typeof r=="number"?Ye(Math.abs(n-r)<1e-8):Zr(n)&&Zr(r)?Ye(aT(n,r)):Ye(typeof n=="object"&&typeof r=="object"?lx(e,t):n===r)}function iT(e,t){return e.length===0&&t.length===0?Ye(!0):e.length!==t.length?Ye(!1):(e.sort(rS),t.sort(rS),Ye(e.every((n,r)=>Wo(T$(n,t[r])))))}function T$(e,t){const{type:n,value:r}=e,{type:o,value:s}=t,l=r==null?void 0:r.valueOf(),u=s==null?void 0:s.valueOf();return typeof l=="number"&&typeof u=="number"?Ye(Math.abs(l-u)<.01):Zr(l)&&Zr(u)?Ye(aT(l,u)):Ye(n==="Coding"&&o==="Coding"?typeof l!="object"||typeof u!="object"?!1:l.code===u.code&&l.system===u.system:typeof l=="object"&&typeof u=="object"?lx({...l,id:void 0},{...u,id:void 0}):typeof l=="string"&&typeof u=="string"?l.toLowerCase()===u.toLowerCase():l===u)}function rS(e,t){var o,s;const n=(o=e.value)==null?void 0:o.valueOf(),r=(s=t.value)==null?void 0:s.valueOf();return typeof n=="number"&&typeof r=="number"?n-r:typeof n=="string"&&typeof r=="string"?n.localeCompare(r):0}function sT(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 P$(n);case"DateTime":return Rf(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return R$(n);case"Quantity":return Zr(n);default:return typeof n=="object"&&(n==null?void 0:n.resourceType)===t}}function P$(e){return typeof e=="string"&&!!nT.date.exec(e)}function Rf(e){return typeof e=="string"&&!!nT.dateTime.exec(e)}function R$(e){return!!(e&&typeof e=="object"&&("start"in e&&Rf(e.start)||"end"in e&&Rf(e.end)))}function Zr(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function aT(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 lx(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const s=e[o],l=t[o];if(oS(s)&&oS(l)){if(!lx(s,l))return!1}else if(s!==l)return!1}return!0}function oS(e){return e!==null&&typeof e=="object"}function iS(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return _$(e??{},t)}return e}function _$(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function Jt(e){const t=Ot(e),n=Ei(e);return n===t?{reference:t}:{reference:t,display:n}}function Ot(e){return Ea(e)?e.reference:`${e.resourceType}/${e.id}`}function Rl(e){if(e)return Ea(e)?e.reference.split("/")[1]:e.id}function D$(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function Ei(e){if(D$(e)){const t=I$(e);if(t)return t}if(e.resourceType==="Device"){const t=N$(e);if(t)return t}if(e.resourceType==="MedicationRequest"&&e.medicationCodeableConcept)return ms(e.medicationCodeableConcept);if(e.resourceType==="Subscription"&&e.criteria)return e.criteria;if(e.resourceType==="User"&&e.email)return e.email;if("name"in e&&e.name&&typeof e.name=="string")return e.name;if("code"in e&&e.code){let t=e.code;if(Array.isArray(t)&&(t=t[0]),dT(t))return ms(t);if(U$(t))return t.text}return Ot(e)}function I$(e){const t=e.name;if(t&&t.length>0)return Ql(t[0])}function N$(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function A$(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=sS(n);if(r)return r}else return sS(t)}function sS(e){var t;if(e.url&&((t=e.contentType)!=null&&t.startsWith("image/")))return e.url}function lT(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(),s=n.getUTCMonth(),l=n.getUTCDate(),u=r.getUTCFullYear(),d=r.getUTCMonth(),p=r.getUTCDate();let h=u-o;(d<s||d===s&&p<l)&&h--;let m=u*12+d-(o*12+s);p<l&&m--;const y=Math.floor((r.getTime()-n.getTime())/(1e3*60*60*24));return{years:h,months:m,days:y}}function M$(e,t){const{years:n,months:r,days:o}=lT(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 ws(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(s=>s.url===t[o]);return n}function To(e,t){return JSON.stringify(e,O$,t?2:void 0)??""}function O$(e,t){return!L$(e)&&yn(t)?void 0:t}function L$(e){return!!/\d+$/.exec(e)}function yn(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!vn(e):!1}function vn(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 hs(e,t,n){return e===t||yn(e)&&yn(t)?!0:yn(e)||yn(t)?!1:Array.isArray(e)&&Array.isArray(t)?$$(e,t):Array.isArray(e)||Array.isArray(t)?!1:nr(e)&&nr(t)?F$(e,t,n):(nr(e)||nr(t),!1)}function $$(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!hs(e[n],t[n]))return!1;return!0}function F$(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 s=e[o],l=t[o];if(!hs(s,l,o))return!1}return!0}function cx(e,t){return yn(e)?!0:yn(t)?!1:Array.isArray(e)&&Array.isArray(t)?z$(e,t):Array.isArray(e)||Array.isArray(t)?!1:nr(e)&&nr(t)?B$(e,t):nr(e)||nr(t)?!1:e===t}function z$(e,t){return t.every(n=>e.some(r=>cx(r,n)))}function B$(e,t){return Object.entries(t).every(([n,r])=>n in e&&cx(e[n],r))}function Br(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function cT(e){return!!/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/i.exec(e)}function nr(e){return e!==null&&typeof e=="object"}function uT(e){return nr(e)&&"code"in e&&typeof e.code=="string"}function dT(e){return nr(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(uT)}function U$(e){return nr(e)&&"text"in e&&typeof e.text=="string"}const fT=[];for(let e=0;e<256;e++)fT.push(e.toString(16).padStart(2,"0"));function V$(e){const t=pT(e),n=new Uint8Array(t),r=new Array(n.length);for(let o=0;o<n.length;o++)r[o]=fT[n[o]];return r.join("")}function W$(e){const t=pT(e),n=new Uint8Array(t),r=new Array(n.length);for(let o=0;o<n.length;o++)r[o]=String.fromCharCode(n[o]);return window.btoa(r.join(""))}function pT(e){return ArrayBuffer.isView(e)?e.buffer:e}function Ln(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function ux(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function ru(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function H$(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 q$(e){if(e!==void 0)return Array.isArray(e)?e:[e]}const aS=e=>new Promise(t=>{setTimeout(t,e)});function Gg(e,t,n){const r=[];for(let o=0;o<n-1;o++){const s=e.indexOf(t);if(s<0)break;r.push(e.slice(0,s)),e=e.slice(s+t.length)}return r.push(e),r}function G$(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function $c(e,t){return e?(e.push(t),e):[t]}function ou(e){return e.sort((t,n)=>t.localeCompare(n))}function hT(e){return e.endsWith("/")?e:e+"/"}function Q$(e){return e.startsWith("/")?e.slice(1):e}function Bo(e,t){return new URL(Q$(t),hT(e.toString())).toString()}function K$(e,t){return Bo(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function Y$(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 mT(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 X$(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 iu(e){if(!e)return"";switch(e.type){case"Address":return gT(e.value);case"CodeableConcept":return ms(e.value);case"Coding":return _u(e.value);case"ContactPoint":return e.value.value;case"HumanName":return Ql(e.value);case"Quantity":return mi(e.value);case"Reference":return J$(e.value);default:return e.value.toString()}}function J$(e){return e?e.display??e.reference??To(e):""}function gT(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 Ql(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=au(e.text);if(r)return r}return n.join(" ").trim()}function Ap(e){return e instanceof Date&&!isNaN(e.getTime())}function Z$(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return Ap(r)?r.toLocaleTimeString(t,n):""}function pr(e,t,n){if(!e)return"";const r=new Date(e);return Ap(r)?r.toLocaleString(t,n):""}function e7(e,t,n){return!e||!e.start&&!e.end?"":pr(e.start,t,n)+" - "+pr(e.end,t,n)}const t7={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},n7={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},r7={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function vT(e){if(!e)return"";const t=[];return o7(t,e.repeat),e.event&&t.push(e.event.map(n=>pr(n)).join(", ")),Ln(t.join(" ").trim())}function o7(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(t7[o]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+n7[o]):e.push("per "+r+" "+r7[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(Ln).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(s=>Z$(s)).join(", "))}function su(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=a7(r.value,t),`> ${mi(r)}`):`>= ${mi(r)}`:(r==null?void 0:r.value)===void 0&&(o==null?void 0:o.value)!==void 0?n&&t!==void 0?(o.value=s7(o.value,t),`< ${mi(o)}`):`<= ${mi(o)}`:((r==null?void 0:r.unit)===(o==null?void 0:o.unit)&&(r==null||delete r.unit),`${mi(r)} - ${mi(o)}`)}function mi(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 i7(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function ms(e){if(!e)return"";const t=au(e.text);return t||(e.coding?e.coding.map(n=>_u(n)).join(", "):"")}function _u(e,t){const n=au(e==null?void 0:e.display);return n?`${n}`:au(e==null?void 0:e.code)??""}function yT(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(mi(e.valueQuantity));else if(e.valueCodeableConcept)t.push(ms(e.valueCodeableConcept));else{const n=au(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>yT(n)).join(" / ")),t.join(" / ").trim()}function au(e){return typeof e=="string"?e:void 0}function s7(e,t,n=1){return(xT(e)+n)*Math.pow(10,-t)}function a7(e,t,n=1){return(xT(e)-n)*Math.pow(10,-t)}function xT(e,t){return e}const re={Address:"Address",Age:"Age",Annotation:"Annotation",Attachment:"Attachment",BackboneElement:"BackboneElement",CodeableConcept:"CodeableConcept",Coding:"Coding",ContactDetail:"ContactDetail",ContactPoint:"ContactPoint",Contributor:"Contributor",Count:"Count",DataRequirement:"DataRequirement",Distance:"Distance",Dosage:"Dosage",Duration:"Duration",Expression:"Expression",Extension:"Extension",HumanName:"HumanName",Identifier:"Identifier",MarketingStatus:"MarketingStatus",Meta:"Meta",Money:"Money",Narrative:"Narrative",ParameterDefinition:"ParameterDefinition",Period:"Period",Population:"Population",ProdCharacteristic:"ProdCharacteristic",ProductShelfLife:"ProductShelfLife",Quantity:"Quantity",Range:"Range",Ratio:"Ratio",Reference:"Reference",RelatedArtifact:"RelatedArtifact",SampledData:"SampledData",Signature:"Signature",SubstanceAmount:"SubstanceAmount",SystemString:"http://hl7.org/fhirpath/System.String",Timing:"Timing",TriggerDefinition:"TriggerDefinition",UsageContext:"UsageContext",base64Binary:"base64Binary",boolean:"boolean",canonical:"canonical",code:"code",date:"date",dateTime:"dateTime",decimal:"decimal",id:"id",instant:"instant",integer:"integer",markdown:"markdown",oid:"oid",positiveInt:"positiveInt",string:"string",time:"time",unsignedInt:"unsignedInt",uri:"uri",url:"url",uuid:"uuid"};function l7(e){let t=Yo.types[e];return t||(t={searchParamsDetails:{}},Yo.types[e]=t),t.searchParams||(t.searchParams={_id:{base:[e],code:"_id",type:"token",expression:e+".id"},_lastUpdated:{base:[e],code:"_lastUpdated",type:"date",expression:e+".meta.lastUpdated"},_compartment:{base:[e],code:"_compartment",type:"reference",expression:e+".meta.compartment"},_profile:{base:[e],code:"_profile",type:"uri",expression:e+".meta.profile"},_security:{base:[e],code:"_security",type:"token",expression:e+".meta.security"},_source:{base:[e],code:"_source",type:"uri",expression:e+".meta.source"},_tag:{base:[e],code:"_tag",type:"token",expression:e+".meta.tag"}}),t}function c7(e){for(const t of e.base??[]){const n=l7(t);n.searchParams||(n.searchParams={}),n.searchParams[e.code]=e}}function lS(e){var n,r,o,s;const t=(r=(n=e.type)==null?void 0:n[0])==null?void 0:r.code;return t==="BackboneElement"||t==="Element"?u7((s=((o=e.base)==null?void 0:o.path)??e.path)==null?void 0:s.split(".")):t}function u7(e){return e.length===1?e[0]:e.map(Ln).join("")}function dx(e){var t;return(t=Yo.types[e])==null?void 0:t.searchParams}function d7(e,t){var n,r;return(r=(n=Yo.types[e])==null?void 0:n.searchParams)==null?void 0:r[t]}function la(e){const t=e.replaceAll("[x]","").split(".").pop();return bT(t)}function bT(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(p7).join(" ").replace("_"," ").replace(/\s+/g," ")}const f7=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function p7(e){const t=e.toUpperCase();return e===t?e:f7.has(t)?t:t.charAt(0)+e.slice(1)}function Ca(e,t,n){const r=Np(e,n);if(r)return h7(r.elements,t)}function h7(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 s=t.slice(0,r)+"[x]",l=e[s];if(l)return l}}}function Mi(e){return!!(e&&typeof e=="object"&&"resourceType"in e)}function Ea(e){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const Yo={types:{}};function mf(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 fi=()=>[],jr={empty:(e,t)=>Ye(t.length===0||t.every(n=>yn(n.value))),hasValue:(e,t)=>Ye(t.length!==0),exists:(e,t,n)=>Ye(n?t.filter(r=>Wo(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!yn(r.value))),all:(e,t,n)=>Ye(t.every(r=>Wo(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return Ye(!1);return Ye(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return Ye(!0);return Ye(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return Ye(!1);return Ye(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return Ye(!0);return Ye(!1)},subsetOf:(e,t,n)=>{if(t.length===0)return Ye(!0);const r=n.eval(e,Us(e));return r.length===0?Ye(!1):Ye(t.every(o=>r.some(s=>s.value===o.value)))},supersetOf:(e,t,n)=>{const r=n.eval(e,Us(e));return r.length===0?Ye(!0):t.length===0?Ye(!1):Ye(r.every(o=>t.some(s=>s.value===o.value)))},count:(e,t)=>[{type:re.integer,value:t.length}],distinct:(e,t)=>{const n=[];for(const r of t)n.some(o=>o.value===r.value)||n.push(r);return n},isDistinct:(e,t)=>Ye(t.length===jr.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>Wo(n.eval(e,[r]))),select:(e,t,n)=>t.map(r=>n.eval({parent:e,variables:{$this:r}},[r])).flat(),repeat:fi,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,Us(e)),o=[];for(const s of t)!o.some(l=>l.value===s.value)&&r.some(l=>l.value===s.value)&&o.push(s);return o},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Us(e)),o=[];for(const s of t)r.some(l=>l.value===s.value)||o.push(s);return o},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Us(e));return oT([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Us(e));return[...t,...r]},htmlChecks:(e,t,n)=>[no(!0)],iif:(e,t,n,r,o)=>{const s=n.eval(e,t);if(s.length>1||s.length===1&&typeof s[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return Wo(s)?r.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Uo(t,1);if(typeof n=="boolean")return[{type:re.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return Ye(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return Ye(!0);if(["false","f","no","n","0","0.0"].includes(r))return Ye(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:Ye(jr.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Uo(t,1);return typeof n=="number"?[{type:re.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:re.integer,value:parseInt(n,10)}]:typeof n=="boolean"?[{type:re.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:Ye(jr.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Uo(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:re.date,value:mf(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:Ye(jr.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Uo(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:re.dateTime,value:mf(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:Ye(jr.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Uo(t,1);return typeof n=="number"?[{type:re.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:re.decimal,value:parseFloat(n)}]:typeof n=="boolean"?[{type:re.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:Ye(jr.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Uo(t,1);return Zr(n)?[{type:re.Quantity,value:n}]:typeof n=="number"?[{type:re.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:re.Quantity,value:{value:parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:re.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:Ye(jr.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Uo(t,1);return n==null?[]:Zr(n)?[{type:re.string,value:`${n.value} '${n.unit}'`}]:[{type:re.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:Ye(jr.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Uo(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:re.time,value:mf("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:Ye(jr.toTime(e,t).length===1),indexOf:(e,t,n)=>Xr((r,o)=>r.indexOf(o),e,t,n),substring:(e,t,n,r)=>Xr((o,s,l)=>{const u=s,d=l?u+l:o.length;return u<0||u>=o.length?void 0:o.substring(u,d)},e,t,n,r),startsWith:(e,t,n)=>Xr((r,o)=>r.startsWith(o),e,t,n),endsWith:(e,t,n)=>Xr((r,o)=>r.endsWith(o),e,t,n),contains:(e,t,n)=>Xr((r,o)=>r.includes(o),e,t,n),upper:(e,t)=>Xr(n=>n.toUpperCase(),e,t),lower:(e,t)=>Xr(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>Xr((o,s,l)=>o.replaceAll(s,l),e,t,n,r),matches:(e,t,n)=>Xr((r,o)=>!!new RegExp(o).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>Xr((o,s,l)=>o.replaceAll(s,l),e,t,n,r),length:(e,t)=>Xr(n=>n.length,e,t),toChars:(e,t)=>Xr(n=>n?n.split(""):void 0,e,t),encode:fi,decode:fi,escape:fi,unescape:fi,trim:fi,split:fi,join:(e,t,n)=>{var o;const r=((o=n==null?void 0:n.eval(e,Us(e))[0])==null?void 0:o.value)??"";if(typeof r!="string")throw new Error("Separator must be a string.");return[{type:re.string,value:t.map(s=>{var l;return((l=s.value)==null?void 0:l.toString())??""}).join(r)}]},abs:(e,t)=>Fo(Math.abs,e,t),ceiling:(e,t)=>Fo(Math.ceil,e,t),exp:(e,t)=>Fo(Math.exp,e,t),floor:(e,t)=>Fo(Math.floor,e,t),ln:(e,t)=>Fo(Math.log,e,t),log:(e,t,n)=>Fo((r,o)=>Math.log(r)/Math.log(o),e,t,n),power:(e,t,n)=>Fo(Math.pow,e,t,n),round:(e,t)=>Fo(Math.round,e,t),sqrt:(e,t)=>Fo(Math.sqrt,e,t),truncate:(e,t)=>Fo(n=>n|0,e,t),children:fi,descendants:fi,trace:(e,t,n)=>t,now:()=>[{type:re.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:re.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:re.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,o)=>{var p;const s=jr.toDateTime(e,n.eval(e,t));if(s.length===0)throw new Error("Invalid start date");const l=jr.toDateTime(e,r.eval(e,t));if(l.length===0)throw new Error("Invalid end date");const u=(p=o.eval(e,t)[0])==null?void 0:p.value;if(u!=="years"&&u!=="months"&&u!=="days")throw new Error("Invalid units");const d=lT(s[0].value,l[0].value);return[{type:re.Quantity,value:{value:d[u],unit:u}}]},is:(e,t,n)=>{let r="";return n instanceof _f?r=n.name:n instanceof px&&(r=n.left.name+"."+n.right.name),r?t.map(o=>({type:re.boolean,value:sT(o,r)})):[]},not:(e,t)=>jr.toBoolean(e,t).map(n=>({type:re.boolean,value:!n.value})),resolve:(e,t)=>t.map(n=>{const r=n.value;let o;if(typeof r=="string")o=r;else if(typeof r=="object"){const s=r;if(s.resource)return no(s.resource);s.reference?o=s.reference:s.type&&s.identifier&&(o=`${s.type}?identifier=${s.identifier.system}|${s.identifier.value}`)}if(o!=null&&o.includes("?")){const[s]=o.split("?");return{type:s,value:{resourceType:s}}}if(o!=null&&o.includes("/")){const[s,l]=o.split("/");return{type:s,value:{resourceType:s,id:l}}}return{type:re.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:re.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:re.BackboneElement,value:{namespace:"System",name:"Integer"}}:Mi(n)?{type:re.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:re.BackboneElement,value:null}),conformsTo:(e,t,n)=>{const r=n.eval(e,t)[0].value;if(!r.startsWith("http://hl7.org/fhir/StructureDefinition/"))throw new Error("Expected a StructureDefinition URL");const o=r.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(s=>{var l;return{type:re.boolean,value:((l=s.value)==null?void 0:l.resourceType)===o}})},getResourceKey:(e,t)=>{const n=t[0].value;return n!=null&&n.id?[{type:re.id,value:n.id}]:[]},getReferenceKey:(e,t,n)=>{const r=t[0].value;if(!(r!=null&&r.reference))return[];let o="";return n instanceof _f&&(o=n.name),o&&!r.reference.startsWith(o+"/")?[]:[{type:re.id,value:Rl(r)}]},extension:(e,t,n)=>{var s;const r=n.eval(e,t)[0].value,o=(s=t==null?void 0:t[0])==null?void 0:s.value;if(o){const l=ws(o,r);if(l)return[{type:re.Extension,value:l}]}return[]}};function Xr(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=Uo(n,1);if(typeof o!="string")throw new Error("String function cannot be called with non-string");const s=e(o,...r.map(l=>{var u;return(u=l==null?void 0:l.eval(t,n)[0])==null?void 0:u.value}));return s===void 0?[]:Array.isArray(s)?s.map(no):[no(s)]}function Fo(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=Uo(n,1),s=Zr(o),l=s?o.value:o;if(typeof l!="number")throw new Error("Math function cannot be called with non-number");const u=e(l,...r.map(h=>{var m;return(m=h.eval(t,n)[0])==null?void 0:m.value})),d=s?re.Quantity:n[0].type,p=s?{...o,value:u}:u;return[{type:d,value:p}]}function Uo(e,t){if(e.length!==t)throw new Error(`Expected ${t} arguments`);for(const n of e)if(n==null)throw new Error("Expected non-null argument");return e}function Us(e){var n;let t=e;for(;(n=t.parent)!=null&&n.variables.$this;)t=t.parent;return[t.variables.$this]}class m7{constructor(t,n){this.original=t,this.child=n}eval(t,n){try{if(n.length>0){const r=[];for(const o of n)r.push(this.child.eval({parent:t,variables:{$this:o}},[o]));return r.flat()}else return this.child.eval(t,[])}catch(r){throw new Error(`FhirPathError on "${this.original}": ${r}`,{cause:r})}}toString(){return this.child.toString()}}class al{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class _f{constructor(t){this.name=t}eval(t,n){if(this.name==="$this")return n;const r=this.getVariable(t);if(r)return[r];if(this.name.startsWith("%"))throw new Error(`Undefined variable ${this.name}`);return n.flatMap(o=>this.evalValue(o)).filter(o=>(o==null?void 0:o.value)!==void 0)}getVariable(t){const n=t.variables[this.name];if(n!==void 0)return n;if(t.parent)return this.getVariable(t.parent)}evalValue(t){const n=t.value;if(!(!n||typeof n!="object"))return Mi(n)&&n.resourceType===this.name?t:Pl(t,this.name)}toString(){return this.name}}class g7{eval(){return[]}toString(){return"{}"}}class v7 extends q5{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 fx extends Pu{constructor(t,n){super("as",t,n)}eval(t,n){return jr.ofType(t,this.left.eval(t,n),this.right)}}class Ir extends Pu{}class xo extends Ir{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 s=r[0].value,l=o[0].value,u=Zr(s)?s.value:s,d=Zr(l)?l.value:l,p=this.impl(u,d);return typeof p=="boolean"?Ye(p):Zr(s)?[{type:re.Quantity,value:{...s,value:p}}]:[no(p)]}}class y7 extends Pu{constructor(t,n){super("&",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n),s=[...r,...o];return s.length>0&&s.every(l=>typeof l.value=="string")?[{type:re.string,value:s.map(l=>l.value).join("")}]:s}}class x7 extends Ir{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return Ye(r.some(s=>s.value===o[0].value))}}class b7 extends Ir{constructor(t,n){super("in",t,n)}eval(t,n){const r=Ci(this.left.eval(t,n)),o=this.right.eval(t,n);return r?Ye(o.some(s=>s.value===r.value)):[]}}class px extends Pu{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 wT extends Pu{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 w7 extends Ir{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return E$(r,o)}}class S7 extends Ir{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return k$(r,o)}}class j7 extends Ir{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return iT(r,o)}}class C7 extends Ir{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return C$(iT(r,o))}}class hx extends Ir{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 Ye(sT(r[0],o))}}class E7 extends Ir{constructor(t,n){super("and",t,n)}eval(t,n){const r=Ci(this.left.eval(t,n),"boolean"),o=Ci(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!0&&(o==null?void 0:o.value)===!0?Ye(!0):(r==null?void 0:r.value)===!1||(o==null?void 0:o.value)===!1?Ye(!1):[]}}class k7 extends Ir{constructor(t,n){super("or",t,n)}eval(t,n){const r=Ci(this.left.eval(t,n),"boolean"),o=Ci(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!1&&(o==null?void 0:o.value)===!1?Ye(!1):r!=null&&r.value||o!=null&&o.value?Ye(!0):[]}}class T7 extends Ir{constructor(t,n){super("xor",t,n)}eval(t,n){const r=Ci(this.left.eval(t,n),"boolean"),o=Ci(this.right.eval(t,n),"boolean");return!r||!o?[]:Ye(r.value!==o.value)}}class P7 extends Ir{constructor(t,n){super("implies",t,n)}eval(t,n){const r=Ci(this.left.eval(t,n),"boolean"),o=Ci(this.right.eval(t,n),"boolean");return(o==null?void 0:o.value)===!0||(r==null?void 0:r.value)===!1?Ye(!0):!r||!o?[]:Ye(!1)}}class mx{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=jr[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 gx{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 s=this.left.eval(t,n);return o in s?[s[o]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const R7=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class _7{constructor(t,n,r,o){this.result=[],this.pos={index:0,line:1,column:0},this.markStack=[],this.str=t,this.keywords=n,this.operators=r,this.dateTimeLiterals=!!(o!=null&&o.dateTimeLiterals),this.symbolRegex=(o==null?void 0:o.symbolRegex)??/[$\w%]/}tokenize(){for(;this.pos.index<this.str.length;){const t=this.consumeToken();t&&this.result.push(t)}return this.result}prevToken(){return this.result.slice(-1)[0]}peekToken(){this.mark();const t=this.consumeToken();return this.reset(),t}consumeToken(){this.consumeWhitespace();const t=this.curr();if(!t)return;this.mark();const n=this.peek();return t==="/"&&n==="*"?this.consumeMultiLineComment():t==="/"&&n==="/"?this.consumeSingleLineComment():t==="'"||t==='"'?this.consumeString(t):t==="`"?this.consumeBacktickSymbol():t==="@"?this.consumeDateTime():/\d/.exec(t)?this.consumeNumber():/\w/.exec(t)?this.consumeSymbol():(t==="$"||t==="%")&&/\w/.exec(n)?this.consumeSymbol():this.consumeOperator()}consumeWhitespace(){this.consumeWhile(()=>/\s/.exec(this.curr()))}consumeMultiLineComment(){const t=this.pos.index;return this.consumeWhile(()=>this.curr()!=="*"||this.peek()!=="/"),this.advance(),this.advance(),this.buildToken("Comment",this.str.substring(t,this.pos.index))}consumeSingleLineComment(){return this.buildToken("Comment",this.consumeWhile(()=>this.curr()!==`
|
|
92
|
-
`))}consumeString(t){this.advance();const n=this.buildToken("String",this.consumeWhile(()=>this.prev()==="\\"||this.curr()!==t));return this.advance(),n}consumeBacktickSymbol(){this.advance();const t=this.buildToken("Symbol",this.consumeWhile(()=>this.curr()!=="`"));return this.advance(),t}consumeDateTime(){this.advance();const t=this.pos.index;this.consumeWhile(()=>/[\d-]/.exec(this.curr()));let n=!1,r=!1;if(this.curr()==="T"&&(n=!0,this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="Z"?(r=!0,this.advance()):(this.curr()==="+"||this.curr()==="-")&&(r=!0,this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr())))),this.pos.index===t)throw new Error("Invalid DateTime literal");let o=this.str.substring(t,this.pos.index);return o.endsWith("T")?o=o.substring(0,o.length-1):!o.startsWith("T")&&n&&!r&&(o+="Z"),this.buildToken("DateTime",o)}consumeNumber(){const t=this.pos.index;let n="Number";return this.consumeWhile(()=>/\d/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="-"&&this.dateTimeLiterals?(this.pos.index=t-1,this.consumeDateTime()):(this.curr()===" "&&D7(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 D7(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&R7.includes(e.value)))}const I7=["true","false"],N7=["!=","!~","<=",">=","{}","->"];function A7(e){return new _7(e,I7,N7).tokenize()}const zt={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},M7={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}},O7={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new gx(t,n)},precedence:zt.Indexer},L7={parse(e,t){if(!(t instanceof _f))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new mx(t.name,n)},precedence:zt.FunctionCall};function $7(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 F7(){return new G5().registerPrefix("String",{parse:(e,t)=>new al({type:re.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new al({type:re.dateTime,value:mf(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new al({type:re.Quantity,value:$7(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new al({type:t.value.includes(".")?re.decimal:re.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new al({type:re.boolean,value:!0})}).registerPrefix("false",{parse:()=>new al({type:re.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new _f(t.value)}).registerPrefix("{}",{parse:()=>new g7}).registerPrefix("(",M7).registerInfix("[",O7).registerInfix("(",L7).prefix("+",zt.UnaryAdd,(e,t)=>new v7("+",t,n=>n)).prefix("-",zt.UnarySubtract,(e,t)=>new xo("-",t,t,(n,r)=>-r)).infixLeft(".",zt.Dot,(e,t,n)=>new px(e,n)).infixLeft("/",zt.Divide,(e,t,n)=>new xo("/",e,n,(r,o)=>r/o)).infixLeft("*",zt.Multiply,(e,t,n)=>new xo("*",e,n,(r,o)=>r*o)).infixLeft("+",zt.Add,(e,t,n)=>new xo("+",e,n,(r,o)=>r+o)).infixLeft("-",zt.Subtract,(e,t,n)=>new xo("-",e,n,(r,o)=>r-o)).infixLeft("|",zt.Union,(e,t,n)=>new wT(e,n)).infixLeft("=",zt.Equals,(e,t,n)=>new w7(e,n)).infixLeft("!=",zt.NotEquals,(e,t,n)=>new S7(e,n)).infixLeft("~",zt.Equivalent,(e,t,n)=>new j7(e,n)).infixLeft("!~",zt.NotEquivalent,(e,t,n)=>new C7(e,n)).infixLeft("<",zt.LessThan,(e,t,n)=>new xo("<",e,n,(r,o)=>r<o)).infixLeft("<=",zt.LessThanOrEquals,(e,t,n)=>new xo("<=",e,n,(r,o)=>r<=o)).infixLeft(">",zt.GreaterThan,(e,t,n)=>new xo(">",e,n,(r,o)=>r>o)).infixLeft(">=",zt.GreaterThanOrEquals,(e,t,n)=>new xo(">=",e,n,(r,o)=>r>=o)).infixLeft("&",zt.Ampersand,(e,t,n)=>new y7(e,n)).infixLeft("and",zt.And,(e,t,n)=>new E7(e,n)).infixLeft("as",zt.As,(e,t,n)=>new fx(e,n)).infixLeft("contains",zt.Contains,(e,t,n)=>new x7(e,n)).infixLeft("div",zt.Divide,(e,t,n)=>new xo("div",e,n,(r,o)=>r/o|0)).infixLeft("in",zt.In,(e,t,n)=>new b7(e,n)).infixLeft("is",zt.Is,(e,t,n)=>new hx(e,n)).infixLeft("mod",zt.Modulo,(e,t,n)=>new xo("mod",e,n,(r,o)=>r%o)).infixLeft("or",zt.Or,(e,t,n)=>new k7(e,n)).infixLeft("xor",zt.Xor,(e,t,n)=>new T7(e,n)).infixLeft("implies",zt.Implies,(e,t,n)=>new P7(e,n))}const z7=F7();function ST(e){return new m7(e,z7.construct(A7(e)).consumeAndParse())}function Kl(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]=no(n[r]))}return ca(e,n).map(r=>r.value)}function ca(e,t,n={}){return ST(e).eval({variables:n},t).map(o=>{var s;return{type:o.type,value:(s=o.value)==null?void 0:s.valueOf()}})}var gi=(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))(gi||{});function Yl(e,t){var r,o;let n=(o=(r=Yo.types[e])==null?void 0:r.searchParamsDetails)==null?void 0:o[t.code];return n||(n=U7(e,t)),n}function B7(e,t,n){let r=Yo.types[e];r||(r={},Yo.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function U7(e,t){const n=t.code,r=q7(e,t.expression),o={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const l of r){const u=qc(l),d=G$(()=>u.join("."));u.length===1&&u[0]instanceof Ir?o.propertyTypes.add("boolean"):t.code.endsWith(":identifier")?o.propertyTypes.add("Identifier"):d().endsWith("extension.value.code")||d().endsWith("extension.value.coding.code")?(o.array=!0,o.propertyTypes.add("code")):jT(o,qc(l),e,1),d().endsWith("extension.valueDateTime")&&(o.array=!1)}const s={type:H7(t,o.propertyTypes),elementDefinitions:o.elementDefinitions,array:o.array};return B7(e,n,s),s}function jT(e,t,n,r){const o=t[r];if(o instanceof fx){e.propertyTypes.add(o.right.toString());return}if(o instanceof mx){V7(e,o);return}const s=o.toString(),l=Ca(n,s);if(!l)throw new Error(`Element definition not found for ${n} ${s}`);let u=!1,d=r+1;if(d<t.length&&t[d]instanceof gx&&(u=!0,d++),l.isArray&&!u&&(e.array=!0),d>=t.length){e.elementDefinitions.push(l);for(const p of l.type)e.propertyTypes.add(p.code);return}for(const p of l.type){let h=p.code;W7(h)&&(h=l.type[0].code),jT(e,t,h,d)}}function V7(e,t){if(t.name==="as"){e.propertyTypes.add(t.args[0].toString());return}if(t.name==="ofType"){e.propertyTypes.add(t.args[0].toString());return}if(t.name==="resolve"){e.propertyTypes.add("string");return}if(t.name==="where"&&t.args[0]instanceof hx){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function W7(e){return e==="Element"||e==="BackboneElement"}function H7(e,t){switch(e.type){case"date":return t.size===1&&t.has(re.date)?"DATE":"DATETIME";case"number":return"NUMBER";case"quantity":return"QUANTITY";case"reference":return t.has(re.canonical)?"CANONICAL":"REFERENCE";case"token":return t.size===1&&t.has(re.boolean)?"BOOLEAN":"TEXT";default:return"TEXT"}}function q7(e,t){const n=[],r=ST(t);return Qg(e,r.child,n),n}function Qg(e,t,n){t instanceof wT?(Qg(e,t.left,n),Qg(e,t.right,n)):t.toString().startsWith(e+".")&&n.push(t)}function qc(e){if(e instanceof fx||e instanceof gx)return[qc(e.left),e].flat();if(e instanceof Ir)return[e];if(e instanceof px)return[qc(e.left),qc(e.right)].flat();if(e instanceof mx){if(e.name==="where"&&!(e.args[0]instanceof hx))return[];if(e.name==="last")return[]}return[e]}const Mp=20;var Ce=(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.STARTS_WITH="sw",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))(Ce||{});const CT={contains:"contains",exact:"exact",above:"above",below:"below",text:"text",not:"not",in:"in","not-in":"not-in","of-type":"of-type",missing:"missing",identifier:"identifier",iterate:"iterate"},vx={eq:"eq",ne:"ne",lt:"lt",le:"le",gt:"gt",ge:"ge",sa:"sa",eb:"eb",ap:"ap",sw:"sw"};function ET(e,t){if(!e)throw new Error("Invalid search URL");let n="",r;if(typeof e=="string")if(e.includes("?")){const[l,u]=e.split("?");n=l,r=new URLSearchParams(u)}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 s=[];return r&&s.push(...r.entries()),G7(o,s)}function G7(e,t){const n={resourceType:e};for(const[r,o]of t)Q7(n,r,o);return n}function Q7(e,t,n){var l,u;let r,o;const s=t.indexOf(":");if(s>=0?(r=t.substring(0,s),o=t.substring(s+1)):(r=t,o=""),r!=="_"){if(r==="_has"||t.includes(".")){e.filters=$c(e.filters,{code:t,operator:"eq",value:n});return}switch(r){case"_sort":K7(e,n);break;case"_cursor":e.cursor=n;break;case"_count":e.count=parseInt(n,10);break;case"_offset":e.offset=parseInt(n,10);break;case"_total":e.total=n;break;case"_summary":n==="count"?(e.total="accurate",e.count=0):(n==="true"||n==="data"||n==="text")&&(e.summary=n);break;case"_include":{const d=cS(n);o==="iterate"&&(d.modifier="iterate"),e.include=$c(e.include,d);break}case"_revinclude":{const d=cS(n);o==="iterate"&&(d.modifier="iterate"),e.revInclude=$c(e.revInclude,d);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 d=(u=(l=Yo.types[e.resourceType])==null?void 0:l.searchParams)==null?void 0:u[r];d?e.filters=$c(e.filters,Y7(d,o,n)):e.filters=$c(e.filters,X7(r,o,n))}}}}function K7(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 Y7(e,t,n){if(t==="missing")return{code:e.code,operator:"missing",value:n};switch(e.type){case"number":case"date":case"quantity":{const{operator:r,value:o}=J7(n);if(!uS(e,o))throw new dt(Qo(`Invalid format for ${e.type} search parameter: ${o}`));return{code:e.code,operator:r,value:o}}case"reference":case"string":case"token":case"uri":if(!uS(e,n))throw new dt(Qo(`Invalid format for ${e.type} search parameter: ${n}`));return{code:e.code,operator:Z7(t),value:n};default:throw new Error("Unrecognized search parameter type: "+e.type)}}function X7(e,t,n){var o;let r="eq";if(t)r=t;else if(n.length>=2){const s=n.substring(0,2);s in vx&&(n.length===2||(o=n.at(2))!=null&&o.match(/\d/))&&(r=s,n=n.substring(s.length))}return{code:e,operator:r,value:n}}function J7(e){const t=e.substring(0,2),n=vx[t];return n?{operator:n,value:e.substring(2)}:{operator:"eq",value:e}}function Z7(e){return CT[e]??"eq"}function cS(e){const t=e.split(":");if(t.includes("*"))throw new dt(Qo("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new dt(Qo(`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 dt(Qo(`Invalid include value '${e}'`))}function uS(e,t){switch(e.type){case"date":return Rf(t);default:return!0}}function hl(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(e6(n))),e.sortRules&&e.sortRules.length>0&&t.push(t6(e.sortRules)),e.cursor!==void 0&&t.push("_cursor="+encodeURIComponent(e.cursor)),e.offset!==void 0&&e.offset!==0&&t.push("_offset="+e.offset),e.count!==void 0&&t.push("_count="+e.count),e.total!==void 0&&t.push("_total="+e.total),e.include&&e.include.forEach(n=>t.push(dS("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(dS("_revinclude",n))),t.length===0?"":(ou(t),"?"+t.join("&"))}function e6(e){const t=e.operator in CT?":"+e.operator:"",n=e.operator!=="eq"&&e.operator in vx?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function t6(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function dS(e,t){return e+(t.modifier?":"+t.modifier:"")+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function yx(e){const t=[];let n="",r=!1;for(const o of e)r?(n+=o,r=!1):o==="\\"?r=!0:o===","?(t.push(n),n=""):n+=o;return t.push(n),t}function n6(e,t){if(t.resourceType!==e.resourceType)return!1;if(t.filters){for(const n of t.filters)if(!r6(e,t,n))return!1}return!0}function r6(e,t,n){var o,s;const r=(s=(o=Yo.types[t.resourceType])==null?void 0:o.searchParams)==null?void 0:s[n.code];if(!r)return!1;if(n.operator===Ce.MISSING||n.operator===Ce.PRESENT)return o6(e,n,r);switch(r.type){case"reference":return i6(e,n,r);case"string":case"uri":return kT(e,n,r);case"token":return s6(e,n,r);case"date":return u6(e,n,r);default:return!1}}function o6(e,t,n){const o=Kl(n.expression,e).length>0;return(t.operator===Ce.MISSING&&t.value==="false"||t.operator===Ce.PRESENT&&t.value==="true")===o}function i6(e,t,n){const r=Kl(n.expression,e),o=Op(t.operator);if(t.value===""&&r.length===0)return t.operator===Ce.EQUALS;const s=r.map(l=>typeof l=="string"?l:l.reference);for(const l of yx(t.value)){let u=s.includes(l);if(!u&&t.code==="_compartment"&&(u=s.some(d=>d==null?void 0:d.endsWith("/"+l))),u)return!o}return o}function s6(e,t,n){return Yl(e.resourceType,n).type===gi.BOOLEAN?a6(e,t,n):kT(e,t,n,!0)}function a6(e,t,n){const r=Kl(n.expression,e),o=t.value==="true",s=r.includes(o);return Op(t.operator)?!s:s}function kT(e,t,n,r){var p,h,m,y;const s=(y=(m=(h=(p=Yl(e.resourceType,n).elementDefinitions)==null?void 0:p[0])==null?void 0:h.type)==null?void 0:m[0])==null?void 0:y.code,l=Kl(n.expression,e),u=yx(t.value),d=Op(t.operator);for(const x of l)for(const b of u){let w;if(s===re.Identifier?w=l6(x,t.operator,b):s===re.CodeableConcept?w=c6(x,t.operator,b):w=Kg(x,t.operator,b,r),w)return!d}return d}function Kg(e,t,n,r){if(r&&n.includes("|")){const[s,l]=n.split("|");return Kg(e,t,s,!1)&&(!l||Kg(e,t,l,!1))}let o="";return e&&(typeof e=="string"?o=e:typeof e=="object"&&(o=JSON.stringify(e))),o.toLowerCase().includes(n.toLowerCase())}function l6(e,t,n){var r,o,s,l;if(n.includes("|")){const[u,d]=n.split("|").map(p=>p.toLowerCase());return!u&&!d?!1:u?((o=e.system)==null?void 0:o.toLowerCase())===u&&(!d||((s=e.value)==null?void 0:s.toLowerCase())===d):!e.system&&((r=e.value)==null?void 0:r.toLowerCase())===d}return((l=e.value)==null?void 0:l.toLowerCase())===n.toLowerCase()}function c6(e,t,n){var r,o,s,l;if(n.includes("|")){const[u,d]=n.split("|").map(p=>p.toLowerCase());return!u&&!d?!1:u?((o=e.coding)==null?void 0:o.some(p=>{var h,m;return((h=p.system)==null?void 0:h.toLowerCase())===u&&(!d||((m=p.code)==null?void 0:m.toLowerCase())===d)}))??!1:((r=e.coding)==null?void 0:r.some(p=>{var h;return!p.system&&((h=p.code)==null?void 0:h.toLowerCase())===d}))??!1}return((s=e.text)==null?void 0:s.toLowerCase())===n.toLowerCase()||(((l=e.coding)==null?void 0:l.some(u=>{var d;return((d=u.code)==null?void 0:d.toLowerCase())===n.toLowerCase()}))??!1)}function u6(e,t,n){const r=Kl(n.expression,e),o=yx(t.value),s=Op(t.operator);for(const l of r)for(const u of o)if(d6(l,t.operator,u))return!s;return s}function d6(e,t,n){switch(t){case Ce.STARTS_AFTER:case Ce.GREATER_THAN:return e>n;case Ce.GREATER_THAN_OR_EQUALS:return e>=n;case Ce.ENDS_BEFORE:case Ce.LESS_THAN:return e<n;case Ce.LESS_THAN_OR_EQUALS:return e<=n;case Ce.EQUALS:case Ce.NOT_EQUALS:return e===n;default:return!1}}function Op(e){return e===Ce.NOT_EQUALS||e===Ce.NOT}const f6={resourceType:"*"},p6=["DomainConfiguration","JsonWebKey","Login"],h6=["PasswordChangeRequest","UserSecurityRequest","Project","ProjectMembership","User"];var xx=(e=>(e.READ="read",e.VREAD="vread",e.UPDATE="update",e.PATCH="patch",e.DELETE="delete",e.HISTORY="history",e.HISTORY_INSTANCE="history-instance",e.HISTORY_TYPE="history-type",e.HISTORY_SYSTEM="history-system",e.CREATE="create",e.SEARCH="search",e.SEARCH_TYPE="search-type",e.SEARCH_SYSTEM="search-system",e.SEARCH_COMPARTMENT="search-compartment",e.CAPABILITIES="capabilities",e.TRANSACTION="transaction",e.BATCH="batch",e.OPERATION="operation",e))(xx||{});const m6=["read","vread","history","history-instance"];function g6(e,t){if(p6.includes(t))return!1;if(e.resource){for(const n of e.resource)if(PT(n.resourceType,t)&&!n.readonly)return!0}return!1}function TT(e,t,n){if(!n)return f6;if(n.resource){for(const r of n.resource)if(v6(e,t,r))return r}}function v6(e,t,n){var o,s;const r=e.resourceType;return!(!PT(n.resourceType,r)||n.readonly&&!m6.includes(t)||n.compartment&&!((s=(o=e.meta)==null?void 0:o.compartment)!=null&&s.find(l=>{var u;return l.reference===((u=n.compartment)==null?void 0:u.reference)}))||n.criteria&&!n6(e,ET(n.criteria)))}function PT(e,t){return e===t||e==="*"&&!h6.includes(t)}function y6(e){if(typeof window<"u"){const t=window.atob(e),n=Uint8Array.from(t,r=>r.charCodeAt(0));return new window.TextDecoder().decode(n)}if(typeof Buffer<"u")return Buffer.from(e,"base64").toString("utf-8");throw new Error("Unable to decode base64")}function x6(e){if(typeof window<"u"){const t=new window.TextEncoder().encode(e),n=String.fromCharCode.apply(null,t);return window.btoa(n)}if(typeof Buffer<"u")return Buffer.from(e,"utf8").toString("base64");throw new Error("Unable to encode base64")}function fS(){const e=new Uint32Array(28);return crypto.getRandomValues(e),V$(e.buffer)}async function b6(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function RT(){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 _T(e){var o,s,l;const t={};e=Br(e);for(const u of e.entry||[]){((o=u.resource)==null?void 0:o.meta)!==void 0&&(delete u.resource.meta.author,delete u.resource.meta.compartment,delete u.resource.meta.lastUpdated,delete u.resource.meta.project,delete u.resource.meta.versionId);const d=(s=u.resource)==null?void 0:s.id;d&&(t[d]=RT(),u.fullUrl="urn:uuid:"+t[d],(l=u.resource)==null||delete l.id)}const n=e.entry,r=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:n==null?void 0:n.map(u=>({fullUrl:u.fullUrl,request:{method:"POST",url:u.resource.resourceType},resource:u.resource}))},(u,d)=>w6(u,d,t),2);return S6(JSON.parse(r))}function w6(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 S6(e){const t=C6(e),{sorted:n,cycles:r}=j6(t),o={};for(const l of e.entry??[])l.fullUrl&&(o[l.fullUrl]=l);const s=n.map(l=>o[l]);for(const l of r)for(const u of l){const d=o[u],p={...d,request:{...d.request,method:"PUT"}};s.push(p)}return{...e,entry:s}}function j6(e){const t=[],n={},r=[];for(const s of Object.keys(e))n[s]=0;function o(s,l){if(n[s]===2)return!0;if(n[s]===1){const d=l.lastIndexOf(s);return d!==-1&&r.push(l.slice(d)),!0}n[s]=1,l.push(s);let u=!1;for(const d of e[s])o(d,l)||(u=!0);return n[s]=2,l.pop(),t.unshift(s),!u}for(const s in e)n[s]===0&&o(s,[]);return{sorted:t,cycles:r}}function DT(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(Ea(r)){const o=r.reference;o.startsWith("urn:uuid:")&&t(o)}else DT(r,t)}}function C6(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&&DT(n.resource,o=>{t[o]&&t[o].push(r)})}return t}class IT{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 On={CSS:"text/css",DICOM:"application/dicom",FAVICON:"image/vnd.microsoft.icon",FHIR_JSON:"application/fhir+json",FORM_URL_ENCODED:"application/x-www-form-urlencoded",HL7_V2:"x-application/hl7-v2+er7",HTML:"text/html",JAVASCRIPT:"text/javascript",JSON:"application/json",JSON_PATCH:"application/json-patch+json",PNG:"image/png",SCIM_JSON:"application/scim+json",SVG:"image/svg+xml",TEXT:"text/plain",TYPESCRIPT:"text/typescript",PING:"x-application/ping"};class E6{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 Lp{constructor(){this.emitter=new E6}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 Yg={"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"},k6=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],bx=["DiagnosticReport-update"];function T6(e){return bx.includes(e)}function P6(e){if(bx.includes(e))throw new dt(an(`'context.version' is required for '${e}'.`))}const R6={"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 _6(e){return k6.includes(e)}function NT(e){return!!e.endpoint}function pS(e){if(!wx(e))throw new dt(an("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:n,topic:r,events:o}=e,s={"hub.channel.type":t,"hub.mode":n,"hub.topic":r,"hub.events":o.join(",")};return NT(e)&&(s.endpoint=e.endpoint),new URLSearchParams(s).toString()}function wx(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 s of o)if(!Yg[s])return!1;return!(NT(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function hS(e,t,n,r){if(typeof t!="object")throw new dt(an(`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 dt(an(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new dt(an(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const o=r.resourceType;if(o!=="*"){if(!_6(t.resourceType))throw new dt(an(`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 dt(an(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${o}.`))}}function D6(e,t,n,r,o){if(o.set(t.key,(o.get(t.key)??0)+1),!r.isArray)hS(e,t.resource,n,r);else{const{resources:s}=t;if(!s)throw new dt(an(`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 l of s)hS(e,l,n,r)}}function I6(e,t){const n=new Map,r=R6[e];for(let o=0;o<t.length;o++){const s=t[o].key;if(!r[s])throw new dt(an(`Key '${s}' not found for event '${e}'. Make sure to add only valid keys.`));D6(e,t[o],o,r[s],n)}for(const[o,s]of Object.entries(r)){if(!(s.optional||n.has(o)))throw new dt(an(`Missing required key '${o}' on context for '${e}' event.`));if(!s.manyAllowed&&(n.get(o)||0)>1)throw new dt(an(`${n.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function mS(e,t,n,r){if(!(e&&typeof e=="string"))throw new dt(an("Must provide a topic."));if(!Yg[t])throw new dt(an(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Yg).join(", ")}`));if(typeof n!="object")throw new dt(an("context must be a context object or array of context objects."));if(bx.includes(t)&&!r)throw new dt(an(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(n)?n:[n];return I6(t,o),{timestamp:new Date().toISOString(),id:RT(),event:{"hub.topic":e,"hub.event":t,context:o,...r?{"context.versionId":r}:{}}}}class N6 extends Lp{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new dt(an("Subscription request should contain an endpoint."));if(!wx(t))throw new dt(an("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 s=o;s.event["hub.event"]!=="heartbeat"&&(this.dispatchEvent({type:"message",payload:s}),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 A6(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=y6(t),r=Array.from(n).reduce((s,l)=>{const u=("00"+l.charCodeAt(0).toString(16)).slice(-2);return`${s}%${u}`},""),o=decodeURIComponent(r);return JSON.parse(o)}function M6(e){return e.split(".").length===3}function Sx(e){const[t,n,r]=e.split(".");return A6(n)}function O6(e){try{return typeof Sx(e).login_id=="string"}catch{return!1}}function L6(e){try{const n=Sx(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class $6{constructor(t){this.medplum=t}async get(t){return this.medplum.get(`keyvalue/v1/${t}`)}async set(t,n){await this.medplum.put(`keyvalue/v1/${t}`,n,On.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}var AT;AT=Symbol.toStringTag;class bo{constructor(t){this[AT]="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 F6{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new z6)}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?To(n):void 0)}}class z6{constructor(){this.data=new Map}get length(){return this.data.size}clear(){this.data.clear()}getItem(t){return this.data.get(t)??null}setItem(t,n){n?this.data.set(t,n):this.data.delete(t)}removeItem(t){this.data.delete(t)}key(t){return Array.from(this.data.keys())[t]}}/*!
|
|
94
|
-
* Reconnecting WebSocket
|
|
95
|
-
* by Pedro Ladaria <pedro.ladaria@gmail.com>
|
|
96
|
-
* https://github.com/pladaria/reconnecting-websocket
|
|
97
|
-
* License MIT
|
|
98
|
-
*
|
|
99
|
-
* Copy of "partysocket" from Partykit team, a fork of the original "Reconnecting WebSocket"
|
|
100
|
-
* https://github.com/partykit/partykit/blob/main/packages/partysocket
|
|
101
|
-
*/const xl={Event:typeof globalThis.Event<"u"?globalThis.Event:void 0,ErrorEvent:void 0,CloseEvent:void 0};let gS=!1;function B6(){if(typeof globalThis.Event>"u")throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");xl.Event=globalThis.Event,xl.ErrorEvent=class extends Event{constructor(t,n){super("error",n),this.message=t.message,this.error=t}},xl.CloseEvent=class extends Event{constructor(t=1e3,n="",r){super("close",r),this.wasClean=!0,this.code=t,this.reason=n}}}function U6(e,t){if(!e)throw new Error(t)}function ef(e){return new e.constructor(e.type,e)}const Vs={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1};let vS=!1;class as extends Lp{constructor(t,n,r={}){gS||(B6(),gS=!0),super(),this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._closeCalled=!1,this._messageQueue=[],this._debugLogger=console.log.bind(console),this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=o=>{this._debug("open event");const{minUptime:s=Vs.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),s),U6(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(l=>{var u;return(u=this._ws)==null?void 0:u.send(l)}),this._messageQueue=[],this.onopen&&this.onopen(o),this.dispatchEvent(ef(o))},this._handleMessage=o=>{this._debug("message event"),this.onmessage&&this.onmessage(o),this.dispatchEvent(ef(o))},this._handleError=o=>{this._debug("error event",o.message),this._disconnect(void 0,o.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(o),this._debug("exec error listeners"),this.dispatchEvent(ef(o)),this._connect()},this._handleClose=o=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(o),this.dispatchEvent(ef(o))},this._url=t,this._protocols=n,this._options=r,this._options.startClosed&&(this._shouldReconnect=!1),this._options.binaryType?this._binaryType=this._options.binaryType:this._binaryType="blob",this._options.debugLogger&&(this._debugLogger=this._options.debugLogger),this._connect()}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return as.CONNECTING}get OPEN(){return as.OPEN}get CLOSING(){return as.CLOSING}get CLOSED(){return as.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(t){this._binaryType=t,this._ws&&(this._ws.binaryType=t)}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){var n;return this._messageQueue.reduce((r,o)=>(typeof o=="string"?r+=o.length:o instanceof Blob?r+=o.size:r+=o.byteLength,r),0)+(((n=this._ws)==null?void 0:n.bufferedAmount)??0)}get extensions(){var t;return((t=this._ws)==null?void 0:t.extensions)??""}get protocol(){var t;return((t=this._ws)==null?void 0:t.protocol)??""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?as.CLOSED:as.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}close(t=1e3,n){if(this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),!this._ws){this._debug("close enqueued: no ws instance");return}if(this._ws.readyState===this.CLOSED){this._debug("close: already closed");return}this._ws.close(t,n)}reconnect(t,n){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED?this._connect():(this._disconnect(t,n),this._connect())}send(t){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",t),this._ws.send(t);else{const{maxEnqueuedMessages:n=Vs.maxEnqueuedMessages}=this._options;this._messageQueue.length<n&&(this._debug("enqueue",t),this._messageQueue.push(t))}}_debug(...t){this._options.debug&&this._debugLogger("RWS>",...t)}_getNextDelay(){const{reconnectionDelayGrowFactor:t=Vs.reconnectionDelayGrowFactor,minReconnectionDelay:n=Vs.minReconnectionDelay,maxReconnectionDelay:r=Vs.maxReconnectionDelay}=this._options;let o=0;return this._retryCount>0&&(o=n*Math.pow(t,this._retryCount-1),o>r&&(o=r)),this._debug("next delay",o),o}_wait(){return new Promise(t=>{setTimeout(t,this._getNextDelay())})}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;const{maxRetries:t=Vs.maxRetries,connectionTimeout:n=Vs.connectionTimeout}=this._options;if(this._retryCount>=t){this._debug("max retries reached",this._retryCount,">=",t);return}this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),this._wait().then(()=>{if(this._closeCalled){this._connectLock=!1;return}!this._options.WebSocket&&typeof WebSocket>"u"&&!vS&&(console.error("‼️ No WebSocket implementation available. You should define options.WebSocket."),vS=!0);const r=this._options.WebSocket||WebSocket;this._debug("connect",{url:this._url,protocols:this._protocols}),this._ws=this._protocols?new r(this._url,this._protocols):new r(this._url),this._ws.binaryType=this._binaryType,this._connectLock=!1,this._addListeners(),this._connectTimeout=setTimeout(()=>this._handleTimeout(),n)}).catch(r=>{this._connectLock=!1,this._handleError(new xl.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new xl.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new xl.CloseEvent(t,n,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_removeListeners(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))}_addListeners(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))}_clearTimeouts(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)}}const V6=5e3;class Xg extends Lp{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 W6{constructor(t,n){this.connecting=!1,this.criteria=t,this.emitter=new Xg(t),this.refCount=1,this.subscriptionProps=n?{...n}:void 0}clearAttachedSubscription(){this.subscriptionId=void 0,this.token=void 0}}class H6{constructor(t,n,r){if(this.pingTimer=void 0,this.waitingForPong=!1,!(t instanceof OT))throw new dt(an("First arg of constructor should be a `MedplumClient`"));let o;try{o=new URL(n).toString()}catch{throw new dt(an("Not a valid URL"))}const s=r!=null&&r.ReconnectingWebSocket?new r.ReconnectingWebSocket(o,void 0,{debug:r==null?void 0:r.debug,debugLogger:r==null?void 0:r.debugLogger}):new as(o,void 0,{debug:r==null?void 0:r.debug,debugLogger:r==null?void 0:r.debugLogger});this.medplum=t,this.ws=s,this.masterSubEmitter=new Xg,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.pingIntervalMs=(r==null?void 0:r.pingIntervalMs)??V6,this.currentProfile=t.getProfile(),this.setupListeners()}setupListeners(){const t=this.ws;t.addEventListener("message",n=>{var r,o,s,l,u,d;try{const p=JSON.parse(n.data);if(p.type==="pong"){this.waitingForPong=!1;return}const h=p,m=(o=(r=h==null?void 0:h.entry)==null?void 0:r[0])==null?void 0:o.resource;if(m.type==="heartbeat"){(s=this.masterSubEmitter)==null||s.dispatchEvent({type:"heartbeat",payload:h});return}if(m.type==="handshake"){const x=Rl(m.subscription),b={type:"connect",payload:{subscriptionId:x}};(l=this.masterSubEmitter)==null||l.dispatchEvent(b);const w=this.criteriaEntriesBySubscriptionId.get(x);if(!w){console.warn("Received handshake for criteria the SubscriptionManager is not listening for yet");return}w.connecting=!1,w.emitter.dispatchEvent({...b});return}(u=this.masterSubEmitter)==null||u.dispatchEvent({type:"message",payload:h});const y=this.criteriaEntriesBySubscriptionId.get(Rl(m.subscription));if(!y){console.warn("Received notification for criteria the SubscriptionManager is not listening for");return}y.emitter.dispatchEvent({type:"message",payload:h})}catch(p){console.error(p);const h={type:"error",payload:p};(d=this.masterSubEmitter)==null||d.dispatchEvent(h);for(const m of this.getAllCriteriaEmitters())m.dispatchEvent({...h})}}),t.addEventListener("error",()=>{var r;const n={type:"error",payload:new dt(iL(new Error("WebSocket error")))};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const o of this.getAllCriteriaEmitters())o.dispatchEvent({...n})}),t.addEventListener("close",()=>{var r,o;const n={type:"close"};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const s of this.getAllCriteriaEmitters())s.dispatchEvent({...n});this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=void 0,this.waitingForPong=!1),this.wsClosed&&(this.criteriaEntries.clear(),this.criteriaEntriesBySubscriptionId.clear(),(o=this.masterSubEmitter)==null||o.removeAllListeners())}),t.addEventListener("open",()=>{var r;const n={type:"open"};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const o of this.getAllCriteriaEmitters())o.dispatchEvent({...n});this.refreshAllSubscriptions().catch(console.error),this.pingTimer||(this.pingTimer=setInterval(()=>{if(this.waitingForPong){this.waitingForPong=!1,t.reconnect();return}t.send(JSON.stringify({type:"ping"})),this.waitingForPong=!0},this.pingIntervalMs))}),this.medplum.addEventListener("change",()=>{var r;const n=this.medplum.getProfile();this.currentProfile&&n===void 0?this.ws.close():n&&((r=this.currentProfile)==null?void 0:r.id)!==n.id&&this.ws.reconnect(),this.currentProfile=n})}emitError(t,n){var o;const r={type:"error",payload:n};(o=this.masterSubEmitter)==null||o.dispatchEvent(r),t.emitter.dispatchEvent({...r})}maybeEmitDisconnect(t){var r;const{subscriptionId:n}=t;if(n){const o={type:"disconnect",payload:{subscriptionId:n}};(r=this.masterSubEmitter)==null||r.dispatchEvent(o),t.emitter.dispatchEvent({...o})}else console.warn("Called disconnect for `CriteriaEntry` before `subscriptionId` was present.")}async getTokenForCriteria(t){var l,u;let n=t==null?void 0:t.subscriptionId;n||(n=(await this.medplum.createResource({...t.subscriptionProps,resourceType:"Subscription",status:"active",reason:`WebSocket subscription for ${Ot(this.medplum.getProfile())}`,channel:{type:"websocket"},criteria:t.criteria})).id);const{parameter:r}=await this.medplum.get(`fhir/R4/Subscription/${n}/$get-ws-binding-token`),o=(l=r==null?void 0:r.find(d=>d.name==="token"))==null?void 0:l.valueString,s=(u=r==null?void 0:r.find(d=>d.name==="websocket-url"))==null?void 0:u.valueUrl;if(!o)throw new dt(an("Failed to get token"));if(!s)throw new dt(an("Failed to get URL from $get-ws-binding-token"));return[n,o]}maybeGetCriteriaEntry(t,n){const r=this.criteriaEntries.get(t);if(r){if(!n)return r.bareCriteria;for(const o of r.criteriaWithProps)if(hs(n,o.subscriptionProps))return o}}getAllCriteriaEmitters(){const t=[];for(const n of this.criteriaEntries.values()){n.bareCriteria&&t.push(n.bareCriteria.emitter);for(const r of n.criteriaWithProps)t.push(r.emitter)}return t}addCriteriaEntry(t){const{criteria:n,subscriptionProps:r}=t;let o;this.criteriaEntries.has(n)?o=this.criteriaEntries.get(n):(o={criteriaWithProps:[]},this.criteriaEntries.set(n,o)),r?o.criteriaWithProps.push(t):o.bareCriteria=t}removeCriteriaEntry(t){var u;const{criteria:n,subscriptionProps:r,subscriptionId:o,token:s}=t;if(!this.criteriaEntries.has(n))return;const l=this.criteriaEntries.get(n);r?l.criteriaWithProps=l.criteriaWithProps.filter(d=>{const p=d.subscriptionProps;return!hs(r,p)}):l.bareCriteria=void 0,!l.bareCriteria&&l.criteriaWithProps.length===0&&(this.criteriaEntries.delete(n),(u=this.masterSubEmitter)==null||u._removeCriteria(n)),o&&this.criteriaEntriesBySubscriptionId.delete(o),s&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"unbind-from-token",payload:{token:s}}))}async subscribeToCriteria(t){if(!(this.ws.readyState!==WebSocket.OPEN||t.connecting)){t.connecting=!0;try{const[n,r]=await this.getTokenForCriteria(t);t.subscriptionId=n,t.token=r,this.criteriaEntriesBySubscriptionId.set(n,t),this.ws.send(JSON.stringify({type:"bind-with-token",payload:{token:r}}))}catch(n){console.error(Ze(n)),this.emitError(t,n),this.removeCriteriaEntry(t)}}}async refreshAllSubscriptions(){this.criteriaEntriesBySubscriptionId.clear();for(const t of this.criteriaEntries.values())for(const n of[...t.bareCriteria?[t.bareCriteria]:[],...t.criteriaWithProps])n.clearAttachedSubscription(),await this.subscribeToCriteria(n)}addCriteria(t,n){this.masterSubEmitter&&this.masterSubEmitter._addCriteria(t);const r=this.maybeGetCriteriaEntry(t,n);if(r)return r.refCount+=1,r.emitter;const o=new W6(t,n);return this.addCriteriaEntry(o),this.subscribeToCriteria(o).catch(console.error),o.emitter}removeCriteria(t,n){const r=this.maybeGetCriteriaEntry(t,n);if(!r){console.warn("Criteria not known to `SubscriptionManager`. Possibly called remove too many times.");return}r.refCount-=1,!(r.refCount>0)&&(this.maybeEmitDisconnect(r),this.removeCriteriaEntry(r))}getWebSocket(){return this.ws}closeWebSocket(){this.wsClosed||(this.wsClosed=!0,this.ws.close())}reconnectWebSocket(){this.ws.reconnect(),this.wsClosed=!1}getCriteriaCount(){return this.getAllCriteriaEmitters().length}getMasterEmitter(){return this.masterSubEmitter||(this.masterSubEmitter=new Xg(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const MT="3.2.27-4cec0e5ad",q6=On.FHIR_JSON+", */*; q=0.1",G6="https://api.medplum.com/",Q6=1e3,K6=6e4,Y6=0,X6=3e5,J6="Binary/",yS={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]};class OT extends Lp{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)??Z6(),this.storage=(t==null?void 0:t.storage)??new F6,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=hT((t==null?void 0:t.baseUrl)??G6),this.fhirBaseUrl=Bo(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4"),this.authorizeUrl=Bo(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=Bo(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=Bo(this.baseUrl,(t==null?void 0:t.logoutUrl)??"oauth2/logout"),this.fhircastHubUrl=Bo(this.baseUrl,(t==null?void 0:t.fhircastHubUrl)??"fhircast/STU3"),this.clientId=(t==null?void 0:t.clientId)??"",this.clientSecret=(t==null?void 0:t.clientSecret)??"",this.defaultHeaders=(t==null?void 0:t.defaultHeaders)??{},this.onUnauthenticated=t==null?void 0:t.onUnauthenticated,this.refreshGracePeriod=(t==null?void 0:t.refreshGracePeriod)??X6,this.cacheTime=(t==null?void 0:t.cacheTime)??(typeof window>"u"?Y6:K6),this.cacheTime>0?this.requestCache=new IT((t==null?void 0:t.resourceCacheSize)??Q6):this.requestCache=void 0,t!=null&&t.autoBatchTime?(this.autoBatchTime=t.autoBatchTime,this.autoBatchQueue=[]):(this.autoBatchTime=0,this.autoBatchQueue=void 0),t!=null&&t.accessToken&&this.setAccessToken(t.accessToken),this.storage.getInitPromise===void 0?(t!=null&&t.accessToken||this.attemptResumeActiveLogin().catch(console.error),this.initPromise=Promise.resolve(),this.dispatchEvent({type:"storageInitialized"})):(this.initComplete=!1,this.initPromise=this.storage.getInitPromise(),this.initPromise.then(()=>{t!=null&&t.accessToken||this.attemptResumeActiveLogin().catch(console.error),this.initComplete=!0,this.dispatchEvent({type:"storageInitialized"})}).catch(n=>{console.error(n),this.initComplete=!0,this.dispatchEvent({type:"storageInitFailed",payload:{error:n}})})),this.setupStorageListener()}get isInitialized(){return this.initComplete}getInitPromise(){return this.initPromise}async attemptResumeActiveLogin(){const t=this.getActiveLogin();t&&(this.setAccessToken(t.accessToken,t.refreshToken),await this.refreshProfile())}getBaseUrl(){return this.baseUrl}getAuthorizeUrl(){return this.authorizeUrl}getTokenUrl(){return this.tokenUrl}getLogoutUrl(){return this.logoutUrl}getFhircastHubUrl(){return this.fhircastHubUrl}getDefaultHeaders(){return this.defaultHeaders}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=Bo(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((l,u)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:n,resolve:l,reject:u}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):o=this.request("GET",t,n);const s=new bo(o);return this.setCacheEntry(t,s),s}post(t,n,r,o={}){return t=t.toString(),this.setRequestBody(o,n),r&&this.setRequestContentType(o,r),this.invalidateUrl(t),this.request("POST",t,o)}put(t,n,r,o={}){return t=t.toString(),this.setRequestBody(o,n),r&&this.setRequestContentType(o,r),this.invalidateUrl(t),this.request("PUT",t,o)}patch(t,n,r={}){return t=t.toString(),this.setRequestBody(r,n),this.setRequestContentType(r,On.JSON_PATCH),this.invalidateUrl(t),this.request("PATCH",t,r)}delete(t,n){return t=t.toString(),this.invalidateUrl(t),this.request("DELETE",t,n)}async startNewUser(t,n){const{codeChallengeMethod:r,codeChallenge:o}=await this.startPkce();return this.post("auth/newuser",{...t,clientId:t.clientId??this.clientId,codeChallengeMethod:r,codeChallenge:o},void 0,n)}async startNewProject(t,n){return this.post("auth/newproject",t,void 0,n)}async startNewPatient(t,n){return this.post("auth/newpatient",t,void 0,n)}async startLogin(t,n){return this.post("auth/login",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async startGoogleLogin(t,n){return this.post("auth/google",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async ensureCodeChallenge(t){return t.codeChallenge?t:{...t,...await this.startPkce()}}async signOut(){await this.post(this.logoutUrl,{}),this.clear()}async signInWithRedirect(t){const r=new URLSearchParams(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,s=!0){let l=o;s&&(l=await this.ensureCodeChallenge(o)),window.location.assign(this.getExternalAuthRedirectUri(t,n,r,l,s))}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,s=!0){const l=new URL(t);if(l.searchParams.set("response_type","code"),l.searchParams.set("client_id",n),l.searchParams.set("redirect_uri",r),l.searchParams.set("scope",o.scope??"openid profile email"),l.searchParams.set("state",JSON.stringify(o)),s){const{codeChallenge:u,codeChallengeMethod:d}=o;if(!d)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!u)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");l.searchParams.set("code_challenge_method",d),l.searchParams.set("code_challenge",u)}return l.toString()}fhirUrl(...t){return new URL(Bo(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=Y$(n)),r}search(t,n,r){const o=this.fhirSearchUrl(t,n),s="search-"+o.toString(),l=this.getCacheEntry(s,r);if(l)return l.value;const u=new bo((async()=>{const d=await this.get(o,r);if(d.entry)for(const p of d.entry)this.cacheResource(p.resource);return d})());return this.setCacheEntry(s,u),u}searchOne(t,n,r){const o=this.fhirSearchUrl(t,n);o.searchParams.set("_count","1"),o.searchParams.sort();const s="searchOne-"+o.toString(),l=this.getCacheEntry(s,r);if(l)return l.value;const u=new bo(this.search(t,o.searchParams,r).then(d=>{var p,h;return(h=(p=d.entry)==null?void 0:p[0])==null?void 0:h.resource}));return this.setCacheEntry(s,u),u}searchResources(t,n,r){const s="searchResources-"+this.fhirSearchUrl(t,n).toString(),l=this.getCacheEntry(s,r);if(l)return l.value;const u=new bo(this.search(t,n,r).then(wS));return this.setCacheEntry(s,u),u}async*searchResourcePages(t,n,r){var s,l;let o=this.fhirSearchUrl(t,n);for(;o;){const u=new URL(o).searchParams,d=await this.search(t,u,r),p=(s=d.link)==null?void 0:s.find(h=>h.relation==="next");if(!((l=d.entry)!=null&&l.length)&&!p)break;yield wS(d),o=p!=null&&p.url?new URL(p.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,s;const r=(s=(o=this.requestCache)==null?void 0:o.get(this.fhirUrl(t,n).toString()))==null?void 0:s.value;return r!=null&&r.isOk()?r.read():void 0}getCachedReference(t){const n=t.reference;if(!n)return;if(n==="system")return yS;const[r,o]=n.split("/");if(!(!r||!o))return this.getCached(r,o)}readResource(t,n,r){if(!n)throw new Error('The "id" parameter cannot be null, undefined, or an empty string.');return this.get(this.fhirUrl(t,n),r)}readReference(t,n){const r=t.reference;if(!r)return new bo(Promise.reject(new Error("Missing reference")));if(r==="system")return new bo(Promise.resolve(yS));const[o,s]=r.split("/");return!o||!s?new bo(Promise.reject(new Error("Invalid reference"))):this.readResource(o,s,n)}requestSchema(t){if(eT(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const o=new bo((async()=>{const s=`{
|
|
102
|
-
StructureDefinitionList(name: "${t}") {
|
|
103
|
-
resourceType,
|
|
104
|
-
name,
|
|
105
|
-
kind,
|
|
106
|
-
description,
|
|
107
|
-
type,
|
|
108
|
-
url,
|
|
109
|
-
snapshot {
|
|
110
|
-
element {
|
|
111
|
-
id,
|
|
112
|
-
path,
|
|
113
|
-
definition,
|
|
114
|
-
min,
|
|
115
|
-
max,
|
|
116
|
-
base {
|
|
117
|
-
path,
|
|
118
|
-
min,
|
|
119
|
-
max
|
|
120
|
-
},
|
|
121
|
-
contentReference,
|
|
122
|
-
type {
|
|
123
|
-
code,
|
|
124
|
-
profile,
|
|
125
|
-
targetProfile
|
|
126
|
-
},
|
|
127
|
-
binding {
|
|
128
|
-
strength,
|
|
129
|
-
valueSet
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
SearchParameterList(base: "${t}", _count: 100) {
|
|
135
|
-
base,
|
|
136
|
-
code,
|
|
137
|
-
type,
|
|
138
|
-
expression,
|
|
139
|
-
target
|
|
140
|
-
}
|
|
141
|
-
}`.replace(/\s+/g," "),l=await this.graphql(s);Zw(l.data.StructureDefinitionList.filter(u=>u.name===t));for(const u of l.data.SearchParameterList)c7(u)})());return this.setCacheEntry(n,o),o}requestProfileSchema(t,n){if(!(n!=null&&n.expandProfile)&&sx(t))return Promise.resolve();const r=t+"-requestSchema"+(n!=null&&n.expandProfile?"-nested":""),o=this.getCacheEntry(r,void 0);if(o)return o.value;const s=new bo((async()=>{if(n!=null&&n.expandProfile){const l=this.fhirUrl("StructureDefinition","$expand-profile");l.search=new URLSearchParams({url:t}).toString();const u=await this.post(l.toString(),{});Zw(u)}else{const l=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});if(!l){console.warn(`No StructureDefinition found for ${t}!`);return}Zk(l)}})());return this.setCacheEntry(r,s),s}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){const o=this.fhirUrl(t.resourceType);r?r.headers?Array.isArray(r.headers)?r.headers.push(["If-None-Exist",n]):r.headers instanceof Headers?r.headers.set("If-None-Exist",n):r.headers["If-None-Exist"]=n:r.headers={"If-None-Exist":n}:r={headers:{"If-None-Exist":n}};const s=await this.post(o,t,void 0,r);return this.cacheResource(s),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),s}async upsertResource(t,n,r){const o=this.fhirSearchUrl(t.resourceType,n);let s=await this.put(o,t,void 0,r);return s||(s=t),this.cacheResource(s),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),s}async createAttachment(t,n,r,o,s){const l=SS(t,n,r,o),u=s??(typeof n=="object"?n:{}),d=await this.createBinary(l,u);return{contentType:l.contentType,url:d.url,title:l.filename}}createBinary(t,n,r,o,s){const l=SS(t,n,r,o),u=s??(typeof n=="object"?n:{}),{data:d,contentType:p,filename:h,securityContext:m,onProgress:y}=l,x=this.fhirUrl("Binary");return h&&x.searchParams.set("_filename",h),m!=null&&m.reference&&this.setRequestHeader(u,"X-Security-Context",m.reference),y?this.uploadwithProgress(x,d,p,y,u):this.post(x,d,p,u)}uploadwithProgress(t,n,r,o,s){return new Promise((l,u)=>{var m;const d=new XMLHttpRequest,p=()=>d.abort();(m=s==null?void 0:s.signal)==null||m.addEventListener("abort",p);const h=y=>{var x;(x=s==null?void 0:s.signal)==null||x.removeEventListener("abort",p),y instanceof Error?u(y):l(y)};if(d.responseType="json",d.onabort=()=>h(new DOMException("Request aborted","AbortError")),d.onerror=()=>h(new Error("Request error")),o&&(d.upload.onprogress=y=>o(y),d.upload.onload=y=>o(y)),d.onload=()=>{d.status>=200&&d.status<300?h(d.response):h(new dt(Bt(d.response||d.statusText)))},d.open("POST",t),d.withCredentials=!0,d.setRequestHeader("Authorization","Bearer "+this.accessToken),d.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),d.setRequestHeader("Content-Type",r),this.options.extendedMode!==!1&&d.setRequestHeader("X-Medplum","extended"),s!=null&&s.headers){const y=s.headers;for(const[x,b]of Object.entries(y))d.setRequestHeader(x,b)}d.send(n)})}async createPdf(t,n,r,o){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const s=nF(t,n,r,o),l=typeof n=="object"?n:{},{docDefinition:u,tableLayouts:d,fonts:p,...h}=s,m=await this.createPdfImpl(u,d,p),y={...h,data:m,contentType:"application/pdf"};return this.createBinary(y,l)}createComment(t,n,r){const o=this.getProfile();let s,l;return t.resourceType==="Encounter"&&(s=Jt(t),l=t.subject),t.resourceType==="ServiceRequest"&&(s=t.encounter,l=t.subject),t.resourceType==="Patient"&&(l=Jt(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[Jt(t)],encounter:s,subject:l,sender:o?Jt(o):void 0,sent:new Date().toISOString(),payload:[{contentString:n}]},r)}async updateResource(t,n){if(!t.resourceType)throw new Error("Missing resourceType");if(!t.id)throw new Error("Missing id");let r=await this.put(this.fhirUrl(t.resourceType,t.id),t,void 0,n);return r||(r=t),this.cacheResource(r),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),r}async patchResource(t,n,r,o){const s=await this.patch(this.fhirUrl(t,n),r,o);return this.cacheResource(s),this.invalidateUrl(this.fhirUrl(t,n,"_history")),this.invalidateSearches(t),s}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 s;if(typeof t=="string"){const l=t;s=this.fhirUrl("Bot",l,"$execute")}else{const l=t;s=this.fhirUrl("Bot","$execute"),s.searchParams.set("identifier",l.system+"|"+l.value)}return this.post(s,n,r,o)}executeBatch(t,n){return this.post(this.fhirBaseUrl,t,void 0,n)}sendEmail(t,n){return this.post("email/v1/send",t,On.JSON,n)}graphql(t,n,r,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},On.JSON,o)}readResourceGraph(t,n,r,o){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,o)}pushToAgent(t,n,r,o,s,l){return this.post(this.fhirUrl("Agent",Rl(t),"$push"),{destination:typeof n=="string"?n:Ot(n),body:r,contentType:o,waitForResponse:s},On.FHIR_JSON,l)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){var n,r;(!((n=this.sessionDetails)!=null&&n.profile)||Ot(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}isAuthenticated(t){return this.accessTokenExpires!==void 0&&Date.now()<this.accessTokenExpires-(t??this.refreshGracePeriod)}setAccessToken(t,n){this.accessToken=t,this.refreshToken=n,this.accessTokenExpires=L6(t),this.medplumServer=O6(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const n=this.getLogins().filter(r=>{var o,s;return((o=r.profile)==null?void 0:o.reference)!==((s=t.profile)==null?void 0:s.reference)});n.push(t),this.storage.setObject("logins",n)}async refreshProfile(){return this.medplumServer?(this.profilePromise=new Promise((t,n)=>{this.get("auth/me",{cache:"no-cache"}).then(r=>{var s,l;this.profilePromise=void 0;const o=((l=(s=this.sessionDetails)==null?void 0:s.profile)==null?void 0:l.id)!==r.profile.id;this.sessionDetails=r,o&&this.dispatchEvent({type:"change"}),t(r.profile),this.dispatchEvent({type:"profileRefreshed"})}).catch(n)}),this.dispatchEvent({type:"profileRefreshing"}),this.profilePromise):Promise.resolve(void 0)}isLoading(){var t;return!this.isInitialized||!!this.profilePromise&&!((t=this.sessionDetails)!=null&&t.profile)}isSuperAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.project.superAdmin)}isProjectAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.membership.admin)}getProject(){var t;return(t=this.sessionDetails)==null?void 0:t.project}getProjectMembership(){var t;return(t=this.sessionDetails)==null?void 0:t.membership}getProfile(){var t;return(t=this.sessionDetails)==null?void 0:t.profile}async getProfileAsync(){return this.profilePromise?this.profilePromise:this.sessionDetails?this.sessionDetails.profile:this.refreshProfile()}getUserConfiguration(){var t;return(t=this.sessionDetails)==null?void 0:t.config}getAccessPolicy(){var t;return(t=this.sessionDetails)==null?void 0:t.accessPolicy}async download(t,n={}){this.refreshPromise&&await this.refreshPromise;const r=t.toString();r.startsWith(J6)&&(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,s=await this.createResource({resourceType:"Media",status:"preparation",content:{contentType:t.contentType},...r});o.securityContext||(o.securityContext=Jt(s));const l=await this.createAttachment(o,n);return this.updateResource({...s,status:"completed",content:l})}async uploadMedia(t,n,r,o,s){return this.createMedia({data:t,contentType:n,filename:r,additionalFields:o},s)}async bulkExport(t="",n,r,o){const s=t&&`${t}/`,l=this.fhirUrl(`${s}$export`);return n&&l.searchParams.set("_type",n),r&&l.searchParams.set("_since",r),this.startAsyncRequest(l.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 $6(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 bo(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 s=await this.fetchWithRetry(n,r);if(s.status===401)return this.handleUnauthenticated(t,n,r);if(s.status===204||s.status===304)return;const l=s.headers.get("content-type"),u=l==null?void 0:l.includes("json");if(s.status===404&&!u)throw new dt(rL);const d=await this.parseBody(s,u);if(s.status===200&&r.followRedirectOnOk||s.status===201&&r.followRedirectOnCreated){const p=await bS(s,d);if(p)return this.request("GET",p,{...r,body:void 0})}if(s.status===202&&r.pollStatusOnAccepted){const h=await bS(s,d)??o.statusUrl;if(h)return this.pollStatus(h,r,o)}if(s.status>=400)throw new dt(Bt(d));return d}async parseBody(t,n){let r;if(t.headers.get("content-length")!=="0"){if(n)try{r=await t.json()}catch(o){throw console.error("Error parsing response",t.status,o),o}else r=await t.text();return r}}async fetchWithRetry(t,n){t.startsWith("http")||(t=Bo(this.baseUrl,t));const r=(n==null?void 0:n.maxRetries)??2,o=200;for(let s=0;s<=r;s++){try{this.options.verbose&&this.logRequest(t,n);const l=await this.fetch(t,n);if(this.options.verbose&&this.logResponse(l),l.status<500||s===r)return l}catch(l){if(l.message==="Failed to fetch"&&s===0&&this.dispatchEvent({type:"offline"}),l.name==="AbortError"||s===r)throw l}await aS(o)}throw new Error("Unreachable")}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const o of ou(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 s=n.pollStatusPeriod??1e3;await aS(s),r.pollCount++}return this.request("GET",t,o,r)}async executeAutoBatch(){var o,s;if(this.autoBatchQueue===void 0)return;const t=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,t.length===1){const l=t[0];try{l.resolve(await this.request(l.method,Bo(this.fhirBaseUrl,l.url),l.options))}catch(u){l.reject(new dt(Bt(u)))}return}const n={resourceType:"Bundle",type:"batch",entry:t.map(l=>({request:{method:l.method,url:l.url},resource:l.options.body?JSON.parse(l.options.body):void 0}))},r=await this.post(this.fhirBaseUrl,n);for(let l=0;l<t.length;l++){const u=t[l],d=(o=r.entry)==null?void 0:o[l];(s=d==null?void 0:d.response)!=null&&s.outcome&&!Kk(d.response.outcome)?u.reject(new dt(d.response.outcome)):u.resolve(d==null?void 0:d.resource)}}addFetchOptionsDefaults(t){Object.entries(this.defaultHeaders).forEach(([n,r])=>{this.setRequestHeader(t,n,r)}),this.setRequestHeader(t,"Accept",q6,!0),this.options.extendedMode!==!1&&this.setRequestHeader(t,"X-Medplum","extended"),t.body&&this.setRequestHeader(t,"Content-Type",On.FHIR_JSON,!0),this.accessToken?this.setRequestHeader(t,"Authorization","Bearer "+this.accessToken):this.basicAuth&&this.setRequestHeader(t,"Authorization","Basic "+this.basicAuth),t.cache||(t.cache="no-cache"),t.credentials||(t.credentials="include")}setRequestContentType(t,n){this.setRequestHeader(t,"Content-Type",n)}setRequestHeader(t,n,r,o=!1){t.headers||(t.headers={});const s=t.headers;o&&s[n]||(s[n]=r)}setRequestBody(t,n){typeof n=="string"||typeof Blob<"u"&&(n instanceof Blob||(n==null?void 0:n.constructor.name)==="Blob")||typeof File<"u"&&(n instanceof File||(n==null?void 0:n.constructor.name)==="File")||typeof Uint8Array<"u"&&(n instanceof Uint8Array||(n==null?void 0: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 dt(nu)))}async startPkce(){const t=fS();sessionStorage.setItem("pkceState",t);const n=fS().slice(0,128);sessionStorage.setItem("codeVerifier",n);const r=await b6(n),o=W$(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??xS()),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)??xS()),typeof sessionStorage<"u"){const o=sessionStorage.getItem("codeVerifier");o&&r.set("code_verifier",o)}return this.fetchTokens(r)}refreshIfExpired(t){return!this.refreshPromise&&this.accessTokenExpires!==void 0&&!this.isAuthenticated(t)&&this.refresh(),this.refreshPromise??Promise.resolve()}refresh(){if(this.refreshPromise)return this.refreshPromise;if(this.refreshToken){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=x6(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new dt(an("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new dt(an("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},s=(await this.post(this.fhircastHubUrl,pS(r),On.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!s)throw new Error("Invalid response!");return r.endpoint=s,r}async fhircastUnsubscribe(t){if(!wx(t))throw new dt(an("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new dt(an("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post(this.fhircastHubUrl,pS(t),On.FORM_URL_ENCODED)}fhircastConnect(t){return new N6(t)}async fhircastPublish(t,n,r,o){return T6(n)?this.post(this.fhircastHubUrl,mS(t,n,r,o),On.JSON):(P6(n),this.post(this.fhircastHubUrl,mS(t,n,r),On.JSON))}async fhircastGetContext(t){return this.get(`${this.fhircastHubUrl}/${t}`)}async invite(t,n){return this.post("admin/projects/"+t+"/invite",n)}async fetchTokens(t){const n={method:"POST",headers:{"Content-Type":On.FORM_URL_ENCODED},body:t.toString(),credentials:"include"},r=n.headers;Object.assign(r,this.defaultHeaders),this.basicAuth&&(r.Authorization=`Basic ${this.basicAuth}`);let o;try{o=await this.fetchWithRetry(this.tokenUrl,n)}catch(l){throw this.refreshPromise=void 0,l}if(!o.ok){this.clearActiveLogin();try{const l=await o.json();throw new dt(Qo(l.error_description))}catch(l){throw new dt(Qo("Failed to fetch tokens"),l)}}const s=await o.json();return await this.verifyTokens(s),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(M6(n)){const r=Sx(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new dt(oL);if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new dt(Xw)}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new dt(Xw)}return this.setActiveLogin({accessToken:n,refreshToken:t.refresh_token,project:t.project,profile:t.profile})}checkSessionDetailsMatchLogin(t){var n,r;return this.sessionDetails&&t?((r=(n=t.profile)==null?void 0:n.reference)==null?void 0:r.endsWith(this.sessionDetails.profile.id))??!1:!0}setupStorageListener(){try{window.addEventListener("storage",t=>{if(t.key===null)window.location.reload();else if(t.key==="activeLogin"){const n=t.oldValue?JSON.parse(t.oldValue):void 0,r=t.newValue?JSON.parse(t.newValue):void 0;(n==null?void 0:n.profile.reference)!==(r==null?void 0:r.profile.reference)||!this.checkSessionDetailsMatchLogin(r)?window.location.reload():r?this.setAccessToken(r.accessToken,r.refreshToken):this.clear()}})}catch{}}getSubscriptionManager(){return this.subscriptionManager||(this.subscriptionManager=new H6(this,K$(this.baseUrl,"/ws/subscriptions-r4"))),this.subscriptionManager}subscribeToCriteria(t,n){return this.getSubscriptionManager().addCriteria(t,n)}unsubscribeFromCriteria(t,n){this.subscriptionManager&&(this.subscriptionManager.removeCriteria(t,n),this.subscriptionManager.getCriteriaCount()===0&&this.subscriptionManager.closeWebSocket())}getMasterSubscriptionEmitter(){return this.getSubscriptionManager().getMasterEmitter()}}function Z6(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function xS(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}async function bS(e,t){var o,s;const n=e.headers.get("content-location");if(n)return n;const r=e.headers.get("location");if(r)return r;if(Ip(t)&&((s=(o=t.issue)==null?void 0:o[0])!=null&&s.diagnostics))return t.issue[0].diagnostics}function wS(e){var n;const t=((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];return Object.assign(t,{bundle:e})}function eF(e){return nr(e)&&"data"in e&&"contentType"in e}function SS(e,t,n,r){return eF(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function tF(e){return nr(e)&&"docDefinition"in e}function nF(e,t,n,r){return tF(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function _l({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:o,accessPolicyResource:s}){if(t===(e==null?void 0:e.path))return;o??(o=(e==null?void 0:e.debugMode)??!1),s??(s=e==null?void 0:e.accessPolicyResource);let l=rF(t,n,e,!!o);const u=Gg(t,".",2)[1];l=oF(l,s,u),l=iF(l,s,u);const d=Object.create(null);for(const[h,m]of Object.entries(l))d[t+"."+h]=m;let p;if(e&&!e.isDefaultContext)p=e.getExtendedProps;else{const h=Object.create(null);p=m=>{const y=Gg(m,".",2)[1];if(y){if(!h[y]){const x=Df(y,s==null?void 0:s.hiddenFields);h[y]={hidden:x,readonly:x||Df(y,s==null?void 0:s.readonlyFields)}}return h[y]}}}return{path:t,elements:l,elementsByPath:d,profileUrl:r??(e==null?void 0:e.profileUrl),debugMode:o,getExtendedProps:p,accessPolicyResource:s}}function rF(e,t,n,r){const o=Object.create(null);if(n)for(const[l,u]of Object.entries(n.elementsByPath)){const d=ru(e,l);d!==void 0&&(o[d]=u)}let s=!1;if(t)for(const[l,u]of Object.entries(t))l in o||(o[l]=u,s=!0);return r&&console.assert(s,"Unnecessary ElementsContext; not using any newly provided elements"),o}function oF(e,t,n){var o;if(!((o=t==null?void 0:t.hiddenFields)!=null&&o.length))return e;const r=n?n+".":"";return Object.fromEntries(Object.entries(e).filter(([s])=>!Df(r+s,t.hiddenFields)))}function iF(e,t,n){var s;if(!((s=t==null?void 0:t.readonlyFields)!=null&&s.length))return e;const r=Object.create(null),o=n?n+".":"";for(const[l,u]of Object.entries(e))Df(o+l,t.readonlyFields)?r[l]={...u,readonly:!0}:r[l]=u;return r}function Df(e,t){if(!(t!=null&&t.length))return!1;const n=e.split(".");for(let r=1;r<=n.length;r++){const o=n.slice(0,r).join(".");if(t.includes(o))return!0}return!1}function LT(e){return e.type!==void 0&&e.type.length>0}function sF(e,t,n,r){var s;const o=b$(e,t.path,{profileUrl:r});if(o){const l=((s=n.typeSchema)==null?void 0:s.elements)??n.elements;return o.some(u=>j$(u,t,n,l))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function $T(e,t,n,r){var o,s;if(e)for(const l of t){const u={value:e,type:((o=l.typeSchema)==null?void 0:o.type)??((s=l.type)==null?void 0:s[0].code)};if(n.every(d=>{var p;return sF(u,d,l,((p=l.typeSchema)==null?void 0:p.url)??r)}))return l.name}}class aF{constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const o=_l({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(([s])=>s.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(!vn(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=lF(t);for(const o of r)this.crawlElementNode(o,n)}crawlElementNode(t,n){var o,s;const r=n+"."+t.key;this.visitor.onEnterElement&&this.visitor.onEnterElement(r,t.element,this.elementsContext);for(const l of t.children)this.crawlElementNode(l,n);vn((s=(o=t.element)==null?void 0:o.slicing)==null?void 0:s.slices)&&this.crawlSlicingImpl(t.element.slicing,r),this.visitor.onExitElement&&this.visitor.onExitElement(r,t.element,this.elementsContext)}prepareSlices(t,n){var s,l;const r=[];for(const u of t){if(!LT(u))continue;const d=(l=(s=u.type.find(p=>vn(p.profile)))==null?void 0:s.profile)==null?void 0:l[0];if(vn(d)){const p=Gl(d);p&&(u.typeSchema=p)}r.push(u)}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 s;const l=(o==null?void 0:o.elements)??t.elements;vn(l)&&(s=_l({path:n,parentContext:this.elementsContext,elements:l})),s&&this.elementsContextStack.push(s),this.crawlElementsImpl(l,n),s&&this.elementsContextStack.pop(),this.visitor.onExitSlice&&this.visitor.onExitSlice(n,t,r),o&&this.visitor.onExitSchema&&this.visitor.onExitSchema(o)}}function lF(e){const t=[];function n(s,l){return l.startsWith(s+".")}function r(s,l){for(const u of s.children)if(n(u.key,l.key)){r(u,l);return}s.children.push(l)}const o=Object.entries(e);o.sort((s,l)=>s[0].localeCompare(l[0]));for(const[s,l]of o){const u={key:s,element:l,children:[]};let d=!1;for(const p of t)if(n(p.key,s)){r(p,u),d=!0;break}d||t.push(u)}return t}const ug="__sliceName";function cF(e,t){const n=new uF(e,e.resourceType,"resource");return new aF(t,n).crawlResource(),n.getDefaultValue()}function jS(e,t,n){for(const[r,o]of Object.entries(t)){if(n===void 0||n===r){If(e,r,o,t);continue}const s=ru(n,r);s!==void 0&&If(e,s,o,t)}return e}class uF{constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=Br(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,s=this.value.path,l=ru(s,t);if(l===void 0)throw new Error(`Expected ${t} to be prefixed by ${s}`);const u=[];for(const d of o){if(d===void 0)continue;const p=Array.isArray(d)?d:[d];for(const h of p){dF(h,l,n,r.elements),If(h,l,n,r.elements);const m=Zg(h,l,n,r.elements);m!==void 0&&u.push(m)}}this.valueStack.push({type:"element",path:t,values:u})}onExitElement(t,n,r){if(!this.valueStack.pop())throw new Error("Expected value context to exist when exiting element");const s=ru(this.value.path,t);if(s===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);for(const l of this.value.values){const u=Zg(l,s,n,r.elements);if(Array.isArray(u))for(let d=u.length-1;d>=0;d--){const p=u[d];vn(p)||u.splice(d,1)}yn(u)&&Jg(l,void 0,s,n)}}onEnterSlice(t,n,r){const o=this.value.values,s=[];for(const l of o)if(l!==void 0){const u=Array.isArray(l)?l:[l],d=this.getMatchingSliceValues(u,n,r);s.push(d)}this.valueStack.push({type:"slice",path:t,values:s})}getMatchingSliceValues(t,n,r){const o=[];for(const s of t)(s[ug]??$T(s,[n],r.discriminator,this.schema.url))===n.name&&o.push(s);for(let s=o.length;s<n.min;s++)if(ux(n.type[0].code)){const l=Object.create(null);o.push(l),t.push(l)}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];ug in o&&delete o[ug]}}getDefaultValue(){return this.rootValue}}function dF(e,t,n,r){const o=Zg(e,t,n,r);n.min>0&&o===void 0&&ux(n.type[0].code)&&(n.isArray?Jg(e,[Object.create(null)],t,n):Jg(e,Object.create(null),t,n))}function Jg(e,t,n,r){if(n.includes("."))throw new Error("key cannot be nested");let o=n;if(n.includes("[x]")){const s=r.type[0].code;o=n.replace("[x]",Ln(s))}t===void 0?delete e[o]:e[o]=t}function Zg(e,t,n,r){const o=t.split(".");let s=e,l;for(let u=0;u<o.length;u++){let d=o[u];if(d.includes("[x]")){const h=r[o.slice(0,u+1).join(".")].type[0].code;d=d.replace("[x]",Ln(h))}if(u===o.length-1){Array.isArray(s)?l=s.map(p=>p[d]):l=s[d];continue}if(Array.isArray(s))s=s.map(p=>p[d]);else if(nr(s)){if(s[d]===void 0)return;s=s[d]}else return}return l}function If(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(u=>If(u,t,n,r));e==null&&(e=Object.create(null));const o=e,s=t.split(".");let l=o;for(let u=0;u<s.length;u++){let d=s[u];if(d.includes("[x]")){const h=r[s.slice(0,u+1).join(".")].type[0].code;d=d.replace("[x]",Ln(h))}if(u===s.length-1){const p=Array.isArray(l)?l:[l];for(const h of p)n.fixed?h[d]??(h[d]=n.fixed.value):n.pattern&&(h[d]=FT(h[d],n.pattern.value))}else{if(!(d in l)){const p=s.slice(0,u+1).join(".");l[d]=r[p].isArray?[Object.create(null)]:Object.create(null)}l=l[d]}}return o}function FT(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return((e==null?void 0:e.length)??0)>0?e:Br(t);if(nr(t)&&(nr(e)&&!Array.isArray(e)||e===void 0)){const n=Br(e)??Object.create(null);for(const r of Object.keys(t))n[r]=FT(n[r],t[r]);return n}return e}const fF="https://meta.medplum.com/releases",dg=new Map;function pF(e){const t=e;if(!t.tag_name)throw new Error("Manifest missing tag_name");const n=t.assets;if(!(n!=null&&n.length))throw new Error("Manifest missing assets list");for(const r of n){if(!r.browser_download_url)throw new Error("Asset missing browser download URL");if(!r.name)throw new Error("Asset missing name")}}async function hF(e,t,n){let r=dg.get("latest");if(!r){const o="latest",s=new URL(`${fF}/${o}.json`);s.searchParams.set("a",e),s.searchParams.set("c",MT);const l=await fetch(s.toString());if(l.status!==200){let d;try{d=(await l.json()).message}catch(p){console.error(`Failed to parse message from body: ${Ze(p)}`)}throw new Error(`Received status code ${l.status} while fetching manifest for version 'latest'. Message: ${d}`)}const u=await l.json();pF(u),r=u,dg.set("latest",r),dg.set(r.tag_name.slice(1),r)}return r}async function mF(e){const t=await hF(e);if(!t.tag_name.startsWith("v"))throw new Error(`Invalid release name found. Release tag '${t.tag_name}' did not start with 'v'`);return t.tag_name.slice(1)}const zT=g.createContext(void 0);function $p(){return g.useContext(zT)}function Te(){return $p().medplum}function Fp(){return $p().navigate}function zp(){return $p().profile}const CS=["change","storageInitialized","storageInitFailed","profileRefreshing","profileRefreshed"];function gF(e){const t=e.medplum,n=e.navigate??vF,[r,o]=g.useState({profile:t.getProfile(),loading:t.isLoading()});g.useEffect(()=>{function l(){o(u=>({...u,profile:t.getProfile(),loading:t.isLoading()}))}for(const u of CS)t.addEventListener(u,l);return()=>{for(const u of CS)t.removeEventListener(u,l)}},[t]);const s=g.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return i.jsx(zT.Provider,{value:s,children:e.children})}function vF(e){window.location.assign(e)}const ES=new Map,BT=e=>g.useMemo(()=>{if(!e)return;const t=e.split("?")[0];if(!t)return e;let n;try{n=new URLSearchParams(new URL(e).search)}catch{return e}if(!n.has("Key-Pair-Id")||!n.has("Signature"))return e;const r=n.get("Expires");if(!r||r.length>13)return e;const o=ES.get(t);if(o){const l=new URLSearchParams(new URL(o).search).get("Expires");if(l&&parseInt(l,10)*1e3-5e3>Date.now())return o}return ES.set(t,e),e},[e]);function yF(e){const t=g.useRef();return g.useEffect(()=>{t.current=e}),t.current}function Kt(e,t){const n=Te(),[r,o]=g.useState(()=>kS(n,e)),s=g.useCallback(l=>{hs(l,r)||o(l)},[r]);return g.useEffect(()=>{let l=!0;const u=kS(n,e);return!u&&Ea(e)?n.readReference(e).then(d=>{l&&s(d)}).catch(d=>{l&&(s(void 0),t&&t(Bt(d)))}):s(u),()=>l=!1},[n,e,s,t]),r}function kS(e,t){if(t){if(Mi(t))return t;if(Ea(t))return e.getCachedReference(t)}}function xF(e,t,n={leading:!1}){const[r,o]=g.useState(e),s=g.useRef(!1),l=g.useRef(),u=g.useRef(!1),d=g.useCallback(()=>window.clearTimeout(l.current),[]);return g.useEffect(()=>{s.current&&(!u.current&&n.leading?(u.current=!0,o(e)):(d(),l.current=setTimeout(()=>{u.current=!1,o(e)},t)))},[e,n.leading,t,d]),g.useEffect(()=>(s.current=!0,d),[d]),[r,d]}const bF=250;function wF(e,t,n){return UT("searchOne",e,t)}function Dl(e,t,n){return UT("searchResources",e,t)}function UT(e,t,n,r){const o=Te(),[s,l]=g.useState(),[u,d]=g.useState(!0),[p,h]=g.useState(),[m,y]=g.useState(),x=o.fhirSearchUrl(t,n).toString(),[b]=xF(x,bF,{leading:!0});return g.useEffect(()=>{b!==s&&(l(b),o[e](t,n).then(w=>{d(!1),h(w),y(nL)}).catch(w=>{d(!1),h(void 0),y(Bt(w))}))},[o,e,t,n,s,b]),[p,u,m]}function SF(e){const t=e.value;return t?i.jsx(i.Fragment,{children:gT(t)}):null}const VT=["meta","implicitRules","contained","extension","modifierExtension"],WT=["language","text"],Qt=g.createContext({path:"",profileUrl:void 0,elements:Object.create(null),elementsByPath:Object.create(null),getExtendedProps:()=>({readonly:!1,hidden:!1}),accessPolicyResource:void 0,debugMode:!1,isDefaultContext:!0});Qt.displayName="ElementsContext";const jx=["extension","modifierExtension"],jF=["id",...VT].filter(e=>!jx.includes(e));function CF(e){return Object.entries(e).filter(([n,r])=>{var o;return!vn(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||jx.includes(n)&&!vn((o=r.slicing)==null?void 0:o.slices)||jF.includes(n)?!1:!(WT.includes(n)&&r.path.split(".").length===2||n.includes("."))})}function TS(e,t){return e.line&&e.line.length>t?e.line[t]:""}function PS(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:r}}function EF(e){const[t,n]=g.useState(e.defaultValue||{}),r=g.useRef();r.current=t;const{getExtendedProps:o}=g.useContext(Qt),[s,l,u,d,p,h,m]=g.useMemo(()=>["use","type","line1","line2","city","state","postalCode"].map(E=>o(e.path+"."+E)),[o,e.path]);function y(E){n(E),e.onChange&&e.onChange(E)}function x(E){y({...r.current,use:E})}function b(E){y({...r.current,type:E})}function w(E){y(PS(r.current||{},0,E))}function j(E){y(PS(r.current||{},1,E))}function T(E){y({...r.current,city:E})}function P(E){y({...r.current,state:E})}function k(E){y({...r.current,postalCode:E})}return i.jsxs(be,{gap:"xs",wrap:"nowrap",grow:!0,children:[i.jsx(Zt,{disabled:e.disabled||(s==null?void 0:s.readonly),"data-testid":"address-use",defaultValue:t.use,onChange:E=>x(E.currentTarget.value),data:["","home","work","temp","old","billing"]}),i.jsx(Zt,{disabled:e.disabled||(l==null?void 0:l.readonly),"data-testid":"address-type",defaultValue:t.type,onChange:E=>b(E.currentTarget.value),data:["","postal","physical","both"]}),i.jsx(Fe,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"Line 1",defaultValue:TS(t,0),onChange:E=>w(E.currentTarget.value)}),i.jsx(Fe,{disabled:e.disabled||(d==null?void 0:d.readonly),placeholder:"Line 2",defaultValue:TS(t,1),onChange:E=>j(E.currentTarget.value)}),i.jsx(Fe,{disabled:e.disabled||(p==null?void 0:p.readonly),placeholder:"City",defaultValue:t.city,onChange:E=>T(E.currentTarget.value)}),i.jsx(Fe,{disabled:e.disabled||(h==null?void 0:h.readonly),placeholder:"State",defaultValue:t.state,onChange:E=>P(E.currentTarget.value)}),i.jsx(Fe,{disabled:e.disabled||(m==null?void 0:m.readonly),placeholder:"Postal Code",defaultValue:t.postalCode,onChange:E=>k(E.currentTarget.value)})]})}function kF(e){const t=zp(),[n,r]=g.useState(e.defaultValue||{});function o(s){const l=s?{text:s,authorReference:t&&Jt(t),time:new Date().toISOString()}:{};r(l),e.onChange&&e.onChange(l)}return i.jsx(Fe,{disabled:e.disabled,name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:s=>o(s.currentTarget.value)})}/**
|
|
142
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
143
|
-
*
|
|
144
|
-
* This source code is licensed under the MIT license.
|
|
145
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/var TF={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/**
|
|
147
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
148
|
-
*
|
|
149
|
-
* This source code is licensed under the MIT license.
|
|
150
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
-
*/const Ve=(e,t,n,r)=>{const o=g.forwardRef(({color:s="currentColor",size:l=24,stroke:u=2,title:d,className:p,children:h,...m},y)=>g.createElement("svg",{ref:y,...TF[e],width:l,height:l,className:["tabler-icon",`tabler-icon-${t}`,p].join(" "),...e==="filled"?{fill:s}:{strokeWidth:u,stroke:s},...m},[d&&g.createElement("title",{key:"svg-title"},d),...r.map(([x,b])=>g.createElement(x,b)),...Array.isArray(h)?h:[h]]));return o.displayName=`${n}`,o};/**
|
|
152
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
153
|
-
*
|
|
154
|
-
* This source code is licensed under the MIT license.
|
|
155
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
-
*/var PF=Ve("outline","adjustments-horizontal","IconAdjustmentsHorizontal",[["path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M4 6l8 0",key:"svg-1"}],["path",{d:"M16 6l4 0",key:"svg-2"}],["path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-3"}],["path",{d:"M4 12l2 0",key:"svg-4"}],["path",{d:"M10 12l10 0",key:"svg-5"}],["path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-6"}],["path",{d:"M4 18l11 0",key:"svg-7"}],["path",{d:"M19 18l1 0",key:"svg-8"}]]);/**
|
|
157
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
158
|
-
*
|
|
159
|
-
* This source code is licensed under the MIT license.
|
|
160
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/var Xl=Ve("outline","alert-circle","IconAlertCircle",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]]);/**
|
|
162
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
163
|
-
*
|
|
164
|
-
* This source code is licensed under the MIT license.
|
|
165
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
-
*/var RF=Ve("outline","arrow-down","IconArrowDown",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 13l-6 6",key:"svg-1"}],["path",{d:"M6 13l6 6",key:"svg-2"}]]);/**
|
|
167
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
168
|
-
*
|
|
169
|
-
* This source code is licensed under the MIT license.
|
|
170
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
-
*/var _F=Ve("outline","arrow-up","IconArrowUp",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]]);/**
|
|
172
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
173
|
-
*
|
|
174
|
-
* This source code is licensed under the MIT license.
|
|
175
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/var DF=Ve("outline","bleach-off","IconBleachOff",[["path",{d:"M5 19h14m1.986 -1.977a2 2 0 0 0 -.146 -.773l-7.1 -12.25a2 2 0 0 0 -3.5 0l-.815 1.405m-1.488 2.568l-4.797 8.277a2 2 0 0 0 1.75 2.75",key:"svg-0"}],["path",{d:"M3 3l18 18",key:"svg-1"}]]);/**
|
|
177
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
178
|
-
*
|
|
179
|
-
* This source code is licensed under the MIT license.
|
|
180
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
-
*/var IF=Ve("outline","bleach","IconBleach",[["path",{d:"M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75",key:"svg-0"}]]);/**
|
|
182
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
183
|
-
*
|
|
184
|
-
* This source code is licensed under the MIT license.
|
|
185
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
-
*/var NF=Ve("outline","box-multiple","IconBoxMultiple",[["path",{d:"M7 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M17 17v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h2",key:"svg-1"}]]);/**
|
|
187
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
188
|
-
*
|
|
189
|
-
* This source code is licensed under the MIT license.
|
|
190
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
-
*/var AF=Ve("outline","brackets-contain","IconBracketsContain",[["path",{d:"M7 4h-4v16h4",key:"svg-0"}],["path",{d:"M17 4h4v16h-4",key:"svg-1"}],["path",{d:"M8 16h.01",key:"svg-2"}],["path",{d:"M12 16h.01",key:"svg-3"}],["path",{d:"M16 16h.01",key:"svg-4"}]]);/**
|
|
192
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
193
|
-
*
|
|
194
|
-
* This source code is licensed under the MIT license.
|
|
195
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
-
*/var MF=Ve("outline","brand-asana","IconBrandAsana",[["path",{d:"M12 7m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-0"}],["path",{d:"M17 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M7 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-2"}]]);/**
|
|
197
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
198
|
-
*
|
|
199
|
-
* This source code is licensed under the MIT license.
|
|
200
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
-
*/var OF=Ve("outline","bucket-off","IconBucketOff",[["path",{d:"M5.029 5.036c-.655 .58 -1.029 1.25 -1.029 1.964c0 2.033 3.033 3.712 6.96 3.967m3.788 -.21c3.064 -.559 5.252 -2.029 5.252 -3.757c0 -2.21 -3.582 -4 -8 -4c-1.605 0 -3.1 .236 -4.352 .643",key:"svg-0"}],["path",{d:"M4 7c0 .664 .088 1.324 .263 1.965l2.737 10.035c.5 1.5 2.239 2 5 2s4.5 -.5 5 -2c.1 -.3 .252 -.812 .457 -1.535m.862 -3.146c.262 -.975 .735 -2.76 1.418 -5.354a7.45 7.45 0 0 0 .263 -1.965",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]]);/**
|
|
202
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
203
|
-
*
|
|
204
|
-
* This source code is licensed under the MIT license.
|
|
205
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
-
*/var LF=Ve("outline","bucket","IconBucket",[["path",{d:"M12 7m-8 0a8 4 0 1 0 16 0a8 4 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 7c0 .664 .088 1.324 .263 1.965l2.737 10.035c.5 1.5 2.239 2 5 2s4.5 -.5 5 -2c.333 -1 1.246 -4.345 2.737 -10.035a7.45 7.45 0 0 0 .263 -1.965",key:"svg-1"}]]);/**
|
|
207
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
208
|
-
*
|
|
209
|
-
* This source code is licensed under the MIT license.
|
|
210
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
-
*/var $F=Ve("outline","building","IconBuilding",[["path",{d:"M3 21l18 0",key:"svg-0"}],["path",{d:"M9 8l1 0",key:"svg-1"}],["path",{d:"M9 12l1 0",key:"svg-2"}],["path",{d:"M9 16l1 0",key:"svg-3"}],["path",{d:"M14 8l1 0",key:"svg-4"}],["path",{d:"M14 12l1 0",key:"svg-5"}],["path",{d:"M14 16l1 0",key:"svg-6"}],["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16",key:"svg-7"}]]);/**
|
|
212
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
213
|
-
*
|
|
214
|
-
* This source code is licensed under the MIT license.
|
|
215
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
-
*/var Ws=Ve("outline","calendar","IconCalendar",[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v4",key:"svg-2"}],["path",{d:"M4 11h16",key:"svg-3"}],["path",{d:"M11 15h1",key:"svg-4"}],["path",{d:"M12 15v3",key:"svg-5"}]]);/**
|
|
217
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
218
|
-
*
|
|
219
|
-
* This source code is licensed under the MIT license.
|
|
220
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
-
*/var Ss=Ve("outline","check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]);/**
|
|
222
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
223
|
-
*
|
|
224
|
-
* This source code is licensed under the MIT license.
|
|
225
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
-
*/var FF=Ve("outline","checkbox","IconCheckbox",[["path",{d:"M9 11l3 3l8 -8",key:"svg-0"}],["path",{d:"M20 12v6a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h9",key:"svg-1"}]]);/**
|
|
227
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
228
|
-
*
|
|
229
|
-
* This source code is licensed under the MIT license.
|
|
230
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
-
*/var Cx=Ve("outline","chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]);/**
|
|
232
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
233
|
-
*
|
|
234
|
-
* This source code is licensed under the MIT license.
|
|
235
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
-
*/var zF=Ve("outline","circle-check","IconCircleCheck",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l2 2l4 -4",key:"svg-1"}]]);/**
|
|
237
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
238
|
-
*
|
|
239
|
-
* This source code is licensed under the MIT license.
|
|
240
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
-
*/var Nf=Ve("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"}]]);/**
|
|
242
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
243
|
-
*
|
|
244
|
-
* This source code is licensed under the MIT license.
|
|
245
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
-
*/var Af=Ve("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"}]]);/**
|
|
247
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
248
|
-
*
|
|
249
|
-
* This source code is licensed under the MIT license.
|
|
250
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
-
*/var Ex=Ve("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"}]]);/**
|
|
252
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
253
|
-
*
|
|
254
|
-
* This source code is licensed under the MIT license.
|
|
255
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
-
*/var BF=Ve("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"}]]);/**
|
|
257
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
258
|
-
*
|
|
259
|
-
* This source code is licensed under the MIT license.
|
|
260
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
-
*/var HT=Ve("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"}]]);/**
|
|
262
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
263
|
-
*
|
|
264
|
-
* This source code is licensed under the MIT license.
|
|
265
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
-
*/var UF=Ve("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"}]]);/**
|
|
267
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
268
|
-
*
|
|
269
|
-
* This source code is licensed under the MIT license.
|
|
270
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
-
*/var VF=Ve("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"}]]);/**
|
|
272
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
273
|
-
*
|
|
274
|
-
* This source code is licensed under the MIT license.
|
|
275
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
-
*/var WF=Ve("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"}]]);/**
|
|
277
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
278
|
-
*
|
|
279
|
-
* This source code is licensed under the MIT license.
|
|
280
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
-
*/var qT=Ve("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"}]]);/**
|
|
282
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
283
|
-
*
|
|
284
|
-
* This source code is licensed under the MIT license.
|
|
285
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
-
*/var Du=Ve("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"}]]);/**
|
|
287
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
288
|
-
*
|
|
289
|
-
* This source code is licensed under the MIT license.
|
|
290
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
-
*/var Iu=Ve("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);/**
|
|
292
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
293
|
-
*
|
|
294
|
-
* This source code is licensed under the MIT license.
|
|
295
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
-
*/var RS=Ve("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"}]]);/**
|
|
297
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
298
|
-
*
|
|
299
|
-
* This source code is licensed under the MIT license.
|
|
300
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
-
*/var HF=Ve("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"}]]);/**
|
|
302
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
303
|
-
*
|
|
304
|
-
* This source code is licensed under the MIT license.
|
|
305
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
-
*/var qF=Ve("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"}]]);/**
|
|
307
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
308
|
-
*
|
|
309
|
-
* This source code is licensed under the MIT license.
|
|
310
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
-
*/var GF=Ve("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"}]]);/**
|
|
312
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
313
|
-
*
|
|
314
|
-
* This source code is licensed under the MIT license.
|
|
315
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
-
*/var QF=Ve("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"}]]);/**
|
|
317
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
318
|
-
*
|
|
319
|
-
* This source code is licensed under the MIT license.
|
|
320
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
-
*/var _S=Ve("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"}]]);/**
|
|
322
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
323
|
-
*
|
|
324
|
-
* This source code is licensed under the MIT license.
|
|
325
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
-
*/var KF=Ve("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"}]]);/**
|
|
327
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
328
|
-
*
|
|
329
|
-
* This source code is licensed under the MIT license.
|
|
330
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
331
|
-
*/var YF=Ve("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"}]]);/**
|
|
332
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
333
|
-
*
|
|
334
|
-
* This source code is licensed under the MIT license.
|
|
335
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
336
|
-
*/var XF=Ve("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"}]]);/**
|
|
337
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
338
|
-
*
|
|
339
|
-
* This source code is licensed under the MIT license.
|
|
340
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
341
|
-
*/var GT=Ve("outline","math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]);/**
|
|
342
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
343
|
-
*
|
|
344
|
-
* This source code is licensed under the MIT license.
|
|
345
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
346
|
-
*/var QT=Ve("outline","math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]);/**
|
|
347
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
348
|
-
*
|
|
349
|
-
* This source code is licensed under the MIT license.
|
|
350
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
351
|
-
*/var JF=Ve("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"}]]);/**
|
|
352
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
353
|
-
*
|
|
354
|
-
* This source code is licensed under the MIT license.
|
|
355
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
356
|
-
*/var ZF=Ve("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"}]]);/**
|
|
357
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
358
|
-
*
|
|
359
|
-
* This source code is licensed under the MIT license.
|
|
360
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
-
*/var e8=Ve("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"}]]);/**
|
|
362
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
363
|
-
*
|
|
364
|
-
* This source code is licensed under the MIT license.
|
|
365
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
366
|
-
*/var t8=Ve("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"}]]);/**
|
|
367
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
368
|
-
*
|
|
369
|
-
* This source code is licensed under the MIT license.
|
|
370
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
371
|
-
*/var n8=Ve("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"}]]);/**
|
|
372
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
373
|
-
*
|
|
374
|
-
* This source code is licensed under the MIT license.
|
|
375
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
376
|
-
*/var r8=Ve("outline","player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]);/**
|
|
377
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
378
|
-
*
|
|
379
|
-
* This source code is licensed under the MIT license.
|
|
380
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
381
|
-
*/var o8=Ve("outline","plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]);/**
|
|
382
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
383
|
-
*
|
|
384
|
-
* This source code is licensed under the MIT license.
|
|
385
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
386
|
-
*/var i8=Ve("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"}]]);/**
|
|
387
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
388
|
-
*
|
|
389
|
-
* This source code is licensed under the MIT license.
|
|
390
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
391
|
-
*/var s8=Ve("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"}]]);/**
|
|
392
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
393
|
-
*
|
|
394
|
-
* This source code is licensed under the MIT license.
|
|
395
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
396
|
-
*/var a8=Ve("outline","repeat","IconRepeat",[["path",{d:"M4 12v-3a3 3 0 0 1 3 -3h13m-3 -3l3 3l-3 3",key:"svg-0"}],["path",{d:"M20 12v3a3 3 0 0 1 -3 3h-13m3 3l-3 -3l3 -3",key:"svg-1"}]]);/**
|
|
397
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
398
|
-
*
|
|
399
|
-
* This source code is licensed under the MIT license.
|
|
400
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
401
|
-
*/var l8=Ve("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"}]]);/**
|
|
402
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
403
|
-
*
|
|
404
|
-
* This source code is licensed under the MIT license.
|
|
405
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
406
|
-
*/var c8=Ve("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"}]]);/**
|
|
407
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
408
|
-
*
|
|
409
|
-
* This source code is licensed under the MIT license.
|
|
410
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
411
|
-
*/var u8=Ve("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"}]]);/**
|
|
412
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
413
|
-
*
|
|
414
|
-
* This source code is licensed under the MIT license.
|
|
415
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
416
|
-
*/var ev=Ve("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"}]]);/**
|
|
417
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
418
|
-
*
|
|
419
|
-
* This source code is licensed under the MIT license.
|
|
420
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
421
|
-
*/var kx=Ve("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"}]]);/**
|
|
422
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
423
|
-
*
|
|
424
|
-
* This source code is licensed under the MIT license.
|
|
425
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
426
|
-
*/var Tx=Ve("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"}]]);/**
|
|
427
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
428
|
-
*
|
|
429
|
-
* This source code is licensed under the MIT license.
|
|
430
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
431
|
-
*/var d8=Ve("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"}]]);/**
|
|
432
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
433
|
-
*
|
|
434
|
-
* This source code is licensed under the MIT license.
|
|
435
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
436
|
-
*/var f8=Ve("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"}]]);/**
|
|
437
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
438
|
-
*
|
|
439
|
-
* This source code is licensed under the MIT license.
|
|
440
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
441
|
-
*/var p8=Ve("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"}]]);/**
|
|
442
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
443
|
-
*
|
|
444
|
-
* This source code is licensed under the MIT license.
|
|
445
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
446
|
-
*/var h8=Ve("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"}]]);/**
|
|
447
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
448
|
-
*
|
|
449
|
-
* This source code is licensed under the MIT license.
|
|
450
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
451
|
-
*/var m8=Ve("outline","text-recognition","IconTextRecognition",[["path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2",key:"svg-0"}],["path",{d:"M4 16v2a2 2 0 0 0 2 2h2",key:"svg-1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v2",key:"svg-2"}],["path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2",key:"svg-3"}],["path",{d:"M12 16v-7",key:"svg-4"}],["path",{d:"M9 9h6",key:"svg-5"}]]);/**
|
|
452
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
453
|
-
*
|
|
454
|
-
* This source code is licensed under the MIT license.
|
|
455
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
456
|
-
*/var Px=Ve("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"}]]);/**
|
|
457
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
458
|
-
*
|
|
459
|
-
* This source code is licensed under the MIT license.
|
|
460
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
461
|
-
*/var DS=Ve("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"}]]);/**
|
|
462
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
463
|
-
*
|
|
464
|
-
* This source code is licensed under the MIT license.
|
|
465
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
466
|
-
*/var g8=Ve("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"}]]);/**
|
|
467
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
468
|
-
*
|
|
469
|
-
* This source code is licensed under the MIT license.
|
|
470
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
471
|
-
*/var Il=Ve("outline","x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);/**
|
|
472
|
-
* @license @tabler/icons-react v3.17.0 - MIT
|
|
473
|
-
*
|
|
474
|
-
* This source code is licensed under the MIT license.
|
|
475
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
476
|
-
*/var v8=Ve("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 KT extends g.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?i.jsx(xs,{icon:i.jsx(Xl,{size:16}),title:"Something went wrong",color:"red",children:Ze(this.state.error)}):this.props.children}}function Ur(){return i.jsx(Vn,{style:{width:"100%",height:"100vh"},children:i.jsx(Rr,{})})}const y8="_main_g2hyx_1",x8={main:y8};function qt(e){e.preventDefault(),e.stopPropagation()}function YT(e){if(IS(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&IS(t[0]))return!0}return!1}function IS(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}async function Gc(e,t){return new Promise((n,r)=>{var s;const o=new MessageChannel;o.port1.onmessage=({data:l})=>{o.port1.close(),l.error?r(l.error):n(l.result)},(s=e.contentWindow)==null||s.postMessage(t,new URL(e.src).origin,[o.port2])})}function xt(e){const t=Fp(),{to:n,suffix:r,label:o,onClick:s,children:l,...u}=e;let d=b8(n);return r&&(d+="/"+r),i.jsx(Rt,{href:d,"aria-label":o,onClick:p=>{qt(p),s?s(p):n&&t(d)},...u,children:l})}function b8(e){if(e){if(typeof e=="string")return w8(e);if(Mi(e))return S8(e);if(Ea(e))return j8(e)}return"#"}function w8(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function S8(e){return`/${e.resourceType}/${e.id}`}function j8(e){return`/${e.reference}`}function C8(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 js(e){const t=Kt(e.value),n=t?Ei(t):e.alt??"",r=C8(n),o=(t&&A$(t))??e.src,s=BT(o??void 0),l=e.radius??"xl",u={...e,value:void 0,link:void 0};return e.link?i.jsx(xt,{to:t,children:i.jsx(ia,{src:s,alt:n,radius:l,...u,children:r})}):i.jsx(ia,{src:s,alt:n,radius:l,...u,children:r})}const E8="_logoButton_189g3_1",k8="_user_189g3_11",T8="_userName_189g3_21",P8="_userActive_189g3_31",tf={logoButton:E8,user:k8,userName:T8,userActive:P8};function Rx(e){const t=e.value;return t?i.jsx(i.Fragment,{children:Ql(t,e.options)}):null}function R8(e){var d,p,h;const t=$p(),{medplum:n,profile:r,navigate:o}=t,s=n.getLogins(),{colorScheme:l,setColorScheme:u}=kI();return i.jsxs(i.Fragment,{children:[i.jsxs(tt,{align:"center",p:"xl",children:[i.jsx(js,{size:"xl",radius:100,value:t.profile}),i.jsx(Rx,{value:(p=(d=t.profile)==null?void 0:d.name)==null?void 0:p[0]}),i.jsx($e,{c:"dimmed",size:"xs",children:(h=n.getActiveLogin())==null?void 0:h.project.display})]}),s.length>1&&i.jsx(xe.Divider,{}),s.map(m=>m.profile.reference!==Ot(t.profile)&&i.jsx(xe.Item,{onClick:()=>{n.setActiveLogin(m).then(()=>window.location.reload()).catch(console.log)},children:i.jsxs(be,{children:[i.jsx(ia,{radius:"xl"}),i.jsxs("div",{style:{flex:1},children:[i.jsx($e,{size:"sm",fw:500,children:m.profile.display}),i.jsx($e,{c:"dimmed",size:"xs",children:m.project.display})]})]})},m.profile.reference)),i.jsx(xe.Divider,{}),i.jsx(be,{justify:"center",children:i.jsx(qy,{size:"xs",value:l,onChange:m=>u(m),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),i.jsx(xe.Divider,{}),i.jsx(xe.Item,{leftSection:i.jsx(p8,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Add another account"}),i.jsx(xe.Item,{leftSection:i.jsx(ev,{size:14,stroke:1.5}),onClick:()=>o(`/${Ot(r)}`),children:"Account settings"}),i.jsx(xe.Item,{leftSection:i.jsx(XF,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),o("/signin")},children:"Sign out"}),i.jsx($e,{size:"xs",c:"dimmed",ta:"center",children:e.version})]})}const NS={selectedItems:"selected-items",options:"options"};function _x(e){const t=yu({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:o,error:s,defaultValue:l,toOption:u,loadOptions:d,itemComponent:p,pillComponent:h,emptyComponent:m,onChange:y,onCreate:x,creatable:b,clearable:w,required:j,placeholder:T,leftSection:P,maxValues:k,optionsDropdownMaxHeight:E=320,minInputLength:_=0,...R}=e,M=R.disabled,N=_8(l),[L,z]=g.useState(""),[q,G]=g.useState(),[Y,Q]=g.useState(),[te,V]=g.useState(),[O,A]=g.useState(N.map(u)),[B,I]=g.useState([]),F=p??D8,J=h??I8,de=m??N8,Ee=g.useRef();Ee.current=L;const ve=g.useRef(),we=g.useRef(),_e=g.useRef();_e.current=q;const fe=g.useRef();fe.current=Y;const Je=g.useRef();Je.current=te;const pt=g.useRef();pt.current=B;const at=g.useCallback(()=>{var Re;if(G(void 0),Ee.current===we.current&&d===ve.current||(((Re=Ee.current)==null?void 0:Re.length)??0)<_)return;we.current=Ee.current,ve.current=d;const pe=new AbortController;Q(pe),d(Ee.current??"",pe.signal).then(He=>{pe.signal.aborted||(I(He.map(u)),Je.current?(He.length>0&&y(He.slice(0,1)),V(!1)):He.length>0&&t.openDropdown())}).catch(He=>{pe.signal.aborted||He.message.includes("aborted")||Ie({color:"red",message:Ze(He)})}).finally(()=>{pe.signal.aborted||Q(void 0)})},[t,d,y,u,_]),St=g.useCallback(pe=>{(B&&B.length>0||b)&&t.openDropdown(),t.updateSelectedOptionIndex(),z(pe.currentTarget.value),fe.current&&(fe.current.abort(),Q(void 0)),_e.current!==void 0&&window.clearTimeout(_e.current);const Re=window.setTimeout(()=>at(),100);G(Re)},[t,B,b,at]),jt=g.useCallback(pe=>{const Re=O.some(ke=>ke.value===pe),He=Re?O.filter(ke=>ke.value!==pe):[...O];let he=B==null?void 0:B.find(ke=>ke.value===pe);if(!he&&b!==!1&&x){const ke=x(pe);he=u(ke)}if(he){if(k===0){y([he.resource]),O.length>0&&A([]);return}Re||He.push(he)}if(k!==void 0)for(;He.length>k;)He.shift();y(He.map(ke=>ke.resource)),A(He)},[b,B,O,k,y,x,u]),Et=g.useMemo(()=>{if(!M)return pe=>{M||(k===1&&(z(""),I([]),t.closeDropdown()),we.current=void 0,jt(pe==="$create"?L:pe))}},[jt,t,M,k,L]),vt=g.useCallback(pe=>{const Re=O.filter(He=>He.value!==pe.value);y(Re.map(He=>He.resource)),A(Re)},[O,y]),kt=g.useCallback(pe=>{pe.key==="Enter"?(q||Y)&&V(!0):pe.key==="Backspace"&&L.length===0&&(qt(pe),vt(O[O.length-1]))},[Y,vt,L.length,O,q]);g.useEffect(()=>()=>{fe.current&&fe.current.abort()},[]);const ce=!M&&w&&O.length>0&&i.jsx(st.ClearButton,{title:"Clear all",size:16,onClear:()=>{z(""),A([]),y([]),t.closeDropdown()}});return i.jsxs(st,{store:t,onOptionSubmit:Et,withinPortal:!0,shadow:"xl",...R,children:[i.jsx(st.DropdownTarget,{children:i.jsx(kl,{label:r,description:o,error:s,className:e.className,leftSection:P,rightSection:Y?i.jsx(Rr,{size:16}):ce,required:j,disabled:M,children:i.jsxs(sa.Group,{"data-testid":NS.selectedItems,children:[O.map(pe=>i.jsx(J,{item:pe,disabled:M,onRemove:()=>vt(pe)},pe.value)),!M&&(k===void 0||k===0||O.length<k)&&i.jsx(st.EventsTarget,{children:i.jsx(kl.Field,{role:"searchbox",name:n,value:L,placeholder:T,onFocus:St,onBlur:()=>{t.closeDropdown(),z("")},onKeyDown:kt,onChange:St})})]})})}),i.jsx(st.Dropdown,{hidden:B.length===0,"data-testid":NS.options,children:i.jsx(st.Options,{children:i.jsxs(rp,{type:"scroll",mah:E,children:[B.map(pe=>{const Re=O.some(He=>He.value===pe.value);return i.jsx(st.Option,{value:pe.value,active:Re,children:i.jsx(F,{...pe,active:Re})},pe.value)}),b&&L.trim().length>0&&i.jsxs(st.Option,{value:"$create",children:["+ Create ",L]}),!b&&L.trim().length>0&&B.length===0&&i.jsx(de,{search:L})]})})})]})}function _8(e){return e?Array.isArray(e)?e:[e]:[]}function D8(e){return i.jsxs(be,{gap:"xs",children:[e.active&&i.jsx(Ss,{size:12}),i.jsx("span",{children:e.label})]})}function I8({item:e,disabled:t,onRemove:n}){return i.jsx(sa,{withRemoveButton:!t,onRemove:n,children:e.label})}function N8(){return i.jsx(st.Empty,{children:"Nothing found"})}const A8="_searchInput_dick8_1",M8={searchInput:A8};function O8(e){return{value:e.id,label:Ei(e),resource:e}}function L8(e){const t=Fp(),n=Te(),r=g.useCallback(async(s,l)=>{const u=F8(s),d={signal:l},p=await n.graphql(u,void 0,void 0,d);return z8(p,s)},[n]),o=g.useCallback(s=>{s.length>0&&t(`/${Ot(s[0])}`)},[t]);return i.jsx(_x,{size:"sm",radius:"md",className:M8.searchInput,leftSection:i.jsx(u8,{size:16}),placeholder:"Search",itemComponent:$8,toOption:O8,onChange:o,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const $8=g.forwardRef(({resource:e,active:t,...n},r)=>{var s;let o;return e.resourceType==="Patient"?o=e.birthDate:e.resourceType==="ServiceRequest"&&(o=(s=e.subject)==null?void 0:s.display),i.jsx("div",{ref:r,...n,children:i.jsxs(be,{wrap:"nowrap",children:[i.jsx(js,{value:e}),i.jsxs("div",{children:[i.jsx($e,{children:Ei(e)}),i.jsx($e,{size:"xs",c:"dimmed",children:o})]})]})})});function F8(e){const t=JSON.stringify(e);return cT(e)?`{
|
|
477
|
-
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
478
|
-
resourceType
|
|
479
|
-
id
|
|
480
|
-
identifier {
|
|
481
|
-
system
|
|
482
|
-
value
|
|
483
|
-
}
|
|
484
|
-
name {
|
|
485
|
-
given
|
|
486
|
-
family
|
|
487
|
-
}
|
|
488
|
-
birthDate
|
|
489
|
-
}
|
|
490
|
-
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
491
|
-
resourceType
|
|
492
|
-
id
|
|
493
|
-
identifier {
|
|
494
|
-
system
|
|
495
|
-
value
|
|
496
|
-
}
|
|
497
|
-
subject {
|
|
498
|
-
display
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
}`.replace(/\s+/g," "):`{
|
|
502
|
-
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
503
|
-
resourceType
|
|
504
|
-
id
|
|
505
|
-
identifier {
|
|
506
|
-
system
|
|
507
|
-
value
|
|
508
|
-
}
|
|
509
|
-
name {
|
|
510
|
-
given
|
|
511
|
-
family
|
|
512
|
-
}
|
|
513
|
-
birthDate
|
|
514
|
-
}
|
|
515
|
-
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
516
|
-
resourceType
|
|
517
|
-
id
|
|
518
|
-
identifier {
|
|
519
|
-
system
|
|
520
|
-
value
|
|
521
|
-
}
|
|
522
|
-
name {
|
|
523
|
-
given
|
|
524
|
-
family
|
|
525
|
-
}
|
|
526
|
-
birthDate
|
|
527
|
-
}
|
|
528
|
-
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
529
|
-
resourceType
|
|
530
|
-
id
|
|
531
|
-
identifier {
|
|
532
|
-
system
|
|
533
|
-
value
|
|
534
|
-
}
|
|
535
|
-
subject {
|
|
536
|
-
display
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
}`.replace(/\s+/g," ")}function z8(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),U8(B8(n),t).slice(0,5)}function B8(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 U8(e,t){return e.sort((n,r)=>AS(r,t)-AS(n,t))}function AS(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,MS(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,MS(Ql(r),t));return n}function MS(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function V8(e){var o;const t=zp(),[n,r]=g.useState(!1);return i.jsx(Pr.Header,{p:8,style:{zIndex:101},children:i.jsxs(be,{justify:"space-between",children:[i.jsxs(be,{gap:"xs",children:[i.jsx(Gn,{className:tf.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&i.jsx(L8,{pathname:e.pathname,searchParams:e.searchParams})]}),i.jsxs(be,{gap:"lg",pr:"sm",children:[e.notifications,i.jsxs(xe,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:n,onClose:()=>r(!1),children:[i.jsx(xe.Target,{children:i.jsx(Gn,{className:It(tf.user,{[tf.userActive]:n}),onClick:()=>r(s=>!s),children:i.jsxs(be,{gap:7,children:[i.jsx(js,{value:t,radius:"xl",size:24}),i.jsx($e,{size:"sm",className:tf.userName,children:Ql((o=t==null?void 0:t.name)==null?void 0:o[0])}),i.jsx(Cx,{size:12,stroke:1.5})]})})}),i.jsx(xe.Dropdown,{children:i.jsx(R8,{version:e.version})})]})]})]})})}function W8(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?H8(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&q8(t,n);return t}function H8(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function q8(e,t){e[t.name]=t.value}function yt(e){return i.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:t=>{t.preventDefault();const n=W8(t.target);e.onSubmit&&e.onSubmit(n)},children:e.children})}function G8(e){const t=Te(),n=t.getUserConfiguration();function r(o){var h,m;const{menuname:s,bookmarkname:l}=o,u=`${e.pathname}?${e.searchParams.toString()}`,d=Br(n),p=(h=d.menu)==null?void 0:h.find(({title:y})=>y===s);(m=p==null?void 0:p.link)==null||m.push({name:l,target:u}),t.updateResource(d).then(y=>{n.menu=y.menu,t.dispatchEvent({type:"change"}),Ie({color:"green",message:"Success"}),e.onOk()}).catch(y=>{Ie({color:"red",message:Ze(y)})})}return i.jsx(Nn,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:i.jsx(yt,{onSubmit:r,children:i.jsxs(tt,{children:[i.jsx(Q8,{config:n}),i.jsx(Fe,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),i.jsx(be,{justify:"flex-end",children:i.jsx(Pe,{mt:"sm",type:"submit",children:"OK"})})]})})})}function Q8(e){function t(r){var o;return(o=r==null?void 0:r.menu)==null?void 0:o.map(s=>s.title)}const n=t(e.config);return i.jsx(Zt,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function XT(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function K8(e){return typeof e.display=="string"?e.display:XT(e)}function Y8(e){return{value:XT(e),label:K8(e),resource:e}}function X8(e){return{code:e,display:e}}function Dx(e){const t=Te(),{binding:n,creatable:r,clearable:o,expandParams:s,withHelpText:l,...u}=e,d=g.useCallback(async(p,h)=>{var b;if(!n)return[];const y=((b=(await t.valueSetExpand({...s,url:n,filter:p},{signal:h})).expansion)==null?void 0:b.contains)??[],x=[];for(const w of y)w.code&&!x.some(j=>j.code===w.code)&&x.push(w);return x},[t,s,n]);return i.jsx(_x,{...u,creatable:r??!0,clearable:o??!0,toOption:Y8,loadOptions:d,onCreate:X8,itemComponent:l?J8:void 0})}const J8=g.forwardRef(({label:e,resource:t,active:n,...r},o)=>i.jsx("div",{ref:o,...r,children:i.jsxs(be,{wrap:"nowrap",gap:"xs",children:[n&&i.jsx(Ss,{size:12}),i.jsxs("div",{children:[i.jsx($e,{children:e}),i.jsx($e,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})]})}));function JT(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[s,l]=g.useState(t);function u(d){const p=d[0],h=ez(p);l(h),n&&n(h)}return i.jsx(Dx,{defaultValue:Z8(s),onChange:u,withHelpText:r??!0,...o})}function Z8(e){return e?{code:e}:void 0}function ez(e){return e==null?void 0:e.code}function Ix(e){const[t,n]=g.useState(e.defaultValue),r=e.onChange,o=g.useCallback(s=>{n(s),r&&r(s)},[r]);return i.jsx(JT,{disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":e.testId,defaultValue:t,onChange:o,name:e.name,placeholder:e.placeholder,binding:"https://medplum.com/fhir/ValueSet/resource-types",creatable:!1,maxValues:e.maxValues??1,clearable:!1,withHelpText:!1})}const tz="_menuTitle_9g6l5_1",nz="_link_9g6l5_9",rz="_linkActive_9g6l5_38",tv={menuTitle:tz,link:nz,linkActive:rz};function oz(e){var u;const t=Fp(),n=az(e.pathname,e.searchParams,e.menus),[r,o]=g.useState(!1);function s(d,p){d.stopPropagation(),d.preventDefault(),t(p),window.innerWidth<768&&e.closeNavbar()}function l(d){d&&t(`/${d}`)}return i.jsxs(i.Fragment,{children:[i.jsx(Pr.Navbar,{children:i.jsxs(oo,{p:"xs",children:[!e.resourceTypeSearchDisabled&&i.jsx(Pr.Section,{mb:"sm",children:i.jsx(Ix,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:d=>l(d)},window.location.pathname)}),i.jsxs(Pr.Section,{grow:!0,children:[(u=e.menus)==null?void 0:u.map(d=>{var p;return i.jsxs(g.Fragment,{children:[i.jsx($e,{className:tv.menuTitle,children:d.title}),(p=d.links)==null?void 0:p.map(h=>i.jsxs(iz,{to:h.href,active:h.href===(n==null?void 0:n.href),onClick:m=>s(m,h.href),children:[i.jsx(sz,{to:h.href,icon:h.icon}),i.jsx("span",{children:h.label})]},h.href))]},`menu-${d.title}`)}),e.displayAddBookmark&&i.jsx(Pe,{variant:"subtle",size:"xs",mt:"xl",leftSection:i.jsx(o8,{size:"0.75rem"}),onClick:()=>o(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&i.jsx(G8,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>o(!1),onCancel:()=>o(!1)})]})}function iz(e){return i.jsx(xt,{onClick:e.onClick,to:e.to,className:It(tv.link,{[tv.linkActive]:e.active}),children:e.children})}function sz(e){return e.icon?e.icon:i.jsx(_p,{w:30})}function az(e,t,n){if(!e||!t||!n)return;let r,o=0;for(const s of n)if(s.links)for(const l of s.links){const u=lz(e,t,l.href);u>o&&(o=u,r=l)}return r}function lz(e,t,n){const r=new URL(n,"https://example.com");if(e!==r.pathname)return 0;const o=["_count","_offset"];for(const[l,u]of r.searchParams.entries())if(!o.includes(l)&&t.get(l)!==u)return 0;let s=1;for(const[l,u]of t.entries())o.includes(l)||r.searchParams.get(l)===u&&s++;return s}function cz(e){const[t,n]=g.useState(localStorage.navbarOpen==="true"),r=Te(),o=zp();g.useEffect(()=>{function d(){Ie({id:"offline",color:"red",message:"No connection to server",autoClose:!1})}return r.addEventListener("offline",d),()=>r.removeEventListener("offline",d)},[r]);function s(d){localStorage.navbarOpen=d.toString(),n(d)}function l(){s(!1)}function u(){s(!t)}return r.isLoading()?i.jsx(Ur,{}):i.jsxs(Pr,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!o||!t,mobile:!o||!t}},padding:0,children:[o&&i.jsx(V8,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:u,notifications:e.notifications}),o&&t?i.jsx(oz,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:l,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,i.jsx(Pr.Main,{className:x8.main,children:i.jsx(KT,{children:i.jsx(g.Suspense,{fallback:i.jsx(Ur,{}),children:e.children})})})]})}const uz="https://ccda.medplum.com";function dz(e){const{xml:t}=e,[n,r]=g.useState(!1),o=g.useRef(null);return g.useEffect(()=>{t&&n&&o.current&&(Gc(o.current,{command:"setCcdaXml",value:t}).catch(console.error),r(!1))},[t,n]),t?i.jsx("div",{"data-testid":"ccda-iframe",style:{maxWidth:e.maxWidth,minHeight:400},children:i.jsx("iframe",{title:"C-CDA Viewer",width:"100%",height:"400",ref:o,src:uz,allowFullScreen:!0,frameBorder:0,seamless:!0,onLoad:()=>r(!0)})}):null}const fz="_root_1vii2_1",pz={root:fz};function Nu(e){const{children:t,...n}=e;return i.jsx(Sy,{className:pz.root,...n,children:t})}const hz="_paper_1igaj_1",mz="_fill_1igaj_20",OS={paper:hz,fill:mz};function Nx(e){const{width:t,fill:n,className:r,children:o,...s}=e,l=t?{maxWidth:t}:void 0;return i.jsx(kr,{className:It(OS.paper,n&&OS.fill,r),style:l,shadow:"sm",radius:"sm",withBorder:!0,...s,children:o})}function it(e){const{children:t,...n}=e;return i.jsx(Nu,{children:i.jsx(Nx,{...n,children:t})})}function gz(e){const{url:t}=e,n=Te(),[r,o]=g.useState(),[s,l]=g.useState(),u=g.useRef(null);return g.useEffect(()=>{t&&n.download(t).then(d=>d.text().then(o)).catch(console.error)},[n,t]),g.useEffect(()=>{r&&(r.includes("<ClinicalDocument")&&r.includes('xmlns="urn:hl7-org:v3"')?l(!0):l(!1))},[r]),t?r?s?i.jsx(dz,{xml:r}):i.jsx("div",{"data-testid":"xml-display-iframe",style:{maxWidth:e.maxWidth,minHeight:400},children:i.jsx("iframe",{title:"XMLDisplay Iframe",width:"100%",height:"400",ref:u,src:t,allowFullScreen:!0,frameBorder:0,seamless:!0})}):i.jsx(it,{children:i.jsx(Vn,{children:i.jsx(Ur,{})})}):null}function Au(e){const{contentType:t,url:n,title:r}=e.value??{},o=BT(n);return o?i.jsxs("div",{"data-testid":"attachment-display",children:[(t==null?void 0:t.startsWith("image/"))&&i.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:o,alt:r}),(t==null?void 0:t.startsWith("video/"))&&i.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:i.jsx("source",{type:t,src:o})}),((t==null?void 0:t.startsWith("text/"))&&t!=="text/xml"||t==="application/json"||t==="application/pdf")&&i.jsx("div",{"data-testid":"attachment-iframe",style:{maxWidth:e.maxWidth,minHeight:400},children:i.jsx("iframe",{width:"100%",height:"400",src:o+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),t==="text/xml"&&i.jsx(gz,{url:o}),i.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:i.jsx(Rt,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:vz(r),children:r||"Download"})})]}):null}function vz(e){return e!=null&&e.includes(".")?e:void 0}const yz="_root_17n8t_1",xz="_compact_17n8t_25",LS={root:yz,compact:xz};function Ax(e){const{children:t,compact:n}=e;return i.jsx("dl",{className:It(LS.root,{[LS.compact]:n}),children:t})}function xi(e){return i.jsxs(i.Fragment,{children:[i.jsx("dt",{children:e.term}),i.jsx("dd",{children:e.children})]})}function bz(e){var r;const t=(r=e.values)==null?void 0:r.map((o,s)=>i.jsx("div",{children:i.jsx(Au,{value:o,maxWidth:e.maxWidth})},"attatchment-"+s));let n;if(e.includeDescriptionListEntry){if(e.property===void 0)throw new Error("props.property is required when includeDescriptionListEntry is true");if(!vn(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const o=e.path.split(".").pop();n=i.jsx(xi,{term:la(o),children:t})}else n=i.jsx(i.Fragment,{children:t});return n}function Mx(e){const t=Te(),n=g.useRef(null);function r(l){var u;qt(l),(u=n.current)==null||u.click()}function o(l){qt(l);const u=l.target.files;u&&Array.from(u).forEach(s)}function s(l){!l||!l.name||(e.onUploadStart&&e.onUploadStart(),t.createAttachment({data:l,contentType:l.type||"application/octet-stream",filename:l.name,securityContext:e.securityContext,onProgress:e.onUploadProgress}).then(d=>e.onUpload(d)).catch(d=>{e.onUploadError&&e.onUploadError(Bt(d))}))}return i.jsxs(i.Fragment,{children:[i.jsx("input",{disabled:e.disabled,type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:n,onChange:l=>o(l)}),e.children({onClick:r,disabled:e.disabled})]})}function wz(e){const[t,n]=g.useState(e.defaultValue??[]),r=g.useRef();r.current=t;function o(s){n(s),e.onChange&&e.onChange(s)}return i.jsxs("table",{style:{width:"100%"},children:[i.jsxs("colgroup",{children:[i.jsx("col",{width:"97%"}),i.jsx("col",{width:"3%"})]}),i.jsxs("tbody",{children:[t.map((s,l)=>i.jsxs("tr",{children:[i.jsx("td",{children:i.jsx(Au,{value:s,maxWidth:200})}),i.jsx("td",{children:i.jsx(Cn,{disabled:e.disabled,title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:u=>{qt(u);const d=t.slice();d.splice(l,1),o(d)},children:i.jsx(Nf,{})})})]},`${l}-${t.length}`)),i.jsxs("tr",{children:[i.jsx("td",{}),i.jsx("td",{children:i.jsx(Mx,{disabled:e.disabled,onUpload:s=>{o([...r.current,s])},children:s=>i.jsx(Cn,{...s,title:"Add",variant:"subtle",size:"sm",color:s.disabled?"gray":"green",children:i.jsx(Ex,{})})})})]})]})]})}function ZT(e){const[t,n]=g.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return t?i.jsxs(i.Fragment,{children:[i.jsx(Au,{value:t,maxWidth:200}),i.jsx(Pe,{disabled:e.disabled,onClick:o=>{qt(o),r(void 0)},children:"Remove"})]}):i.jsx(Mx,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:o=>i.jsx(Pe,{...o,children:"Upload..."})})}function Do(e){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 491 491",style:{width:e.size,height:e.size},children:[i.jsx("title",{children:"Medplum Logo"}),i.jsx("path",{fill:e.fill??"#ad7136",d:"M282 67c6-16 16-29 29-40L289 0c-22 17-37 41-43 68l17 23 19-24z"}),i.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"}),i.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"}),i.jsx("path",{fill:e.fill??"#40bc26",d:"M207 220a176 176 0 01-177 43A176 176 0 01251 43l1 5c17 59 2 125-45 172z"}),i.jsx("path",{fill:e.fill??"#33961e",d:"M252 48A421 421 0 0057 270l-27-7A176 176 0 01251 43l1 5z"})]})}function Ct(e,t){var n,r,o;return(o=(r=(n=e==null?void 0:e.issue)==null?void 0:n.filter(s=>{var l;return eP((l=s.expression)==null?void 0:l[0],t)}))==null?void 0:r.map(s=>{var l;return(l=s.details)==null?void 0:l.text}))==null?void 0:o.join(`
|
|
540
|
-
`)}function Mu(e,t){var n;return(n=e==null?void 0:e.issue)==null?void 0:n.filter(r=>{var o;return eP((o=r.expression)==null?void 0:o[0],t)})}const nf=/\[\d+\]/;function eP(e,t){const n=typeof e=="string"&&nf.test(e),r=typeof t=="string"&&nf.test(t);if(n!==r&&(e=e==null?void 0:e.replace(nf,""),t=t==null?void 0:t.replace(nf,"")),e===t)return!0;if(!e||!t)return!1;const o=e.indexOf(".");if(o>=0&&e.substring(o+1)===t)return!0;const s=t.indexOf(".");return s>=0&&t.substring(s+1)===e}function tP(e){const t=Te(),[n,r]=g.useState();return i.jsxs(yt,{onSubmit:async o=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:o.projectName}))}catch(s){r(Bt(s))}},children:[i.jsxs(Vn,{style:{flexDirection:"column"},children:[i.jsx(Do,{size:32}),i.jsx(ze,{children:"Create project"})]}),i.jsxs(tt,{gap:"xl",children:[i.jsx(Fe,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:Ct(n,"projectName")}),i.jsxs($e,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",i.jsx(Rt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",i.jsx(Rt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),i.jsx(be,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:i.jsx(Pe,{type:"submit",children:"Create project"})})]})}function nP(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 rP(e){const t=Te(),{googleClientId:n,handleGoogleCredential:r}=e,o=g.useRef(null),[s,l]=g.useState(typeof google<"u"),[u,d]=g.useState(!1),[p,h]=g.useState(!1);return g.useEffect(()=>{if(typeof google>"u"){nP("https://accounts.google.com/gsi/client",()=>l(!0));return}u||(google.accounts.id.initialize({client_id:n,callback:r}),d(!0)),o.current&&!p&&(google.accounts.id.renderButton(o.current,{}),h(!0))},[t,n,u,s,o,p,r]),n?i.jsx("div",{ref:o}):null}function oP(e){if(e)return e;if(typeof window<"u"){const t=window.location.protocol+"//"+window.location.host;if([].includes(t))return"__GOOGLE_CLIENT_ID__"}}function ao(e){var n;const t=((n=e.outcome)==null?void 0:n.issue)||e.issues;return!t||t.length===0?null:i.jsx(xs,{icon:i.jsx(Xl,{size:16}),color:"red",children:t.map(r=>{var o;return i.jsx("div",{"data-testid":"text-field-error",children:Xk(r)},(o=r.details)==null?void 0:o.text)})})}function iP(e){typeof grecaptcha>"u"&&nP("https://www.google.com/recaptcha/api.js?render="+e)}function sP(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function Sz(e){const t=oP(e.googleClientId),n=e.recaptchaSiteKey,r=Te(),[o,s]=g.useState(),l=Mu(o,void 0);return g.useEffect(()=>{n&&iP(n)},[n]),i.jsxs(yt,{onSubmit:async u=>{try{let d="";n&&(d=await sP(n)),e.handleAuthResponse(await r.startNewUser({projectId:e.projectId,clientId:e.clientId,firstName:u.firstName,lastName:u.lastName,email:u.email,password:u.password,remember:u.remember==="true",recaptchaSiteKey:n,recaptchaToken:d}))}catch(d){s(Bt(d))}},children:[i.jsx(Vn,{style:{flexDirection:"column"},children:e.children}),i.jsx(ao,{issues:l}),t&&i.jsxs(i.Fragment,{children:[i.jsx(be,{justify:"center",p:"xl",style:{height:70},children:i.jsx(rP,{googleClientId:t,handleGoogleCredential:async u=>{try{e.handleAuthResponse(await r.startGoogleLogin({googleClientId:u.clientId,googleCredential:u.credential,projectId:e.projectId,createUser:!0}))}catch(d){s(Bt(d))}}})}),i.jsx(Dn,{label:"or",labelPosition:"center",my:"lg"})]}),i.jsxs(tt,{gap:"xl",children:[i.jsx(Fe,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:Ct(o,"firstName")}),i.jsx(Fe,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:Ct(o,"lastName")}),i.jsx(Fe,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:Ct(o,"email")}),i.jsx(Co,{name:"password",label:"Password",autoComplete:"off",required:!0,error:Ct(o,"password")}),i.jsxs($e,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",i.jsx(Rt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",i.jsx(Rt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),i.jsxs($e,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",i.jsx(Rt,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",i.jsx(Rt,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),i.jsxs(be,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[i.jsx(rr,{name:"remember",label:"Remember me",size:"xs"}),i.jsx(Pe,{type:"submit",children:"Create account"})]})]})}function jz(e){const{type:t,projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:s,onSuccess:l}=e,u=Te(),[d,p]=g.useState(),[h,m]=g.useState();g.useEffect(()=>{t==="patient"&&d&&u.startNewPatient({login:d,projectId:n}).then(x=>u.processCode(x.code)).then(()=>l()).catch(x=>m(Bt(x)))},[u,t,n,d,l]);function y(x){x.code?u.processCode(x.code).then(()=>l()).catch(console.log):x.login&&p(x.login)}return i.jsxs(it,{width:450,children:[h&&i.jsx("pre",{children:JSON.stringify(h,null,2)}),!d&&i.jsx(Sz,{projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:s,handleAuthResponse:y,children:e.children}),d&&t==="project"&&i.jsx(tP,{login:d,handleAuthResponse:y})]})}function Cz(e){const[t,n]=g.useState();return t?i.jsx(kz,{email:t,...e}):i.jsx(Ez,{setEmail:n,...e})}function Ez(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:o,disableEmailAuth:s,...l}=e,u=Te(),d=!e.disableGoogleAuth&&oP(e.googleClientId),[p,h]=g.useState(),m=Mu(p,void 0),y=g.useCallback(async w=>{if(!w.authorizeUrl)return!1;const j=JSON.stringify({...await u.ensureCodeChallenge(l),domain:w.domain}),T=new URL(w.authorizeUrl);return T.searchParams.set("state",j),window.location.assign(T.toString()),!0},[u,l]),x=g.useCallback(async w=>{const j=await u.post("auth/method",{email:w.email});await y(j)||t(w.email)},[u,y,t]),b=g.useCallback(async w=>{try{const j=await u.startGoogleLogin({...l,googleCredential:w.credential});await y(j)||r(j)}catch(j){h(Bt(j))}},[u,l,y,r]);return i.jsxs(yt,{onSubmit:x,children:[i.jsx(Vn,{style:{flexDirection:"column"},children:o}),i.jsx(ao,{issues:m}),d&&i.jsxs(i.Fragment,{children:[i.jsx(be,{justify:"center",p:"xl",style:{height:70},children:i.jsx(rP,{googleClientId:d,handleGoogleCredential:b})}),!s&&i.jsx(Dn,{label:"or",labelPosition:"center",my:"lg"})]}),!s&&i.jsx(Fe,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:Ct(p,"email")}),i.jsxs(be,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[i.jsx("div",{children:n&&i.jsx(Rt,{component:"button",type:"button",color:"dimmed",onClick:n,size:"xs",children:"Register"})}),!s&&i.jsx(Pe,{type:"submit",children:"Next"})]})]})}function kz(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...o}=e,s=Te(),[l,u]=g.useState(),d=Mu(l,void 0),p=g.useCallback(h=>{s.startLogin({...o,password:h.password,remember:h.remember==="on"}).then(n).catch(m=>u(Bt(m)))},[s,o,n]);return i.jsxs(yt,{onSubmit:p,children:[i.jsx(Vn,{style:{flexDirection:"column"},children:r}),i.jsx(ao,{issues:d}),i.jsx(tt,{gap:"xl",children:i.jsx(Co,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:Ct(l,"password")})}),i.jsxs(be,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&i.jsx(Rt,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),i.jsx(rr,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),i.jsx(Pe,{type:"submit",children:"Sign in"})]})]})}function Tz(e){const t=Te(),n=yu(),[r,o]=g.useState(""),[s,l]=g.useState();function u(m){var y;return!!((y=m==null?void 0:m.toLowerCase())!=null&&y.includes(r.toLowerCase()))}function d(m){var y,x;return u((y=m.profile)==null?void 0:y.display)||u((x=m.project)==null?void 0:x.display)}function p(m){t.post("auth/profile",{login:e.login,profile:m}).then(e.handleAuthResponse).catch(y=>l(Bt(y)))}const h=e.memberships.filter(d).slice(0,10).map(m=>i.jsx(st.Option,{value:m.id,children:i.jsx(Pz,{...m})},m.id));return i.jsxs(tt,{children:[i.jsxs(oa,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[i.jsx(Do,{size:32}),i.jsx(ze,{order:3,children:"Choose profile"})]}),i.jsx(ao,{outcome:s}),i.jsxs(st,{store:n,onOptionSubmit:p,children:[i.jsx(st.EventsTarget,{children:i.jsx(Fe,{placeholder:"Search",value:r,onChange:m=>{o(m.currentTarget.value),n.updateSelectedOptionIndex()}})}),i.jsx("div",{children:i.jsx(st.Options,{children:h.length>0?h:i.jsx(st.Empty,{children:"Nothing found..."})})})]})]})}function Pz(e){var t,n;return i.jsxs(be,{children:[i.jsx(ia,{radius:"xl"}),i.jsxs("div",{children:[i.jsx($e,{fz:"sm",fw:500,children:(t=e.profile)==null?void 0:t.display}),i.jsx($e,{fz:"xs",opacity:.6,children:(n=e.project)==null?void 0:n.display})]})]})}function Rz(e){const t=Te();return i.jsx(yt,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:i.jsxs(tt,{children:[i.jsxs(Vn,{style:{flexDirection:"column"},children:[i.jsx(Do,{size:32}),i.jsx(ze,{children:"Choose scope"})]}),i.jsx(tt,{children:(e.scope??"openid").split(" ").map(n=>i.jsx(rr,{id:n,name:n,label:n,defaultChecked:!0},n))}),i.jsx(be,{justify:"flex-end",mt:"xl",children:i.jsx(Pe,{type:"submit",children:"Set scope"})})]})})}function aP(e){const[t,n]=g.useState();return i.jsx(yt,{onSubmit:r=>{n(void 0),e.onSubmit(r).catch(o=>n(Ze(o)))},children:i.jsxs(tt,{children:[i.jsxs(Vn,{style:{flexDirection:"column"},children:[i.jsx(Do,{size:32}),i.jsx(ze,{children:"Enter MFA code"})]}),t&&i.jsx(xs,{icon:i.jsx(Xl,{size:16}),title:"Error",color:"red",children:t}),i.jsx(tt,{children:i.jsx(Fe,{name:"token",label:"MFA code",required:!0,autoFocus:!0})}),i.jsx(be,{justify:"flex-end",mt:"xl",children:i.jsx(Pe,{type:"submit",children:"Submit code"})})]})})}function lP(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:o,onRegister:s,onCode:l,...u}=e,d=Te(),[p,h]=g.useState(),m=g.useRef(!1),[y,x]=g.useState(!1),[b,w]=g.useState(),j=g.useCallback(k=>{l?l(k):d.processCode(k).then(()=>{r&&r()}).catch(E=>Ie({color:"red",message:Ze(E)}))},[d,l,r]),T=g.useCallback(k=>{x(!!k.mfaRequired),k.login&&h(k.login),k.memberships&&w(k.memberships),k.code&&(n?w(void 0):j(k.code))},[n,j]),P=g.useCallback(k=>{j(k.code)},[j]);return g.useEffect(()=>{t&&!m.current&&!p&&(m.current=!0,d.get("auth/login/"+t).then(T).catch(k=>Ie({color:"red",message:Ze(k)})))},[d,t,m,p,T]),i.jsx(it,{width:450,px:"sm",py:"md",children:p?y?i.jsx(aP,{onSubmit:async k=>{const E=await d.post("auth/mfa/verify",{login:p,token:k.token});T(E)}}):b?i.jsx(Tz,{login:p,memberships:b,handleAuthResponse:T}):e.projectId==="new"?i.jsx(tP,{login:p,handleAuthResponse:T}):e.chooseScopes?i.jsx(Rz,{login:p,scope:e.scope,handleAuthResponse:P}):i.jsx("div",{children:"Success"}):i.jsx(Cz,{onForgotPassword:o,onRegister:s,handleAuthResponse:T,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...u,children:e.children})})}function Ko(e){return i.jsx(i.Fragment,{children:ms(e.value)})}function _z(e){return i.jsx(i.Fragment,{children:_u(e.value)})}function cP(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("]")),i.jsx(i.Fragment,{children:n.join("").trim()})}function Dz(e){var n;const t=e.value;return t?i.jsxs(i.Fragment,{children:[t.name,t.name&&": ",(n=t.telecom)==null?void 0:n.map(r=>i.jsx(cP,{value:r},`telecom-${t.name}-${r.value}`))]}):null}function Iz(e){var t,n;return i.jsxs("div",{children:[(t=e.value)==null?void 0:t.system,": ",(n=e.value)==null?void 0:n.value]})}function Nz(e){return i.jsx(i.Fragment,{children:i7(e.value)})}function lu(e){return i.jsx(i.Fragment,{children:mi(e.value)})}function Ox(e){return i.jsx(i.Fragment,{children:su(e.value)})}function Az(e){const t=e.value;return t?i.jsxs(i.Fragment,{children:[i.jsx(lu,{value:t.numerator})," / ",i.jsx(lu,{value:t.denominator})]}):null}function Mf(e){if(!e.value)return null;const t=e.value.display||e.value.reference||To(e.value);return e.link!==!1&&e.value.reference?i.jsx(xt,{to:e.value,children:t}):i.jsx(i.Fragment,{children:t})}function uP(e,t,n,r){if(!vn(n==null?void 0:n.slices))return[e];const o=new Array(t.length+1);for(let s=0;s<o.length;s++)o[s]=[];for(const s of e){const l=$T(s,t,n.discriminator,r);let u=l?t.findIndex(d=>d.name===l):-1;u===-1&&(u=t.length),o[u].push(s)}return o}async function dP({medplum:e,property:t}){return new Promise((n,r)=>{var u,d;if(!t.slicing){n([]);return}const o=[],s=[],l=[];for(const p of t.slicing.slices){if(!LT(p)){console.debug("Unsupported slice definition",p);continue}let h;vn(p.elements)||(h=(d=(u=p.type[0])==null?void 0:u.profile)==null?void 0:d[0]),o.push(p),s.push(h),h&&l.push(e.requestProfileSchema(h))}Promise.all(l).then(()=>{for(let p=0;p<o.length;p++){const h=o[p],m=s[p];if(m){const y=Gl(m);h.typeSchema=y}}n(o)}).catch(r)})}function Bp(e,t,n){return t!==void 0?i.jsx(e,{value:t,children:n}):n}function Mz(e){var l,u;const{slice:t,property:n}=e,r=((l=t.typeSchema)==null?void 0:l.elements)??t.elements,o=g.useContext(Qt),s=g.useMemo(()=>{var d;if(vn(r))return _l({parentContext:o,elements:r,path:e.path,profileUrl:(d=t.typeSchema)==null?void 0:d.url})},[o,e.path,(u=t.typeSchema)==null?void 0:u.url,r]);return Bp(Qt.Provider,s,i.jsx(i.Fragment,{children:e.value.map((d,p)=>i.jsx("div",{children:i.jsx(Po,{property:n,path:e.path,arrayElement:!0,elementDefinitionType:t.type[0],propertyType:t.type[0].code,value:d,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${p}-${e.value.length}`))}))}function Oz(e){var b;const{property:t,propertyType:n}=e,r=Te(),o=g.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[s,l]=g.useState(!0),[u,d]=g.useState([]),[p,h]=g.useState(()=>[o]),m=g.useContext(Qt);if(g.useEffect(()=>{dP({medplum:r,property:t}).then(w=>{d(w);const j=uP(o,w,t.slicing,m.profileUrl);h(j),l(!1)}).catch(w=>{console.error(w),l(!1)})},[r,t,m.profileUrl,h,o]),s)return i.jsx("div",{children:"Loading..."});let y;if(((b=t.type[0])==null?void 0:b.code)!=="Extension"){const w=p[u.length],j=w.map((T,P)=>i.jsx("div",{children:i.jsx(Po,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:T,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${P}-${w.length}`));if(e.includeDescriptionListEntry){if(!vn(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const T=e.path.split(".").pop();y=i.jsx(xi,{term:la(T),children:j})}else y=i.jsx(i.Fragment,{children:j})}return i.jsxs(i.Fragment,{children:[u.map((w,j)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let T=i.jsx(Mz,{path:e.path,slice:w,property:t,value:p[j],ignoreMissingValues:e.ignoreMissingValues,link:e.link},w.name);return e.includeDescriptionListEntry&&(T=i.jsx(xi,{term:la(w.name),children:T},w.name)),T}),y]})}function Ou(e,t,n){const r=Pl(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 Lz(e,t,n){const r=rT(e,t,n);return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function $z(e){const{elementDefinitionType:t}=e,n=Te(),r=g.useContext(Qt),[o,s]=g.useState(tT("Extension")),l=g.useMemo(()=>{if(vn(t==null?void 0:t.profile))return t.profile[0]},[t]),[u,d]=g.useState(l!==void 0);if(g.useEffect(()=>{l&&(d(!0),n.requestProfileSchema(l).then(()=>{const m=Gl(l);d(!1),m&&s(m)}).catch(m=>{d(!1),console.warn(m)}))},[n,l]),l&&(u||!sx(l)))return i.jsx("div",{children:"Loading..."});const p=o.elements["value[x]"];if((p==null?void 0:p.max)!==0){const[m,y]=Ou({type:"Extension",value:e.value},"value[x]",l??r.profileUrl);return i.jsx(Po,{propertyType:y,value:m})}return i.jsx(Of,{path:e.path,value:{type:o.type,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:l})}function Po(e){var s;const{property:t,propertyType:n,value:r}=e;if((s=t==null?void 0:t.path)==null?void 0:s.endsWith(".id"))return i.jsxs(se,{component:"div",style:{display:"flex",gap:3,alignItems:"center"},children:[r,!yn(r)&&i.jsx(nk,{value:r,timeout:2e3,children:({copied:l,copy:u})=>i.jsx(wa,{label:l?"Copied":"Copy",withArrow:!0,position:"right",children:i.jsx(Cn,{variant:"subtle",color:l?"teal":"gray",onClick:u,children:l?i.jsx(Ss,{size:"1rem"}):i.jsx(HT,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===re.Attachment?i.jsx(bz,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):i.jsx(Oz,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case re.boolean:return i.jsx(i.Fragment,{children:r===void 0?"":(!!r).toString()});case re.SystemString:case re.string:return i.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case re.code:case re.date:case re.decimal:case re.id:case re.integer:case re.positiveInt:case re.unsignedInt:case re.uri:case re.url:return i.jsx(i.Fragment,{children:r});case re.canonical:return i.jsx(Mf,{value:{reference:r},link:e.link});case re.dateTime:case re.instant:return i.jsx(i.Fragment,{children:pr(r)});case re.markdown:return i.jsx("pre",{children:r});case re.Address:return i.jsx(SF,{value:r});case re.Annotation:return i.jsx(i.Fragment,{children:r==null?void 0:r.text});case re.Attachment:return i.jsx(Au,{value:r,maxWidth:e.maxWidth});case re.CodeableConcept:return i.jsx(Ko,{value:r});case re.Coding:return i.jsx(_z,{value:r});case re.ContactDetail:return i.jsx(Dz,{value:r});case re.ContactPoint:return i.jsx(cP,{value:r});case re.HumanName:return i.jsx(Rx,{value:r});case re.Identifier:return i.jsx(Iz,{value:r});case re.Money:return i.jsx(Nz,{value:r});case re.Period:return i.jsx(i.Fragment,{children:e7(r)});case re.Quantity:case re.Duration:return i.jsx(lu,{value:r});case re.Range:return i.jsx(Ox,{value:r});case re.Ratio:return i.jsx(Az,{value:r});case re.Reference:return i.jsx(Mf,{value:r,link:e.link});case re.Timing:return i.jsx(i.Fragment,{children:vT(r)});case re.Dosage:case re.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return i.jsx(Of,{path:e.path,value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});case re.Extension:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return i.jsx($z,{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 i.jsx(Of,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}const fP=["extension","modifierExtension"],Fz=VT.filter(e=>!fP.includes(e));function Of(e){const t=e.value,{value:n,type:r}=t,o=g.useContext(Qt),s=e.profileUrl??(o==null?void 0:o.profileUrl),l=g.useMemo(()=>Np(r,s),[s,r]),u=g.useMemo(()=>{if(l)return _l({parentContext:o,elements:l.elements,path:e.path,profileUrl:l.url,accessPolicyResource:e.accessPolicyResource})},[l,o,e.path,e.accessPolicyResource]);if(yn(n))return null;if(!l)return i.jsxs("div",{children:[r," not implemented"]});if(typeof n=="object"&&"name"in n&&Object.keys(n).length===1&&typeof n.name=="string")return i.jsx("div",{children:n.name});const d=u??o;return Bp(Qt.Provider,u,i.jsx(Ax,{compact:e.compact,children:Object.entries(d.elements).map(([p,h])=>{var w;if(fP.includes(p)&&yn((w=h.slicing)==null?void 0:w.slices))return null;if(Fz.includes(p))return null;if(WT.includes(p)&&h.path.split(".").length===2||p.includes("."))return null;const[m,y]=Ou(t,p,d.profileUrl);if((e.ignoreMissingValues||h.max===0)&&yn(m)||e.path.endsWith(".extension")&&(p==="url"||p==="id"))return null;const x=h.max>1||h.isArray,b=i.jsx(Po,{property:h,propertyType:y,path:e.path+"."+p,value:m,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:x,link:e.link},p);return x?b:i.jsx(xi,{term:la(p),children:b},p)})}))}const pP="Read Only";function hP(e,t){return e?i.jsx(wa.Floating,{label:e,children:t}):t}const zz="_dimmed_t0nld_1",Bz="_preserveBreaks_t0nld_5",nv={dimmed:zz,preserveBreaks:Bz};function mP(e){const{debugMode:t}=g.useContext(Qt);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,hP(e!=null&&e.readonly?pP:void 0,i.jsxs(be,{wrap:"nowrap","data-testid":e.testId,children:[i.jsx("div",{children:e.children}),i.jsx("div",{children:i.jsx(pn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e!=null&&e.readonly?nv.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function Wt(e){const{debugMode:t}=g.useContext(Qt);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,hP(e!=null&&e.readonly?pP:void 0,i.jsx(pn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:It({[nv.dimmed]:e==null?void 0:e.readonly},nv.preserveBreaks)},description:e.description,withAsterisk:e.withAsterisk,error:Ct(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function gP(e,t,n,r,o){const s=r.type;if(s.length>1)for(const l of s){const u=t.replace("[x]",Ln(l.code));u in e&&delete e[u]}return e[n]=o,e}function Uz(e){return!!e&&!yn(e.url)&&!yn(e.name)}function Vz(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:o,path:s,valuePath:l,...u}=e,[d,p]=g.useState(t);function h(m){const y=Hz(m);p(y),n&&n(y)}return i.jsx(Dx,{defaultValue:d&&Wz(d),onChange:h,withHelpText:r??!0,...u})}function Wz(e){var t;return(t=e.coding)==null?void 0:t.map(n=>({system:n.system,code:n.code,display:n.display}))}function Hz(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function vP(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[s,l]=g.useState(t);function u(d){const p=d[0],h=p&&Gz(p);l(h),n&&n(h)}return i.jsx(Dx,{defaultValue:s&&qz(s),maxValues:1,onChange:u,withHelpText:r??!0,...o})}function qz(e){return{system:e.system,code:e.code,display:e.display}}function Gz(e){return{system:e.system,code:e.code,display:e.display}}function yP(e){const{path:t,outcome:n}=e,{elementsByPath:r,getExtendedProps:o}=g.useContext(Qt),[s,l]=g.useState(e.defaultValue),u=g.useRef();u.current=s;const[d,p,h]=g.useMemo(()=>["system","use","value"].map(k=>r[t+"."+k]),[r,t]),[m,y,x]=g.useMemo(()=>["system","use","value"].map(k=>o(t+"."+k)),[o,t]);function b(k){k&&Object.keys(k).length===0&&(k=void 0),l(k),e.onChange&&e.onChange(k)}function w(k){const E={...u.current,system:k};k||delete E.system,b(E)}function j(k){const E={...u.current,use:k};k||delete E.use,b(E)}function T(k){const E={...u.current,value:k};k||delete E.value,b(E)}const P=e.valuePath??t;return i.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[i.jsx(Zt,{disabled:e.disabled||(m==null?void 0:m.readonly),"data-testid":"system",defaultValue:s==null?void 0:s.system,required:((d==null?void 0:d.min)??0)>0,onChange:k=>w(k.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:Ct(n,P+".system")}),i.jsx(Zt,{disabled:e.disabled||(y==null?void 0:y.readonly),"data-testid":"use",defaultValue:s==null?void 0:s.use,required:((p==null?void 0:p.min)??0)>0,onChange:k=>j(k.currentTarget.value),data:["","home","work","temp","old","mobile"],error:Ct(n,P+".use")}),i.jsx(Fe,{disabled:e.disabled||(x==null?void 0:x.readonly),placeholder:"Value",defaultValue:s==null?void 0:s.value,required:((h==null?void 0:h.min)??0)>0,onChange:k=>T(k.currentTarget.value),error:Ct(n,P+".value")})]})}function Qz(e){var h;const[t,n]=g.useState(e.defaultValue),r=g.useRef();r.current=t;const{getExtendedProps:o}=g.useContext(Qt),[s,l]=g.useMemo(()=>["name","telecom"].map(m=>o(e.path+"."+m)),[o,e.path]);function u(m){n(m),e.onChange&&e.onChange(m)}function d(m){const y={...r.current,name:m};m||delete y.name,u(y)}function p(m){const y={...r.current,telecom:m&&[m]};m||delete y.telecom,u(y)}return i.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",children:[i.jsx(Fe,{disabled:e.disabled||(s==null?void 0:s.readonly),"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t==null?void 0:t.name,onChange:m=>d(m.currentTarget.value)}),i.jsx(yP,{disabled:e.disabled||(l==null?void 0:l.readonly),name:e.name+"-telecom",path:e.path+".telecom",defaultValue:(h=t==null?void 0:t.telecom)==null?void 0:h[0],onChange:p,outcome:e.outcome})]})}function Kz(e){if(!e)return"";const t=new Date(e);return Ap(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function xP(e){if(!e)return"";const t=new Date(e);return Ap(t)?t.toISOString():""}function ua(e){return i.jsx(Fe,{id:e.name,name:e.name,label:e.label,"data-autofocus":e.autoFocus,"data-testid":e["data-testid"]??e.name,placeholder:e.placeholder,required:e.required,disabled:e.disabled,type:Yz(),defaultValue:Kz(e.defaultValue),autoFocus:e.autoFocus,error:Ct(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(xP(n))}}})}function Yz(){return"datetime-local"}function Xz(e){const{propertyType:t}=e,n=Te(),r=g.useMemo(()=>{if(vn(t.profile))return t.profile[0]},[t]),[o,s]=g.useState(r!==void 0);return g.useEffect(()=>{r&&(s(!0),n.requestProfileSchema(r).then(()=>s(!1)).catch(l=>{s(!1),console.warn(l)}))},[n,r]),r&&(o||!sx(r))?i.jsx("div",{children:"Loading..."}):i.jsx(zx,{profileUrl:r,path:e.path,typeName:"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function Jz(e){var P,k,E;const{outcome:t,path:n}=e,[r,o]=g.useState(e.defaultValue),{getExtendedProps:s}=g.useContext(Qt),[l,u,d,p,h]=g.useMemo(()=>["use","prefix","given","family","suffix"].map(_=>s(e.path+"."+_)),[s,e.path]);function m(_){o(_),e.onChange&&e.onChange(_)}function y(_){m({...r,use:_||void 0})}function x(_){m({...r,prefix:_?_.split(" "):void 0})}function b(_){m({...r,given:_?_.split(" "):void 0})}function w(_){m({...r,family:_||void 0})}function j(_){m({...r,suffix:_?_.split(" "):void 0})}const T=e.valuePath??n;return i.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",children:[i.jsx(Zt,{disabled:e.disabled||(l==null?void 0:l.readonly),defaultValue:r==null?void 0:r.use,name:e.name+"-use","data-testid":"use",onChange:_=>y(_.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:Ct(t,T+".use")}),i.jsx(Fe,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(P=r==null?void 0:r.prefix)==null?void 0:P.join(" "),onChange:_=>x(_.currentTarget.value),error:Ct(t,T+".prefix")}),i.jsx(Fe,{disabled:e.disabled||(d==null?void 0:d.readonly),placeholder:"Given",name:e.name+"-given",defaultValue:(k=r==null?void 0:r.given)==null?void 0:k.join(" "),onChange:_=>b(_.currentTarget.value),error:Ct(t,T+".given")}),i.jsx(Fe,{disabled:e.disabled||(p==null?void 0:p.readonly),name:e.name+"-family",placeholder:"Family",defaultValue:r==null?void 0:r.family,onChange:_=>w(_.currentTarget.value),error:Ct(t,T+".family")}),i.jsx(Fe,{disabled:e.disabled||(h==null?void 0:h.readonly),placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(E=r==null?void 0:r.suffix)==null?void 0:E.join(" "),onChange:_=>j(_.currentTarget.value),error:Ct(t,T+".suffix")})]})}function Zz(e){const[t,n]=g.useState(e.defaultValue),{elementsByPath:r,getExtendedProps:o}=g.useContext(Qt),[s,l]=g.useMemo(()=>["system","value"].map(m=>r[e.path+"."+m]),[r,e.path]),[u,d]=g.useMemo(()=>["system","value"].map(m=>o(e.path+"."+m)),[o,e.path]);function p(m){n(m),e.onChange&&e.onChange(m)}const h=e.valuePath??e.path;return i.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[i.jsx(Fe,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"System",required:((s==null?void 0:s.min)??0)>0,defaultValue:t==null?void 0:t.system,onChange:m=>p({...t,system:m.currentTarget.value}),error:Ct(e.outcome,h+".system")}),i.jsx(Fe,{disabled:e.disabled||(d==null?void 0:d.readonly),placeholder:"Value",required:((l==null?void 0:l.min)??0)>0,defaultValue:t==null?void 0:t.value,onChange:m=>p({...t,value:m.currentTarget.value}),error:Ct(e.outcome,h+".value")})]})}const eB=["USD","EUR","CAD","GBP","AUD"];function tB(e){var m;const{onChange:t}=e,[n,r]=g.useState(e.defaultValue),{getExtendedProps:o}=g.useContext(Qt),[s,l]=g.useMemo(()=>["currency","value"].map(y=>o(e.path+"."+y)),[o,e.path]),u=g.useCallback(y=>{r(y),t&&t(y)},[t]),d=g.useCallback(y=>{u({...n,currency:y.currentTarget.value})},[n,u]),p=g.useCallback(y=>{u({...n,value:y.currentTarget.valueAsNumber})},[n,u]),h=i.jsx(Zt,{disabled:e.disabled||(s==null?void 0:s.readonly),defaultValue:n==null?void 0:n.currency,data:eB,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:d});return i.jsx(Fe,{disabled:e.disabled||(l==null?void 0:l.readonly),type:"number",name:e.name,label:e.label,placeholder:e.placeholder??"Value",defaultValue:((m=n==null?void 0:n.value)==null?void 0:m.toString())??"USD",leftSection:i.jsx(UF,{size:14}),rightSection:h,rightSectionWidth:92,onChange:p})}function nB(e){const[t,n]=g.useState(e.defaultValue),{getExtendedProps:r}=g.useContext(Qt),[o,s]=g.useMemo(()=>["start","end"].map(u=>r(e.path+"."+u)),[r,e.path]);function l(u){n(u),e.onChange&&e.onChange(u)}return i.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",children:[i.jsx(ua,{disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:u=>l({...t,start:u})}),i.jsx(ua,{disabled:e.disabled||(s==null?void 0:s.readonly),name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:u=>l({...t,end:u})})]})}function da(e){const[t,n]=g.useState(e.defaultValue),{getExtendedProps:r}=g.useContext(Qt),[o,s,l]=g.useMemo(()=>["comparator","value","unit"].map(d=>r(e.path+"."+d)),[r,e.path]);function u(d){n(d),e.onChange&&e.onChange(d)}return i.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",children:[i.jsx(Zt,{disabled:e.disabled||(o==null?void 0:o.readonly),style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t==null?void 0:t.comparator,data:["","<","<=",">=",">"],onChange:d=>u({...t,comparator:d.currentTarget.value})}),i.jsx(Fe,{disabled:e.disabled||(s==null?void 0:s.readonly),id:e.name,name:e.name,required:e.required,"data-autofocus":e.autoFocus,"data-testid":e.name+"-value",type:"number",placeholder:"Value",defaultValue:t==null?void 0:t.value,autoFocus:e.autoFocus,step:"any",onWheel:d=>{e.disableWheel&&d.currentTarget.blur()},onChange:d=>{u({...t,value:rB(d.currentTarget.value)})}}),i.jsx(Fe,{disabled:e.disabled||(l==null?void 0:l.readonly),placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:d=>u({...t,unit:d.currentTarget.value})})]})}function rB(e){if(e)return parseFloat(e)}function Lx(e){const[t,n]=g.useState(e.defaultValue),{getExtendedProps:r}=g.useContext(Qt),[o,s]=g.useMemo(()=>["low","high"].map(u=>r(e.path+"."+u)),[r,e.path]);function l(u){n(u),e.onChange&&e.onChange(u)}return i.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",children:[i.jsx(da,{path:e.path+".low",disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:u=>l({...t,low:u})}),i.jsx(da,{path:e.path+".high",disabled:e.disabled||(s==null?void 0:s.readonly),name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:u=>l({...t,high:u})})]})}function oB(e){const[t,n]=g.useState(e.defaultValue),{getExtendedProps:r}=g.useContext(Qt),[o,s]=g.useMemo(()=>["numerator","denominator"].map(u=>r(e.path+"."+u)),[r,e.path]);function l(u){n(u),e.onChange&&e.onChange(u)}return i.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",children:[i.jsx(da,{path:e.path+".numerator",disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:u=>l({...t,numerator:u})}),i.jsx(da,{path:e.path+".denominator",disabled:e.disabled||(s==null?void 0:s.readonly),name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:u=>l({...t,denominator:u})})]})}const iB={Device:"device-name",Observation:"code",Subscription:"criteria",User:"email:contains"},sB=["AccessPolicy","Account","ActivityDefinition","Bot","CapabilityStatement","CareTeam","ClientApplication","CodeSystem","CompartmentDefinition","ConceptMap","EffectEvidenceSynthesis","Endpoint","EventDefinition","Evidence","EvidenceVariable","ExampleScenario","GraphDefinition","Group","HealthcareService","ImplementationGuide","InsurancePlan","Library","Location","Measure","MedicinalProduct","MessageDefinition","NamingSystem","OperationDefinition","Organization","Patient","Person","PlanDefinition","Practitioner","Project","Questionnaire","RelatedPerson","ResearchDefinition","ResearchElementDefinition","ResearchStudy","RiskEvidenceSynthesis","SearchParameter","StructureDefinition","StructureMap","TerminologyCapabilities","TestScript","UserConfiguration","ValueSet"];function aB(e){return{value:Ot(e),label:Ei(e),resource:e}}function ka(e){const t=Te(),{resourceType:n,searchCriteria:r}=e,[o,s]=g.useState(),l=Kt(e.defaultValue,s),u=e.itemComponent??lB,d=e.onChange,p=g.useCallback(async(m,y)=>{const x=cB(n),b=new URLSearchParams({[x]:m??"",_count:"10",...r});return await t.searchResources(n,b,{signal:y})},[t,n,r]),h=g.useCallback(m=>{d&&d(m[0])},[d]);return vn(e.defaultValue)&&!o&&!l?null:i.jsx(_x,{disabled:e.disabled,name:e.name,label:e.label,error:e.error,required:e.required,itemComponent:u,defaultValue:l,placeholder:e.placeholder,maxValues:1,toOption:aB,loadOptions:p,onChange:h,clearable:!0})}const lB=g.forwardRef(({label:e,resource:t,active:n,...r},o)=>i.jsx("div",{ref:o,...r,children:i.jsxs(be,{wrap:"nowrap",children:[i.jsx(js,{value:t}),i.jsxs("div",{children:[i.jsx($e,{children:e}),i.jsx($e,{size:"xs",c:"dimmed",children:t.birthDate||t.id})]})]})}));function cB(e){return iB[e]??(sB.includes(e)?"name":"_id")}function Up(e){const{onChange:t}=e,n=Te(),[r,o]=g.useState(e.defaultValue),[s,l]=g.useState(()=>uB(e.targetTypes)),[u,d]=g.useState(()=>dB(e.defaultValue,s)),p=g.useRef(new IT),h=g.useMemo(()=>(u==null?void 0:u.type)==="profile"?{...e.searchCriteria,_profile:u.value}:e.searchCriteria,[e.searchCriteria,u]);g.useEffect(()=>{let x=!1;const b=s==null?void 0:s.map(w=>{if(!pB(w))return Promise.resolve(w);x=!0;const j=w.value,T=p.current.get(j);if(T)return T;const P=fB(n,w.value).then(E=>{const _={...w};return E?vn(E.type)?(_.resourceType=E.type,_.name=E.name,_.title=E.title):(console.error(`StructureDefinition.type missing for ${w.value}`),_.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${w.value}`),_.error="StructureDefinition not found"),_}).catch(E=>(console.error(E),{...w,error:E})),k=new bo(P);return p.current.set(j,k),k});!b||!x||Promise.all(b).then(w=>{if(l(w),!u)return;const j=w.findIndex(T=>T.value===u.value||T.resourceType===u.resourceType);if(j===-1){console.debug(`defaultValue had unexpected resourceType: ${u.resourceType}`);return}d(w[j])}).catch(console.error)},[n,u,s]);const m=g.useCallback(x=>{const b=x?Jt(x):void 0;o(b),t&&t(b)},[t]),y=g.useMemo(()=>s?s.map(x=>({value:x.value,label:x.type==="profile"?x.title??x.name??x.resourceType??x.value:x.value})):[],[s]);return i.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",children:[s&&s.length>1&&i.jsx(Zt,{disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:u==null?void 0:u.resourceType,autoFocus:e.autoFocus,onChange:x=>{const b=x.currentTarget.value,w=s.find(j=>j.value===b);d(w)},data:y}),!s&&i.jsx(Ix,{disabled:e.disabled,autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:u==null?void 0:u.resourceType,onChange:x=>{d(x?{type:"resourceType",value:x,resourceType:x}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),i.jsx(ka,{resourceType:u==null?void 0:u.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:h,onChange:m,disabled:e.disabled})]})}function uB(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 dB(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(s=>s.resourceType===n);return o||{type:"resourceType",value:n,resourceType:n}}if(t&&t.length>0)return t[0]}async function fB(e,t){const n=Gl(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
|
|
541
|
-
StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
|
|
542
|
-
type,
|
|
543
|
-
name,
|
|
544
|
-
title,
|
|
545
|
-
}
|
|
546
|
-
}`.replace(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function pB(e){return e.type==="profile"&&!(e!=null&&e.error)&&yn(e.resourceType)}const hB="_indented_ldk1d_1",bP={indented:hB};function $x({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?i.jsx(Pe,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:i.jsx(Af,{size:"1.25rem"}),onClick:t,children:r}):i.jsx(Cn,{title:r,color:"green.6","data-testid":n,onClick:t,children:i.jsx(Af,{size:"1.25rem"})})}function wP({propertyDisplayName:e,onClick:t,testId:n}){return i.jsx(Cn,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:i.jsx(Nf,{size:"1.25rem"})})}function mB(e){var x,b;const{slice:t,property:n}=e,[r,o]=g.useState(e.defaultValue),s=((x=t.typeSchema)==null?void 0:x.elements)??t.elements,l=g.useContext(Qt),u=g.useMemo(()=>{var w;if(vn(s))return _l({parentContext:l,elements:s,path:e.path,profileUrl:(w=t.typeSchema)==null?void 0:w.url})},[l,e.path,(b=t.typeSchema)==null?void 0:b.url,s]);function d(w){o(w),e.onChange&&e.onChange(w)}const p=t.min>0,h=yn(t.elements),m=bT(t.name),y=e.property.readonly&&r.length===0;return Bp(Qt.Provider,u,i.jsx(Wt,{title:m,description:t.definition,withAsterisk:p,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:y?i.jsx($e,{c:"dimmed",children:"(empty)"}):i.jsxs(tt,{className:h?bP.indented:void 0,children:[r.map((w,j)=>i.jsxs(be,{wrap:"nowrap",children:[i.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${j}`,children:i.jsx(Fx,{elementDefinitionType:t.type[0],name:t.name,defaultValue:w,onChange:T=>{const P=[...r];P[j]=T,d(P)},outcome:e.outcome,min:t.min,max:t.max,binding:t.binding,path:e.path,valuePath:void 0,readOnly:e.property.readonly})}),!e.property.readonly&&r.length>t.min&&i.jsx(wP,{propertyDisplayName:m,testId:e.testId&&`${e.testId}-remove-${j}`,onClick:T=>{qt(T);const P=[...r];P.splice(j,1),d(P)}})]},`${j}-${r.length}`)),!e.property.readonly&&r.length<t.max&&i.jsx(be,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:i.jsx($x,{propertyDisplayName:m,onClick:w=>{qt(w);const j=[...r,void 0];d(j)},testId:e.testId&&`${e.testId}-add`})})]})}))}function gB(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}function vB(e){var P;const{property:t}=e,n=Te(),[r,o]=g.useState(!0),[s,l]=g.useState([]),[u]=g.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[d,p]=g.useState(()=>[u]),h=g.useContext(Qt),m=(P=t.type[0])==null?void 0:P.code;g.useEffect(()=>{dP({medplum:n,property:t}).then(k=>{l(k);const E=uP(u,k,t.slicing,h.profileUrl);yB(E,k),p(E),o(!1)}).catch(k=>{console.error(k),o(!1)})},[n,t,u,h.profileUrl,p]);function y(k,E){const _=[...d];if(_[E]=k,p(_),e.onChange){const R=_.flat().filter(M=>M!==void 0);e.onChange(R)}}if(r)return i.jsx("div",{children:"Loading..."});const x=s.length,b=d[x],w=!(e.hideNonSliceValues??(m==="Extension"&&s.length>0)),j=la(t.path),T=e.property.readonly&&s.length===0&&u.length===0;return i.jsxs(tt,{className:e.indent?bP.indented:void 0,children:[T&&i.jsx($e,{c:"dimmed",children:"(empty)"}),s.map((k,E)=>i.jsx(mB,{slice:k,path:e.path,valuePath:e.valuePath,property:t,defaultValue:d[E],onChange:_=>{y(_,E)},testId:`slice-${k.name}`},k.name)),w&&b.map((k,E)=>i.jsxs(be,{wrap:"nowrap",style:{flexGrow:1},children:[i.jsx("div",{style:{flexGrow:1},children:i.jsx(Jl,{arrayElement:!0,property:e.property,name:e.name+"."+E,path:e.path,valuePath:gB(e.path,e.valuePath,E),defaultValue:k,onChange:_=>{const R=[...b];R[E]=_,y(R,x)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&i.jsx(wP,{propertyDisplayName:j,testId:`nonsliced-remove-${E}`,onClick:_=>{qt(_);const R=[...b];R.splice(E,1),y(R,x)}})]},`${E}-${b.length}`)),!e.property.readonly&&w&&d.flat().length<t.max&&i.jsx(be,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:i.jsx($x,{propertyDisplayName:j,onClick:k=>{qt(k);const E=[...b];E.push(void 0),y(E,x)},testId:"nonsliced-add"})})]})}function yB(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 xB(e){const[t,n]=g.useState(!1),r=rC(),o=g.useRef(null),s={...e.styles};return t||(s.input||(s.input={}),s.input.WebkitTextSecurity="disc"),i.jsxs(oa,{gap:"xs",children:[i.jsx(ba,{...e,styles:{...s,root:{...s.root??{},flexGrow:1}},ref:o,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),i.jsx(Cn,{title:"Copy secret",onClick:()=>{var l;r.copy((l=o.current)==null?void 0:l.value),Ie({color:"green",message:"Copied"})},children:i.jsx(HT,{})})]})}const bB=["sun","mon","tue","wed","thu","fri","sat"];function wB(e){const[t,n]=g.useState(e.defaultValue),[r,o]=g.useState(!e.disabled&&(e.defaultModalOpen??!1)),s=g.useRef();return s.current=t,i.jsxs(i.Fragment,{children:[i.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",children:[i.jsx("span",{children:vT(s.current)||"No repeat"}),i.jsx(Pe,{disabled:e.disabled,onClick:()=>o(!0),children:"Edit"})]}),!e.disabled&&i.jsx(SB,{path:e.path,visible:r,defaultValue:s.current,onOk:l=>{e.onChange&&e.onChange(l),n(l),o(!1)},onCancel:()=>o(!1)})]})}const $S={repeat:{period:1,periodUnit:"d"}};function SB(e){const[t,n]=g.useState(e.defaultValue||$S),{getExtendedProps:r}=g.useContext(Qt),[o,s,l,u,d]=g.useMemo(()=>["event","repeat","repeat.period","repeat.periodUnit","repeat.dayOfWeek"].map(w=>r(e.path+"."+w)),[r,e.path]),p=g.useRef();p.current=t;function h(w){n({...p.current,event:[w]})}function m(w){n({...p.current,repeat:w})}function y(w){var j;m({...(j=p.current)==null?void 0:j.repeat,period:w})}function x(w){var j;m({...(j=p.current)==null?void 0:j.repeat,periodUnit:w})}function b(w){var j;m({...(j=p.current)==null?void 0:j.repeat,dayOfWeek:w})}return i.jsx(Nn,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:i.jsxs(tt,{children:[i.jsx(Wt,{title:"Starts on",htmlFor:"timing-dialog-start",children:i.jsx(ua,{disabled:o==null?void 0:o.readonly,name:"timing-dialog-start",onChange:w=>h(w)})}),i.jsx(Eu,{disabled:s==null?void 0:s.readonly,label:"Repeat",checked:!!t.repeat,onChange:w=>m(w.currentTarget.checked?$S.repeat:void 0)}),t.repeat&&i.jsxs(i.Fragment,{children:[i.jsx(Wt,{title:"Repeat every",htmlFor:"timing-dialog-period",children:i.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",children:[i.jsx(Fe,{disabled:l==null?void 0:l.readonly,type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:w=>y(parseInt(w.currentTarget.value,10)||1)}),i.jsx(Zt,{disabled:u==null?void 0:u.readonly,id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:w=>x(w.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"&&i.jsx(Wt,{title:"Repeat on",children:i.jsx(Zc.Group,{multiple:!0,onChange:b,children:i.jsx(be,{justify:"space-between",mt:"md",gap:"xs",children:bB.map(w=>i.jsx(Zc,{value:w,size:"xs",radius:"xl",disabled:d==null?void 0:d.readonly,children:w.charAt(0).toUpperCase()},w))})})})]}),i.jsx(be,{justify:"flex-end",children:i.jsx(Pe,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function Jl(e){var u;const{property:t,name:n,onChange:r,defaultValue:o}=e,s=e.defaultPropertyType&&e.defaultPropertyType!=="undefined"?e.defaultPropertyType:t.type[0].code,l=t.type;if((t.isArray||t.max>1)&&!e.arrayElement){if(s===re.Attachment)return i.jsx(wz,{name:n,defaultValue:o,onChange:r,disabled:t.readonly});const d=((u=l[0])==null?void 0:u.code)!==re.Extension;return i.jsx(vB,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:o,indent:d,onChange:r,outcome:e.outcome})}else return l.length>1?i.jsx(jB,{elementDefinitionTypes:l,...e}):i.jsx(Fx,{name:n,defaultValue:o,onChange:d=>{if(e.onChange){const p=e.name.replace("[x]",Ln(l[0].code));e.onChange(d,p)}},outcome:e.outcome,elementDefinitionType:l[0],min:t.min,max:t.min,binding:t.binding,path:e.path,valuePath:e.valuePath,readOnly:t.readonly})}function jB(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(s=>s.code===e.defaultPropertyType)),n||(n=t[0]);const[r,o]=g.useState(n);return i.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[i.jsx(Zt,{disabled:e.property.readonly,style:{width:"200px"},defaultValue:r.code,"data-testid":e.name&&e.name+"-selector",onChange:s=>{o(t.find(l=>l.code===s.currentTarget.value))},data:t.map(s=>({value:s.code,label:s.code}))}),i.jsx(Fx,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:s=>{e.onChange&&e.onChange(s,e.name.replace("[x]",Ln(r.code)))},min:e.property.min,max:e.property.max,binding:e.property.binding,path:e.property.path,valuePath:e.valuePath,readOnly:e.property.readonly})]})}function Fx(e){const{name:t,onChange:n,outcome:r,binding:o,path:s,valuePath:l,readOnly:u}=e,d=e.min!==void 0&&e.min>0,p=e.elementDefinitionType.code,h=g.useContext(Qt),m=g.useMemo(()=>{if(!ux(p)||!yn(e.defaultValue))return e.defaultValue;const b=Object.create(null);if(h.path===e.path)jS(b,h.elements);else{const w=ru(h.path,e.path);if(w===void 0)return e.defaultValue;jS(b,h.elements,w)}return vn(b)?b:e.defaultValue},[p,h.path,h.elements,e.path,e.defaultValue]);if(!p)return i.jsx("div",{children:"Property type not specified "});function y(){return{name:t,defaultValue:m,onChange:n,outcome:r,path:s,valuePath:l,disabled:u}}function x(){const b=Ct(e.outcome,l??s);return{id:t,name:t,"data-testid":t,defaultValue:m,required:d,error:b,disabled:u}}switch(p){case re.SystemString:case re.canonical:case re.string:case re.time:case re.uri:case re.url:return e.path==="Project.secret.value[x]"?i.jsx(xB,{...x(),onChange:b=>{e.onChange&&e.onChange(b.currentTarget.value)}}):i.jsx(Fe,{...x(),onChange:b=>{n&&n(b.currentTarget.value)}});case re.date:return i.jsx(Fe,{...x(),type:"date",onChange:b=>{n&&n(b.currentTarget.value)}});case re.dateTime:case re.instant:return i.jsx(ua,{...x(),onChange:n,outcome:r});case re.decimal:case re.integer:case re.positiveInt:case re.unsignedInt:return i.jsx(Fe,{...x(),type:"number",step:p===re.decimal?"any":"1",onChange:b=>{if(n){const w=b.currentTarget.valueAsNumber;n(Number.isNaN(w)?void 0:w)}}});case re.code:return i.jsx(JT,{...x(),error:void 0,onChange:n,binding:o==null?void 0:o.valueSet});case re.boolean:return i.jsx(rr,{...x(),defaultChecked:!!m,onChange:b=>{n&&n(b.currentTarget.checked)}});case re.base64Binary:case re.markdown:return i.jsx(ba,{...x(),spellCheck:p!==re.base64Binary,onChange:b=>{n&&n(b.currentTarget.value)}});case re.Address:return i.jsx(EF,{...y()});case re.Annotation:return i.jsx(kF,{...y()});case re.Attachment:return i.jsx(ZT,{...y()});case re.CodeableConcept:return i.jsx(Vz,{binding:o==null?void 0:o.valueSet,...y()});case re.Coding:return i.jsx(vP,{binding:o==null?void 0:o.valueSet,...y()});case re.ContactDetail:return i.jsx(Qz,{...y()});case re.ContactPoint:return i.jsx(yP,{...y()});case re.Extension:return i.jsx(Xz,{...y(),propertyType:e.elementDefinitionType});case re.HumanName:return i.jsx(Jz,{...y()});case re.Identifier:return i.jsx(Zz,{...y()});case re.Money:return i.jsx(tB,{...y()});case re.Period:return i.jsx(nB,{...y()});case re.Duration:case re.Quantity:return i.jsx(da,{...y()});case re.Range:return i.jsx(Lx,{...y()});case re.Ratio:return i.jsx(oB,{...y()});case re.Reference:return i.jsx(Up,{...y(),targetTypes:EB(e.elementDefinitionType)});case re.Timing:return i.jsx(wB,{...y()});case re.Dosage:case re.UsageContext:default:return i.jsx(zx,{...y(),typeName:p})}}const CB=[`${Dp}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function EB(e){var t;return(t=e==null?void 0:e.targetProfile)==null?void 0:t.map(n=>{const r=CB.find(o=>n.startsWith(o));return r?n.slice(r.length):n})}function kB(e){const[t,n]=g.useState(e.defaultValue??{}),r=g.useContext(Qt),o=g.useMemo(()=>CF(r.elements),[r.elements]);function s(u){n(u),e.onChange&&e.onChange(u)}const l={type:e.type,value:t};return i.jsx(tt,{style:{flexGrow:1},"data-testid":e.testId,children:o.map(([u,d])=>{const[p,h]=Lz(l,u,d),m=d.min!==void 0&&d.min>0,y=e.valuePath?e.valuePath+"."+u:void 0,x=i.jsx(Jl,{property:d,name:u,path:e.path+"."+u,valuePath:y,defaultValue:p,defaultPropertyType:h,onChange:(b,w)=>{s(gP({...t},u,w??u,d,b))},outcome:e.outcome},u);return e.type==="Extension"||jx.includes(u)?x:d.type.length===1&&d.type[0].code==="boolean"?i.jsx(mP,{title:la(u),description:d.description,htmlFor:u,fhirPath:d.path,withAsterisk:m,readonly:d.readonly,children:x},u):i.jsx(Wt,{title:la(u),description:d.description,withAsterisk:m,htmlFor:u,outcome:e.outcome,fhirPath:d.path,errorExpression:y,readonly:d.readonly,children:x},u)})})}function zx(e){const[t]=g.useState(()=>e.defaultValue??{}),n=g.useContext(Qt),r=e.profileUrl??(n==null?void 0:n.profileUrl),o=g.useMemo(()=>Np(e.typeName,r),[e.typeName,r]),s=(o==null?void 0:o.type)??e.typeName,l=g.useMemo(()=>{if(o)return _l({parentContext:n,elements:o.elements,path:e.path,profileUrl:o.url,accessPolicyResource:e.accessPolicyResource})},[o,n,e.path,e.accessPolicyResource]);return o?Bp(Qt.Provider,l,i.jsx(kB,{path:e.path,valuePath:e.valuePath,type:s,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):i.jsxs("div",{children:[s," not implemented"]})}const TB="_noteBody_10swh_1",PB="_noteCite_10swh_5",RB="_noteRoot_10swh_10",FS={noteBody:TB,noteCite:PB,noteRoot:RB};function SP({value:e}){return e?i.jsx(tt,{justify:"flex-start",gap:"xs",children:e.map(t=>{var n;return t.text&&i.jsx(yy,{classNames:{cite:FS.noteCite,root:FS.noteRoot},cite:((n=t.authorReference)==null?void 0:n.display)||t.authorString,icon:null,children:t.text},`note-${t.text}`)})}):null}function Zl(e){const{value:t,link:n,...r}=e,[o,s]=g.useState(),l=Kt(t,s);let u;if(o&&!Kk(o))u=`[${Ze(o)}]`;else if(l)u=Ei(l);else return null;return n?i.jsx(xt,{to:t,...r,children:u}):i.jsx($e,{component:"span",...r,children:u})}function bl(e){return i.jsxs(be,{gap:"xs",children:[i.jsx(js,{size:24,radius:12,value:e.value,link:e.link}),i.jsx(Zl,{value:e.value,link:e.link})]})}const _B={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 Bx(e){return i.jsx(xu,{color:_B[e.status],children:e.status})}const DB="_table_pe9td_1",IB="_criticalRow_pe9td_12",NB="_noteBody_pe9td_23",AB="_noteCite_pe9td_27",MB="_noteRoot_pe9td_32",jP={table:DB,criticalRow:IB,noteBody:NB,noteCite:AB,noteRoot:MB};Ux.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1};function Ux(e){var l;const t=Te(),n=Kt(e.value),[r,o]=g.useState();if(g.useEffect(()=>{n!=null&&n.specimen&&Promise.allSettled(n.specimen.map(u=>t.readReference(u))).then(u=>u.filter(d=>d.status==="fulfilled").map(d=>d.value)).then(o).catch(console.error)},[t,n]),!n)return null;const s=(r==null?void 0:r.flatMap(u=>u.note||[]))||[];if(n.presentedForm&&n.presentedForm.length>0){const u=n.presentedForm[0];(l=u.contentType)!=null&&l.startsWith("text/plain")&&u.data&&s.push({text:window.atob(u.data)})}return i.jsxs(tt,{children:[i.jsx(ze,{children:"Diagnostic Report"}),i.jsx(OB,{value:n}),r&&!e.hideSpecimenInfo&&LB(r),n.result&&i.jsx($B,{hideObservationNotes:e.hideObservationNotes,value:n.result}),s.length>0&&i.jsx(SP,{value:s})]})}function OB({value:e}){var t,n;return i.jsxs(be,{mt:"md",gap:30,children:[e.subject&&i.jsxs("div",{children:[i.jsx($e,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),i.jsx(bl,{value:e.subject,link:!0})]}),(t=e.resultsInterpreter)==null?void 0:t.map(r=>i.jsxs("div",{children:[i.jsx($e,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),i.jsx(bl,{value:r,link:!0})]},r.reference)),(n=e.performer)==null?void 0:n.map(r=>i.jsxs("div",{children:[i.jsx($e,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),i.jsx(bl,{value:r,link:!0})]},r.reference)),e.issued&&i.jsxs("div",{children:[i.jsx($e,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),i.jsx($e,{children:pr(e.issued)})]}),e.status&&i.jsxs("div",{children:[i.jsx($e,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),i.jsx($e,{children:Ln(e.status)})]})]})}function LB(e){return i.jsxs(tt,{gap:"xs",children:[i.jsx(ze,{order:2,size:"h6",children:"Specimens"}),i.jsx(fr,{type:"ordered",children:e==null?void 0:e.map(t=>{var n;return i.jsx(fr.Item,{ml:"sm",children:i.jsxs(be,{gap:20,children:[i.jsxs(be,{gap:5,children:[i.jsx($e,{fw:500,children:"Collected:"})," ",pr((n=t.collection)==null?void 0:n.collectedDateTime)]}),i.jsxs(be,{gap:5,children:[i.jsx($e,{fw:500,children:"Received:"})," ",pr(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function $B(e){return i.jsxs("table",{className:jP.table,children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Test"}),i.jsx("th",{children:"Value"}),i.jsx("th",{children:"Reference Range"}),i.jsx("th",{children:"Interpretation"}),i.jsx("th",{children:"Category"}),i.jsx("th",{children:"Performer"}),i.jsx("th",{children:"Status"})]})}),i.jsx("tbody",{children:i.jsx(CP,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function CP(e){var t;return i.jsx(i.Fragment,{children:(t=e.value)==null?void 0:t.map(n=>i.jsx(FB,{value:n,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${Ea(n)?n.reference:n.id}`))})}function FB(e){var o,s;const t=Kt(e.value);if(!t||(o=e.ancestorIds)!=null&&o.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=UB(t);return i.jsxs(i.Fragment,{children:[i.jsxs("tr",{className:It({[jP.criticalRow]:r}),children:[i.jsx("td",{rowSpan:n?2:1,children:i.jsx(xt,{to:t,children:i.jsx(Ko,{value:t.code})})}),i.jsx("td",{children:i.jsx(zB,{value:t})}),i.jsx("td",{children:i.jsx(BB,{value:t.referenceRange})}),i.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&i.jsx(Ko,{value:t.interpretation[0]})}),i.jsx("td",{children:t.category&&t.category.length>0&&i.jsx(i.Fragment,{children:t.category.map(l=>i.jsx("div",{children:i.jsx(Ko,{value:l})},`category-${ms(l)}`))})}),i.jsx("td",{children:(s=t.performer)==null?void 0:s.map(l=>i.jsx(Mf,{value:l},l.reference))}),i.jsx("td",{children:t.status&&i.jsx(Bx,{status:t.status})})]}),t.hasMember&&i.jsx(CP,{value:t.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,t.id]:[t.id],hideObservationNotes:e.hideObservationNotes}),n&&i.jsx("tr",{children:i.jsx("td",{colSpan:6,children:i.jsx(SP,{value:t.note})})})]})}function zB(e){const t=e.value;return i.jsx(i.Fragment,{children:yT(t)})}function BB(e){const t=e.value&&e.value.length>0&&e.value[0];return t?t.text?i.jsx(i.Fragment,{children:t.text}):i.jsx(Ox,{value:t}):null}function UB(e){var n,r,o,s;const t=(s=(o=(r=(n=e.interpretation)==null?void 0:n[0])==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:s.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}var fg={},pi={},zS;function EP(){if(zS)return pi;zS=1,Object.defineProperty(pi,"__esModule",{value:!0}),pi.Pointer=pi.escapeToken=pi.unescapeToken=void 0;function e(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}pi.unescapeToken=e;function t(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}pi.escapeToken=t;var n=function(){function r(o){o===void 0&&(o=[""]),this.tokens=o}return r.fromJSON=function(o){var s=o.split("/").map(e);if(s[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(o));return new r(s)},r.prototype.toString=function(){return this.tokens.map(t).join("/")},r.prototype.evaluate=function(o){for(var s=null,l="",u=o,d=1,p=this.tokens.length;d<p;d++)s=u,l=this.tokens[d],!(l=="__proto__"||l=="constructor"||l=="prototype")&&(u=(s||{})[l]);return{parent:s,key:l,value:u}},r.prototype.get=function(o){return this.evaluate(o).value},r.prototype.set=function(o,s){var l=this.evaluate(o);l.parent&&(l.parent[l.key]=s)},r.prototype.push=function(o){this.tokens.push(o)},r.prototype.add=function(o){var s=this.tokens.concat(String(o));return new r(s)},r}();return pi.Pointer=n,pi}var dn={},pg={},BS;function kP(){return BS||(BS=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.clone=e.objectType=e.hasOwnProperty=void 0,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(o){return o===void 0?"undefined":o===null?"null":Array.isArray(o)?"array":typeof o}e.objectType=t;function n(o){return o!=null&&typeof o=="object"}function r(o){if(!n(o))return o;if(o.constructor==Array){for(var s=o.length,l=new Array(s),u=0;u<s;u++)l[u]=r(o[u]);return l}if(o.constructor==Date){var d=new Date(+o);return d}var p={};for(var h in o)e.hasOwnProperty.call(o,h)&&(p[h]=r(o[h]));return p}e.clone=r}(pg)),pg}var ur={},US;function TP(){if(US)return ur;US=1,Object.defineProperty(ur,"__esModule",{value:!0}),ur.diffAny=ur.diffObjects=ur.diffArrays=ur.intersection=ur.subtract=ur.isDestructive=void 0;var e=kP();function t(h){var m=h.op;return m==="remove"||m==="replace"||m==="copy"||m==="move"}ur.isDestructive=t;function n(h,m){var y={};for(var x in h)e.hasOwnProperty.call(h,x)&&h[x]!==void 0&&(y[x]=1);for(var b in m)e.hasOwnProperty.call(m,b)&&m[b]!==void 0&&delete y[b];return Object.keys(y)}ur.subtract=n;function r(h){for(var m=h.length,y={},x=0;x<m;x++){var b=h[x];for(var w in b)e.hasOwnProperty.call(b,w)&&b[w]!==void 0&&(y[w]=(y[w]||0)+1)}for(var w in y)y[w]<m&&delete y[w];return Object.keys(y)}ur.intersection=r;function o(h){return h.op==="add"}function s(h){return h.op==="remove"}function l(h,m){return{operations:h.operations.concat(m),cost:h.cost+1}}function u(h,m,y,x){x===void 0&&(x=p);var b={"0,0":{operations:[],cost:0}};function w(E,_){var R="".concat(E,",").concat(_),M=b[R];if(M===void 0){if(E>0&&_>0&&!x(h[E-1],m[_-1],y.add(String(E-1))).length)M=w(E-1,_-1);else{var N=[];if(E>0){var L=w(E-1,_),z={op:"remove",index:E-1};N.push(l(L,z))}if(_>0){var q=w(E,_-1),G={op:"add",index:E-1,value:m[_-1]};N.push(l(q,G))}if(E>0&&_>0){var Y=w(E-1,_-1),Q={op:"replace",index:E-1,original:h[E-1],value:m[_-1]};N.push(l(Y,Q))}var te=N.sort(function(V,O){return V.cost-O.cost})[0];M=te}b[R]=M}return M}var j=isNaN(h.length)||h.length<=0?0:h.length,T=isNaN(m.length)||m.length<=0?0:m.length,P=w(j,T).operations,k=P.reduce(function(E,_){var R=E[0],M=E[1];if(o(_)){var N=_.index+1+M,L=N<j+M?String(N):"-",z={op:_.op,path:y.add(L).toString(),value:_.value};return[R.concat(z),M+1]}else if(s(_)){var z={op:_.op,path:y.add(String(_.index+M)).toString()};return[R.concat(z),M-1]}else{var q=y.add(String(_.index+M)),G=x(_.original,_.value,q);return[R.concat.apply(R,G),M]}},[[],0])[0];return k}ur.diffArrays=u;function d(h,m,y,x){x===void 0&&(x=p);var b=[];return n(h,m).forEach(function(w){b.push({op:"remove",path:y.add(w).toString()})}),n(m,h).forEach(function(w){b.push({op:"add",path:y.add(w).toString(),value:m[w]})}),r([h,m]).forEach(function(w){b.push.apply(b,x(h[w],m[w],y.add(w)))}),b}ur.diffObjects=d;function p(h,m,y,x){if(x===void 0&&(x=p),h===m)return[];var b=(0,e.objectType)(h),w=(0,e.objectType)(m);return b=="array"&&w=="array"?u(h,m,y,x):b=="object"&&w=="object"?d(h,m,y,x):[{op:"replace",path:y.toString(),value:m}]}return ur.diffAny=p,ur}var VS;function VB(){if(VS)return dn;VS=1;var e=dn.__extends||function(){var j=function(T,P){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,E){k.__proto__=E}||function(k,E){for(var _ in E)Object.prototype.hasOwnProperty.call(E,_)&&(k[_]=E[_])},j(T,P)};return function(T,P){if(typeof P!="function"&&P!==null)throw new TypeError("Class extends value "+String(P)+" is not a constructor or null");j(T,P);function k(){this.constructor=T}T.prototype=P===null?Object.create(P):(k.prototype=P.prototype,new k)}}();Object.defineProperty(dn,"__esModule",{value:!0}),dn.apply=dn.InvalidOperationError=dn.test=dn.copy=dn.move=dn.replace=dn.remove=dn.add=dn.TestError=dn.MissingError=void 0;var t=EP(),n=kP(),r=TP(),o=function(j){e(T,j);function T(P){var k=j.call(this,"Value required at path: ".concat(P))||this;return k.path=P,k.name="MissingError",k}return T}(Error);dn.MissingError=o;var s=function(j){e(T,j);function T(P,k){var E=j.call(this,"Test failed: ".concat(P," != ").concat(k))||this;return E.actual=P,E.expected=k,E.name="TestError",E}return T}(Error);dn.TestError=s;function l(j,T,P){if(Array.isArray(j))if(T=="-")j.push(P);else{var k=parseInt(T,10);j.splice(k,0,P)}else j[T]=P}function u(j,T){if(Array.isArray(j)){var P=parseInt(T,10);j.splice(P,1)}else delete j[T]}function d(j,T){var P=t.Pointer.fromJSON(T.path).evaluate(j);return P.parent===void 0?new o(T.path):(l(P.parent,P.key,(0,n.clone)(T.value)),null)}dn.add=d;function p(j,T){var P=t.Pointer.fromJSON(T.path).evaluate(j);return P.value===void 0?new o(T.path):(u(P.parent,P.key),null)}dn.remove=p;function h(j,T){var P=t.Pointer.fromJSON(T.path).evaluate(j);if(P.parent===null)return new o(T.path);if(Array.isArray(P.parent)){if(parseInt(P.key,10)>=P.parent.length)return new o(T.path)}else if(P.value===void 0)return new o(T.path);return P.parent[P.key]=(0,n.clone)(T.value),null}dn.replace=h;function m(j,T){var P=t.Pointer.fromJSON(T.from).evaluate(j);if(P.value===void 0)return new o(T.from);var k=t.Pointer.fromJSON(T.path).evaluate(j);return k.parent===void 0?new o(T.path):(u(P.parent,P.key),l(k.parent,k.key,P.value),null)}dn.move=m;function y(j,T){var P=t.Pointer.fromJSON(T.from).evaluate(j);if(P.value===void 0)return new o(T.from);var k=t.Pointer.fromJSON(T.path).evaluate(j);return k.parent===void 0?new o(T.path):(l(k.parent,k.key,(0,n.clone)(P.value)),null)}dn.copy=y;function x(j,T){var P=t.Pointer.fromJSON(T.path).evaluate(j);return(0,r.diffAny)(P.value,T.value,new t.Pointer).length?new s(P.value,T.value):null}dn.test=x;var b=function(j){e(T,j);function T(P){var k=j.call(this,"Invalid operation: ".concat(P.op))||this;return k.operation=P,k.name="InvalidOperationError",k}return T}(Error);dn.InvalidOperationError=b;function w(j,T){switch(T.op){case"add":return d(j,T);case"remove":return p(j,T);case"replace":return h(j,T);case"move":return m(j,T);case"copy":return y(j,T);case"test":return x(j,T)}return new b(T)}return dn.apply=w,dn}var WS;function WB(){return WS||(WS=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=EP();Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=VB(),r=TP();function o(p,h){return h.map(function(m){return(0,n.apply)(p,m)})}e.applyPatch=o;function s(p){function h(m,y,x){var b=p(m,y,x);return Array.isArray(b)?b:(0,r.diffAny)(m,y,x,h)}return h}function l(p,h,m){var y=new t.Pointer;return(m?s(m):r.diffAny)(p,h,y)}e.createPatch=l;function u(p,h){var m=t.Pointer.fromJSON(h).evaluate(p);if(m!==void 0)return{op:"test",path:h,value:m.value}}function d(p,h){var m=new Array;return h.filter(r.isDestructive).forEach(function(y){var x=u(p,y.path);if(x&&m.push(x),"from"in y){var b=u(p,y.from);b&&m.push(b)}}),m}e.createTests=d}(fg)),fg}var PP=WB();const HB="_root_x463w_1",qB="_removed_x463w_20",GB="_added_x463w_25",hg={root:HB,removed:qB,added:GB};function QB(e){const t=Te(),{original:n,revised:r}=e,[o,s]=g.useState(!1);g.useEffect(()=>{t.requestSchema(e.original.resourceType).then(()=>s(!0)).catch(console.log)},[t,e.original.resourceType]);const l=g.useMemo(()=>{if(!o)return null;const u=[no(n)],d=[no(r)],p=[],h=KB(PP.createPatch(n,r));for(const m of h){const y=m.path,x=YB(y),b=XB(n.resourceType,x),w=m.op==="add"?void 0:ca(x,u),j=m.op==="remove"?void 0:ca(x,d);p.push({key:`op-${m.op}-${m.path}`,name:`${Ln(m.op)} ${x}`,path:(b==null?void 0:b.path)??n.resourceType+"."+x,property:b,originalValue:HS(b,w),revisedValue:HS(b,j)})}return p},[o,n,r]);return l?i.jsxs(Le,{className:hg.root,children:[i.jsx(Le.Thead,{children:i.jsxs(Le.Tr,{children:[i.jsx(Le.Th,{}),i.jsx(Le.Th,{children:"Before"}),i.jsx(Le.Th,{children:"After"})]})}),i.jsx(Le.Tbody,{children:l.map(u=>i.jsxs(Le.Tr,{children:[i.jsx(Le.Td,{children:u.name}),i.jsx(Le.Td,{className:hg.removed,children:u.originalValue&&i.jsx(Po,{path:u.path,property:u.property,propertyType:u.originalValue.type,value:u.originalValue.value,ignoreMissingValues:!0})}),i.jsx(Le.Td,{className:hg.added,children:u.revisedValue&&i.jsx(Po,{path:u.path,property:u.property,propertyType:u.revisedValue.type,value:u.revisedValue.value,ignoreMissingValues:!0})})]},u.key))})]}):null}function KB(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 s=e.filter(u=>u.op===r&&u.path===o).length,l={op:r,path:o};s>1&&(r==="add"||r==="remove")&&/\/[0-9-]+$/.test(o)&&(l.op="replace",l.path=o.replace(/\/[^/]+$/,"")),t.some(u=>u.op===l.op&&u.path===l.path)||t.push(l)}return t}function YB(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 XB(e,t){var r;const n=Yl(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 HS(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:JB(t,!!(e!=null&&e.isArray))}}function JB(e,t){const n=q$(e).flatMap(r=>r.value);return t?n:n[0]}function Vx(e){const{profileUrl:t}=e,n=Te(),r=n.getAccessPolicy(),o=Kt(e.value),[s,l]=g.useState(!1);g.useEffect(()=>{if(o)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{Gl(t)?l(!0):console.error(`Schema not found for ${t}`)}).catch(d=>{console.error("Error in requestProfileSchema",d)});else{const d=o.resourceType;n.requestSchema(d).then(()=>{l(!0)}).catch(console.error)}},[n,t,o]);const u=g.useMemo(()=>o&&TT(o,xx.READ,r),[r,o]);return!s||!o?null:i.jsx(Of,{path:o.resourceType,value:{type:o.resourceType,value:e.forceUseInput?e.value:o},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:u})}const ZB="_item_5q6yx_1",eU="_itemPadding_5q6yx_5",qS={item:ZB,itemPadding:eU};function tU(e){return i.jsx(Nu,{children:e.children})}function fa(e){var d,p;const{resource:t,profile:n,padding:r,popupMenuItems:o,...s}=e,l=n??((d=t.meta)==null?void 0:d.author),u=e.dateTime??((p=t.meta)==null?void 0:p.lastUpdated);return i.jsxs(Nx,{"data-testid":"timeline-item",fill:!0,...s,children:[i.jsxs(be,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[i.jsx(js,{value:l,link:!0,size:"md"}),i.jsxs("div",{style:{flex:1},children:[i.jsx($e,{size:"sm",children:i.jsx(Zl,{c:"dark",fw:500,value:l,link:!0})}),i.jsxs($e,{size:"xs",children:[i.jsx(xt,{c:"dimmed",to:e.resource,children:pr(u)}),i.jsx($e,{component:"span",c:"dimmed",mx:8,children:"·"}),i.jsx(xt,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&i.jsxs(xe,{position:"bottom-end",shadow:"md",width:200,children:[i.jsx(xe.Target,{children:i.jsx(Cn,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${Ot(e.resource)}`,children:i.jsx(WF,{})})}),o]})]}),i.jsx(KT,{children:i.jsx("div",{className:It(qS.item,{[qS.itemPadding]:r}),children:e.children})})]})}function RP(e,t){e.sort((n,r)=>{const o=GS(n,t),s=GS(r,t);return o>s?1:o<s?-1:QS(n,t)-QS(r,t)})}function GS(e,t){if(!_P(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function QS(e,t){var r;if(!_P(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 _P(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const nU="_pinnedComment_5uxzi_2",rU={pinnedComment:nU};function Vp(e){const t=Te(),n=t.getProfile(),r=g.useRef(null),o=Kt(e.value),[s,l]=g.useState(),[u,d]=g.useState([]),p=e.loadTimelineResources,h=g.useRef(u);h.current=u;const m=g.useCallback(E=>{RP(E,o),E.reverse(),d(E)},[o]),y=g.useCallback(E=>{const _=[];for(const R of E){if(R.status!=="fulfilled")continue;const M=R.value;if(M.type==="history"&&l(M),M.entry)for(const N of M.entry)_.push(N.resource)}m(_)},[m]),x=g.useCallback(E=>m([...h.current,E]),[m]),b=g.useCallback(()=>{var R;let E,_;"resourceType"in e.value?(E=e.value.resourceType,_=e.value.id):[E,_]=(R=e.value.reference)==null?void 0:R.split("/"),p(t,E,_).then(y).catch(console.error)},[t,e.value,p,y]);g.useEffect(()=>b(),[b]);function w(E){!o||!e.createCommunication||t.createResource(e.createCommunication(o,n,E)).then(_=>x(_)).catch(console.error)}function j(E){!o||!e.createMedia||t.createResource(e.createMedia(o,n,E)).then(_=>x(_)).then(()=>Zs({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:i.jsx(Ss,{size:16}),autoClose:2e3})).catch(_=>Zs({id:"upload-notification",color:"red",title:"Upload error",message:Ze(_),icon:i.jsx(RS,{size:16}),autoClose:2e3}))}function T(){Ie({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function P(E){Zs({id:"upload-notification",loading:!0,title:"Uploading...",message:uU(E),autoClose:!1,withCloseButton:!1})}function k(E){Zs({id:"upload-notification",color:"red",title:"Upload error",message:Ze(E),icon:i.jsx(RS,{size:16}),autoClose:2e3})}return o?i.jsxs(tU,{children:[e.createCommunication&&i.jsx(Nx,{children:i.jsx(yt,{testid:"timeline-form",onSubmit:E=>{w(E.text);const _=r.current;_&&(_.value="",_.focus())},children:i.jsxs(be,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[i.jsx(js,{value:n}),i.jsx(Fe,{name:"text",ref:r,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),i.jsx(Cn,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:i.jsx(JF,{size:16})}),i.jsx(Mx,{securityContext:Jt(o),onUpload:j,onUploadStart:T,onUploadProgress:P,onUploadError:k,children:E=>i.jsx(Cn,{...E,radius:"xl",color:"blue",variant:"filled",children:i.jsx(Ex,{size:16})})})]})})}),u.map(E=>{var M;if(!E)return null;const _=`${E.resourceType}/${E.id}/${(M=E.meta)==null?void 0:M.versionId}`,R=e.getMenu?e.getMenu({primaryResource:o,currentResource:E,reloadTimeline:b}):void 0;if(E.resourceType===o.resourceType&&E.id===o.id)return i.jsx(oU,{history:s,resource:E,popupMenuItems:R},_);switch(E.resourceType){case"AuditEvent":return i.jsx(lU,{resource:E,popupMenuItems:R},_);case"Communication":return i.jsx(sU,{resource:E,popupMenuItems:R},_);case"DiagnosticReport":return i.jsx(cU,{resource:E,popupMenuItems:R},_);case"Media":return i.jsx(aU,{resource:E,popupMenuItems:R},_);default:return i.jsx(fa,{resource:E,padding:!0,children:i.jsx(Vx,{value:E,ignoreMissingValues:!0})},_)}})]}):i.jsx(Vn,{style:{width:"100%",height:"100%"},children:i.jsx(Rr,{})})}function oU(e){const{history:t,resource:n,...r}=e,o=iU(t,n);return o?i.jsx(fa,{resource:n,padding:!0,...r,children:i.jsx(QB,{original:o,revised:e.resource})}):i.jsxs(fa,{resource:n,padding:!0,...r,children:[i.jsx("h3",{children:"Created"}),i.jsx(Vx,{value:n,ignoreMissingValues:!0,forceUseInput:!0})]})}function iU(e,t){const n=e.entry??[],r=n.findIndex(o=>{var s,l,u;return((l=(s=o.resource)==null?void 0:s.meta)==null?void 0:l.versionId)===((u=t.meta)==null?void 0:u.versionId)});if(!(r>=n.length-1))return n[r+1].resource}function sU(e){var r,o;const n=!e.resource.priority||e.resource.priority==="routine"?void 0:rU.pinnedComment;return i.jsx(fa,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:e.popupMenuItems,children:i.jsx("p",{children:(o=(r=e.resource.payload)==null?void 0:r[0])==null?void 0:o.contentString})})}function aU(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 i.jsx(fa,{resource:e.resource,padding:!!n,popupMenuItems:e.popupMenuItems,children:i.jsx(Au,{value:e.resource.content})})}function lU(e){return i.jsx(fa,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:i.jsx(oo,{children:i.jsx("pre",{children:e.resource.outcomeDesc})})})}function cU(e){return i.jsx(fa,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:i.jsx(Ux,{value:e.resource})})}function uU(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${mg(e.loaded)} / ${mg(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${mg(e.loaded)}`}function mg(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 dU(e){const{resource:t,...n}=e;return i.jsx(Vp,{value:t,loadTimelineResources:async(r,o,s)=>{const l=`${o}/${s}`;return Promise.allSettled([r.readHistory(o,s),r.search("Task",{_filter:`based-on eq ${l} or focus eq ${l} or subject eq ${l}`,_count:100})])},...n})}function fU(e){const{encounter:t,...n}=e;return i.jsx(Vp,{value:t,loadTimelineResources:async(r,o,s)=>Promise.allSettled([r.readHistory("Encounter",s),r.search("Communication","encounter=Encounter/"+s),r.search("Media","encounter=Encounter/"+s)]),createCommunication:(r,o,s)=>({resourceType:"Communication",status:"completed",encounter:Jt(r),subject:r.subject,sender:Jt(o),sent:new Date().toISOString(),payload:[{contentString:s}]}),createMedia:(r,o,s)=>({resourceType:"Media",status:"completed",encounter:Jt(r),subject:r.subject,operator:Jt(o),issued:new Date().toISOString(),content:s}),...n})}function pU(e){let t;try{t=Kl(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 i.jsx(Po,{value:t[0]||"",propertyType:e.propertyType})}function hU(e){return i.jsxs(Nn,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[i.jsxs(se,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&i.jsx(KS,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&i.jsx(KS,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),i.jsx($e,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function KS(e){return i.jsx(Pe,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const mU={string:[Ce.EQUALS,Ce.NOT,Ce.CONTAINS,Ce.EXACT],fulltext:[Ce.EQUALS,Ce.NOT,Ce.CONTAINS,Ce.EXACT],token:[Ce.EQUALS,Ce.NOT],reference:[Ce.EQUALS,Ce.NOT],numeric:[Ce.EQUALS,Ce.NOT_EQUALS,Ce.GREATER_THAN,Ce.LESS_THAN,Ce.GREATER_THAN_OR_EQUALS,Ce.LESS_THAN_OR_EQUALS],quantity:[Ce.EQUALS,Ce.NOT_EQUALS,Ce.GREATER_THAN,Ce.LESS_THAN,Ce.GREATER_THAN_OR_EQUALS,Ce.LESS_THAN_OR_EQUALS],date:[Ce.EQUALS,Ce.NOT_EQUALS,Ce.GREATER_THAN,Ce.LESS_THAN,Ce.GREATER_THAN_OR_EQUALS,Ce.LESS_THAN_OR_EQUALS,Ce.STARTS_AFTER,Ce.ENDS_BEFORE,Ce.APPROXIMATELY],datetime:[Ce.EQUALS,Ce.NOT_EQUALS,Ce.GREATER_THAN,Ce.LESS_THAN,Ce.GREATER_THAN_OR_EQUALS,Ce.LESS_THAN_OR_EQUALS,Ce.STARTS_AFTER,Ce.ENDS_BEFORE,Ce.APPROXIMATELY]},gU={eq:"equals",ne:"not equals",gt:"greater than",lt:"less than",ge:"greater than or equals",le:"less than or equals",sa:"starts after",eb:"ends before",ap:"approximately",sw:"starts with",contains:"contains",exact:"exact",text:"text",not:"not",above:"above",below:"below",in:"in","not-in":"not in","of-type":"of type",missing:"missing",present:"present",identifier:"identifier",iterate:"iterate"};function Wx(e,t){return{...e,filters:t,offset:0,name:void 0}}function DP(e,t){return Wx(e,(e.filters??[]).filter(n=>n.code!==t))}function Wp(e,t,n,r,o){const s=[];return e.filters&&s.push(...e.filters),s.push({code:t,operator:n,value:r??""}),Wx(e,s)}function vU(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function yU(e,t){return Hx(e,t,-1)}function xU(e,t){return Hx(e,t,0)}function bU(e,t){return Hx(e,t,1)}function Hx(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),Gx(e,t,r,o)}function wU(e,t){return qx(e,t,-1)}function SU(e,t){return qx(e,t,0)}function jU(e,t){return qx(e,t,1)}function qx(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),Gx(e,t,r,o)}function CU(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),Gx(e,t,n,new Date)}function Gx(e,t,n,r){return e=DP(e,t),e=YS(e,t,Ce.GREATER_THAN_OR_EQUALS,n),e=YS(e,t,Ce.LESS_THAN_OR_EQUALS,r),e}function YS(e,t,n,r){return Wp(e,t,n,r.toISOString())}function XS(e,t,n=!0){return Wp(e,t,Ce.MISSING,n.toString())}function EU(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function kU(e,t){const n=e.count??Mp,r=(t-1)*n;return EU(e,r)}function TU(e,t,n){return t===PU(e)&&n!==void 0&&n===RU(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function PU(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function RU(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function _U(e){return mU[e.type]}function IP(e){return gU[e]??""}function pa(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(Ln).join(" "))}function DU(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"?pr((o=e.meta)==null?void 0:o.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?IU(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?NU(e,t.searchParams[0]):null}function IU(e,t){var s,l,u;const n=((u=(l=(s=t.path)==null?void 0:s.split("."))==null?void 0:l.pop())==null?void 0:u.replaceAll("[x]",""))??"",[r,o]=Ou({type:e.resourceType,value:e},n);return r?i.jsx(Po,{path:t.path,property:t,propertyType:o,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function NU(e,t){const n=ca(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:i.jsx(i.Fragment,{children:n.map((r,o)=>i.jsx(Po,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${n.length}`))})}function AU(e){const t=g.useRef(!1),[n,r]=g.useState({search:JSON.parse(To(e.search))}),[o,s]=g.useState(!1);g.useEffect(()=>{r({search:e.search})},[e.search]);const l=g.useMemo(()=>{if(!e.visible)return[];const d=e.search.resourceType,p=tT(d),h=dx(d);return ou(MU(p,h)).map(m=>({value:m,label:pa(m)}))},[e.visible,e.search.resourceType]);if(!e.visible)return null;function u(d){r({search:{...n.search,fields:d}})}return i.jsx(Nn,{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:i.jsx("div",{"data-testid":"overlay-child"})},children:i.jsxs(tt,{children:[i.jsx(wu,{style:{width:550},placeholder:"Select fields to display",data:l,value:n.search.fields??[],onChange:u,onDropdownOpen:()=>s(!0),onDropdownClose:()=>s(!1),maxDropdownHeight:"250px",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),i.jsx(be,{justify:"flex-end",children:i.jsx(Pe,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function MU(e,t){const n=[],r=new Set,o=new Set;for(const s of Object.keys(e.elements))n.push(s),r.add(s.toLowerCase()),o.add(pa(s));if(t)for(const s of Object.keys(t)){const l=pa(s);!r.has(s)&&!o.has(l)&&(n.push(s),r.add(s),o.add(l))}return n}function NP(e){const t=Yl(e.resourceType,e.searchParam),n=e.name??"filter-value";switch(t.type){case gi.REFERENCE:return i.jsx(Up,{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 gi.BOOLEAN:return i.jsx(rr,{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 gi.DATE:return i.jsx(Fe,{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 gi.DATETIME:return i.jsx(ua,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case gi.NUMBER:return i.jsx(Fe,{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 gi.QUANTITY:return i.jsx(da,{name:n,path:"",defaultValue:OU(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return i.jsx(Fe,{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 OU(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function LU(e){const[t,n]=g.useState(Br(e.search)),r=g.useRef(t);r.current=t,g.useEffect(()=>{n(Br(e.search))},[e.search]);function o(d){n(Wp(r.current,d.code,d.operator,d.value))}if(!e.visible)return null;const s=e.search.resourceType,l=dx(s)??{},u=t.filters||[];return i.jsx(Nn,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:i.jsxs(yt,{onSubmit:()=>e.onOk(r.current),children:[i.jsxs("div",{children:[i.jsxs("table",{children:[i.jsxs("colgroup",{children:[i.jsx("col",{style:{width:200}}),i.jsx("col",{style:{width:200}}),i.jsx("col",{style:{width:380}}),i.jsx("col",{style:{width:40}})]}),i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Field"}),i.jsx("th",{children:"Operation"}),i.jsx("th",{children:"Value"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:u.map((d,p)=>i.jsx($U,{id:`filter-${p}-row`,resourceType:s,searchParams:l,value:d,onChange:h=>{const m=[...u];m[p]=h,n(Wx(r.current,m))},onDelete:()=>n(vU(r.current,p))},`filter-${p}-row`))})]}),i.jsx($x,{propertyDisplayName:"Filter",onClick:()=>o({})})]}),i.jsx(be,{justify:"flex-end",mt:"xl",children:i.jsx(Pe,{type:"submit",children:"OK"})})]})})}function $U(e){const t=e.value,n=g.useRef(t);n.current=t;function r(d){n.current.code=d,n.current.operator=Ce.EQUALS,n.current.value="",e.onChange(n.current)}function o(d){n.current.operator=d,n.current.value="",e.onChange(n.current)}function s(d){n.current.value=d,e.onChange(n.current)}const l=e.searchParams[t.code],u=l&&_U(l);return i.jsxs("tr",{children:[i.jsx("td",{children:i.jsx(Zt,{"data-testid":`${e.id}-filter-field`,defaultValue:e.value.code,onChange:d=>r(d.currentTarget.value),data:["",...Object.keys(e.searchParams).map(d=>({value:d,label:pa(d)}))]})}),i.jsx("td",{children:u&&i.jsx(Zt,{"data-testid":`${e.id}-filter-operation`,defaultValue:t.operator,onChange:d=>o(d.currentTarget.value),data:["",...u.map(d=>({value:d,label:IP(d)}))]})}),i.jsx("td",{children:l&&t.operator&&i.jsx(NP,{name:`${e.id}-filter-value`,resourceType:e.resourceType,searchParam:l,defaultValue:t.value,onChange:s})}),i.jsx("td",{children:e.onDelete&&i.jsx(Cn,{variant:"outline",color:"red",radius:"xl","aria-label":"Delete filter",onClick:e.onDelete,children:i.jsx(Il,{style:{width:"70%",height:"70%"},stroke:1.5})})})]})}function FU(e){const[t,n]=g.useState(e.defaultValue??"");if(!e.visible||!e.searchParam||!e.filter)return null;function r(){e.onOk({...e.filter,value:t})}return i.jsx(Nn,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:i.jsx(yt,{onSubmit:r,children:i.jsxs(Fr,{children:[i.jsx(Fr.Col,{span:10,children:i.jsx(NP,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),i.jsx(Fr.Col,{span:2,children:i.jsx(Pe,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function zU(e){var o;const{resourceType:t,filter:n}=e,r=(o=Yo.types[t].searchParams)==null?void 0:o[n.code];if(r){if(r.type==="reference"&&(n.operator===Ce.EQUALS||n.operator===Ce.NOT_EQUALS))return i.jsx(Zl,{value:{reference:n.value}});const s=Yl(t,r);if(n.code==="_lastUpdated"||s.type===gi.DATETIME)return i.jsx(i.Fragment,{children:pr(n.value)})}return i.jsx(i.Fragment,{children:n.value})}function BU(e){if(!e.searchParams)return null;function t(s,l){o(TU(e.search,s.code,l))}function n(s){o(DP(e.search,s.code))}function r(s,l){e.onPrompt(s,{code:s.code,operator:l,value:""})}function o(s){e.onChange(s)}return e.searchParams.length===1?i.jsx(UU,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:o,onClear:n}):i.jsx(xe.Dropdown,{children:e.searchParams.map(s=>i.jsx(xe.Item,{children:pa(s.code)},s.code))})}function UU(e){switch(e.searchParam.type){case"date":return i.jsx(VU,{...e});case"number":case"quantity":return i.jsx(WU,{...e});case"reference":return i.jsx(HU,{...e});case"string":return i.jsx(qU,{...e});case"token":case"uri":return i.jsx(GU,{...e});default:return i.jsxs(i.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function VU(e){const{searchParam:t}=e,n=t.code;return i.jsxs(xe.Dropdown,{children:[i.jsx(xe.Item,{leftSection:i.jsx(kx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),i.jsx(xe.Item,{leftSection:i.jsx(Tx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),i.jsx(xe.Divider,{}),i.jsx(xe.Item,{leftSection:i.jsx(Iu,{size:14}),onClick:()=>e.onPrompt(t,Ce.EQUALS),children:"Equals..."}),i.jsx(xe.Item,{leftSection:i.jsx(Du,{size:14}),onClick:()=>e.onPrompt(t,Ce.NOT_EQUALS),children:"Does not equal..."}),i.jsx(xe.Divider,{}),i.jsx(xe.Item,{leftSection:i.jsx(QT,{size:14}),onClick:()=>e.onPrompt(t,Ce.ENDS_BEFORE),children:"Before..."}),i.jsx(xe.Item,{leftSection:i.jsx(GT,{size:14}),onClick:()=>e.onPrompt(t,Ce.STARTS_AFTER),children:"After..."}),i.jsx(xe.Item,{leftSection:i.jsx(AF,{size:14}),onClick:()=>e.onPrompt(t,Ce.EQUALS),children:"Between..."}),i.jsx(xe.Divider,{}),i.jsx(xe.Item,{leftSection:i.jsx(Ws,{size:14}),onClick:()=>e.onChange(bU(e.search,n)),children:"Tomorrow"}),i.jsx(xe.Item,{leftSection:i.jsx(Ws,{size:14}),onClick:()=>e.onChange(xU(e.search,n)),children:"Today"}),i.jsx(xe.Item,{leftSection:i.jsx(Ws,{size:14}),onClick:()=>e.onChange(yU(e.search,n)),children:"Yesterday"}),i.jsx(xe.Divider,{}),i.jsx(xe.Item,{leftSection:i.jsx(Ws,{size:14}),onClick:()=>e.onChange(jU(e.search,n)),children:"Next Month"}),i.jsx(xe.Item,{leftSection:i.jsx(Ws,{size:14}),onClick:()=>e.onChange(SU(e.search,n)),children:"This Month"}),i.jsx(xe.Item,{leftSection:i.jsx(Ws,{size:14}),onClick:()=>e.onChange(wU(e.search,n)),children:"Last Month"}),i.jsx(xe.Divider,{}),i.jsx(xe.Item,{leftSection:i.jsx(Ws,{size:14}),onClick:()=>e.onChange(CU(e.search,n)),children:"Year to date"}),i.jsx(Lu,{...e})]})}function WU(e){const{searchParam:t}=e;return i.jsxs(xe.Dropdown,{children:[i.jsx(xe.Item,{leftSection:i.jsx(kx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),i.jsx(xe.Item,{leftSection:i.jsx(Tx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),i.jsx(xe.Divider,{}),i.jsx(xe.Item,{leftSection:i.jsx(Iu,{size:14}),onClick:()=>e.onPrompt(t,Ce.EQUALS),children:"Equals..."}),i.jsx(xe.Item,{leftSection:i.jsx(Du,{size:14}),onClick:()=>e.onPrompt(t,Ce.NOT_EQUALS),children:"Does not equal..."}),i.jsx(xe.Divider,{}),i.jsx(xe.Item,{leftSection:i.jsx(GT,{size:14}),onClick:()=>e.onPrompt(t,Ce.GREATER_THAN),children:"Greater than..."}),i.jsx(xe.Item,{leftSection:i.jsx(ev,{size:14}),onClick:()=>e.onPrompt(t,Ce.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),i.jsx(xe.Item,{leftSection:i.jsx(QT,{size:14}),onClick:()=>e.onPrompt(t,Ce.LESS_THAN),children:"Less than..."}),i.jsx(xe.Item,{leftSection:i.jsx(ev,{size:14}),onClick:()=>e.onPrompt(t,Ce.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),i.jsx(Lu,{...e})]})}function HU(e){const{searchParam:t}=e;return i.jsxs(xe.Dropdown,{children:[i.jsx(xe.Item,{leftSection:i.jsx(Iu,{size:14}),onClick:()=>e.onPrompt(t,Ce.EQUALS),children:"Equals..."}),i.jsx(xe.Item,{leftSection:i.jsx(Du,{size:14}),onClick:()=>e.onPrompt(t,Ce.NOT),children:"Does not equal..."}),i.jsx(Lu,{...e})]})}function qU(e){const{searchParam:t}=e;return i.jsxs(xe.Dropdown,{children:[i.jsx(xe.Item,{leftSection:i.jsx(kx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),i.jsx(xe.Item,{leftSection:i.jsx(Tx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),i.jsx(xe.Divider,{}),i.jsx(xe.Item,{leftSection:i.jsx(Iu,{size:14}),onClick:()=>e.onPrompt(t,Ce.EQUALS),children:"Equals..."}),i.jsx(xe.Item,{leftSection:i.jsx(Du,{size:14}),onClick:()=>e.onPrompt(t,Ce.NOT),children:"Does not equal..."}),i.jsx(xe.Divider,{}),i.jsx(xe.Item,{leftSection:i.jsx(LF,{size:14}),onClick:()=>e.onPrompt(t,Ce.CONTAINS),children:"Contains..."}),i.jsx(xe.Item,{leftSection:i.jsx(OF,{size:14}),onClick:()=>e.onPrompt(t,Ce.EQUALS),children:"Does not contain..."}),i.jsx(Lu,{...e})]})}function GU(e){const{searchParam:t}=e;return i.jsxs(xe.Dropdown,{children:[i.jsx(xe.Item,{leftSection:i.jsx(Iu,{size:14}),onClick:()=>e.onPrompt(t,Ce.EQUALS),children:"Equals..."}),i.jsx(xe.Item,{leftSection:i.jsx(Du,{size:14}),onClick:()=>e.onPrompt(t,Ce.NOT),children:"Does not equal..."}),i.jsx(Lu,{...e})]})}function Lu(e){const{searchParam:t}=e,n=t.code;return i.jsxs(i.Fragment,{children:[i.jsx(xe.Divider,{}),i.jsx(xe.Item,{leftSection:i.jsx(IF,{size:14}),onClick:()=>e.onChange(XS(e.search,n)),children:"Missing"}),i.jsx(xe.Item,{leftSection:i.jsx(DF,{size:14}),onClick:()=>e.onChange(XS(e.search,n,!1)),children:"Not missing"}),i.jsx(xe.Divider,{}),i.jsx(xe.Item,{leftSection:i.jsx(Il,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}const QU="_root_vlout_1",KU="_table_vlout_8",YU="_tr_vlout_12",XU="_th_vlout_18",JU="_control_vlout_22",ZU="_icon_vlout_31",Fc={root:QU,table:KU,tr:YU,th:XU,control:JU,icon:ZU};function eV(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(tV(t,r));return n}function tV(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=Ca(e,t),r=d7(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const s=dx(e);let l;if(s){const u=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);l=Object.values(s).filter(d=>!!d.expression&&u.test(d==null?void 0:d.expression)),l.length===0&&(l=void 0)}return{name:t,elementDefinition:n,searchParams:l}}if(r){const s=Yl(e,r);return{name:t,elementDefinition:(o=s.elementDefinitions)==null?void 0:o[0],searchParams:[r]}}return{name:t}}class nV extends Event{constructor(t){super("change"),this.definition=t}}class rV extends Event{constructor(t){super("load"),this.response=t}}class Lf extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function $u(e){var Q,te,V;const t=Te(),[n,r]=g.useState(),{search:o,onLoad:s}=e,[l,u]=g.useState(o);hs(o,l)||u(o);const[d,p]=g.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),h=g.useRef(d);h.current=d;const m=l.total??"accurate",y=g.useCallback(O=>{r(void 0),t.requestSchema(l.resourceType).then(()=>t.search(l.resourceType,hl({...l,total:m,fields:void 0}),O)).then(A=>{p({...h.current,searchResponse:A}),s&&s(new rV(A))}).catch(A=>{p({...h.current,searchResponse:void 0}),r(Bt(A))})},[t,l,m,s]),x=g.useCallback(()=>{p({...h.current,searchResponse:void 0}),y({cache:"reload"})},[y]);g.useEffect(()=>{y()},[y]);function b(O,A){O.stopPropagation();const I=O.target.checked,F={...h.current.selected};I?F[A]=!0:delete F[A],p({...h.current,selected:F})}function w(O){O.stopPropagation();const B=O.target.checked,I={},F=h.current.searchResponse;B&&(F!=null&&F.entry)&&F.entry.forEach(J=>{var de;(de=J.resource)!=null&&de.id&&(I[J.resource.id]=!0)}),p({...h.current,selected:I})}function j(){var A,B;const O=h.current;if(!((A=O.searchResponse)!=null&&A.entry)||O.searchResponse.entry.length===0)return!1;for(const I of O.searchResponse.entry)if((B=I.resource)!=null&&B.id&&!O.selected[I.resource.id])return!1;return!0}function T(O){e.onChange&&e.onChange(new nV(O))}function P(O,A){if(YT(O.target)||O.button===2)return;qt(O);const B=O.button===1||O.ctrlKey||O.metaKey;!B&&e.onClick&&e.onClick(new Lf(A,O)),B&&e.onAuxClick&&e.onAuxClick(new Lf(A,O))}function k(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(n)return i.jsx(ao,{outcome:n});if(!eT(l.resourceType))return i.jsx(Vn,{style:{width:"100%",height:"100%"},children:i.jsx(Rr,{})});const E=e.checkboxesEnabled,_=eV(l),R=l.resourceType,M=d.searchResponse,N=M==null?void 0:M.entry,L=N==null?void 0:N.map(O=>O.resource),z="subtle",q="gray",G=16,Y=window.innerWidth<768;return i.jsxs("div",{className:Fc.root,"data-testid":"search-control",children:[!e.hideToolbar&&i.jsxs(be,{justify:"space-between",mb:"xl",children:[i.jsxs(be,{gap:2,children:[i.jsx(Pe,{size:"compact-md",variant:z,color:q,leftSection:i.jsx(BF,{size:G}),onClick:()=>p({...h.current,fieldEditorVisible:!0}),children:"Fields"}),i.jsx(Pe,{size:"compact-md",variant:z,color:q,leftSection:i.jsx(qF,{size:G}),onClick:()=>p({...h.current,filterEditorVisible:!0}),children:"Filters"}),e.onNew&&i.jsx(Pe,{size:"compact-md",variant:z,color:q,leftSection:i.jsx(HF,{size:G}),onClick:e.onNew,children:"New..."}),!Y&&k()&&i.jsx(Pe,{size:"compact-md",variant:z,color:q,leftSection:i.jsx(h8,{size:G}),onClick:e.onExport?e.onExport:()=>p({...h.current,exportDialogVisible:!0}),children:"Export..."}),!Y&&e.onDelete&&i.jsx(Pe,{size:"compact-md",variant:z,color:q,leftSection:i.jsx(Px,{size:G}),onClick:()=>e.onDelete(Object.keys(d.selected)),children:"Delete..."}),!Y&&e.onBulk&&i.jsx(Pe,{size:"compact-md",variant:z,color:q,leftSection:i.jsx(NF,{size:G}),onClick:()=>e.onBulk(Object.keys(d.selected)),children:"Bulk..."})]}),i.jsxs(be,{gap:2,children:[M&&i.jsxs($e,{size:"xs",c:"dimmed","data-testid":"count-display",children:[AP(l,M).toLocaleString(),"-",lV(l,M).toLocaleString(),M.total!==void 0&&` of ${l.total==="estimate"?"~":""}${(Q=M.total)==null?void 0:Q.toLocaleString()}`]}),i.jsx(Cn,{variant:z,color:q,title:"Refresh",onClick:x,children:i.jsx(s8,{size:G})})]})]}),i.jsxs(Le,{className:Fc.table,children:[i.jsxs(Le.Thead,{children:[i.jsxs(Le.Tr,{children:[E&&i.jsx(Le.Th,{children:i.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:j(),onChange:O=>w(O)})}),_.map(O=>i.jsx(Le.Th,{children:i.jsxs(xe,{shadow:"md",width:240,position:"bottom-end",children:[i.jsx(xe.Target,{children:i.jsx(Gn,{className:Fc.control,p:2,children:i.jsxs(be,{justify:"space-between",wrap:"nowrap",children:[i.jsx($e,{fw:500,children:pa(O.name)}),i.jsx(Vn,{className:Fc.icon,children:i.jsx(PF,{size:14,stroke:1.5})})]})})}),i.jsx(BU,{search:l,searchParams:O.searchParams,onPrompt:(A,B)=>{p({...h.current,filterDialogVisible:!0,filterDialogSearchParam:A,filterDialogFilter:B})},onChange:A=>{T(A)}})]})},O.name))]}),!e.hideFilters&&i.jsxs(Le.Tr,{children:[E&&i.jsx(Le.Th,{}),_.map(O=>i.jsx(Le.Th,{children:O.searchParams&&i.jsx(iV,{resourceType:R,searchParams:O.searchParams,filters:l.filters})},O.name))]})]}),i.jsx(Le.Tbody,{children:L==null?void 0:L.map(O=>O&&i.jsxs(Le.Tr,{className:Fc.tr,"data-testid":"search-control-row",onClick:A=>P(A,O),onAuxClick:A=>P(A,O),children:[E&&i.jsx(Le.Td,{children:i.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${O.id}`,checked:!!d.selected[O.id],onChange:A=>b(A,O.id)})}),_.map(A=>i.jsx(Le.Td,{children:DU(O,A)},A.name))]},O.id))})]}),!(L!=null&&L.length)&&i.jsx(Nu,{children:i.jsx(Vn,{style:{height:150},children:i.jsx($e,{size:"xl",c:"dimmed",children:"No results"})})}),M&&i.jsx(Vn,{m:"md",p:"md",children:i.jsx(_o,{value:sV(l),total:aV(l,M),onChange:O=>T(kU(l,O)),getControlProps:O=>{switch(O){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),i.jsx(AU,{search:l,visible:h.current.fieldEditorVisible,onOk:O=>{T(O),p({...h.current,fieldEditorVisible:!1})},onCancel:()=>{p({...h.current,fieldEditorVisible:!1})}}),i.jsx(LU,{search:l,visible:h.current.filterEditorVisible,onOk:O=>{T(O),p({...h.current,filterEditorVisible:!1})},onCancel:()=>{p({...h.current,filterEditorVisible:!1})}}),i.jsx(hU,{visible:h.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{p({...h.current,exportDialogVisible:!1})}}),i.jsx(FU,{visible:h.current.filterDialogVisible,title:(te=d.filterDialogSearchParam)!=null&&te.code?pa(d.filterDialogSearchParam.code):"",resourceType:R,searchParam:d.filterDialogSearchParam,filter:d.filterDialogFilter,defaultValue:"",onOk:O=>{T(Wp(l,O.code,O.operator,O.value)),p({...h.current,filterDialogVisible:!1})},onCancel:()=>{p({...h.current,filterDialogVisible:!1})}},(V=d.filterDialogSearchParam)==null?void 0:V.code)]})}const oV=$u;function iV(e){const t=(e.filters??[]).filter(n=>e.searchParams.find(r=>r.code===n.code));return t.length===0?i.jsx("span",{children:"no filters"}):i.jsx(i.Fragment,{children:t.map(n=>i.jsxs("div",{children:[IP(n.operator)," ",i.jsx(zU,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function sV(e){return Math.floor((e.offset??0)/(e.count??Mp))+1}function aV(e,t){const n=e.count??Mp,r=MP(e,t);return Math.ceil(r/n)}function AP(e,t){return Math.min(MP(e,t),(e.offset??0)+1)}function lV(e,t){var n;return Math.max(AP(e,t)+(((n=t.entry)==null?void 0:n.length)??0)-1,0)}function MP(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(s=>s.relation==="next")?1:0)),n}function cV(e){const t=Te(),[n,r]=g.useState(!1),[o,s]=g.useState(),{query:l,fields:u}=e,[d,p]=g.useState(),[h,m]=g.useState({}),y=g.useRef();y.current=d;const x=g.useRef({});x.current=h,g.useEffect(()=>{s(void 0),t.graphql(l).then(p).catch(k=>s(Bt(k)))},[t,l]);function b(k,E){k.stopPropagation();const R=k.target.checked,M={...x.current};R?M[E]=!0:delete M[E],m(M)}function w(k){var N;k.stopPropagation();const _=k.target.checked,R={},M=(N=y.current)==null?void 0:N.data.ResourceList;_&&M&&M.forEach(L=>{L.id&&(R[L.id]=!0)}),m(R)}function j(){var E;const k=(E=y.current)==null?void 0:E.data.ResourceList;if(!k||k.length===0)return!1;for(const _ of k)if(_.id&&!x.current[_.id])return!1;return!0}function T(k,E){YT(k.target)||(qt(k),k.button!==1&&e.onClick&&e.onClick(new Lf(E,k)),k.button===1&&e.onAuxClick&&e.onAuxClick(new Lf(E,k)))}if(g.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return i.jsx(Rr,{});const P=e.checkboxesEnabled;return i.jsxs("div",{onContextMenu:k=>qt(k),"data-testid":"search-control",children:[i.jsxs(Le,{children:[i.jsx(Le.Thead,{children:i.jsxs(Le.Tr,{children:[P&&i.jsx(Le.Th,{children:i.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:j(),onChange:k=>w(k)})}),u.map(k=>i.jsx(Le.Th,{children:k.name},k.name))]})}),i.jsx(Le.Tbody,{children:d==null?void 0:d.data.ResourceList.map(k=>k&&i.jsxs(Le.Tr,{"data-testid":"search-control-row",onClick:E=>T(E,k),onAuxClick:E=>T(E,k),children:[P&&i.jsx(Le.Td,{children:i.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${k.id}`,checked:!!h[k.id],onChange:E=>b(E,k.id)})}),u.map(E=>i.jsx(Le.Td,{children:i.jsx(pU,{propertyType:E.propertyType,path:E.fhirPath,resource:k})},E.name))]},k.id))})]}),(d==null?void 0:d.data.ResourceList.length)===0&&i.jsx("div",{"data-testid":"empty-search",children:"No results"}),o&&i.jsx("div",{"data-testid":"search-error",children:i.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),e.onBulk&&i.jsx(Pe,{onClick:()=>e.onBulk(Object.keys(x.current)),children:"Bulk..."})]})}const uV=g.memo(cV);function dV(e){const{group:t}=e;return i.jsx(kr,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:i.jsxs(be,{children:[t.measureScore&&i.jsx(hV,{group:t}),!t.measureScore&&i.jsx(pV,{group:t})]})})}function fV(e){const{measure:t}=e;return i.jsxs(i.Fragment,{children:[i.jsx($e,{fz:"md",fw:500,mb:8,children:t.title}),i.jsx($e,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function pV(e){const{group:t}=e,n=t.population,r=n==null?void 0:n.find(d=>ms(d.code)==="numerator"),o=n==null?void 0:n.find(d=>ms(d.code)==="denominator"),s=r==null?void 0:r.count,l=o==null?void 0:o.count;if(l===0)return i.jsxs(se,{children:[i.jsx(ze,{order:3,children:"Not Applicable"}),i.jsx($e,{children:`Denominator: ${l}`})]});if(s===void 0||l===void 0)return i.jsxs(se,{children:[i.jsx(ze,{order:3,children:"Insufficient Data"}),i.jsx($e,{children:`Numerator: ${s}`}),i.jsx($e,{children:`Denominator: ${l}`})]});const u=s/l*100;return i.jsx(Rp,{size:120,thickness:12,roundCaps:!0,sections:[{value:u,color:OP(u)}],label:i.jsx(oa,{justify:"center",children:i.jsxs($e,{fw:700,fz:18,children:[s," / ",l]})})})}function hV(e){var r,o,s;const{group:t}=e,n=((r=t.measureScore)==null?void 0:r.unit)??((o=t.measureScore)==null?void 0:o.code);return i.jsx(i.Fragment,{children:n==="%"?i.jsx(Rp,{size:120,thickness:12,roundCaps:!0,sections:[{value:mV(t),color:OP(((s=t==null?void 0:t.measureScore)==null?void 0:s.value)??0)}],label:i.jsx(oa,{justify:"center",children:i.jsx($e,{fw:700,fz:18,children:i.jsx(lu,{value:t.measureScore})})})}):i.jsx(oa,{h:120,align:"center",children:i.jsx(ze,{order:3,children:i.jsx(lu,{value:t.measureScore})})})})}function mV(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 OP(e){return e<=33?"red":e<=67?"yellow":"green"}function gV(e){var r;const t=Kt(e.measureReport),[n]=wF("Measure",{url:t==null?void 0:t.measure});return t?i.jsxs(se,{children:[n&&i.jsx(fV,{measure:n}),i.jsx(Gy,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:(r=t.group)==null?void 0:r.map((o,s)=>i.jsx(dV,{group:o},o.id??s))})]}):null}function vV(e){const{patient:t,...n}=e,r=g.useCallback((o,s,l)=>{const u=`${s}/${l}`,d=100;return Promise.allSettled([o.readHistory("Patient",l),o.search("Communication",{subject:u,_count:d}),o.search("Device",{patient:u,_count:d}),o.search("DeviceRequest",{patient:u,_count:d}),o.search("DiagnosticReport",{subject:u,_count:d}),o.search("Media",{subject:u,_count:d}),o.search("ServiceRequest",{subject:u,_count:d}),o.search("Task",{subject:u,_count:d})])},[]);return i.jsx(Vp,{value:t,loadTimelineResources:r,createCommunication:(o,s,l)=>({resourceType:"Communication",status:"completed",subject:Jt(o),sender:Jt(s),sent:new Date().toISOString(),payload:[{contentString:l}]}),createMedia:(o,s,l)=>({resourceType:"Media",status:"completed",subject:Jt(o),operator:Jt(s),issued:new Date().toISOString(),content:l}),...n})}const yV="_section_14dzq_2",xV="_hovering_14dzq_11",bV="_editing_14dzq_15",wV="_bottomActions_14dzq_20",ml={section:yV,hovering:xV,editing:bV,bottomActions:wV};function SV(e){const t=Te(),n=Kt(e.value),[r,o]=g.useState(!1),[s,l]=g.useState(),[u,d]=g.useState(),[p,h]=g.useState();function m(){d(void 0)}function y(){l(void 0)}const x=g.useRef();if(x.current=p,g.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>o(!0)).catch(console.log)},[t]),g.useEffect(()=>(h(PV(n??{resourceType:"PlanDefinition",status:"active"})),document.addEventListener("mouseover",m),document.addEventListener("click",y),()=>{document.removeEventListener("mouseover",m),document.removeEventListener("click",y)}),[n]),!r||!p)return null;function b(w,j){h({...x.current,[w]:j})}return i.jsx("div",{children:i.jsxs(yt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(p),children:[i.jsx(Fe,{label:"Plan Title",defaultValue:p.title,onChange:w=>b("title",w.currentTarget.value)}),i.jsx(LP,{actions:p.action||[],selectedKey:s,setSelectedKey:l,hoverKey:u,setHoverKey:d,onChange:w=>b("action",w)}),i.jsx(Pe,{type:"submit",children:"Save"})]})})}function LP(e){const t=g.useRef();t.current=e.actions;function n(s){e.onChange(t.current.map(l=>l.id===s.id?s:l))}function r(s){e.onChange([...t.current,s]),e.setSelectedKey(s.id)}function o(s){e.onChange(t.current.filter(l=>l!==s))}return i.jsxs("div",{className:ml.section,children:[e.actions.map(s=>i.jsx("div",{children:i.jsx(jV,{action:s,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>o(s)})},s.id)),i.jsx("div",{className:ml.bottomActions,children:i.jsx(Rt,{href:"#",onClick:s=>{qt(s),r({id:FP()})},children:"Add action"})})]})}function jV(e){const{action:t}=e,n=TV(t),r=e.selectedKey===e.action.id,o=e.hoverKey===e.action.id;function s(d){d.stopPropagation(),e.setSelectedKey(e.action.id)}function l(d){qt(d),e.setHoverKey(e.action.id)}const u=It(ml.section,{[ml.editing]:r,[ml.hovering]:o&&!r});return i.jsxs("div",{"data-testid":t.id,className:u,onClick:s,onMouseOver:l,onFocus:l,children:[r?i.jsx(EV,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onRemove:e.onRemove}):i.jsx(CV,{action:t,actionType:n}),i.jsx("div",{className:ml.bottomActions,children:i.jsx(Rt,{href:"#",onClick:d=>{d.preventDefault(),e.onRemove()},children:"Remove"})})]})}const rv={path:"PlanDefinition.action.timing[x]",min:0,max:1,description:"",isArray:!1,constraints:[],type:["dateTime","Period","Range","Timing"].map(e=>({code:e}))};function CV(e){const{action:t,actionType:n}=e,[r,o]=$P(t);return i.jsxs("div",{children:[i.jsxs("div",{children:[t.title||"Untitled"," ",n&&`(${n})`]}),t.definitionCanonical&&i.jsx("div",{children:i.jsx(Mf,{value:{reference:t.definitionCanonical}})}),r&&i.jsx("div",{children:i.jsx(Po,{property:rv,propertyType:o,value:r})})]})}function EV(e){const{action:t}=e,[n,r]=g.useState(e.actionType);function o(s,l){e.onChange({...t,[s]:l})}return i.jsxs(tt,{gap:"xl",children:[i.jsx(Fe,{name:`actionTitle-${t.id}`,label:"Title",defaultValue:t.title,onChange:s=>o("title",s.currentTarget.value)}),i.jsx(Fe,{name:`actionDescription-${t.id}`,label:"Description",defaultValue:t.description,onChange:s=>o("description",s.currentTarget.value)}),i.jsx(Zt,{label:"Type of Action",description:"The type of the action to be performed.",name:`actionType-${t.id}`,defaultValue:n,onChange:s=>r(s.currentTarget.value),data:["","appointment","lab","questionnaire","task"]}),t.action&&t.action.length>0&&i.jsx(LP,{actions:t.action,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:s=>o("action",s)}),(()=>{switch(n){case"appointment":return i.jsx(rf,{title:"Appointment",description:"The subject must schedule an appointment from the schedule.",resourceType:"Schedule",action:t,onChange:e.onChange});case"lab":return i.jsx(rf,{title:"Lab",description:"The subject must complete the following lab panel.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});case"questionnaire":return i.jsx(rf,{title:"Questionnaire",description:"The subject must complete the selected questionnaire.",resourceType:"Questionnaire",action:t,onChange:e.onChange});case"task":return i.jsx(rf,{title:"Task",description:"The subject must complete the following task.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});default:return null}})(),i.jsx(Wt,{title:"Timing",description:"When the action should take place.",children:i.jsx(kV,{name:"timing-"+t.id,action:t,onChange:e.onChange})})]})}function rf(e){const{id:t,definitionCanonical:n}=e.action,r=n!=null&&n.startsWith(e.resourceType+"/")?{reference:n}:void 0;return i.jsx(ka,{name:t,resourceType:e.resourceType,defaultValue:r,loadOnFocus:!0,onChange:o=>{o?e.onChange({...e.action,definitionCanonical:Ot(o)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function kV(e){const t=e.action,n="timing",[r,o]=$P(t);return i.jsx(Jl,{property:rv,name:"timing[x]",path:"PlanDefinition.timing[x]",defaultValue:r,defaultPropertyType:o,onChange:(s,l)=>{e.onChange(gP(t,n,l??n,rv,s))},outcome:void 0})}function TV(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 $P(e){return Ou({type:"PlanDefinitionAction",value:e},"timing")}let gg=1;function FP(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(gg=Math.max(gg,t+1))}return e}return"id-"+gg++}function PV(e){return{...e,action:zP(e.action)}}function zP(e){if(e)return e.map(t=>({...t,id:FP(t.id),action:zP(t.action)}))}var Xt=(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))(Xt||{});function RV(e){return e.type==="choice"||e.type==="open-choice"}function _V(e,t){var o;const n=ws(e,Dp+"/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression");if(t&&n){const s=(o=n.valueExpression)==null?void 0:o.expression;if(s){const l=no(t),u=ca(s,[l],{"%resource":l});return Wo(u)}}if(!e.enableWhen)return!0;const r=e.enableBehavior??"any";for(const s of e.enableWhen){const l=WP(t==null?void 0:t.item,s.question);if(s.operator==="exists"&&!s.answerBoolean&&!(l!=null&&l.length)){if(r==="any")return!0;continue}const{anyMatch:u,allMatch:d}=AV(s,l,r);if(r==="any"&&u)return!0;if(r==="all"&&!d)return!1}return r!=="any"}function BP(e,t){return e.map(n=>{if(n.item)return{...n,item:BP(n.item,t)};{const r=IV(n,t);if(!r)return null;const o=DV(n,r);return o?{id:n==null?void 0:n.id,linkId:n==null?void 0:n.linkId,text:n.text,answer:[o]}:null}}).filter(n=>n!==null)}function DV(e,t){if(e.type)switch(e.type){case"boolean":return t.type===re.boolean?{valueBoolean:t.value}:void 0;case"date":return t.type===re.date?{valueDate:t.value}:void 0;case"dateTime":return t.type===re.dateTime?{valueDateTime:t.value}:void 0;case"time":return t.type===re.time?{valueTime:t.value}:void 0;case"url":return t.type===re.url?{valueString:t.value}:void 0;case"text":return t.type===re.string?{valueString:t.value}:void 0;case"attachment":return t.type===re.Attachment?{valueAttachment:t.value}:void 0;case"reference":return t.type===re.Reference?{valueReference:t.value}:void 0;case"quantity":return{valueQuantity:t.value};case"decimal":return{valueDecimal:t.value};case"integer":return{valueInteger:t.value};case"string":return{valueString:t.value};default:return}}function IV(e,t){var r;if(!t)return;const n=ws(e,Dp+"/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression");if(n){const o=(r=n.valueExpression)==null?void 0:r.expression;if(o){const s=no(t),l=ca(o,[s],{"%resource":s});return l.length!==0?l[0]:void 0}}}function UP(e,t){return e.map(n=>{const r=t.find(o=>o.linkId===n.linkId);return r?{...n,item:r.item?UP(n.item||[],r.item):n.item,answer:r.answer||n.answer}:n})}function VP(e,t,n){var o;const r=[];for(const s of e){const l=(o=n.answerOption)==null?void 0:o.find(u=>iu(ki(u))===s);if(l){const u=ki(l);u&&r.push({[t]:u.value})}}return r}function WP(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=WP(n.item,t);if(r)return r}}}function NV(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}]=ca(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return o}else return!1}function AV(e,t,n){const r=t||[],o=BV(e);let s=!1,l=!0;for(const u of r){const d=UV(u),{operator:p}=e;if(NV(d,o,p)?s=!0:l=!1,n==="any"&&s)break}return{anyMatch:s,allMatch:l}}function HP(e){var n,r;const t=ws(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 vg(e,t){var o;const n=Br(e);let r=ws(n,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");return!t||t.length===0?(r&&(n.extension=(o=n.extension)==null?void 0:o.filter(s=>s!==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(s=>({code:s}))},delete r.valueCode),n)}function MV(e,t,n){const r=ws(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 s={},l=o.split("&");for(const u of l){const[d,p]=Gg(u,"=",2);s[d]=p}return s}function OV(e){return{resourceType:"QuestionnaireResponse",questionnaire:Ot(e),item:qP(e.item),status:"in-progress"}}function qP(e){return(e==null?void 0:e.map(GP))??[]}function GP(e){var t;return{id:$V(),linkId:e.linkId,text:e.text,item:qP(e.item),answer:((t=e.initial)==null?void 0:t.map(FV))??[]}}let LV=1;function $V(){return"id-"+LV++}function FV(e){return{...e}}function zV(e){var n,r,o,s;const t=(n=e==null?void 0:e.item)==null?void 0:n[0];if(t){const l=ws(t,"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl");if(((s=(o=(r=l==null?void 0:l.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:s.code)==="page")return e.item.length}return 1}function Hp(e){return Ru({type:"QuestionnaireItemInitial",value:e},"value")}function ki(e){return Ru({type:"QuestionnaireItemAnswerOption",value:e},"value")}function BV(e){return Ru({type:"QuestionnaireItemEnableWhen",value:e},"answer")}function UV(e){return Ru({type:"QuestionnaireResponseItemAnswer",value:e},"value")}const QP=g.createContext({});function ov(e){const t=g.useContext(QP),n=e.item,r=e.response;function o(p){var m,y,x,b;let h;Array.isArray(p)?h=p:e.index>=(((y=(m=e.response)==null?void 0:m.answer)==null?void 0:y.length)??0)?h=(((x=e.response)==null?void 0:x.answer)??[]).concat([p]):h=(((b=e.response)==null?void 0:b.answer)??[]).map((j,T)=>T===e.index?p:j)??[],e.onChange({id:r==null?void 0:r.id,linkId:r==null?void 0:r.linkId,text:n.text,answer:h})}const s=n.type;if(!s)return null;const l=n.linkId;if(!l)return null;const u=n.initial&&n.initial.length>0?n.initial[0]:void 0,d=Kx(r,e.index)??Hp(u);switch(s){case Xt.display:return i.jsx("p",{children:e.item.text},e.item.linkId);case Xt.boolean:return i.jsx(mP,{title:e.item.text,htmlFor:e.item.linkId,children:i.jsx(rr,{id:e.item.linkId,name:e.item.linkId,defaultChecked:d==null?void 0:d.value,onChange:p=>o({valueBoolean:p.currentTarget.checked})})},e.item.linkId);case Xt.decimal:return i.jsx(Fe,{type:"number",step:"any",id:l,name:l,required:n.required,defaultValue:d==null?void 0:d.value,onChange:p=>o({valueDecimal:p.currentTarget.valueAsNumber})});case Xt.integer:return i.jsx(Fe,{type:"number",step:1,id:l,name:l,required:n.required,defaultValue:d==null?void 0:d.value,onChange:p=>o({valueInteger:p.currentTarget.valueAsNumber})});case Xt.date:return i.jsx(Fe,{type:"date",id:l,name:l,required:n.required,defaultValue:d==null?void 0:d.value,onChange:p=>o({valueDate:p.currentTarget.value})});case Xt.dateTime:return i.jsx(ua,{name:l,required:n.required,defaultValue:d==null?void 0:d.value,onChange:p=>o({valueDateTime:p})});case Xt.time:return i.jsx(Fe,{type:"time",id:l,name:l,required:n.required,defaultValue:d==null?void 0:d.value,onChange:p=>o({valueTime:p.currentTarget.value})});case Xt.string:case Xt.url:return i.jsx(Fe,{id:l,name:l,required:n.required,defaultValue:d==null?void 0:d.value,onChange:p=>o({valueString:p.currentTarget.value})});case Xt.text:return i.jsx(ba,{id:l,name:l,required:n.required,defaultValue:d==null?void 0:d.value,onChange:p=>o({valueString:p.currentTarget.value})});case Xt.attachment:return i.jsx(be,{py:4,children:i.jsx(ZT,{path:"",name:l,defaultValue:d==null?void 0:d.value,onChange:p=>o({valueAttachment:p})})});case Xt.reference:return i.jsx(Up,{name:l,required:n.required,targetTypes:HP(n),searchCriteria:MV(n,t.subject,t.encounter),defaultValue:d==null?void 0:d.value,onChange:p=>o({valueReference:p})});case Xt.quantity:return i.jsx(da,{path:"",name:l,required:n.required,defaultValue:d==null?void 0:d.value,onChange:p=>o({valueQuantity:p}),disableWheel:!0});case Xt.choice:case Xt.openChoice:return QV(n)&&!n.answerValueSet?i.jsx(VV,{name:l,item:n,initial:u,response:r,onChangeAnswer:p=>o(p)}):KV(n)&&!n.answerValueSet?i.jsx(WV,{name:l,item:n,initial:u,response:r,onChangeAnswer:p=>o(p)}):i.jsx(HV,{name:l,item:n,initial:u,response:r,onChangeAnswer:p=>o(p)});default:return null}}function VV(e){var d;const{name:t,item:n,initial:r,response:o}=e;if(!((d=n.answerOption)!=null&&d.length))return i.jsx(Qx,{});const s=Hp(r),l=[""];for(const p of n.answerOption){const h=ki(p);l.push(iu(h))}const u=Kx(o)??s;if(n.repeats){const{propertyName:p,data:h}=YP(e.item),m=KP(o);return i.jsx(wu,{data:h,placeholder:"Select items",searchable:!0,defaultValue:m||[iu(s)],onChange:y=>{const x=VP(y,p,n);e.onChangeAnswer(x)}})}return i.jsx(Zt,{id:t,name:t,onChange:p=>{const h=p.currentTarget.selectedIndex;if(h===0){e.onChangeAnswer({});return}const m=n.answerOption[h-1],y=ki(m),x="value"+Ln(y.type);e.onChangeAnswer({[x]:y.value})},defaultValue:_u(u==null?void 0:u.value)||(u==null?void 0:u.value),data:l})}function WV(e){var d;const{item:t,initial:n,response:r}=e;if(!((d=t.answerOption)!=null&&d.length))return i.jsx(Qx,{});const o=Hp(n),{propertyName:s,data:l}=YP(e.item),u=KP(r);return i.jsx(wu,{data:l,placeholder:"Select items",searchable:!0,defaultValue:u||[iu(o)],onChange:p=>{const h=VP(p,s,t);e.onChangeAnswer(h)}})}function HV(e){var l;const{name:t,item:n,initial:r,onChangeAnswer:o,response:s}=e;return!((l=n.answerOption)!=null&&l.length)&&!n.answerValueSet?i.jsx(Qx,{}):n.answerValueSet?i.jsx(vP,{path:"",name:t,binding:n.answerValueSet,onChange:u=>o({valueCoding:u}),creatable:n.type===Xt.openChoice}):i.jsx(qV,{name:(s==null?void 0:s.id)??t,item:n,initial:r,response:s,onChangeAnswer:o})}function qV(e){const{name:t,item:n,initial:r,onChangeAnswer:o,response:s}=e,l=Ca("QuestionnaireItemAnswerOption","value[x]"),u=Hp(r),d=[];let p;if(n.answerOption)for(let y=0;y<n.answerOption.length;y++){const x=n.answerOption[y],b=`${t}-option-${y}`,w=ki(x);w!=null&&w.value&&(u&&To(w)===To(u)&&(p=b),d.push([b,w]))}const h=Kx(s),m=GV(d,h);return i.jsx(aa.Group,{name:t,value:m??p,onChange:y=>{const x=d.find(b=>b[0]===y);if(x){const b=x[1],w="value"+Ln(b.type);o({[w]:b.value})}},children:d.map(([y,x])=>i.jsx(aa,{id:y,value:y,py:4,label:i.jsx(Po,{property:l,propertyType:x.type,value:x.value})},y))})}function Qx(){return i.jsx(Fe,{disabled:!0,placeholder:"No Answers Defined"})}function Kx(e,t=0){const n=e.answer;return ki((n==null?void 0:n[t])??{})}function KP(e){const t=e.answer;return t?t.map(r=>ki(r)).map(r=>_u(r==null?void 0:r.value)||(r==null?void 0:r.value)):[]}function GV(e,t){var n;return(n=e.find(r=>hs(r[1].value,t==null?void 0:t.value)))==null?void 0:n[0]}function QV(e){var t;return!!((t=e.extension)!=null&&t.some(n=>{var r,o,s;return n.url==="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl"&&((s=(o=(r=n.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:s.code)==="drop-down"}))}function KV(e){var t;return!!((t=e.extension)!=null&&t.some(n=>{var r,o,s;return n.url===Dp+"/fhir/StructureDefinition/questionnaire-itemControl"&&((s=(o=(r=n.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:s.code)==="multi-select"}))}function YP(e){var s;if(((s=e.answerOption)==null?void 0:s.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=ki(t),r="value"+Ln(n.type),o=(e.answerOption??[]).map(l=>{const u=ki(l),d=iu(u);return{value:d,label:d}});return{propertyName:r,data:o}}const YV="_section_1rlfy_1",XV="_hovering_1rlfy_10",JV="_editing_1rlfy_14",ZV="_questionBody_1rlfy_20",eW="_topActions_1rlfy_24",tW="_bottomActions_1rlfy_33",nW="_movementActions_1rlfy_44",rW="_movementIcons_1rlfy_56",oW="_columnAlignment_1rlfy_60",iW="_linkIdInput_1rlfy_65",sW="_typeSelect_1rlfy_70",aW="_preserveBreaks_1rlfy_74",Lr={section:YV,hovering:XV,editing:JV,questionBody:ZV,topActions:eW,bottomActions:tW,movementActions:nW,movementIcons:rW,columnAlignment:oW,linkIdInput:iW,typeSelect:sW,preserveBreaks:aW};function lW(e){const t=Te(),n=Kt(e.questionnaire),[r,o]=g.useState(!1),[s,l]=g.useState(),[u,d]=g.useState(),[p,h]=g.useState();function m(){h(void 0)}function y(){d(void 0)}g.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>o(!0)).catch(console.log)},[t]),g.useEffect(()=>(l(fW(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",m),document.addEventListener("click",y),()=>{document.removeEventListener("mouseover",m),document.removeEventListener("click",y)}),[n]);const x=(b,w)=>{l(b),e.autoSave&&!w&&e.onSubmit&&e.onSubmit(b)};return!r||!s?null:i.jsx("div",{children:i.jsxs(yt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(s),children:[i.jsx(XP,{item:s,selectedKey:u,setSelectedKey:d,hoverKey:p,setHoverKey:h,onChange:x}),i.jsx(Pe,{type:"submit",children:"Save"})]})})}function XP(e){var k;const t=e.item,n=e.item,r=Mi(e.item),o=r||n.type===Xt.group,s=n.linkId??"[untitled]",l=e.selectedKey===e.item.id,u=e.hoverKey===e.item.id,d=g.useRef();d.current=e.item;function p(E){qt(E),e.setSelectedKey(e.item.id)}function h(E){qt(E),e.setHoverKey(e.item.id)}function m(E){var R;const _=d.current;e.onChange({..._,item:(R=_.item)==null?void 0:R.map(M=>M.id===E.id?E:M)})}function y(E,_){e.onChange({...e.item,item:[...e.item.item??[],E]},_)}function x(E){var _;e.onChange({...e.item,item:(_=e.item.item)==null?void 0:_.filter(R=>R!==E)})}function b(E,_){e.onChange({...d.current,[E]:_})}function w(E){e.onChange({...e.item,...E})}function j(E){var _;e.onChange({...e.item,item:(_=e.item.item)==null?void 0:_.map(R=>R===E?{...R,repeats:!R.repeats}:R)})}function T(E,_){const R=mW(e.item.item,E,_);e.onChange({...e.item,item:R})}const P=It(Lr.section,{[Lr.editing]:l,[Lr.hovering]:u&&!l});return i.jsxs("div",{"data-testid":n.linkId,className:P,onClick:p,onMouseOver:h,onFocus:h,children:[i.jsx("div",{className:Lr.questionBody,children:l?i.jsxs(i.Fragment,{children:[r&&i.jsx(Fe,{size:"xl",defaultValue:t.title,onBlur:E=>b("title",E.currentTarget.value)}),!r&&i.jsx(ba,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:E=>b("text",E.currentTarget.value)}),n.type==="reference"&&i.jsx(dW,{item:n,onChange:w}),RV(n)&&i.jsx(cW,{item:n,onChange:E=>w(E)})]}):i.jsxs(i.Fragment,{children:[t.title&&i.jsx(ze,{children:t.title}),n.text&&i.jsx("div",{className:Lr.preserveBreaks,children:n.text}),!o&&i.jsx(ov,{item:n,index:0,onChange:()=>{},response:{linkId:n.linkId}})]})}),(k=n.item)==null?void 0:k.map((E,_)=>i.jsx("div",{children:i.jsx(XP,{item:E,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:_===0,isLast:_===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:m,onRemove:()=>x(E),onRepeatable:j,onMoveUp:()=>T(_,-1),onMoveDown:()=>T(_,1)})},E.id)),!o&&i.jsx("div",{className:Lr.topActions,children:l?i.jsxs(i.Fragment,{children:[i.jsx(Fe,{size:"xs",className:Lr.linkIdInput,defaultValue:n.linkId,onBlur:E=>b("linkId",E.currentTarget.value)}),!o&&i.jsx(Zt,{size:"xs",className:Lr.typeSelect,defaultValue:n.type,onChange:E=>b("type",E.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"}]})]}):i.jsx("div",{children:s})}),!r&&i.jsx(se,{className:Lr.movementActions,children:i.jsxs(se,{className:Lr.columnAlignment,children:[!e.isFirst&&i.jsx(Rt,{href:"#",onClick:E=>{E.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:i.jsx(_F,{"data-testid":"up-button",size:15,className:Lr.movementIcons})}),!e.isLast&&i.jsx(Rt,{href:"#",onClick:E=>{E.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:i.jsx(RF,{"data-testid":"down-button",size:15,className:Lr.movementIcons})})]})}),i.jsxs("div",{className:Lr.bottomActions,children:[o&&i.jsxs(i.Fragment,{children:[i.jsx(Rt,{href:"#",onClick:E=>{E.preventDefault(),y({id:ha(),linkId:av("q"),type:"string",text:"Question"})},children:"Add item"}),i.jsx(Rt,{href:"#",onClick:E=>{E.preventDefault(),y({id:ha(),linkId:av("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&i.jsx(Rt,{href:"#",onClick:E=>{E.preventDefault(),y(hW(),!0)},children:"Add Page"}),l&&!r&&i.jsxs(i.Fragment,{children:[i.jsx(Rt,{href:"#",onClick:E=>{E.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),i.jsx(Rt,{href:"#",onClick:E=>{E.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function cW(e){const t=Ca("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return i.jsxs("div",{children:[e.item.answerValueSet!==void 0?i.jsx(Fe,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):i.jsx(uW,{options:n,property:t,item:e.item,onChange:e.onChange}),i.jsxs(se,{display:"flex",children:[i.jsx(Rt,{href:"#",onClick:r=>{qt(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:ha()}]})},children:"Add choice"}),i.jsx(_p,{w:"lg"}),i.jsx(Rt,{href:"#",onClick:r=>{qt(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function uW(e){return i.jsx("div",{children:e.options.map(t=>{const[n,r]=Ou({type:"QuestionnaireItemAnswerOption",value:t},"value");return i.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"},children:[i.jsx("div",{children:i.jsx(Jl,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(o,s)=>{const l=[...e.options],u=l.findIndex(d=>d.id===t.id);l[u]={id:t.id,[s]:o},e.onChange({...e.item,answerOption:l})},outcome:void 0},t.id)}),i.jsx("div",{children:i.jsx(Rt,{href:"#",onClick:o=>{qt(o),e.onChange({...e.item,answerOption:e.options.filter(s=>s.id!==t.id)})},children:"Remove"})})]},t.id)})})}function dW(e){const t=HP(e.item)??[];return i.jsxs(i.Fragment,{children:[t.map((n,r)=>i.jsxs(be,{children:[i.jsx(Ix,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:o=>{e.onChange(vg(e.item,t.map(s=>s===n?o:s)))}}),i.jsx(Rt,{href:"#",onClick:o=>{qt(o),e.onChange(vg(e.item,t.filter(s=>s!==n)))},children:"Remove"})]},`${n}-${r}`)),i.jsx(Rt,{href:"#",onClick:n=>{qt(n),e.onChange(vg(e.item,[...t,""]))},children:"Add Resource Type"})]})}let iv=1,sv=1;function av(e){return e+iv++}function ha(){return"id-"+sv++}function fW(e){return{...e,id:e.id||ha(),item:JP(e.item)}}function JP(e){if(e)return e.forEach(t=>{var n,r;(n=t.id)!=null&&n.match(/^id-\d+$/)&&(sv=Math.max(sv,parseInt(t.id.substring(3),10)+1)),(r=t.linkId)!=null&&r.match(/^q\d+$/)&&(iv=Math.max(iv,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||ha(),item:JP(t.item),answerOption:pW(t.answerOption)}))}function pW(e){if(e)return e.map(t=>({...t,id:t.id||ha()}))}function hW(){return{id:ha(),linkId:av("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 mW(e,t,n){const r=e??[],o=t+n;if(o<0||o>=r.length)return r;const s=[...r];return[s[t],s[o]]=[s[o],s[t]],s}function ZP(e){const{item:t,response:n,onChange:r}=e,[o,s]=g.useState(gW(t,n??{linkId:t.linkId}));if(!e.checkForQuestionEnabled(t)||!n)return null;if(t.type===Xt.display)return i.jsx("p",{children:t.text},t.linkId);const l=(t==null?void 0:t.repeats)&&t.type!==Xt.choice&&t.type!==Xt.openChoice;return t.type===Xt.boolean?i.jsx(ov,{item:t,response:n,onChange:u=>r([u]),index:0},t.linkId):i.jsxs(Wt,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[[...Array(o)].map((u,d)=>i.jsx(ov,{item:t,response:n,onChange:p=>r([p]),index:d},`${t.linkId}-${d}`)),l&&i.jsx(Rt,{onClick:()=>s(u=>u+1),children:"Add Item"})]},e.item.linkId)}function gW(e,t){if(e.type===Xt.choice||e.type===Xt.openChoice)return 1;const n=t.answer;return n!=null&&n.length?n.length:1}function eR(e){const[t,n]=g.useState(e.response);if(g.useEffect(()=>{n(e.response)},[e.response]),t.length===0)return null;function r(s,l){const u=t.map((d,p)=>p===l?s[0]:d);n(u),e.onChange(u)}function o(){const s=GP(e.item);n([...t,s])}return i.jsxs(i.Fragment,{children:[t.map((s,l)=>i.jsx(tR,{item:e.item,response:s,checkForQuestionEnabled:e.checkForQuestionEnabled,onChange:u=>r(u,l)},s.id)),e.item.repeats&&i.jsx(Rt,{onClick:o,children:`Add Group: ${e.item.text}`})]})}function tR(e){var s;const{response:t,checkForQuestionEnabled:n,onChange:r}=e;function o(l){var h;const u=(h=t.item)==null?void 0:h.map(m=>l.find(x=>x.id===m.id)??m),d=u==null?void 0:u.concat(l.slice(1)),p={...t,item:d};r([p])}return e.checkForQuestionEnabled(e.item)?i.jsxs("div",{children:[e.item.text&&i.jsx(ze,{order:3,mb:"md",children:e.item.text}),i.jsx(tt,{children:(s=e.item.item)==null?void 0:s.map(l=>{var u,d,p;return l.type===Xt.group?l.repeats?i.jsx(eR,{item:l,response:((u=t.item)==null?void 0:u.filter(h=>h.linkId===l.linkId))??[],checkForQuestionEnabled:n,onChange:o},l.linkId):i.jsx(tR,{item:l,checkForQuestionEnabled:n,response:((d=t.item)==null?void 0:d.find(h=>h.linkId===l.linkId))??{linkId:l.linkId},onChange:o},l.linkId):i.jsx(ZP,{item:l,response:(p=t.item)==null?void 0:p.find(h=>h.linkId===l.linkId),onChange:o,checkForQuestionEnabled:n},l.linkId)})})]},e.item.linkId):null}function vW(e){const{items:t,response:n,activePage:r,onChange:o,nextStep:s,prevStep:l,numberOfPages:u,renderPages:d,submitButtonText:p,excludeButtons:h,checkForQuestionEnabled:m}=e,y=t.map(x=>{var j;const b=((j=n==null?void 0:n.item)==null?void 0:j.filter(T=>T.linkId===x.linkId))??[],w=x.type===Xt.group?i.jsx(eR,{item:x,response:b,onChange:o,checkForQuestionEnabled:m},x.linkId):i.jsx(ZP,{item:x,response:b==null?void 0:b[0],onChange:o,checkForQuestionEnabled:m},x.linkId);return d?i.jsx(Tl.Step,{label:x.text,children:w},x.linkId):w});return i.jsxs(i.Fragment,{children:[d&&i.jsx(Tl,{active:r??0,allowNextStepsSelect:!1,p:6,children:y}),!d&&i.jsx(tt,{children:y}),!h&&i.jsx(yW,{activePage:r??0,numberOfPages:u,nextStep:d?s:void 0,prevStep:d?l:void 0,renderPages:d,submitButtonText:p})]})}function yW(e){const t=e.renderPages&&e.activePage>0,n=e.renderPages&&e.activePage<e.numberOfPages-1,r=!e.renderPages||e.activePage===e.numberOfPages-1;return i.jsxs(be,{justify:"flex-end",mt:"xl",gap:"xs",children:[t&&i.jsx(Pe,{onClick:e.prevStep,children:"Back"}),n&&i.jsx(Pe,{onClick:o=>{const s=o.currentTarget.closest("form");e.nextStep&&s.reportValidity()&&e.nextStep()},children:"Next"}),r&&i.jsx(Pe,{type:"submit",children:e.submitButtonText??"Submit"})]})}function nR(e){const t=Te(),{subject:n,source:r}=e,o=Kt(e.questionnaire),s=yF(o),[l,u]=g.useState(),[d,p]=g.useState(0),h=g.useRef(e.onChange);h.current=e.onChange;const m=g.useRef(e.onSubmit);m.current=e.onSubmit,g.useEffect(()=>{o&&JS(s)===JS(o)||u(o?OV(o):void 0)},[o,s]),g.useEffect(()=>{if(l&&h.current)try{h.current(l)}catch(P){console.error("Error invoking QuestionnaireForm.onChange callback",P)}},[l]);const y=g.useCallback(P=>{u(k=>{const E=(k==null?void 0:k.item)??[],_=rR(E,Array.isArray(P)?P:[P]),R={resourceType:"QuestionnaireResponse",status:"in-progress",item:_},M=BP((o==null?void 0:o.item)??[],R);return{resourceType:"QuestionnaireResponse",status:"in-progress",item:UP(_,M)}})},[o]),x=g.useCallback(()=>{const P=m.current;if(P&&l){let k=r;if(!k){const E=t.getProfile();E&&(k=Jt(E))}P({...l,questionnaire:Ot(o),subject:n,source:k,authored:new Date().toISOString(),status:"completed"})}},[t,o,l,n,r]);function b(P){return _V(P,l)}if(!o||!l)return null;const w=zV(o),j=()=>p(P=>P+1),T=()=>p(P=>P-1);return i.jsx(QP.Provider,{value:{subject:e.subject,encounter:e.encounter},children:i.jsxs(yt,{testid:"questionnaire-form",onSubmit:x,children:[o.title&&i.jsx(ze,{children:o.title}),i.jsx(vW,{items:o.item??[],response:l,onChange:y,renderPages:!e.disablePagination&&w>1,activePage:d,numberOfPages:w,excludeButtons:e.excludeButtons,submitButtonText:e.submitButtonText,checkForQuestionEnabled:b,nextStep:j,prevStep:T})]})})}function xW(e,t){const n=rR(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 rR(e,t){const n=[],r=new Set;for(const o of e){const s=o.id,l=t.find(u=>u.id===s);l?(n.push(xW(o,l)),r.add(l.id)):n.push(o)}for(const o of t)r.has(o.id)||n.push(o);return n}function JS(e){return(e==null?void 0:e.id)||e}const bW="_section_4m5it_1",wW={section:bW},SW=["gender","age","gestationalAge","context","appliesTo","category"],jW={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function CW(e){e=Object.assign(jW,e);const t=e.definition,[n,r]=g.useState([]),[o,s]=g.useState(1),[l,u]=g.useState(1);return g.useEffect(()=>{const b=TW(t,u);r(PW(b.qualifiedInterval||[],s))},[t]),i.jsxs(yt,{testid:"reference-range-editor",onSubmit:d,children:[i.jsx(tt,{children:n.map(b=>{var w;return i.jsx(EW,{unit:_W((w=t.quantitativeDetails)==null?void 0:w.unit),onChange:m,onAdd:y,onRemove:x,onRemoveGroup:h,intervalGroup:b},`group-${b.id}`)})}),i.jsx(Cn,{title:"Add Group",variant:"subtle",size:"sm",onClick:b=>{qt(b),p({id:`group-id-${o}`,filters:{},intervals:[]}),s(w=>w+1)},children:i.jsx(Af,{})}),i.jsx(be,{justify:"flex-end",children:i.jsx(Pe,{type:"submit",children:"Save"})})]});function d(){const b=n.flatMap(w=>w.intervals).filter(w=>!DW(w));e.onSubmit({...t,qualifiedInterval:b})}function p(b){r(w=>[...w,b])}function h(b){r(w=>w.filter(j=>j.id!==b.id))}function m(b,w){r(j=>{j=[...j];const T=j.find(k=>k.id===b),P=T==null?void 0:T.intervals.findIndex(k=>k.id===w.id);return P!==void 0&&(T!=null&&T.intervals[P])&&(T.intervals[P]=w),j})}function y(b,w){w.id===void 0&&(w.id=`id-${l}`,u(j=>j+1)),r(j=>{j=[...j];const T=j.findIndex(P=>P.id===b);if(T!==-1){const P={...j[T]};w={...w,...P.filters},P.intervals=[...P.intervals,w],j[T]=P}return j})}function x(b,w){r(j=>{j=[...j];const T=j.find(P=>P.id===b);return T&&(T.intervals=T.intervals.filter(P=>P.id!==w.id)),j})}}function EW(e){const{intervalGroup:t,unit:n}=e;return i.jsx(Nu,{"data-testid":t.id,className:wW.section,children:i.jsxs(tt,{gap:"lg",children:[i.jsx(be,{justify:"flex-end",children:i.jsx(Cn,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{qt(r),e.onRemoveGroup(t)},children:i.jsx(Nf,{})},`remove-group-button-${t.id}`)}),i.jsx(kW,{intervalGroup:t,onChange:e.onChange}),i.jsx(Dn,{}),t.intervals.map(r=>i.jsxs(tt,{gap:"xs",children:[i.jsxs(be,{children:[i.jsx(Fe,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:o=>{qt(o),e.onChange(t.id,{...r,condition:o.currentTarget.value.trim()})}},`condition-${r.id}`),i.jsx(Cn,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:o=>{qt(o),e.onRemove(t.id,r)},children:i.jsx(Nf,{})},`remove-interval-${r.id}`)]}),i.jsx(Lx,{path:"",onChange:o=>{e.onChange(t.id,{...r,range:o})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),i.jsx(Cn,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{qt(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:i.jsx(Af,{})})]})})}function kW(e){var r,o;const{intervalGroup:t,onChange:n}=e;t.filters.age||(t.filters.age={});for(const s of["low","high"])(r=t.filters.age[s])!=null&&r.unit||(t.filters.age[s]={...t.filters.age[s],unit:"years",system:"http://unitsofmeasure.org"});return i.jsxs(tt,{style:{maxWidth:"50%"},children:[i.jsx(be,{children:i.jsx(Zt,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:s=>{for(const l of t.intervals){let u=s.currentTarget.value;u===""&&(u=void 0),n(t.id,{...l,gender:u})}}})}),i.jsxs(be,{gap:"xs",children:[i.jsx($e,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),i.jsx("div",{id:`div-age-${t.id}`,children:i.jsx(Lx,{path:"",name:`age-${t.id}`,defaultValue:t.filters.age,onChange:s=>{for(const l of t.intervals)n(t.id,{...l,age:s})}},`age-${t.id}`)})]}),i.jsx(Zt,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:((o=t.filters.context)==null?void 0:o.text)||"",onChange:s=>{for(const l of t.intervals){let u=s.currentTarget.value;u===""?(u=void 0,n(t.id,{...l,context:void 0})):n(t.id,{...l,context:{text:u,coding:[{code:u,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),i.jsx(Zt,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:s=>{for(const l of t.intervals){const u=s.currentTarget.value;u===""?n(t.id,{...l,category:void 0}):n(t.id,{...l,category:u})}}})]})}function TW(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(o=>{var l;const s=parseInt(((l=o.id)==null?void 0:l.substring(3))||"",10);return isNaN(s)?Number.NEGATIVE_INFINITY:s}))+1;return Number.isFinite(r)||(r=1),e={...e,qualifiedInterval:n.map(o=>({...o,id:o.id||`id-${r++}`}))},t(r),e}function PW(e,t){let n=1;const r={};for(const o of e){const s=RW(o);s in r||(r[s]={id:`group-id-${n++}`,filters:Object.fromEntries(SW.map(l=>[l,o[l]])),intervals:[]}),r[s].intervals.push(o)}return t(n),Object.values(r)}function RW(e){var n,r;return[`gender=${e.gender}`,`age=${su(e.age)}`,`gestationalAge=${su(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 _W(e){return e&&(H$(e,"http://unitsofmeasure.org")||e.text)}function DW(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 IW(e){var p;const t=Te(),n=Kt(e.value),[r,o]=g.useState(!1),[s,l]=g.useState();if(g.useEffect(()=>{n&&!r&&(t.executeBatch(u(n)).then(l).catch(console.log),o(!0))},[t,n,r]),!n||!s)return null;return i.jsx(Fr,{children:(p=n.action)==null?void 0:p.map((h,m)=>{var w,j,T,P,k,E;const y=h.resource&&d(h.resource),x=(j=(w=y==null?void 0:y.input)==null?void 0:w[0])==null?void 0:j.valueReference,b=(P=(T=y==null?void 0:y.output)==null?void 0:T[0])==null?void 0:P.valueReference;return i.jsxs(g.Fragment,{children:[i.jsx(Fr.Col,{span:1,p:"md",children:(y==null?void 0:y.status)==="completed"?i.jsx(FF,{}):i.jsx(d8,{color:"gray"})}),i.jsxs(Fr.Col,{span:9,p:"xs",children:[i.jsx($e,{fw:500,children:h.title}),h.description&&i.jsx("div",{children:h.description}),i.jsxs("div",{children:["Last edited by ",i.jsx(Zl,{value:(k=y==null?void 0:y.meta)==null?void 0:k.author})," on ",pr((E=y==null?void 0:y.meta)==null?void 0:E.lastUpdated)]}),i.jsxs("div",{children:["Status: ",i.jsx(Bx,{status:(y==null?void 0:y.status)||"unknown"})]})]}),i.jsxs(Fr.Col,{span:2,p:"md",children:[x&&!b&&i.jsx(Pe,{onClick:()=>e.onStart(y,x),children:"Start"}),x&&b&&i.jsx(Pe,{onClick:()=>e.onEdit(y,x,b),children:"Edit"})]})]},`action-${m}`)})});function u(h){var y;const m=[];if(h.action)for(const x of h.action)(y=x.resource)!=null&&y.reference&&m.push({request:{method:"GET",url:x.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:m}}function d(h){for(const m of(s==null?void 0:s.entry)??[])if(m.resource&&h.reference===Ot(m.resource))return m.resource}}function oR(e,t){const n=NW(e,t);return AW(n,e,t)}function NW(e,t){const n=e.length,r=t.length,o=n+r+1,s=1+2*o,l=s/2|0,u=new Array(s);u[l+1]={i:0,j:-1,prev:void 0,snake:!0};for(let d=0;d<o;d++){for(let p=-d;p<=d;p+=2){const h=l+p,m=h+1,y=h-1,x=u[m],b=u[y];let w,j=0;p===-d||p!==d&&b.i<x.i?(j=x.i,w=x):(j=b.i+1,w=b),u[y]=void 0;let T=j-p,P={i:j,j:T,prev:MW(w),snake:!1};for(;j<n&&T<r&&e[j]===t[T];)j++,T++;if(j>P.i&&(P={i:j,j:T,prev:P,snake:!0}),u[h]=P,j>=n&&T>=r)return u[h]}u[l+d-1]=void 0}}function AW(e,t,n){const r=[];let o=e;for(o.snake&&(o=o.prev);o!=null&&o.prev&&o.prev.j>=0;){const s=o.i,l=o.j;o=o.prev;const u=o.i,d=o.j,p={position:u,lines:t.slice(u,s)},h={position:d,lines:n.slice(d,l)};let m;p.lines.length===0&&h.lines.length>0?m="insert":p.lines.length>0&&h.lines.length===0?m="delete":m="change",r.push({original:p,revised:h,type:m}),o.snake&&(o=o.prev)}return r}function MW(e){return e&&!e.snake&&e.prev?e.prev:e}function OW(e){const t=(e.entry??[]).filter(r=>!!r.resource).map(r=>{var o;return{meta:(o=r.resource)==null?void 0:o.meta,lines:To(r.resource,!0).match(/[^\r\n]+/g)}}).sort((r,o)=>r.meta.lastUpdated.localeCompare(o.meta.lastUpdated));if(!t.length)return[];const n=t[0].lines.map(r=>({id:t[0].meta.versionId,meta:t[0].meta,value:r,span:1}));return LW(n,t),$W(n),n}function LW(e,t){for(let n=1;n<t.length;n++){const r=oR(t[n-1].lines,t[n].lines);for(const o of r){const s=o.original.position,l=o.original.lines,u=o.revised.lines;if((o.type==="delete"||o.type==="change")&&e.splice(s,l.length),o.type==="insert"||o.type==="change")for(let d=0;d<o.revised.lines.length;d++)e.splice(s+d,0,{id:t[n].meta.versionId,meta:t[n].meta,value:u[d],span:1})}}}function $W(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 FW="_container_1oj0p_1",zW="_root_1oj0p_5",BW="_startRow_1oj0p_20",UW="_normalRow_1oj0p_24",VW="_author_1oj0p_28",WW="_dateTime_1oj0p_32",HW="_lineNumber_1oj0p_37",qW="_line_1oj0p_37",GW="_pre_1oj0p_52",hi={container:FW,root:zW,startRow:BW,normalRow:UW,author:VW,dateTime:WW,lineNumber:HW,line:qW,pre:GW};function QW(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function KW(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return ll(n,"year");const r=Math.floor(t/2592e3);if(r>0)return ll(r,"month");const o=Math.floor(t/86400);if(o>0)return ll(o,"day");const s=Math.floor(t/3600);if(s>0)return ll(s,"hour");const l=Math.floor(t/60);return l>0?ll(l,"minute"):ll(t,"second")}function ll(e,t){return`${e} ${e===1?t:t+"s"} ago`}function YW(e){var l,u;const t=Te(),[n,r]=g.useState(e.history);if(g.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 i.jsx("div",{children:"Loading..."});const o=(u=(l=n.entry)==null?void 0:l[0])==null?void 0:u.resource;if(!o)return null;const s=OW(n);return i.jsx("div",{className:hi.container,children:i.jsx("table",{className:hi.root,children:i.jsx("tbody",{children:s.map((d,p)=>i.jsxs("tr",{className:d.span>0?hi.startRow:hi.normalRow,children:[d.span>0&&i.jsxs(i.Fragment,{children:[i.jsx("td",{className:hi.author,rowSpan:d.span,children:i.jsx(bl,{value:d.meta.author,link:!0})}),i.jsx("td",{className:hi.dateTime,rowSpan:d.span,children:i.jsx(xt,{to:QW(o,d.meta.versionId),children:KW(d.meta.lastUpdated)})})]}),i.jsx("td",{className:hi.lineNumber,children:p+1}),i.jsx("td",{className:hi.line,children:i.jsx("pre",{className:hi.pre,children:d.value})})]},"row-"+p))})})})}const XW="_removed_mgz0k_2",JW="_added_mgz0k_7",ZS={removed:XW,added:JW};function ZW(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=To(t,!0).match(/[^\r\n]+/g),o=To(n,!0).match(/[^\r\n]+/g),s=oR(r,o);return i.jsx("pre",{style:{color:"gray"},children:s.map((l,u)=>i.jsx(eH,{delta:l},"delta"+u))})}function eH(e){return i.jsxs(i.Fragment,{children:["...",i.jsx("br",{}),e.delta.original.lines.length>0&&i.jsx("div",{className:ZS.removed,children:e.delta.original.lines.join(`
|
|
547
|
-
`)}),e.delta.revised.lines.length>0&&i.jsx("div",{className:ZS.added,children:e.delta.revised.lines.join(`
|
|
548
|
-
`)}),"...",i.jsx("br",{})]})}const tH="_splitButton_1i0gi_1",nH="_menuControl_1i0gi_6",ej={splitButton:tH,menuControl:nH};function $f(e){const{outcome:t}=e,n=Te(),r=Kt(e.defaultValue),o=r==null?void 0:r.resourceType,[s,l]=g.useState(!1),[u,d]=g.useState(),p=n.getAccessPolicy(),h=ln();g.useEffect(()=>{if(r)if(e.profileUrl){const x=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const b=Gl(x);if(b){l(!0);const w=cF(r,b);d(w)}else console.error(`Schema not found for ${x}`)}).catch(b=>{console.error("Error in requestProfileSchema",b)})}else n.requestSchema(o).then(()=>{d(r),l(!0)}).catch(console.log)},[n,r,o,e.profileUrl]);const m=g.useMemo(()=>r&&TT(r,xx.READ,p),[p,r]),y=g.useMemo(()=>n.isSuperAdmin()||!p||!vn(u==null?void 0:u.resourceType)?!0:g6(p,u==null?void 0:u.resourceType),[n,p,u==null?void 0:u.resourceType]);return!s||!u?i.jsx("div",{children:"Loading..."}):y?i.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:x=>{x.preventDefault(),e.onSubmit&&e.onSubmit(u)},children:[i.jsxs(tt,{mb:"xl",children:[i.jsx(Wt,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:i.jsx(Fe,{name:"resourceType",defaultValue:u.resourceType,disabled:!0})}),i.jsx(Wt,{title:"ID",htmlFor:"id",outcome:t,children:i.jsx(Fe,{name:"id",defaultValue:u.id,disabled:!0})})]}),i.jsx(zx,{path:u.resourceType,valuePath:u.resourceType,typeName:o,defaultValue:u,outcome:t,onChange:d,profileUrl:e.profileUrl,accessPolicyResource:m}),i.jsxs(be,{justify:"flex-end",mt:"xl",wrap:"nowrap",gap:0,children:[i.jsx(Pe,{type:"submit",className:It((e.onPatch||e.onDelete)&&ej.splitButton),children:r!=null&&r.id?"Update":"Create"}),(e.onPatch||e.onDelete)&&i.jsxs(xe,{transitionProps:{transition:"pop"},position:"bottom-end",withinPortal:!0,children:[i.jsx(xe.Target,{children:i.jsx(Cn,{variant:"filled",color:h.primaryColor,size:36,className:ej.menuControl,"aria-label":"More actions",children:i.jsx(Cx,{size:14,stroke:1.5})})}),i.jsxs(xe.Dropdown,{children:[e.onPatch&&i.jsx(xe.Item,{leftSection:i.jsx(qT,{size:14,stroke:1.5}),onClick:()=>{e.onPatch(u)},children:"Patch"}),e.onDelete&&i.jsx(xe.Item,{color:"red",leftSection:i.jsx(Px,{size:14,stroke:1.5,color:"red"}),onClick:()=>{e.onDelete(u)},children:"Delete"})]})]})]})]}):i.jsxs(xs,{color:"red",title:"Permission denied",icon:i.jsx(Xl,{}),children:["Your access level prevents you from editing and creating ",u.resourceType," resources."]})}function rH(e){var o;const t=Te(),[n,r]=g.useState(e.history);return g.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?i.jsxs(Le,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[i.jsx(Le.Thead,{children:i.jsxs(Le.Tr,{children:[i.jsx(Le.Th,{children:"Author"}),i.jsx(Le.Th,{children:"Date"}),i.jsx(Le.Th,{children:"Version"})]})}),i.jsx(Le.Tbody,{children:(o=n.entry)==null?void 0:o.map((s,l)=>i.jsx(oH,{entry:s},"entry-"+l))})]}):i.jsx("div",{children:"Loading..."})}function oH(e){var r,o,s;const{response:t,resource:n}=e.entry;return n?i.jsxs(Le.Tr,{children:[i.jsx(Le.Td,{children:i.jsx(bl,{value:(r=n.meta)==null?void 0:r.author,link:!0})}),i.jsx(Le.Td,{children:pr((o=n.meta)==null?void 0:o.lastUpdated)}),i.jsx(Le.Td,{children:i.jsx(xt,{to:iH(n),children:(s=n.meta)==null?void 0:s.versionId})})]}):i.jsx(Le.Tr,{children:i.jsx(Le.Td,{colSpan:3,children:Ze(t==null?void 0:t.outcome)})})}function iH(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function sH(e){const{serviceRequest:t,...n}=e;return i.jsx(Vp,{value:t,loadTimelineResources:async(r,o,s)=>{const l=`${o}/${s}`,u=100;return Promise.allSettled([r.readHistory("ServiceRequest",s),r.search("Communication",{"based-on":l,_count:u}),r.search("DiagnosticReport",{"based-on":l,_count:u}),r.search("Media",{"based-on":l,_count:u}),r.search("DocumentReference",{related:l,_count:u}),r.search("Task",{_filter:`based-on eq ${l} or focus eq ${l} or subject eq ${l}`,_count:u})])},createCommunication:(r,o,s)=>({resourceType:"Communication",status:"completed",basedOn:[Jt(r)],subject:r.subject,sender:Jt(o),sent:new Date().toISOString(),payload:[{contentString:s}]}),createMedia:(r,o,s)=>({resourceType:"Media",status:"completed",basedOn:[Jt(r)],subject:r.subject,operator:Jt(o),issued:new Date().toISOString(),content:s}),...n})}function aH(e){const t=Te(),{client:n,patient:r,encounter:o,children:s,...l}=e;function u(){t.createResource({resourceType:"SmartAppLaunch",patient:r,encounter:o}).then(d=>{const p=new URL(n.launchUri);p.searchParams.set("iss",t.getBaseUrl()+"fhir/R4"),p.searchParams.set("launch",d.id),window.location.assign(p.toString())}).catch(d=>Ie({color:"red",message:Ze(d),autoClose:!1}))}return i.jsx(Rt,{onClick:()=>u(),...l,children:s})}var of={},tj;function lH(){if(tj)return of;tj=1;var e=SC();return of.createRoot=e.createRoot,of.hydrateRoot=e.hydrateRoot,of}var cH=lH();/**
|
|
549
|
-
* @remix-run/router v1.21.0
|
|
550
|
-
*
|
|
551
|
-
* Copyright (c) Remix Software Inc.
|
|
552
|
-
*
|
|
553
|
-
* This source code is licensed under the MIT license found in the
|
|
554
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
555
|
-
*
|
|
556
|
-
* @license MIT
|
|
557
|
-
*/function fn(){return fn=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},fn.apply(this,arguments)}var Tn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Tn||(Tn={}));const nj="popstate";function uH(e){e===void 0&&(e={});function t(r,o){let{pathname:s,search:l,hash:u}=r.location;return cu("",{pathname:s,search:l,hash:u},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:Fu(o)}return fH(t,n,null,e)}function gt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Nl(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function dH(){return Math.random().toString(36).substr(2,8)}function rj(e,t){return{usr:e.state,key:e.key,idx:t}}function cu(e,t,n,r){return n===void 0&&(n=null),fn({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Oi(t):t,{state:n,key:t&&t.key||r||dH()})}function Fu(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Oi(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function fH(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:s=!1}=r,l=o.history,u=Tn.Pop,d=null,p=h();p==null&&(p=0,l.replaceState(fn({},l.state,{idx:p}),""));function h(){return(l.state||{idx:null}).idx}function m(){u=Tn.Pop;let j=h(),T=j==null?null:j-p;p=j,d&&d({action:u,location:w.location,delta:T})}function y(j,T){u=Tn.Push;let P=cu(w.location,j,T);p=h()+1;let k=rj(P,p),E=w.createHref(P);try{l.pushState(k,"",E)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;o.location.assign(E)}s&&d&&d({action:u,location:w.location,delta:1})}function x(j,T){u=Tn.Replace;let P=cu(w.location,j,T);p=h();let k=rj(P,p),E=w.createHref(P);l.replaceState(k,"",E),s&&d&&d({action:u,location:w.location,delta:0})}function b(j){let T=o.location.origin!=="null"?o.location.origin:o.location.href,P=typeof j=="string"?j:Fu(j);return P=P.replace(/ $/,"%20"),gt(T,"No window.location.(origin|href) available to create URL for href: "+P),new URL(P,T)}let w={get action(){return u},get location(){return e(o,l)},listen(j){if(d)throw new Error("A history only accepts one active listener");return o.addEventListener(nj,m),d=j,()=>{o.removeEventListener(nj,m),d=null}},createHref(j){return t(o,j)},createURL:b,encodeLocation(j){let T=b(j);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:y,replace:x,go(j){return l.go(j)}};return w}var Vt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Vt||(Vt={}));const pH=new Set(["lazy","caseSensitive","path","id","index","children"]);function hH(e){return e.index===!0}function Ff(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,s)=>{let l=[...n,String(s)],u=typeof o.id=="string"?o.id:l.join("-");if(gt(o.index!==!0||!o.children,"Cannot specify children on an index route"),gt(!r[u],'Found a route id collision on id "'+u+`". Route id's must be globally unique within Data Router usages`),hH(o)){let d=fn({},o,t(o),{id:u});return r[u]=d,d}else{let d=fn({},o,t(o),{id:u,children:void 0});return r[u]=d,o.children&&(d.children=Ff(o.children,t,l,r)),d}})}function Ks(e,t,n){return n===void 0&&(n="/"),gf(e,t,n,!1)}function gf(e,t,n,r){let o=typeof t=="string"?Oi(t):t,s=zu(o.pathname||"/",n);if(s==null)return null;let l=iR(e);gH(l);let u=null;for(let d=0;u==null&&d<l.length;++d){let p=TH(s);u=EH(l[d],p,r)}return u}function mH(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 iR(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let o=(s,l,u)=>{let d={relativePath:u===void 0?s.path||"":u,caseSensitive:s.caseSensitive===!0,childrenIndex:l,route:s};d.relativePath.startsWith("/")&&(gt(d.relativePath.startsWith(r),'Absolute route path "'+d.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),d.relativePath=d.relativePath.slice(r.length));let p=fs([r,d.relativePath]),h=n.concat(d);s.children&&s.children.length>0&&(gt(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+p+'".')),iR(s.children,t,h,p)),!(s.path==null&&!s.index)&&t.push({path:p,score:jH(p,s.index),routesMeta:h})};return e.forEach((s,l)=>{var u;if(s.path===""||!((u=s.path)!=null&&u.includes("?")))o(s,l);else for(let d of sR(s.path))o(s,l,d)}),t}function sR(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return o?[s,""]:[s];let l=sR(r.join("/")),u=[];return u.push(...l.map(d=>d===""?s:[s,d].join("/"))),o&&u.push(...l),u.map(d=>e.startsWith("/")&&d===""?"/":d)}function gH(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:CH(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const vH=/^:[\w-]+$/,yH=3,xH=2,bH=1,wH=10,SH=-2,oj=e=>e==="*";function jH(e,t){let n=e.split("/"),r=n.length;return n.some(oj)&&(r+=SH),t&&(r+=xH),n.filter(o=>!oj(o)).reduce((o,s)=>o+(vH.test(s)?yH:s===""?bH:wH),r)}function CH(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 EH(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,o={},s="/",l=[];for(let u=0;u<r.length;++u){let d=r[u],p=u===r.length-1,h=s==="/"?t:t.slice(s.length)||"/",m=ij({path:d.relativePath,caseSensitive:d.caseSensitive,end:p},h),y=d.route;if(!m&&p&&n&&!r[r.length-1].route.index&&(m=ij({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},h)),!m)return null;Object.assign(o,m.params),l.push({params:o,pathname:fs([s,m.pathname]),pathnameBase:_H(fs([s,m.pathnameBase])),route:y}),m.pathnameBase!=="/"&&(s=fs([s,m.pathnameBase]))}return l}function ij(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=kH(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let s=o[0],l=s.replace(/(.)\/+$/,"$1"),u=o.slice(1);return{params:r.reduce((p,h,m)=>{let{paramName:y,isOptional:x}=h;if(y==="*"){let w=u[m]||"";l=s.slice(0,s.length-w.length).replace(/(.)\/+$/,"$1")}const b=u[m];return x&&!b?p[y]=void 0:p[y]=(b||"").replace(/%2F/g,"/"),p},{}),pathname:s,pathnameBase:l,pattern:e}}function kH(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Nl(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,(l,u,d)=>(r.push({paramName:u,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function TH(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Nl(!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 zu(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 PH(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Oi(e):e;return{pathname:n?n.startsWith("/")?n:RH(n,t):t,search:DH(r),hash:IH(o)}}function RH(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 yg(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 aR(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function lR(e,t){let n=aR(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function cR(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Oi(e):(o=fn({},e),gt(!o.pathname||!o.pathname.includes("?"),yg("?","pathname","search",o)),gt(!o.pathname||!o.pathname.includes("#"),yg("#","pathname","hash",o)),gt(!o.search||!o.search.includes("#"),yg("#","search","hash",o)));let s=e===""||o.pathname==="",l=s?"/":o.pathname,u;if(l==null)u=n;else{let m=t.length-1;if(!r&&l.startsWith("..")){let y=l.split("/");for(;y[0]==="..";)y.shift(),m-=1;o.pathname=y.join("/")}u=m>=0?t[m]:"/"}let d=PH(o,u),p=l&&l!=="/"&&l.endsWith("/"),h=(s||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(p||h)&&(d.pathname+="/"),d}const fs=e=>e.join("/").replace(/\/\/+/g,"/"),_H=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),DH=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,IH=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class zf{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 qp(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const uR=["post","put","patch","delete"],NH=new Set(uR),AH=["get",...uR],MH=new Set(AH),OH=new Set([301,302,303,307,308]),LH=new Set([307,308]),xg={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},$H={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},zc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Yx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,FH=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),dR="remix-router-transitions";function zH(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;gt(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 U=e.detectErrorBoundary;o=K=>({hasErrorBoundary:U(K)})}else o=FH;let s={},l=Ff(e.routes,o,void 0,s),u,d=e.basename||"/",p=e.dataStrategy||WH,h=e.patchRoutesOnNavigation,m=fn({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),y=null,x=new Set,b=null,w=null,j=null,T=e.hydrationData!=null,P=Ks(l,e.history.location,d),k=null;if(P==null&&!h){let U=Cr(404,{pathname:e.history.location.pathname}),{matches:K,route:ee}=gj(l);P=K,k={[ee.id]:U}}P&&!e.hydrationData&&ei(P,l,e.history.location.pathname).active&&(P=null);let E;if(P)if(P.some(U=>U.route.lazy))E=!1;else if(!P.some(U=>U.route.loader))E=!0;else if(m.v7_partialHydration){let U=e.hydrationData?e.hydrationData.loaderData:null,K=e.hydrationData?e.hydrationData.errors:null;if(K){let ee=P.findIndex(le=>K[le.route.id]!==void 0);E=P.slice(0,ee+1).every(le=>!cv(le.route,U,K))}else E=P.every(ee=>!cv(ee.route,U,K))}else E=e.hydrationData!=null;else if(E=!1,P=[],m.v7_partialHydration){let U=ei(null,l,e.history.location.pathname);U.active&&U.matches&&(P=U.matches)}let _,R={historyAction:e.history.action,location:e.history.location,matches:P,initialized:E,navigation:xg,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||k,fetchers:new Map,blockers:new Map},M=Tn.Pop,N=!1,L,z=!1,q=new Map,G=null,Y=!1,Q=!1,te=[],V=new Set,O=new Map,A=0,B=-1,I=new Map,F=new Set,J=new Map,de=new Map,Ee=new Set,ve=new Map,we=new Map,_e;function fe(){if(y=e.history.listen(U=>{let{action:K,location:ee,delta:le}=U;if(_e){_e(),_e=void 0;return}Nl(we.size===0||le!=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 De=Zo({currentLocation:R.location,nextLocation:ee,historyAction:K});if(De&&le!=null){let Ge=new Promise(ot=>{_e=ot});e.history.go(le*-1),No(De,{state:"blocked",location:ee,proceed(){No(De,{state:"proceeding",proceed:void 0,reset:void 0,location:ee}),Ge.then(()=>e.history.go(le))},reset(){let ot=new Map(R.blockers);ot.set(De,zc),at({blockers:ot})}});return}return vt(K,ee)}),n){oq(t,q);let U=()=>iq(t,q);t.addEventListener("pagehide",U),G=()=>t.removeEventListener("pagehide",U)}return R.initialized||vt(Tn.Pop,R.location,{initialHydration:!0}),_}function Je(){y&&y(),G&&G(),x.clear(),L&&L.abort(),R.fetchers.forEach((U,K)=>cn(K)),R.blockers.forEach((U,K)=>Io(K))}function pt(U){return x.add(U),()=>x.delete(U)}function at(U,K){K===void 0&&(K={}),R=fn({},R,U);let ee=[],le=[];m.v7_fetcherPersist&&R.fetchers.forEach((De,Ge)=>{De.state==="idle"&&(Ee.has(Ge)?le.push(Ge):ee.push(Ge))}),[...x].forEach(De=>De(R,{deletedFetchers:le,viewTransitionOpts:K.viewTransitionOpts,flushSync:K.flushSync===!0})),m.v7_fetcherPersist&&(ee.forEach(De=>R.fetchers.delete(De)),le.forEach(De=>cn(De)))}function St(U,K,ee){var le,De;let{flushSync:Ge}=ee===void 0?{}:ee,ot=R.actionData!=null&&R.navigation.formMethod!=null&&wo(R.navigation.formMethod)&&R.navigation.state==="loading"&&((le=U.state)==null?void 0:le._isRedirect)!==!0,Me;K.actionData?Object.keys(K.actionData).length>0?Me=K.actionData:Me=null:ot?Me=R.actionData:Me=null;let Be=K.loaderData?hj(R.loaderData,K.loaderData,K.matches||[],K.errors):R.loaderData,Se=R.blockers;Se.size>0&&(Se=new Map(Se),Se.forEach((mt,wn)=>Se.set(wn,zc)));let Ke=N===!0||R.navigation.formMethod!=null&&wo(R.navigation.formMethod)&&((De=U.state)==null?void 0:De._isRedirect)!==!0;u&&(l=u,u=void 0),Y||M===Tn.Pop||(M===Tn.Push?e.history.push(U,U.state):M===Tn.Replace&&e.history.replace(U,U.state));let lt;if(M===Tn.Pop){let mt=q.get(R.location.pathname);mt&&mt.has(U.pathname)?lt={currentLocation:R.location,nextLocation:U}:q.has(U.pathname)&&(lt={currentLocation:U,nextLocation:R.location})}else if(z){let mt=q.get(R.location.pathname);mt?mt.add(U.pathname):(mt=new Set([U.pathname]),q.set(R.location.pathname,mt)),lt={currentLocation:R.location,nextLocation:U}}at(fn({},K,{actionData:Me,loaderData:Be,historyAction:M,location:U,initialized:!0,navigation:xg,revalidation:"idle",restoreScrollPosition:Da(U,K.matches||R.matches),preventScrollReset:Ke,blockers:Se}),{viewTransitionOpts:lt,flushSync:Ge===!0}),M=Tn.Pop,N=!1,z=!1,Y=!1,Q=!1,te=[]}async function jt(U,K){if(typeof U=="number"){e.history.go(U);return}let ee=lv(R.location,R.matches,d,m.v7_prependBasename,U,m.v7_relativeSplatPath,K==null?void 0:K.fromRouteId,K==null?void 0:K.relative),{path:le,submission:De,error:Ge}=sj(m.v7_normalizeFormMethod,!1,ee,K),ot=R.location,Me=cu(R.location,le,K&&K.state);Me=fn({},Me,e.history.encodeLocation(Me));let Be=K&&K.replace!=null?K.replace:void 0,Se=Tn.Push;Be===!0?Se=Tn.Replace:Be===!1||De!=null&&wo(De.formMethod)&&De.formAction===R.location.pathname+R.location.search&&(Se=Tn.Replace);let Ke=K&&"preventScrollReset"in K?K.preventScrollReset===!0:void 0,lt=(K&&K.flushSync)===!0,mt=Zo({currentLocation:ot,nextLocation:Me,historyAction:Se});if(mt){No(mt,{state:"blocked",location:Me,proceed(){No(mt,{state:"proceeding",proceed:void 0,reset:void 0,location:Me}),jt(U,K)},reset(){let wn=new Map(R.blockers);wn.set(mt,zc),at({blockers:wn})}});return}return await vt(Se,Me,{submission:De,pendingError:Ge,preventScrollReset:Ke,replace:K&&K.replace,enableViewTransition:K&&K.viewTransition,flushSync:lt})}function Et(){if(Mt(),at({revalidation:"loading"}),R.navigation.state!=="submitting"){if(R.navigation.state==="idle"){vt(R.historyAction,R.location,{startUninterruptedRevalidation:!0});return}vt(M||R.historyAction,R.navigation.location,{overrideNavigation:R.navigation,enableViewTransition:z===!0})}}async function vt(U,K,ee){L&&L.abort(),L=null,M=U,Y=(ee&&ee.startUninterruptedRevalidation)===!0,_a(R.location,R.matches),N=(ee&&ee.preventScrollReset)===!0,z=(ee&&ee.enableViewTransition)===!0;let le=u||l,De=ee&&ee.overrideNavigation,Ge=Ks(le,K,d),ot=(ee&&ee.flushSync)===!0,Me=ei(Ge,le,K.pathname);if(Me.active&&Me.matches&&(Ge=Me.matches),!Ge){let{error:Ut,notFoundMatches:Tt,route:en}=lo(K.pathname);St(K,{matches:Tt,loaderData:{},errors:{[en.id]:Ut}},{flushSync:ot});return}if(R.initialized&&!Q&&YH(R.location,K)&&!(ee&&ee.submission&&wo(ee.submission.formMethod))){St(K,{matches:Ge},{flushSync:ot});return}L=new AbortController;let Be=cl(e.history,K,L.signal,ee&&ee.submission),Se;if(ee&&ee.pendingError)Se=[Ys(Ge).route.id,{type:Vt.error,error:ee.pendingError}];else if(ee&&ee.submission&&wo(ee.submission.formMethod)){let Ut=await kt(Be,K,ee.submission,Ge,Me.active,{replace:ee.replace,flushSync:ot});if(Ut.shortCircuited)return;if(Ut.pendingActionResult){let[Tt,en]=Ut.pendingActionResult;if($r(en)&&qp(en.error)&&en.error.status===404){L=null,St(K,{matches:Ut.matches,loaderData:{},errors:{[Tt]:en.error}});return}}Ge=Ut.matches||Ge,Se=Ut.pendingActionResult,De=bg(K,ee.submission),ot=!1,Me.active=!1,Be=cl(e.history,Be.url,Be.signal)}let{shortCircuited:Ke,matches:lt,loaderData:mt,errors:wn}=await ce(Be,K,Ge,Me.active,De,ee&&ee.submission,ee&&ee.fetcherSubmission,ee&&ee.replace,ee&&ee.initialHydration===!0,ot,Se);Ke||(L=null,St(K,fn({matches:lt||Ge},mj(Se),{loaderData:mt,errors:wn})))}async function kt(U,K,ee,le,De,Ge){Ge===void 0&&(Ge={}),Mt();let ot=nq(K,ee);if(at({navigation:ot},{flushSync:Ge.flushSync===!0}),De){let Se=await ti(le,K.pathname,U.signal);if(Se.type==="aborted")return{shortCircuited:!0};if(Se.type==="error"){let Ke=Ys(Se.partialMatches).route.id;return{matches:Se.partialMatches,pendingActionResult:[Ke,{type:Vt.error,error:Se.error}]}}else if(Se.matches)le=Se.matches;else{let{notFoundMatches:Ke,error:lt,route:mt}=lo(K.pathname);return{matches:Ke,pendingActionResult:[mt.id,{type:Vt.error,error:lt}]}}}let Me,Be=Wc(le,K);if(!Be.route.action&&!Be.route.lazy)Me={type:Vt.error,error:Cr(405,{method:U.method,pathname:K.pathname,routeId:Be.route.id})};else if(Me=(await Ae("action",R,U,[Be],le,null))[Be.route.id],U.signal.aborted)return{shortCircuited:!0};if(ta(Me)){let Se;return Ge&&Ge.replace!=null?Se=Ge.replace:Se=dj(Me.response.headers.get("Location"),new URL(U.url),d)===R.location.pathname+R.location.search,await ae(U,Me,!0,{submission:ee,replace:Se}),{shortCircuited:!0}}if(ds(Me))throw Cr(400,{type:"defer-action"});if($r(Me)){let Se=Ys(le,Be.route.id);return(Ge&&Ge.replace)!==!0&&(M=Tn.Push),{matches:le,pendingActionResult:[Se.route.id,Me]}}return{matches:le,pendingActionResult:[Be.route.id,Me]}}async function ce(U,K,ee,le,De,Ge,ot,Me,Be,Se,Ke){let lt=De||bg(K,Ge),mt=Ge||ot||yj(lt),wn=!Y&&(!m.v7_partialHydration||!Be);if(le){if(wn){let nn=pe(Ke);at(fn({navigation:lt},nn!==void 0?{actionData:nn}:{}),{flushSync:Se})}let Pt=await ti(ee,K.pathname,U.signal);if(Pt.type==="aborted")return{shortCircuited:!0};if(Pt.type==="error"){let nn=Ys(Pt.partialMatches).route.id;return{matches:Pt.partialMatches,loaderData:{},errors:{[nn]:Pt.error}}}else if(Pt.matches)ee=Pt.matches;else{let{error:nn,notFoundMatches:fo,route:Yn}=lo(K.pathname);return{matches:fo,loaderData:{},errors:{[Yn.id]:nn}}}}let Ut=u||l,[Tt,en]=lj(e.history,R,ee,mt,K,m.v7_partialHydration&&Be===!0,m.v7_skipActionErrorRevalidation,Q,te,V,Ee,J,F,Ut,d,Ke);if(gr(Pt=>!(ee&&ee.some(nn=>nn.route.id===Pt))||Tt&&Tt.some(nn=>nn.route.id===Pt)),B=++A,Tt.length===0&&en.length===0){let Pt=Ts();return St(K,fn({matches:ee,loaderData:{},errors:Ke&&$r(Ke[1])?{[Ke[0]]:Ke[1].error}:null},mj(Ke),Pt?{fetchers:new Map(R.fetchers)}:{}),{flushSync:Se}),{shortCircuited:!0}}if(wn){let Pt={};if(!le){Pt.navigation=lt;let nn=pe(Ke);nn!==void 0&&(Pt.actionData=nn)}en.length>0&&(Pt.fetchers=Re(en)),at(Pt,{flushSync:Se})}en.forEach(Pt=>{Kn(Pt.key),Pt.controller&&O.set(Pt.key,Pt.controller)});let ni=()=>en.forEach(Pt=>Kn(Pt.key));L&&L.signal.addEventListener("abort",ni);let{loaderResults:$i,fetcherResults:co}=await ut(R,ee,Tt,en,U);if(U.signal.aborted)return{shortCircuited:!0};L&&L.signal.removeEventListener("abort",ni),en.forEach(Pt=>O.delete(Pt.key));let Wr=sf($i);if(Wr)return await ae(U,Wr.result,!0,{replace:Me}),{shortCircuited:!0};if(Wr=sf(co),Wr)return F.add(Wr.key),await ae(U,Wr.result,!0,{replace:Me}),{shortCircuited:!0};let{loaderData:tn,errors:Ps}=pj(R,ee,$i,Ke,en,co,ve);ve.forEach((Pt,nn)=>{Pt.subscribe(fo=>{(fo||Pt.done)&&ve.delete(nn)})}),m.v7_partialHydration&&Be&&R.errors&&(Ps=fn({},R.errors,Ps));let uo=Ts(),Rs=Ra(B),ri=uo||Rs||en.length>0;return fn({matches:ee,loaderData:tn,errors:Ps},ri?{fetchers:new Map(R.fetchers)}:{})}function pe(U){if(U&&!$r(U[1]))return{[U[0]]:U[1].data};if(R.actionData)return Object.keys(R.actionData).length===0?null:R.actionData}function Re(U){return U.forEach(K=>{let ee=R.fetchers.get(K.key),le=Bc(void 0,ee?ee.data:void 0);R.fetchers.set(K.key,le)}),new Map(R.fetchers)}function He(U,K,ee,le){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.");Kn(U);let De=(le&&le.flushSync)===!0,Ge=u||l,ot=lv(R.location,R.matches,d,m.v7_prependBasename,ee,m.v7_relativeSplatPath,K,le==null?void 0:le.relative),Me=Ks(Ge,ot,d),Be=ei(Me,Ge,ot);if(Be.active&&Be.matches&&(Me=Be.matches),!Me){ht(U,K,Cr(404,{pathname:ot}),{flushSync:De});return}let{path:Se,submission:Ke,error:lt}=sj(m.v7_normalizeFormMethod,!0,ot,le);if(lt){ht(U,K,lt,{flushSync:De});return}let mt=Wc(Me,Se),wn=(le&&le.preventScrollReset)===!0;if(Ke&&wo(Ke.formMethod)){he(U,K,Se,mt,Me,Be.active,De,wn,Ke);return}J.set(U,{routeId:K,path:Se}),ke(U,K,Se,mt,Me,Be.active,De,wn,Ke)}async function he(U,K,ee,le,De,Ge,ot,Me,Be){Mt(),J.delete(U);function Se(Sn){if(!Sn.route.action&&!Sn.route.lazy){let Fn=Cr(405,{method:Be.formMethod,pathname:ee,routeId:K});return ht(U,K,Fn,{flushSync:ot}),!0}return!1}if(!Ge&&Se(le))return;let Ke=R.fetchers.get(U);bt(U,rq(Be,Ke),{flushSync:ot});let lt=new AbortController,mt=cl(e.history,ee,lt.signal,Be);if(Ge){let Sn=await ti(De,ee,mt.signal);if(Sn.type==="aborted")return;if(Sn.type==="error"){ht(U,K,Sn.error,{flushSync:ot});return}else if(Sn.matches){if(De=Sn.matches,le=Wc(De,ee),Se(le))return}else{ht(U,K,Cr(404,{pathname:ee}),{flushSync:ot});return}}O.set(U,lt);let wn=A,Tt=(await Ae("action",R,mt,[le],De,U))[le.route.id];if(mt.signal.aborted){O.get(U)===lt&&O.delete(U);return}if(m.v7_fetcherPersist&&Ee.has(U)){if(ta(Tt)||$r(Tt)){bt(U,is(void 0));return}}else{if(ta(Tt))if(O.delete(U),B>wn){bt(U,is(void 0));return}else return F.add(U),bt(U,Bc(Be)),ae(mt,Tt,!1,{fetcherSubmission:Be,preventScrollReset:Me});if($r(Tt)){ht(U,K,Tt.error);return}}if(ds(Tt))throw Cr(400,{type:"defer-action"});let en=R.navigation.location||R.location,ni=cl(e.history,en,lt.signal),$i=u||l,co=R.navigation.state!=="idle"?Ks($i,R.navigation.location,d):R.matches;gt(co,"Didn't find any matches after fetcher action");let Wr=++A;I.set(U,Wr);let tn=Bc(Be,Tt.data);R.fetchers.set(U,tn);let[Ps,uo]=lj(e.history,R,co,Be,en,!1,m.v7_skipActionErrorRevalidation,Q,te,V,Ee,J,F,$i,d,[le.route.id,Tt]);uo.filter(Sn=>Sn.key!==U).forEach(Sn=>{let Fn=Sn.key,Uu=R.fetchers.get(Fn),eh=Bc(void 0,Uu?Uu.data:void 0);R.fetchers.set(Fn,eh),Kn(Fn),Sn.controller&&O.set(Fn,Sn.controller)}),at({fetchers:new Map(R.fetchers)});let Rs=()=>uo.forEach(Sn=>Kn(Sn.key));lt.signal.addEventListener("abort",Rs);let{loaderResults:ri,fetcherResults:Pt}=await ut(R,co,Ps,uo,ni);if(lt.signal.aborted)return;lt.signal.removeEventListener("abort",Rs),I.delete(U),O.delete(U),uo.forEach(Sn=>O.delete(Sn.key));let nn=sf(ri);if(nn)return ae(ni,nn.result,!1,{preventScrollReset:Me});if(nn=sf(Pt),nn)return F.add(nn.key),ae(ni,nn.result,!1,{preventScrollReset:Me});let{loaderData:fo,errors:Yn}=pj(R,co,ri,void 0,uo,Pt,ve);if(R.fetchers.has(U)){let Sn=is(Tt.data);R.fetchers.set(U,Sn)}Ra(Wr),R.navigation.state==="loading"&&Wr>B?(gt(M,"Expected pending action"),L&&L.abort(),St(R.navigation.location,{matches:co,loaderData:fo,errors:Yn,fetchers:new Map(R.fetchers)})):(at({errors:Yn,loaderData:hj(R.loaderData,fo,co,Yn),fetchers:new Map(R.fetchers)}),Q=!1)}async function ke(U,K,ee,le,De,Ge,ot,Me,Be){let Se=R.fetchers.get(U);bt(U,Bc(Be,Se?Se.data:void 0),{flushSync:ot});let Ke=new AbortController,lt=cl(e.history,ee,Ke.signal);if(Ge){let Tt=await ti(De,ee,lt.signal);if(Tt.type==="aborted")return;if(Tt.type==="error"){ht(U,K,Tt.error,{flushSync:ot});return}else if(Tt.matches)De=Tt.matches,le=Wc(De,ee);else{ht(U,K,Cr(404,{pathname:ee}),{flushSync:ot});return}}O.set(U,Ke);let mt=A,Ut=(await Ae("loader",R,lt,[le],De,U))[le.route.id];if(ds(Ut)&&(Ut=await Xx(Ut,lt.signal,!0)||Ut),O.get(U)===Ke&&O.delete(U),!lt.signal.aborted){if(Ee.has(U)){bt(U,is(void 0));return}if(ta(Ut))if(B>mt){bt(U,is(void 0));return}else{F.add(U),await ae(lt,Ut,!1,{preventScrollReset:Me});return}if($r(Ut)){ht(U,K,Ut.error);return}gt(!ds(Ut),"Unhandled fetcher deferred data"),bt(U,is(Ut.data))}}async function ae(U,K,ee,le){let{submission:De,fetcherSubmission:Ge,preventScrollReset:ot,replace:Me}=le===void 0?{}:le;K.response.headers.has("X-Remix-Revalidate")&&(Q=!0);let Be=K.response.headers.get("Location");gt(Be,"Expected a Location header on the redirect Response"),Be=dj(Be,new URL(U.url),d);let Se=cu(R.location,Be,{_isRedirect:!0});if(n){let Tt=!1;if(K.response.headers.has("X-Remix-Reload-Document"))Tt=!0;else if(Yx.test(Be)){const en=e.history.createURL(Be);Tt=en.origin!==t.location.origin||zu(en.pathname,d)==null}if(Tt){Me?t.location.replace(Be):t.location.assign(Be);return}}L=null;let Ke=Me===!0||K.response.headers.has("X-Remix-Replace")?Tn.Replace:Tn.Push,{formMethod:lt,formAction:mt,formEncType:wn}=R.navigation;!De&&!Ge&<&&mt&&wn&&(De=yj(R.navigation));let Ut=De||Ge;if(LH.has(K.response.status)&&Ut&&wo(Ut.formMethod))await vt(Ke,Se,{submission:fn({},Ut,{formAction:Be}),preventScrollReset:ot||N,enableViewTransition:ee?z:void 0});else{let Tt=bg(Se,De);await vt(Ke,Se,{overrideNavigation:Tt,fetcherSubmission:Ge,preventScrollReset:ot||N,enableViewTransition:ee?z:void 0})}}async function Ae(U,K,ee,le,De,Ge){let ot,Me={};try{ot=await HH(p,U,K,ee,le,De,Ge,s,o)}catch(Be){return le.forEach(Se=>{Me[Se.route.id]={type:Vt.error,error:Be}}),Me}for(let[Be,Se]of Object.entries(ot))if(XH(Se)){let Ke=Se.result;Me[Be]={type:Vt.redirect,response:QH(Ke,ee,Be,De,d,m.v7_relativeSplatPath)}}else Me[Be]=await GH(Se);return Me}async function ut(U,K,ee,le,De){let Ge=U.matches,ot=Ae("loader",U,De,ee,K,null),Me=Promise.all(le.map(async Ke=>{if(Ke.matches&&Ke.match&&Ke.controller){let mt=(await Ae("loader",U,cl(e.history,Ke.path,Ke.controller.signal),[Ke.match],Ke.matches,Ke.key))[Ke.match.route.id];return{[Ke.key]:mt}}else return Promise.resolve({[Ke.key]:{type:Vt.error,error:Cr(404,{pathname:Ke.path})}})})),Be=await ot,Se=(await Me).reduce((Ke,lt)=>Object.assign(Ke,lt),{});return await Promise.all([eq(K,Be,De.signal,Ge,U.loaderData),tq(K,Se,le)]),{loaderResults:Be,fetcherResults:Se}}function Mt(){Q=!0,te.push(...gr()),J.forEach((U,K)=>{O.has(K)&&V.add(K),Kn(K)})}function bt(U,K,ee){ee===void 0&&(ee={}),R.fetchers.set(U,K),at({fetchers:new Map(R.fetchers)},{flushSync:(ee&&ee.flushSync)===!0})}function ht(U,K,ee,le){le===void 0&&(le={});let De=Ys(R.matches,K);cn(U),at({errors:{[De.route.id]:ee},fetchers:new Map(R.fetchers)},{flushSync:(le&&le.flushSync)===!0})}function xn(U){return m.v7_fetcherPersist&&(de.set(U,(de.get(U)||0)+1),Ee.has(U)&&Ee.delete(U)),R.fetchers.get(U)||$H}function cn(U){let K=R.fetchers.get(U);O.has(U)&&!(K&&K.state==="loading"&&I.has(U))&&Kn(U),J.delete(U),I.delete(U),F.delete(U),Ee.delete(U),V.delete(U),R.fetchers.delete(U)}function Qn(U){if(m.v7_fetcherPersist){let K=(de.get(U)||0)-1;K<=0?(de.delete(U),Ee.add(U)):de.set(U,K)}else cn(U);at({fetchers:new Map(R.fetchers)})}function Kn(U){let K=O.get(U);K&&(K.abort(),O.delete(U))}function Jo(U){for(let K of U){let ee=xn(K),le=is(ee.data);R.fetchers.set(K,le)}}function Ts(){let U=[],K=!1;for(let ee of F){let le=R.fetchers.get(ee);gt(le,"Expected fetcher: "+ee),le.state==="loading"&&(F.delete(ee),U.push(ee),K=!0)}return Jo(U),K}function Ra(U){let K=[];for(let[ee,le]of I)if(le<U){let De=R.fetchers.get(ee);gt(De,"Expected fetcher: "+ee),De.state==="loading"&&(Kn(ee),I.delete(ee),K.push(ee))}return Jo(K),K.length>0}function ir(U,K){let ee=R.blockers.get(U)||zc;return we.get(U)!==K&&we.set(U,K),ee}function Io(U){R.blockers.delete(U),we.delete(U)}function No(U,K){let ee=R.blockers.get(U)||zc;gt(ee.state==="unblocked"&&K.state==="blocked"||ee.state==="blocked"&&K.state==="blocked"||ee.state==="blocked"&&K.state==="proceeding"||ee.state==="blocked"&&K.state==="unblocked"||ee.state==="proceeding"&&K.state==="unblocked","Invalid blocker state transition: "+ee.state+" -> "+K.state);let le=new Map(R.blockers);le.set(U,K),at({blockers:le})}function Zo(U){let{currentLocation:K,nextLocation:ee,historyAction:le}=U;if(we.size===0)return;we.size>1&&Nl(!1,"A router only supports one blocker at a time");let De=Array.from(we.entries()),[Ge,ot]=De[De.length-1],Me=R.blockers.get(Ge);if(!(Me&&Me.state==="proceeding")&&ot({currentLocation:K,nextLocation:ee,historyAction:le}))return Ge}function lo(U){let K=Cr(404,{pathname:U}),ee=u||l,{matches:le,route:De}=gj(ee);return gr(),{notFoundMatches:le,route:De,error:K}}function gr(U){let K=[];return ve.forEach((ee,le)=>{(!U||U(le))&&(ee.cancel(),K.push(le),ve.delete(le))}),K}function sr(U,K,ee){if(b=U,j=K,w=ee||null,!T&&R.navigation===xg){T=!0;let le=Da(R.location,R.matches);le!=null&&at({restoreScrollPosition:le})}return()=>{b=null,j=null,w=null}}function $n(U,K){return w&&w(U,K.map(le=>mH(le,R.loaderData)))||U.key}function _a(U,K){if(b&&j){let ee=$n(U,K);b[ee]=j()}}function Da(U,K){if(b){let ee=$n(U,K),le=b[ee];if(typeof le=="number")return le}return null}function ei(U,K,ee){if(h)if(U){if(Object.keys(U[0].params).length>0)return{active:!0,matches:gf(K,ee,d,!0)}}else return{active:!0,matches:gf(K,ee,d,!0)||[]};return{active:!1,matches:null}}async function ti(U,K,ee){if(!h)return{type:"success",matches:U};let le=U;for(;;){let De=u==null,Ge=u||l,ot=s;try{await h({path:K,matches:le,patch:(Se,Ke)=>{ee.aborted||uj(Se,Ke,Ge,ot,o)}})}catch(Se){return{type:"error",error:Se,partialMatches:le}}finally{De&&!ee.aborted&&(l=[...l])}if(ee.aborted)return{type:"aborted"};let Me=Ks(Ge,K,d);if(Me)return{type:"success",matches:Me};let Be=gf(Ge,K,d,!0);if(!Be||le.length===Be.length&&le.every((Se,Ke)=>Se.route.id===Be[Ke].route.id))return{type:"success",matches:null};le=Be}}function bn(U){s={},u=Ff(U,o,void 0,s)}function Ao(U,K){let ee=u==null;uj(U,K,u||l,s,o),ee&&(l=[...l],at({}))}return _={get basename(){return d},get future(){return m},get state(){return R},get routes(){return l},get window(){return t},initialize:fe,subscribe:pt,enableScrollRestoration:sr,navigate:jt,fetch:He,revalidate:Et,createHref:U=>e.history.createHref(U),encodeLocation:U=>e.history.encodeLocation(U),getFetcher:xn,deleteFetcher:Qn,dispose:Je,getBlocker:ir,deleteBlocker:Io,patchRoutes:Ao,_internalFetchControllers:O,_internalActiveDeferreds:ve,_internalSetRoutes:bn},_}function BH(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function lv(e,t,n,r,o,s,l,u){let d,p;if(l){d=[];for(let m of t)if(d.push(m),m.route.id===l){p=m;break}}else d=t,p=t[t.length-1];let h=cR(o||".",lR(d,s),zu(e.pathname,n)||e.pathname,u==="path");if(o==null&&(h.search=e.search,h.hash=e.hash),(o==null||o===""||o===".")&&p){let m=Jx(h.search);if(p.route.index&&!m)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!p.route.index&&m){let y=new URLSearchParams(h.search),x=y.getAll("index");y.delete("index"),x.filter(w=>w).forEach(w=>y.append("index",w));let b=y.toString();h.search=b?"?"+b:""}}return r&&n!=="/"&&(h.pathname=h.pathname==="/"?n:fs([n,h.pathname])),Fu(h)}function sj(e,t,n,r){if(!r||!BH(r))return{path:n};if(r.formMethod&&!ZH(r.formMethod))return{path:n,error:Cr(405,{method:r.formMethod})};let o=()=>({path:n,error:Cr(400,{type:"invalid-body"})}),s=r.formMethod||"get",l=e?s.toUpperCase():s.toLowerCase(),u=hR(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!wo(l))return o();let y=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((x,b)=>{let[w,j]=b;return""+x+w+"="+j+`
|
|
558
|
-
`},""):String(r.body);return{path:n,submission:{formMethod:l,formAction:u,formEncType:r.formEncType,formData:void 0,json:void 0,text:y}}}else if(r.formEncType==="application/json"){if(!wo(l))return o();try{let y=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:l,formAction:u,formEncType:r.formEncType,formData:void 0,json:y,text:void 0}}}catch{return o()}}}gt(typeof FormData=="function","FormData is not available in this environment");let d,p;if(r.formData)d=uv(r.formData),p=r.formData;else if(r.body instanceof FormData)d=uv(r.body),p=r.body;else if(r.body instanceof URLSearchParams)d=r.body,p=fj(d);else if(r.body==null)d=new URLSearchParams,p=new FormData;else try{d=new URLSearchParams(r.body),p=fj(d)}catch{return o()}let h={formMethod:l,formAction:u,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(wo(h.formMethod))return{path:n,submission:h};let m=Oi(n);return t&&m.search&&Jx(m.search)&&d.append("index",""),m.search="?"+d,{path:Fu(m),submission:h}}function aj(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(o=>o.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function lj(e,t,n,r,o,s,l,u,d,p,h,m,y,x,b,w){let j=w?$r(w[1])?w[1].error:w[1].data:void 0,T=e.createURL(t.location),P=e.createURL(o),k=n;s&&t.errors?k=aj(n,Object.keys(t.errors)[0],!0):w&&$r(w[1])&&(k=aj(n,w[0]));let E=w?w[1].statusCode:void 0,_=l&&E&&E>=400,R=k.filter((N,L)=>{let{route:z}=N;if(z.lazy)return!0;if(z.loader==null)return!1;if(s)return cv(z,t.loaderData,t.errors);if(UH(t.loaderData,t.matches[L],N)||d.some(Y=>Y===N.route.id))return!0;let q=t.matches[L],G=N;return cj(N,fn({currentUrl:T,currentParams:q.params,nextUrl:P,nextParams:G.params},r,{actionResult:j,actionStatus:E,defaultShouldRevalidate:_?!1:u||T.pathname+T.search===P.pathname+P.search||T.search!==P.search||fR(q,G)}))}),M=[];return m.forEach((N,L)=>{if(s||!n.some(Q=>Q.route.id===N.routeId)||h.has(L))return;let z=Ks(x,N.path,b);if(!z){M.push({key:L,routeId:N.routeId,path:N.path,matches:null,match:null,controller:null});return}let q=t.fetchers.get(L),G=Wc(z,N.path),Y=!1;y.has(L)?Y=!1:p.has(L)?(p.delete(L),Y=!0):q&&q.state!=="idle"&&q.data===void 0?Y=u:Y=cj(G,fn({currentUrl:T,currentParams:t.matches[t.matches.length-1].params,nextUrl:P,nextParams:n[n.length-1].params},r,{actionResult:j,actionStatus:E,defaultShouldRevalidate:_?!1:u})),Y&&M.push({key:L,routeId:N.routeId,path:N.path,matches:z,match:G,controller:new AbortController})}),[R,M]}function cv(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,o=n!=null&&n[e.id]!==void 0;return!r&&o?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!o}function UH(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function fR(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function cj(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function uj(e,t,n,r,o){var s;let l;if(e){let p=r[e];gt(p,"No route found to patch children into: routeId = "+e),p.children||(p.children=[]),l=p.children}else l=n;let u=t.filter(p=>!l.some(h=>pR(p,h))),d=Ff(u,o,[e||"_","patch",String(((s=l)==null?void 0:s.length)||"0")],r);l.push(...d)}function pR(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var o;return(o=t.children)==null?void 0:o.some(s=>pR(n,s))}):!1}async function VH(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];gt(o,"No route found in manifest");let s={};for(let l in r){let d=o[l]!==void 0&&l!=="hasErrorBoundary";Nl(!d,'Route "'+o.id+'" has a static property "'+l+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+l+'" will be ignored.')),!d&&!pH.has(l)&&(s[l]=r[l])}Object.assign(o,s),Object.assign(o,fn({},t(o),{lazy:void 0}))}async function WH(e){let{matches:t}=e,n=t.filter(o=>o.shouldLoad);return(await Promise.all(n.map(o=>o.resolve()))).reduce((o,s,l)=>Object.assign(o,{[n[l].route.id]:s}),{})}async function HH(e,t,n,r,o,s,l,u,d,p){let h=s.map(x=>x.route.lazy?VH(x.route,d,u):void 0),m=s.map((x,b)=>{let w=h[b],j=o.some(P=>P.route.id===x.route.id);return fn({},x,{shouldLoad:j,resolve:async P=>(P&&r.method==="GET"&&(x.route.lazy||x.route.loader)&&(j=!0),j?qH(t,r,x,w,P,p):Promise.resolve({type:Vt.data,result:void 0}))})}),y=await e({matches:m,request:r,params:s[0].params,fetcherKey:l,context:p});try{await Promise.all(h)}catch{}return y}async function qH(e,t,n,r,o,s){let l,u,d=p=>{let h,m=new Promise((b,w)=>h=w);u=()=>h(),t.signal.addEventListener("abort",u);let y=b=>typeof p!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):p({request:t,params:n.params,context:s},...b!==void 0?[b]:[]),x=(async()=>{try{return{type:"data",result:await(o?o(w=>y(w)):y())}}catch(b){return{type:"error",result:b}}})();return Promise.race([x,m])};try{let p=n.route[e];if(r)if(p){let h,[m]=await Promise.all([d(p).catch(y=>{h=y}),r]);if(h!==void 0)throw h;l=m}else if(await r,p=n.route[e],p)l=await d(p);else if(e==="action"){let h=new URL(t.url),m=h.pathname+h.search;throw Cr(405,{method:t.method,pathname:m,routeId:n.route.id})}else return{type:Vt.data,result:void 0};else if(p)l=await d(p);else{let h=new URL(t.url),m=h.pathname+h.search;throw Cr(404,{pathname:m})}gt(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(p){return{type:Vt.error,result:p}}finally{u&&t.signal.removeEventListener("abort",u)}return l}async function GH(e){let{result:t,type:n}=e;if(mR(t)){let p;try{let h=t.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?t.body==null?p=null:p=await t.json():p=await t.text()}catch(h){return{type:Vt.error,error:h}}return n===Vt.error?{type:Vt.error,error:new zf(t.status,t.statusText,p),statusCode:t.status,headers:t.headers}:{type:Vt.data,data:p,statusCode:t.status,headers:t.headers}}if(n===Vt.error){if(vj(t)){var r;if(t.data instanceof Error){var o;return{type:Vt.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status}}t=new zf(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:Vt.error,error:t,statusCode:qp(t)?t.status:void 0}}if(JH(t)){var s,l;return{type:Vt.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((l=t.init)==null?void 0:l.headers)&&new Headers(t.init.headers)}}if(vj(t)){var u,d;return{type:Vt.data,data:t.data,statusCode:(u=t.init)==null?void 0:u.status,headers:(d=t.init)!=null&&d.headers?new Headers(t.init.headers):void 0}}return{type:Vt.data,data:t}}function QH(e,t,n,r,o,s){let l=e.headers.get("Location");if(gt(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!Yx.test(l)){let u=r.slice(0,r.findIndex(d=>d.route.id===n)+1);l=lv(new URL(t.url),u,o,!0,l,s),e.headers.set("Location",l)}return e}function dj(e,t,n){if(Yx.test(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),s=zu(o.pathname,n)!=null;if(o.origin===t.origin&&s)return o.pathname+o.search+o.hash}return e}function cl(e,t,n,r){let o=e.createURL(hR(t)).toString(),s={signal:n};if(r&&wo(r.formMethod)){let{formMethod:l,formEncType:u}=r;s.method=l.toUpperCase(),u==="application/json"?(s.headers=new Headers({"Content-Type":u}),s.body=JSON.stringify(r.json)):u==="text/plain"?s.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?s.body=uv(r.formData):s.body=r.formData}return new Request(o,s)}function uv(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function fj(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function KH(e,t,n,r,o){let s={},l=null,u,d=!1,p={},h=n&&$r(n[1])?n[1].error:void 0;return e.forEach(m=>{if(!(m.route.id in t))return;let y=m.route.id,x=t[y];if(gt(!ta(x),"Cannot handle redirect results in processLoaderData"),$r(x)){let b=x.error;h!==void 0&&(b=h,h=void 0),l=l||{};{let w=Ys(e,y);l[w.route.id]==null&&(l[w.route.id]=b)}s[y]=void 0,d||(d=!0,u=qp(x.error)?x.error.status:500),x.headers&&(p[y]=x.headers)}else ds(x)?(r.set(y,x.deferredData),s[y]=x.deferredData.data,x.statusCode!=null&&x.statusCode!==200&&!d&&(u=x.statusCode),x.headers&&(p[y]=x.headers)):(s[y]=x.data,x.statusCode&&x.statusCode!==200&&!d&&(u=x.statusCode),x.headers&&(p[y]=x.headers))}),h!==void 0&&n&&(l={[n[0]]:h},s[n[0]]=void 0),{loaderData:s,errors:l,statusCode:u||200,loaderHeaders:p}}function pj(e,t,n,r,o,s,l){let{loaderData:u,errors:d}=KH(t,n,r,l);return o.forEach(p=>{let{key:h,match:m,controller:y}=p,x=s[h];if(gt(x,"Did not find corresponding fetcher result"),!(y&&y.signal.aborted))if($r(x)){let b=Ys(e.matches,m==null?void 0:m.route.id);d&&d[b.route.id]||(d=fn({},d,{[b.route.id]:x.error})),e.fetchers.delete(h)}else if(ta(x))gt(!1,"Unhandled fetcher revalidation redirect");else if(ds(x))gt(!1,"Unhandled fetcher deferred data");else{let b=is(x.data);e.fetchers.set(h,b)}}),{loaderData:u,errors:d}}function hj(e,t,n,r){let o=fn({},t);for(let s of n){let l=s.route.id;if(t.hasOwnProperty(l)?t[l]!==void 0&&(o[l]=t[l]):e[l]!==void 0&&s.route.loader&&(o[l]=e[l]),r&&r.hasOwnProperty(l))break}return o}function mj(e){return e?$r(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ys(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 gj(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 Cr(e,t){let{pathname:n,routeId:r,method:o,type:s,message:l}=t===void 0?{}:t,u="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(u="Bad Request",o&&n&&r?d="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.":s==="defer-action"?d="defer() is not supported in actions":s==="invalid-body"&&(d="Unable to encode submission body")):e===403?(u="Forbidden",d='Route "'+r+'" does not match URL "'+n+'"'):e===404?(u="Not Found",d='No route matches URL "'+n+'"'):e===405&&(u="Method Not Allowed",o&&n&&r?d="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&&(d='Invalid request method "'+o.toUpperCase()+'"')),new zf(e||500,u,new Error(d),!0)}function sf(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(ta(o))return{key:r,result:o}}}function hR(e){let t=typeof e=="string"?Oi(e):e;return Fu(fn({},t,{hash:""}))}function YH(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function XH(e){return mR(e.result)&&OH.has(e.result.status)}function ds(e){return e.type===Vt.deferred}function $r(e){return e.type===Vt.error}function ta(e){return(e&&e.type)===Vt.redirect}function vj(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function JH(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 mR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function ZH(e){return MH.has(e.toLowerCase())}function wo(e){return NH.has(e.toLowerCase())}async function eq(e,t,n,r,o){let s=Object.entries(t);for(let l=0;l<s.length;l++){let[u,d]=s[l],p=e.find(y=>(y==null?void 0:y.route.id)===u);if(!p)continue;let h=r.find(y=>y.route.id===p.route.id),m=h!=null&&!fR(h,p)&&(o&&o[p.route.id])!==void 0;ds(d)&&m&&await Xx(d,n,!1).then(y=>{y&&(t[u]=y)})}}async function tq(e,t,n){for(let r=0;r<n.length;r++){let{key:o,routeId:s,controller:l}=n[r],u=t[o];e.find(p=>(p==null?void 0:p.route.id)===s)&&ds(u)&&(gt(l,"Expected an AbortController for revalidating fetcher deferred result"),await Xx(u,l.signal,!0).then(p=>{p&&(t[o]=p)}))}}async function Xx(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Vt.data,data:e.deferredData.unwrappedData}}catch(o){return{type:Vt.error,error:o}}return{type:Vt.data,data:e.deferredData.data}}}function Jx(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Wc(e,t){let n=typeof t=="string"?Oi(t).search:t.search;if(e[e.length-1].route.index&&Jx(n||""))return e[e.length-1];let r=aR(e);return r[r.length-1]}function yj(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:s,json:l}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:s,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function bg(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 nq(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 Bc(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 rq(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 is(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 oq(e,t){try{let n=e.sessionStorage.getItem(dR);if(n){let r=JSON.parse(n);for(let[o,s]of Object.entries(r||{}))s&&Array.isArray(s)&&t.set(o,new Set(s||[]))}}catch{}}function iq(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(dR,JSON.stringify(n))}catch(r){Nl(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
|
|
559
|
-
* React Router v6.28.0
|
|
560
|
-
*
|
|
561
|
-
* Copyright (c) Remix Software Inc.
|
|
562
|
-
*
|
|
563
|
-
* This source code is licensed under the MIT license found in the
|
|
564
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
565
|
-
*
|
|
566
|
-
* @license MIT
|
|
567
|
-
*/function uu(){return uu=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},uu.apply(this,arguments)}const Gp=g.createContext(null),gR=g.createContext(null),Qp=g.createContext(null),Kp=g.createContext(null),Cs=g.createContext({outlet:null,matches:[],isDataRoute:!1}),vR=g.createContext(null);function Yp(){return g.useContext(Kp)!=null}function Li(){return Yp()||gt(!1),g.useContext(Kp).location}function yR(e){g.useContext(Qp).static||g.useLayoutEffect(e)}function En(){let{isDataRoute:e}=g.useContext(Cs);return e?xq():sq()}function sq(){Yp()||gt(!1);let e=g.useContext(Gp),{basename:t,future:n,navigator:r}=g.useContext(Qp),{matches:o}=g.useContext(Cs),{pathname:s}=Li(),l=JSON.stringify(lR(o,n.v7_relativeSplatPath)),u=g.useRef(!1);return yR(()=>{u.current=!0}),g.useCallback(function(p,h){if(h===void 0&&(h={}),!u.current)return;if(typeof p=="number"){r.go(p);return}let m=cR(p,JSON.parse(l),s,h.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:fs([t,m.pathname])),(h.replace?r.replace:r.push)(m,h.state,h)},[t,r,l,s,e])}const aq=g.createContext(null);function lq(e){let t=g.useContext(Cs).outlet;return t&&g.createElement(aq.Provider,{value:e},t)}function $t(){let{matches:e}=g.useContext(Cs),t=e[e.length-1];return t?t.params:{}}function cq(e,t){return xR(e,t)}function xR(e,t,n,r){Yp()||gt(!1);let{navigator:o}=g.useContext(Qp),{matches:s}=g.useContext(Cs),l=s[s.length-1],u=l?l.params:{};l&&l.pathname;let d=l?l.pathnameBase:"/";l&&l.route;let p=Li(),h;if(t){var m;let j=typeof t=="string"?Oi(t):t;d==="/"||(m=j.pathname)!=null&&m.startsWith(d)||gt(!1),h=j}else h=p;let y=h.pathname||"/",x=y;if(d!=="/"){let j=d.replace(/^\//,"").split("/");x="/"+y.replace(/^\//,"").split("/").slice(j.length).join("/")}let b=Ks(e,{pathname:x}),w=hq(b&&b.map(j=>Object.assign({},j,{params:Object.assign({},u,j.params),pathname:fs([d,o.encodeLocation?o.encodeLocation(j.pathname).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?d:fs([d,o.encodeLocation?o.encodeLocation(j.pathnameBase).pathname:j.pathnameBase])})),s,n,r);return t&&w?g.createElement(Kp.Provider,{value:{location:uu({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Tn.Pop}},w):w}function uq(){let e=yq(),t=qp(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 g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:o},n):null,null)}const dq=g.createElement(uq,null);class fq extends g.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?g.createElement(Cs.Provider,{value:this.props.routeContext},g.createElement(vR.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function pq(e){let{routeContext:t,match:n,children:r}=e,o=g.useContext(Gp);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(Cs.Provider,{value:t},r)}function hq(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,u=(o=n)==null?void 0:o.errors;if(u!=null){let h=l.findIndex(m=>m.route.id&&(u==null?void 0:u[m.route.id])!==void 0);h>=0||gt(!1),l=l.slice(0,Math.min(l.length,h+1))}let d=!1,p=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<l.length;h++){let m=l[h];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(p=h),m.route.id){let{loaderData:y,errors:x}=n,b=m.route.loader&&y[m.route.id]===void 0&&(!x||x[m.route.id]===void 0);if(m.route.lazy||b){d=!0,p>=0?l=l.slice(0,p+1):l=[l[0]];break}}}return l.reduceRight((h,m,y)=>{let x,b=!1,w=null,j=null;n&&(x=u&&m.route.id?u[m.route.id]:void 0,w=m.route.errorElement||dq,d&&(p<0&&y===0?(bq("route-fallback"),b=!0,j=null):p===y&&(b=!0,j=m.route.hydrateFallbackElement||null)));let T=t.concat(l.slice(0,y+1)),P=()=>{let k;return x?k=w:b?k=j:m.route.Component?k=g.createElement(m.route.Component,null):m.route.element?k=m.route.element:k=h,g.createElement(pq,{match:m,routeContext:{outlet:h,matches:T,isDataRoute:n!=null},children:k})};return n&&(m.route.ErrorBoundary||m.route.errorElement||y===0)?g.createElement(fq,{location:n.location,revalidation:n.revalidation,component:w,error:x,children:P(),routeContext:{outlet:null,matches:T,isDataRoute:!0}}):P()},null)}var bR=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(bR||{}),Bf=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}(Bf||{});function mq(e){let t=g.useContext(Gp);return t||gt(!1),t}function gq(e){let t=g.useContext(gR);return t||gt(!1),t}function vq(e){let t=g.useContext(Cs);return t||gt(!1),t}function wR(e){let t=vq(),n=t.matches[t.matches.length-1];return n.route.id||gt(!1),n.route.id}function yq(){var e;let t=g.useContext(vR),n=gq(Bf.UseRouteError),r=wR(Bf.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function xq(){let{router:e}=mq(bR.UseNavigateStable),t=wR(Bf.UseNavigateStable),n=g.useRef(!1);return yR(()=>{n.current=!0}),g.useCallback(function(o,s){s===void 0&&(s={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,uu({fromRouteId:t},s)))},[e,t])}const xj={};function bq(e,t,n){xj[e]||(xj[e]=!0)}const bj={};function wq(e,t){bj[t]||(bj[t]=!0,console.warn(t))}const ul=(e,t,n)=>wq(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function Sq(e,t){e!=null&&e.v7_startTransition||ul("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),!(e!=null&&e.v7_relativeSplatPath)&&(!t||!t.v7_relativeSplatPath)&&ul("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),t&&(t.v7_fetcherPersist||ul("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),t.v7_normalizeFormMethod||ul("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),t.v7_partialHydration||ul("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),t.v7_skipActionErrorRevalidation||ul("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"))}function Zx(e){return lq(e.context)}function qe(e){gt(!1)}function jq(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Tn.Pop,navigator:s,static:l=!1,future:u}=e;Yp()&>(!1);let d=t.replace(/^\/*/,"/"),p=g.useMemo(()=>({basename:d,navigator:s,static:l,future:uu({v7_relativeSplatPath:!1},u)}),[d,u,s,l]);typeof r=="string"&&(r=Oi(r));let{pathname:h="/",search:m="",hash:y="",state:x=null,key:b="default"}=r,w=g.useMemo(()=>{let j=zu(h,d);return j==null?null:{location:{pathname:j,search:m,hash:y,state:x,key:b},navigationType:o}},[d,h,m,y,x,b,o]);return w==null?null:g.createElement(Qp.Provider,{value:p},g.createElement(Kp.Provider,{children:n,value:w}))}function Cq(e){let{children:t,location:n}=e;return cq(dv(t),n)}new Promise(()=>{});function dv(e,t){t===void 0&&(t=[]);let n=[];return g.Children.forEach(e,(r,o)=>{if(!g.isValidElement(r))return;let s=[...t,o];if(r.type===g.Fragment){n.push.apply(n,dv(r.props.children,s));return}r.type!==qe&>(!1),!r.props.index||!r.props.children||gt(!1);let l={id:r.props.id||s.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&&(l.children=dv(r.props.children,s)),n.push(l)}),n}function Eq(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:g.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:g.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:g.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
|
|
568
|
-
* React Router DOM v6.28.0
|
|
569
|
-
*
|
|
570
|
-
* Copyright (c) Remix Software Inc.
|
|
571
|
-
*
|
|
572
|
-
* This source code is licensed under the MIT license found in the
|
|
573
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
574
|
-
*
|
|
575
|
-
* @license MIT
|
|
576
|
-
*/function Uf(){return Uf=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},Uf.apply(this,arguments)}function fv(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 kq(e,t){let n=fv(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(s=>{n.append(o,s)})}),n}const Tq="6";try{window.__reactRouterVersion=Tq}catch{}function Pq(e,t){return zH({basename:void 0,future:Uf({},void 0,{v7_prependBasename:!0}),history:uH({window:void 0}),hydrationData:Rq(),routes:e,mapRouteProperties:Eq,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function Rq(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Uf({},t,{errors:_q(t.errors)})),t}function _q(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 zf(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let s=window[o.__subType];if(typeof s=="function")try{let l=new s(o.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let s=new Error(o.message);s.stack="",n[r]=s}}else n[r]=o;return n}const Dq=g.createContext({isTransitioning:!1}),Iq=g.createContext(new Map),Nq="startTransition",wj=Hj[Nq],Aq="flushSync",Sj=YI[Aq];function Mq(e){wj?wj(e):e()}function Uc(e){Sj?Sj(e):e()}class Oq{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 Lq(e){let{fallbackElement:t,router:n,future:r}=e,[o,s]=g.useState(n.state),[l,u]=g.useState(),[d,p]=g.useState({isTransitioning:!1}),[h,m]=g.useState(),[y,x]=g.useState(),[b,w]=g.useState(),j=g.useRef(new Map),{v7_startTransition:T}=r||{},P=g.useCallback(N=>{T?Mq(N):N()},[T]),k=g.useCallback((N,L)=>{let{deletedFetchers:z,flushSync:q,viewTransitionOpts:G}=L;z.forEach(Q=>j.current.delete(Q)),N.fetchers.forEach((Q,te)=>{Q.data!==void 0&&j.current.set(te,Q.data)});let Y=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!G||Y){q?Uc(()=>s(N)):P(()=>s(N));return}if(q){Uc(()=>{y&&(h&&h.resolve(),y.skipTransition()),p({isTransitioning:!0,flushSync:!0,currentLocation:G.currentLocation,nextLocation:G.nextLocation})});let Q=n.window.document.startViewTransition(()=>{Uc(()=>s(N))});Q.finished.finally(()=>{Uc(()=>{m(void 0),x(void 0),u(void 0),p({isTransitioning:!1})})}),Uc(()=>x(Q));return}y?(h&&h.resolve(),y.skipTransition(),w({state:N,currentLocation:G.currentLocation,nextLocation:G.nextLocation})):(u(N),p({isTransitioning:!0,flushSync:!1,currentLocation:G.currentLocation,nextLocation:G.nextLocation}))},[n.window,y,h,j,P]);g.useLayoutEffect(()=>n.subscribe(k),[n,k]),g.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new Oq)},[d]),g.useEffect(()=>{if(h&&l&&n.window){let N=l,L=h.promise,z=n.window.document.startViewTransition(async()=>{P(()=>s(N)),await L});z.finished.finally(()=>{m(void 0),x(void 0),u(void 0),p({isTransitioning:!1})}),x(z)}},[P,l,h,n.window]),g.useEffect(()=>{h&&l&&o.location.key===l.location.key&&h.resolve()},[h,y,o.location,l]),g.useEffect(()=>{!d.isTransitioning&&b&&(u(b.state),p({isTransitioning:!0,flushSync:!1,currentLocation:b.currentLocation,nextLocation:b.nextLocation}),w(void 0))},[d.isTransitioning,b]),g.useEffect(()=>{},[]);let E=g.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:N=>n.navigate(N),push:(N,L,z)=>n.navigate(N,{state:L,preventScrollReset:z==null?void 0:z.preventScrollReset}),replace:(N,L,z)=>n.navigate(N,{replace:!0,state:L,preventScrollReset:z==null?void 0:z.preventScrollReset})}),[n]),_=n.basename||"/",R=g.useMemo(()=>({router:n,navigator:E,static:!1,basename:_}),[n,E,_]),M=g.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return g.useEffect(()=>Sq(r,n.future),[r,n.future]),g.createElement(g.Fragment,null,g.createElement(Gp.Provider,{value:R},g.createElement(gR.Provider,{value:o},g.createElement(Iq.Provider,{value:j.current},g.createElement(Dq.Provider,{value:d},g.createElement(jq,{basename:_,location:o.location,navigationType:o.historyAction,navigator:E,future:M},o.initialized||n.future.v7_partialHydration?g.createElement($q,{routes:n.routes,future:n.future,state:o}):t))))),null)}const $q=g.memo(Fq);function Fq(e){let{routes:t,future:n,state:r}=e;return xR(t,void 0,r,n)}var jj;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(jj||(jj={}));var Cj;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Cj||(Cj={}));function e0(e){let t=g.useRef(fv(e)),n=g.useRef(!1),r=Li(),o=g.useMemo(()=>kq(r.search,n.current?null:t.current),[r.search]),s=En(),l=g.useCallback((u,d)=>{const p=fv(typeof u=="function"?u(o):u);n.current=!0,s("?"+p,d)},[s,o]);return[o,l]}const zq=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function Al(e,t,n){const r=Bq(e),{webkitRelativePath:o}=e,s=typeof t=="string"?t:typeof o=="string"&&o.length>0?o:`./${e.name}`;return typeof r.path!="string"&&Ej(r,"path",s),Ej(r,"relativePath",s),r}function Bq(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),o=zq.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}function Ej(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var Ta=(e,t,n)=>new Promise((r,o)=>{var s=d=>{try{u(n.next(d))}catch(p){o(p)}},l=d=>{try{u(n.throw(d))}catch(p){o(p)}},u=d=>d.done?r(d.value):Promise.resolve(d.value).then(s,l);u((n=n.apply(e,t)).next())});const Uq=[".DS_Store","Thumbs.db"];function Vq(e){return Ta(this,null,function*(){return Vf(e)&&Wq(e.dataTransfer)?Qq(e.dataTransfer,e.type):Hq(e)?qq(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?Gq(e):[]})}function Wq(e){return Vf(e)}function Hq(e){return Vf(e)&&Vf(e.target)}function Vf(e){return typeof e=="object"&&e!==null}function qq(e){return pv(e.target.files).map(t=>Al(t))}function Gq(e){return Ta(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Al(n))})}function Qq(e,t){return Ta(this,null,function*(){if(e.items){const n=pv(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(Kq));return kj(SR(r))}return kj(pv(e.files).map(n=>Al(n)))})}function kj(e){return e.filter(t=>Uq.indexOf(t.name)===-1)}function pv(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 Kq(e){if(typeof e.webkitGetAsEntry!="function")return Tj(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?jR(t):Tj(e,t)}function SR(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?SR(n):[n]],[])}function Tj(e,t){var n;if(typeof e.getAsFileSystemHandle=="function")return e.getAsFileSystemHandle().then(s=>Ta(this,null,function*(){const l=yield s.getFile();return l.handle=s,Al(l)}));const r=e.getAsFile();if(!r)return Promise.reject(`${e} is not a File`);const o=Al(r,(n=t==null?void 0:t.fullPath)!=null?n:void 0);return Promise.resolve(o)}function Yq(e){return Ta(this,null,function*(){return e.isDirectory?jR(e):Xq(e)})}function jR(e){const t=e.createReader();return new Promise((n,r)=>{const o=[];function s(){t.readEntries(l=>Ta(this,null,function*(){if(l.length){const u=Promise.all(l.map(Yq));o.push(u),s()}else try{const u=yield Promise.all(o);n(u)}catch(u){r(u)}}),l=>{r(l)})}s()})}function Xq(e){return Ta(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const o=Al(r,e.fullPath);t(o)},r=>{n(r)})})})}function wg(e,t){if(e&&t){const n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;const r=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return n.some(l=>{const u=l.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?s===u.replace(/\/.*$/,""):o===u})}return!0}var Jq=Object.defineProperty,Zq=Object.defineProperties,eG=Object.getOwnPropertyDescriptors,Pj=Object.getOwnPropertySymbols,tG=Object.prototype.hasOwnProperty,nG=Object.prototype.propertyIsEnumerable,Rj=(e,t,n)=>t in e?Jq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rG=(e,t)=>{for(var n in t||(t={}))tG.call(t,n)&&Rj(e,n,t[n]);if(Pj)for(var n of Pj(t))nG.call(t,n)&&Rj(e,n,t[n]);return e},oG=(e,t)=>Zq(e,eG(t));const iG=typeof wg=="function"?wg:wg.default,sG="file-invalid-type",aG="file-too-large",lG="file-too-small",cG="too-many-files",uG=(e="")=>{const t=e.split(","),n=t.length>1?`one of ${t.join(", ")}`:t[0];return{code:sG,message:`File type must be ${n}`}},_j=e=>({code:aG,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),Dj=e=>({code:lG,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),dG={code:cG,message:"Too many files"};function CR(e,t){const n=e.type==="application/x-moz-file"||iG(e,t);return[n,n?null:uG(t)]}function ER(e,t,n){if(Xs(e.size))if(Xs(t)&&Xs(n)){if(e.size>n)return[!1,_j(n)];if(e.size<t)return[!1,Dj(t)]}else{if(Xs(t)&&e.size<t)return[!1,Dj(t)];if(Xs(n)&&e.size>n)return[!1,_j(n)]}return[!0,null]}function Xs(e){return e!=null}function fG({files:e,accept:t,minSize:n,maxSize:r,multiple:o,maxFiles:s,validator:l}){return!o&&e.length>1||o&&s>=1&&e.length>s?!1:e.every(u=>{const[d]=CR(u,t),[p]=ER(u,n,r),h=l?l(u):null;return d&&p&&!h})}function Wf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function af(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 Ij(e){e.preventDefault()}function pG(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function hG(e){return e.indexOf("Edge/")!==-1}function mG(e=window.navigator.userAgent){return pG(e)||hG(e)}function zo(...e){return(t,...n)=>e.some(r=>(!Wf(t)&&r&&r(t,...n),Wf(t)))}function gG(){return"showOpenFilePicker"in window}function vG(e){return Xs(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let o=!0;return kR(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(TR))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),o=!1),o}).reduce((n,[r,o])=>oG(rG({},n),{[r]:o}),{})}]:e}function yG(e){if(Xs(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>kR(t)||TR(t)).join(",")}function xG(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function bG(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function kR(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function TR(e){return/^.*\.[\w]+$/.test(e)}var wG=Object.defineProperty,SG=Object.defineProperties,jG=Object.getOwnPropertyDescriptors,Hf=Object.getOwnPropertySymbols,PR=Object.prototype.hasOwnProperty,RR=Object.prototype.propertyIsEnumerable,Nj=(e,t,n)=>t in e?wG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dr=(e,t)=>{for(var n in t||(t={}))PR.call(t,n)&&Nj(e,n,t[n]);if(Hf)for(var n of Hf(t))RR.call(t,n)&&Nj(e,n,t[n]);return e},ls=(e,t)=>SG(e,jG(t)),qf=(e,t)=>{var n={};for(var r in e)PR.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Hf)for(var r of Hf(e))t.indexOf(r)<0&&RR.call(e,r)&&(n[r]=e[r]);return n};const t0=g.forwardRef((e,t)=>{var n=e,{children:r}=n,o=qf(n,["children"]);const s=DR(o),{open:l}=s,u=qf(s,["open"]);return g.useImperativeHandle(t,()=>({open:l}),[l]),gn.createElement(g.Fragment,null,r(ls(dr({},u),{open:l})))});t0.displayName="Dropzone";const _R={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:!1,autoFocus:!1};t0.defaultProps=_R;t0.propTypes={children:Ht.func,accept:Ht.objectOf(Ht.arrayOf(Ht.string)),multiple:Ht.bool,preventDropOnDocument:Ht.bool,noClick:Ht.bool,noKeyboard:Ht.bool,noDrag:Ht.bool,noDragEventsBubbling:Ht.bool,minSize:Ht.number,maxSize:Ht.number,maxFiles:Ht.number,disabled:Ht.bool,getFilesFromEvent:Ht.func,onFileDialogCancel:Ht.func,onFileDialogOpen:Ht.func,useFsAccessApi:Ht.bool,autoFocus:Ht.bool,onDragEnter:Ht.func,onDragLeave:Ht.func,onDragOver:Ht.func,onDrop:Ht.func,onDropAccepted:Ht.func,onDropRejected:Ht.func,onError:Ht.func,validator:Ht.func};const hv={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function DR(e={}){const{accept:t,disabled:n,getFilesFromEvent:r,maxSize:o,minSize:s,multiple:l,maxFiles:u,onDragEnter:d,onDragLeave:p,onDragOver:h,onDrop:m,onDropAccepted:y,onDropRejected:x,onFileDialogCancel:b,onFileDialogOpen:w,useFsAccessApi:j,autoFocus:T,preventDropOnDocument:P,noClick:k,noKeyboard:E,noDrag:_,noDragEventsBubbling:R,onError:M,validator:N}=dr(dr({},_R),e),L=g.useMemo(()=>yG(t),[t]),z=g.useMemo(()=>vG(t),[t]),q=g.useMemo(()=>typeof w=="function"?w:Aj,[w]),G=g.useMemo(()=>typeof b=="function"?b:Aj,[b]),Y=g.useRef(null),Q=g.useRef(null),[te,V]=g.useReducer(CG,hv),{isFocused:O,isFileDialogActive:A}=te,B=g.useRef(typeof window<"u"&&window.isSecureContext&&j&&gG()),I=()=>{!B.current&&A&&setTimeout(()=>{if(Q.current){const{files:he}=Q.current;he.length||(V({type:"closeDialog"}),G())}},300)};g.useEffect(()=>(window.addEventListener("focus",I,!1),()=>{window.removeEventListener("focus",I,!1)}),[Q,A,G,B]);const F=g.useRef([]),J=he=>{Y.current&&Y.current.contains(he.target)||(he.preventDefault(),F.current=[])};g.useEffect(()=>(P&&(document.addEventListener("dragover",Ij,!1),document.addEventListener("drop",J,!1)),()=>{P&&(document.removeEventListener("dragover",Ij),document.removeEventListener("drop",J))}),[Y,P]),g.useEffect(()=>(!n&&T&&Y.current&&Y.current.focus(),()=>{}),[Y,T,n]);const de=g.useCallback(he=>{M?M(he):console.error(he)},[M]),Ee=g.useCallback(he=>{he.preventDefault(),he.persist(),ce(he),F.current=[...F.current,he.target],af(he)&&Promise.resolve(r(he)).then(ke=>{if(Wf(he)&&!R)return;const ae=ke.length,Ae=ae>0&&fG({files:ke,accept:L,minSize:s,maxSize:o,multiple:l,maxFiles:u,validator:N}),ut=ae>0&&!Ae;V({isDragAccept:Ae,isDragReject:ut,isDragActive:!0,type:"setDraggedFiles"}),d&&d(he)}).catch(ke=>de(ke))},[r,d,de,R,L,s,o,l,u,N]),ve=g.useCallback(he=>{he.preventDefault(),he.persist(),ce(he);const ke=af(he);if(ke&&he.dataTransfer)try{he.dataTransfer.dropEffect="copy"}catch{}return ke&&h&&h(he),!1},[h,R]),we=g.useCallback(he=>{he.preventDefault(),he.persist(),ce(he);const ke=F.current.filter(Ae=>Y.current&&Y.current.contains(Ae)),ae=ke.indexOf(he.target);ae!==-1&&ke.splice(ae,1),F.current=ke,!(ke.length>0)&&(V({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),af(he)&&p&&p(he))},[Y,p,R]),_e=g.useCallback((he,ke)=>{const ae=[],Ae=[];he.forEach(ut=>{const[Mt,bt]=CR(ut,L),[ht,xn]=ER(ut,s,o),cn=N?N(ut):null;if(Mt&&ht&&!cn)ae.push(ut);else{let Qn=[bt,xn];cn&&(Qn=Qn.concat(cn)),Ae.push({file:ut,errors:Qn.filter(Kn=>Kn)})}}),(!l&&ae.length>1||l&&u>=1&&ae.length>u)&&(ae.forEach(ut=>{Ae.push({file:ut,errors:[dG]})}),ae.splice(0)),V({acceptedFiles:ae,fileRejections:Ae,isDragReject:Ae.length>0,type:"setFiles"}),m&&m(ae,Ae,ke),Ae.length>0&&x&&x(Ae,ke),ae.length>0&&y&&y(ae,ke)},[V,l,L,s,o,u,m,y,x,N]),fe=g.useCallback(he=>{he.preventDefault(),he.persist(),ce(he),F.current=[],af(he)&&Promise.resolve(r(he)).then(ke=>{Wf(he)&&!R||_e(ke,he)}).catch(ke=>de(ke)),V({type:"reset"})},[r,_e,de,R]),Je=g.useCallback(()=>{if(B.current){V({type:"openDialog"}),q();const he={multiple:l,types:z};window.showOpenFilePicker(he).then(ke=>r(ke)).then(ke=>{_e(ke,null),V({type:"closeDialog"})}).catch(ke=>{xG(ke)?(G(ke),V({type:"closeDialog"})):bG(ke)?(B.current=!1,Q.current?(Q.current.value=null,Q.current.click()):de(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."))):de(ke)});return}Q.current&&(V({type:"openDialog"}),q(),Q.current.value=null,Q.current.click())},[V,q,G,j,_e,de,z,l]),pt=g.useCallback(he=>{!Y.current||!Y.current.isEqualNode(he.target)||(he.key===" "||he.key==="Enter"||he.keyCode===32||he.keyCode===13)&&(he.preventDefault(),Je())},[Y,Je]),at=g.useCallback(()=>{V({type:"focus"})},[]),St=g.useCallback(()=>{V({type:"blur"})},[]),jt=g.useCallback(()=>{k||(mG()?setTimeout(Je,0):Je())},[k,Je]),Et=he=>n?null:he,vt=he=>E?null:Et(he),kt=he=>_?null:Et(he),ce=he=>{R&&he.stopPropagation()},pe=g.useMemo(()=>(he={})=>{var ke=he,{refKey:ae="ref",role:Ae,onKeyDown:ut,onFocus:Mt,onBlur:bt,onClick:ht,onDragEnter:xn,onDragOver:cn,onDragLeave:Qn,onDrop:Kn}=ke,Jo=qf(ke,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return dr(dr({onKeyDown:vt(zo(ut,pt)),onFocus:vt(zo(Mt,at)),onBlur:vt(zo(bt,St)),onClick:Et(zo(ht,jt)),onDragEnter:kt(zo(xn,Ee)),onDragOver:kt(zo(cn,ve)),onDragLeave:kt(zo(Qn,we)),onDrop:kt(zo(Kn,fe)),role:typeof Ae=="string"&&Ae!==""?Ae:"presentation",[ae]:Y},!n&&!E?{tabIndex:0}:{}),Jo)},[Y,pt,at,St,jt,Ee,ve,we,fe,E,_,n]),Re=g.useCallback(he=>{he.stopPropagation()},[]),He=g.useMemo(()=>(he={})=>{var ke=he,{refKey:ae="ref",onChange:Ae,onClick:ut}=ke,Mt=qf(ke,["refKey","onChange","onClick"]);const bt={accept:L,multiple:l,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:Et(zo(Ae,fe)),onClick:Et(zo(ut,Re)),tabIndex:-1,[ae]:Q};return dr(dr({},bt),Mt)},[Q,t,l,fe,n]);return ls(dr({},te),{isFocused:O&&!n,getRootProps:pe,getInputProps:He,rootRef:Y,inputRef:Q,open:Et(Je)})}function CG(e,t){switch(t.type){case"focus":return ls(dr({},e),{isFocused:!0});case"blur":return ls(dr({},e),{isFocused:!1});case"openDialog":return ls(dr({},hv),{isFileDialogActive:!0});case"closeDialog":return ls(dr({},e),{isFileDialogActive:!1});case"setDraggedFiles":return ls(dr({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return ls(dr({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return dr({},hv);default:return e}}function Aj(){}const[EG,kG]=hr("Dropzone component was not found in tree");function n0(e){const t=n=>{const{children:r,...o}=ie(`Dropzone${zb(e)}`,{},n),s=kG(),l=Ti(r)?r:i.jsx("span",{children:r});return s[e]?g.cloneElement(l,o):null};return t.displayName=`@mantine/dropzone/${zb(e)}`,t}const TG=n0("accept"),PG=n0("reject"),RG=n0("idle");var du={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const _G={loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},DG=(e,{radius:t,variant:n,acceptColor:r,rejectColor:o})=>{const s=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),l=e.variantColorResolver({color:o||"red",theme:e,variant:n});return{root:{"--dropzone-radius":At(t),"--dropzone-accept-color":s.color,"--dropzone-accept-bg":s.background,"--dropzone-reject-color":l.color,"--dropzone-reject-bg":l.background}}},Es=ue((e,t)=>{const n=ie("Dropzone",_G,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,radius:p,disabled:h,loading:m,multiple:y,maxSize:x,accept:b,children:w,onDropAny:j,onDrop:T,onReject:P,openRef:k,name:E,maxFiles:_,autoFocus:R,activateOnClick:M,activateOnDrag:N,dragEventsBubbling:L,activateOnKeyboard:z,onDragEnter:q,onDragLeave:G,onDragOver:Y,onFileDialogCancel:Q,onFileDialogOpen:te,preventDropOnDocument:V,useFsAccessApi:O,getFilesFromEvent:A,validator:B,rejectColor:I,acceptColor:F,enablePointerEvents:J,loaderProps:de,inputProps:Ee,mod:ve,...we}=n,_e=Ne({name:"Dropzone",classes:du,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:DG}),{getRootProps:fe,getInputProps:Je,isDragAccept:pt,isDragReject:at,open:St}=DR({onDrop:j,onDropAccepted:T,onDropRejected:P,disabled:h||m,accept:Array.isArray(b)?b.reduce((Et,vt)=>({...Et,[vt]:[]}),{}):b,multiple:y,maxSize:x,maxFiles:_,autoFocus:R,noClick:!M,noDrag:!N,noDragEventsBubbling:!L,noKeyboard:!z,onDragEnter:q,onDragLeave:G,onDragOver:Y,onFileDialogCancel:Q,onFileDialogOpen:te,preventDropOnDocument:V,useFsAccessApi:O,validator:B,...A?{getFilesFromEvent:A}:null});Kf(k,St);const jt=!pt&&!at;return i.jsx(EG,{value:{accept:pt,reject:at,idle:jt},children:i.jsxs(se,{...fe(),..._e("root",{focusable:!0}),...we,mod:[{accept:pt,reject:at,idle:jt,disabled:h,loading:m,"activate-on-click":M},ve],children:[i.jsx(Py,{visible:m,overlayProps:{radius:p},unstyled:u,loaderProps:de}),i.jsx("input",{...Je(Ee),name:E}),i.jsx("div",{..._e("inner"),ref:t,"data-enable-pointer-events":J||void 0,children:w})]})})});Es.classes=du;Es.displayName="@mantine/dropzone/Dropzone";Es.Accept=TG;Es.Idle=RG;Es.Reject=PG;const IG={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Vr("max"),withinPortal:!0},r0=ue((e,t)=>{const n=ie("DropzoneFullScreen",IG,e),{classNames:r,className:o,style:s,styles:l,unstyled:u,vars:d,active:p,onDrop:h,onReject:m,zIndex:y,withinPortal:x,portalProps:b,...w}=n,j=Ne({name:"DropzoneFullScreen",classes:du,props:n,className:o,style:s,classNames:r,styles:l,unstyled:u,rootSelector:"fullScreen"}),{resolvedClassNames:T,resolvedStyles:P}=Ol({classNames:r,styles:l,props:n}),[k,E]=g.useState(0),[_,{open:R,close:M}]=Yf(!1),N=z=>{var q;(q=z.dataTransfer)!=null&&q.types.includes("Files")&&(E(G=>G+1),R())},L=()=>{E(z=>z-1)};return g.useEffect(()=>{k===0&&M()},[k]),g.useEffect(()=>{if(p)return document.addEventListener("dragenter",N,!1),document.addEventListener("dragleave",L,!1),()=>{document.removeEventListener("dragenter",N,!1),document.removeEventListener("dragleave",L,!1)}},[p]),i.jsx(ya,{...b,withinPortal:x,children:i.jsx(se,{...j("fullScreen",{style:{opacity:_?1:0,pointerEvents:_?"all":"none",zIndex:y}}),ref:t,children:i.jsx(Es,{...w,classNames:T,styles:P,unstyled:u,className:du.dropzone,onDrop:z=>{h==null||h(z),M(),E(0)},onReject:z=>{m==null||m(z),M(),E(0)}})})})});r0.classes=du;r0.displayName="@mantine/dropzone/DropzoneFullScreen";Es.FullScreen=r0;const lf=Es,NG='{"resourceType": "Bundle"}';function Sg({id:e,title:t,message:n,color:r,icon:o,withCloseButton:s=!1,method:l="show",loading:u}){Go[l]({id:e,loading:u,title:t,message:n,color:r,icon:o,withCloseButton:s,autoClose:!1})}function AG(){const e=ln(),t=Te(),[n,r]=g.useState({}),o=g.useCallback(async(u,d)=>{const p="batch-upload";Sg({id:p,title:"Batch Upload in Progress",message:"Your batch data is being uploaded. This may take a moment...",method:"show",loading:!0});try{r({});let h=JSON.parse(u);h.type!=="batch"&&h.type!=="transaction"&&(h=_T(h));const m=await t.executeBatch(h);r(y=>({...y,[d]:m})),Sg({id:p,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:i.jsx(Ss,{size:"1rem"}),withCloseButton:!0})}catch(h){Sg({id:p,title:"Batch Upload Failed",color:"red",message:Ze(h),method:"update",icon:i.jsx(Il,{size:"1rem"}),withCloseButton:!0})}},[t]),s=g.useCallback(async u=>{for(const d of u){const p=new FileReader;p.onload=h=>{var m;return o((m=h.target)==null?void 0:m.result,d.name)},p.readAsText(d)}},[o]),l=g.useCallback(async u=>{await o(u.input,"JSON Data")},[o]);return i.jsxs(it,{children:[i.jsx(ze,{children:"Batch Create"}),i.jsxs("p",{children:["Use this page to create, read, or update multiple resources. For more details, see ",i.jsx("a",{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(n).length===0&&i.jsxs(i.Fragment,{children:[i.jsx("h3",{children:"Input"}),i.jsxs(Dt,{defaultValue:"upload",children:[i.jsxs(Dt.List,{children:[i.jsx(Dt.Tab,{value:"upload",children:"File Upload"}),i.jsx(Dt.Tab,{value:"json",children:"JSON"})]}),i.jsx(Dt.Panel,{value:"upload",pt:"xs",children:i.jsx(lf,{onDrop:s,accept:["application/json"],children:i.jsxs(be,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[i.jsx(lf.Accept,{children:i.jsx(DS,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),i.jsx(lf.Reject,{children:i.jsx(Il,{size:50,stroke:1.5,color:e.colors.red[5]})}),i.jsx(lf.Idle,{children:i.jsx(DS,{size:50,stroke:1.5})}),i.jsxs("div",{children:[i.jsx($e,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),i.jsx($e,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),i.jsx(Dt.Panel,{value:"json",pt:"xs",children:i.jsxs(yt,{onSubmit:l,children:[i.jsx(Vl,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:NG,deserialize:JSON.parse}),i.jsx(be,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:i.jsx(Pe,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&i.jsxs(i.Fragment,{children:[i.jsx("h3",{children:"Output"}),i.jsxs(Dt,{defaultValue:Object.keys(n)[0],children:[i.jsx(Dt.List,{children:Object.keys(n).map(u=>i.jsx(Dt.Tab,{value:u,children:u},u))}),Object.keys(n).map(u=>i.jsx(Dt.Panel,{value:u,children:i.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[u],void 0,2)})},u))]}),i.jsx(be,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:i.jsx(Pe,{onClick:()=>r({}),children:"Start over"})})]})]})}function MG(){const{resourceType:e}=$t(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(o=>!!o),[r]=Dl("Questionnaire",`subject-type=${e}`);return r?r.length===0?i.jsxs(it,{children:[i.jsxs(ze,{children:["No apps for ",e]}),i.jsx(xt,{to:`/${e}`,children:"Return to search page"})]}):i.jsx(it,{children:i.jsx("div",{children:r.map(o=>i.jsxs("div",{children:[i.jsx("h3",{children:i.jsx(xt,{to:`/forms/${o.id}?subject=`+n.map(s=>`${e}/${s}`).join(","),children:o.name})}),i.jsx("p",{children:o.description})]},o.id))})}):i.jsx(Ur,{})}function OG(){const e=Te(),[t,n]=g.useState(),[r,o]=g.useState(!1);return i.jsx(it,{width:450,children:i.jsxs(yt,{onSubmit:s=>{n(void 0),e.post("auth/changepassword",s).then(()=>o(!0)).catch(l=>n(Bt(l)))},children:[i.jsxs(Vn,{style:{flexDirection:"column"},children:[i.jsx(Do,{size:32}),i.jsx(ze,{children:"Change password"})]}),!r&&i.jsxs(tt,{gap:"xl",mt:"xl",children:[i.jsx(Co,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:Ct(t,"oldPassword")}),i.jsx(Co,{name:"newPassword",label:"New password",required:!0,error:Ct(t,"newPassword")}),i.jsx(Co,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Ct(t,"confirmPassword")}),i.jsx(be,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:i.jsx(Pe,{type:"submit",children:"Change password"})})]}),r&&i.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const mv=["Form","JSON","Profiles"],LG=["Profiles"],jg=mv[0].toLowerCase();function $G(){const e=En(),t=ln(),{resourceType:n}=$t(),[r,o]=g.useState(()=>{const l=window.location.pathname.split("/").pop();return l&&mv.map(u=>u.toLowerCase()).includes(l)?l:jg});function s(l){l||(l=jg),o(l),e(`/${n}/new/${l}`)}return i.jsxs(i.Fragment,{children:[i.jsxs(kr,{children:[i.jsxs($e,{p:"md",fw:500,children:["New ",n]}),i.jsx(oo,{children:i.jsx(Dt,{defaultValue:jg,value:r,onChange:s,children:i.jsx(Dt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:mv.map(l=>i.jsx(Dt.Tab,{value:l.toLowerCase(),px:"md",children:LG.includes(l)?i.jsxs(be,{gap:"xs",wrap:"nowrap",children:[l,i.jsx(xu,{color:t.primaryColor,size:"sm",children:"Beta"})]}):l},l))})})})]}),i.jsx(Zx,{})]})}function FG(){return i.jsx(it,{children:i.jsxs(tt,{children:[i.jsx(ze,{order:1,children:"Unexpected Error"}),i.jsx($e,{children:"We're sorry, something went wrong."}),i.jsxs($e,{children:["Please contact ",i.jsx(Rt,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}const zG="_root_1fbwr_1",BG="_entry_1fbwr_8",UG="_key_1fbwr_13",VG="_value_1fbwr_20",Xp={root:zG,entry:BG,key:UG,value:VG};function ft(e){return i.jsx(oo,{children:i.jsx("div",{className:Xp.root,children:e.children})})}ft.Entry=function(t){return i.jsx("div",{className:Xp.entry,children:t.children})};ft.Key=function(t){return i.jsx("div",{className:Xp.key,children:t.children})};ft.Value=function(t){return i.jsx("div",{className:Xp.value,children:t.children})};function WG(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function IR(e){var n,r;const t=Kt(e.patient);return t?i.jsxs(ft,{children:[i.jsx(js,{value:t,size:"lg",color:WG(t)}),i.jsxs(ft.Entry,{children:[i.jsx(ft.Key,{children:"Name"}),i.jsx(ft.Value,{children:i.jsx(xt,{to:t,fw:500,children:t.name?i.jsx(Rx,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&i.jsxs(i.Fragment,{children:[i.jsxs(ft.Entry,{children:[i.jsx(ft.Key,{children:"DoB"}),i.jsx(ft.Value,{children:t.birthDate})]}),i.jsxs(ft.Entry,{children:[i.jsx(ft.Key,{children:"Age"}),i.jsx(ft.Value,{children:M$(t.birthDate)})]})]}),t.gender&&i.jsxs(ft.Entry,{children:[i.jsx(ft.Key,{children:"Gender"}),i.jsx(ft.Value,{children:t.gender})]}),t.address&&i.jsxs(ft.Entry,{children:[i.jsx(ft.Key,{children:"State"}),i.jsx(ft.Value,{children:(n=t.address[0])==null?void 0:n.state})]}),(r=t.identifier)==null?void 0:r.map(o=>i.jsxs(ft.Entry,{children:[i.jsx(ft.Key,{children:o==null?void 0:o.system}),i.jsx(ft.Value,{children:o==null?void 0:o.value})]},`${o==null?void 0:o.system}-${o==null?void 0:o.value}`))]}):null}function NR(e){const t=Kt(e.resource);if(!t)return null;const n=[{key:"Type",value:i.jsx(xt,{to:`/${t.resourceType}`,children:t.resourceType})}];function r(l,u){l&&u&&n.push({key:l,value:u})}function o(l){l&&r(l.system,l.value)}function s(l,u){Array.isArray(u)?u.forEach(d=>s(l,d)):typeof u=="string"?r(l,u):u&&(Array.isArray(u.coding)?r(l,u.coding.map(d=>d.display||d.code).join(", ")):r(l,u.text))}if("name"in t){const l=Ei(t);l!==Ot(t)&&r("Name",l)}return"category"in t&&s("Category",t.category),t.resourceType!=="Bot"&&"code"in t&&s("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}),i.jsx(ft,{children:n.map((l,u)=>i.jsxs(ft.Entry,{children:[i.jsx(ft.Key,{children:l.key}),i.jsx(ft.Value,{children:l.value})]},`${l.key}-${u}`))})}function o0(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function HG(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 ks(e){var t;return Rl((t=e.getActiveLogin())==null?void 0:t.project)}function qG(e,t){const n=new Blob([e],{type:On.JSON}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r;const s=new Date().toISOString().replace(/\D/g,"");o.download=`${s}.json`,document.body.appendChild(o),o.click(),URL.revokeObjectURL(r)}function GG(){const{id:e}=$t(),t=Li(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=Te(),[s,l]=g.useState(!0),[u,d]=g.useState(),[p,h]=g.useState(),[m,y]=g.useState(),[x,b]=g.useState(),[w,j]=g.useState();if(g.useEffect(()=>{const k={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const E=r.split(",").filter(_=>!!_);E.length===1&&k.entry.push({request:{method:"GET",url:E[0]}}),h(E)}o.executeBatch(k).then(E=>{var _,R,M,N,L,z,q,G;((M=(R=(_=E.entry)==null?void 0:_[0])==null?void 0:R.response)==null?void 0:M.status)!=="200"?b((z=(L=(N=E.entry)==null?void 0:N[0])==null?void 0:L.response)==null?void 0:z.outcome):(d((q=E.entry[0])==null?void 0:q.resource),y((G=E.entry[1])==null?void 0:G.resource)),l(!1)}).catch(E=>{b(E),l(!1)})},[o,e,r]),x)return i.jsx(it,{children:i.jsx("pre",{"data-testid":"error",children:JSON.stringify(x,void 0,2)})});if(w)return i.jsxs(it,{children:[i.jsx(ze,{children:u==null?void 0:u.title}),i.jsx("p",{children:"Your response has been recorded."}),i.jsxs("ul",{children:[w.length===1&&i.jsx("li",{children:i.jsx(xt,{to:w[0],children:"Review your answers"})}),w.length>1&&i.jsxs("li",{children:["Review your answers:",i.jsx("ul",{children:w.map(k=>i.jsx("li",{children:i.jsx(xt,{to:k,children:Ot(k)})},k.id))})]}),m&&i.jsx("li",{children:i.jsxs(xt,{to:m,children:["Back to ",Ei(m)]})}),i.jsx("li",{children:i.jsx(xt,{to:"/",children:"Go back home"})})]})]});if(s||!u)return i.jsx(Ur,{});const T=m&&o0(m);return i.jsxs(i.Fragment,{children:[i.jsxs(kr,{shadow:"xs",radius:0,children:[T&&i.jsx(IR,{patient:T}),m&&m.resourceType!=="Patient"&&i.jsx(NR,{resource:m}),i.jsx(se,{px:"xl",py:"md",children:i.jsxs($e,{children:[Ei(u),p&&p.length>1&&i.jsxs(i.Fragment,{children:[" (for ",p.length," resources)"]})]})})]}),i.jsx(it,{children:i.jsx(nR,{questionnaire:u,subject:m&&Jt(m),onSubmit:P})})]});async function P(k){const E=[];if(!p||p.length===0)E.push(await o.createResource(k));else for(const _ of p)E.push(await o.createResource({...k,subject:{reference:_}}));j(E)}}const QG="_paper_unw9o_1",KG={paper:QG},YG={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function AR(e,t){const n=e.resourceType||XG(t),r=e.fields??JG(n),o=e.filters??(e.resourceType?void 0:ZG(n)),s=e.sortRules??eQ(n),l=e.offset??0,u=e.count??Mp;return{...e,resourceType:n,fields:r,filters:o,sortRules:s,offset:l,count:u}}function XG(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 JG(e){const t=i0(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 ZG(e){var t;return(t=i0(e))==null?void 0:t.filters}function eQ(e){const t=i0(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function i0(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function tQ(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function nQ(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,hl({...r,total:"accurate",fields:void 0}));return _T(o)}function Mj(){const e=Te(),t=En(),n=Li(),[r,o]=g.useState();return g.useEffect(()=>{const s=ET(n.pathname+n.search),l=AR(s,e.getUserConfiguration());n.pathname===`/${l.resourceType}`&&n.search===hl(l)?(tQ(l),o(l)):t(`/${l.resourceType}${hl(l)}`)},[e,t,n]),!(r!=null&&r.resourceType)||!r.fields||r.fields.length===0?i.jsx(Ur,{}):i.jsx(kr,{shadow:"xs",m:"md",p:"xs",className:KG.paper,children:i.jsx($u,{checkboxesEnabled:!0,search:r,onClick:s=>t(`/${s.resource.resourceType}/${s.resource.id}`),onAuxClick:s=>window.open(`/${s.resource.resourceType}/${s.resource.id}`,"_blank"),onChange:s=>{t(`/${r.resourceType}${hl(s.definition)}`)},onNew:()=>{t(YG[r.resourceType]??`/${r.resourceType}/new`)},onExportCsv:()=>{const s=e.fhirUrl(r.resourceType,"$csv")+hl(r);e.download(s).then(l=>{window.open(window.URL.createObjectURL(l),"_blank")}).catch(l=>Ie({color:"red",message:Ze(l),autoClose:!1}))},onExportTransactionBundle:async()=>{nQ(r,e).then(s=>qG(JSON.stringify(s,void 0,2))).catch(s=>Ie({color:"red",message:Ze(s),autoClose:!1}))},onDelete:s=>{window.confirm("Are you sure you want to delete these resources?")&&(e.invalidateSearches(r.resourceType),e.executeBatch({resourceType:"Bundle",type:"batch",entry:s.map(l=>({request:{method:"DELETE",url:`${r.resourceType}/${l}`}}))}).then(()=>o({...r})).catch(l=>Ie({color:"red",message:Ze(l),autoClose:!1})))},onBulk:s=>{t(`/bulk/${r.resourceType}?ids=${s.join(",")}`)}})})}function rQ(){const e=Te(),[t,n]=g.useState(),[r,o]=g.useState(void 0),[s,l]=g.useState(!1),u=g.useCallback(()=>{e.get("auth/mfa/status",{cache:"no-cache"}).then(h=>{n(h.enrollQrCode),o(h.enrolled)}).catch(h=>Ie({color:"red",message:Ze(h),autoClose:!1}))},[e]);g.useEffect(()=>{u()},[u]);const d=g.useCallback(h=>{e.post("auth/mfa/enroll",h).then(()=>{o(!0),Ie({color:"green",message:"Success"})}).catch(m=>Ie({color:"red",message:Ze(m),autoClose:!1}))},[e]),p=g.useCallback(async h=>e.post("auth/mfa/disable",{token:h.token}),[e]);return r===void 0?null:r?i.jsxs(it,{children:[i.jsx(Nn,{title:"Disable MFA",opened:s,onClose:()=>l(!1),children:i.jsx(aP,{onSubmit:async h=>{await p(h),l(!1),o(!1),Ie({id:"mfa-disabled",color:"green",title:"Success",message:"MFA disabled",icon:i.jsx(zF,{})}),u()}})}),i.jsxs(be,{children:[i.jsx(ze,{children:"MFA is enabled"}),i.jsx(Pe,{onClick:()=>l(!0),children:"Disable MFA"})]})]}):i.jsx(it,{width:400,children:i.jsxs(yt,{onSubmit:d,children:[i.jsx(ze,{children:"Multi Factor Auth Setup"}),i.jsx(Vn,{children:i.jsx("img",{src:t})}),i.jsx(Fe,{name:"token",label:"Code"}),i.jsx(be,{justify:"flex-end",mt:"xl",children:i.jsx(Pe,{type:"submit",children:"Enroll"})})]})})}const Cg={BASE_URL:"/",DEV:!1,GOOGLE_CLIENT_ID:"__GOOGLE_CLIENT_ID__",MEDPLUM_BASE_URL:"__MEDPLUM_BASE_URL__",MEDPLUM_CLIENT_ID:"__MEDPLUM_CLIENT_ID__",MEDPLUM_REGISTER_ENABLED:"__MEDPLUM_REGISTER_ENABLED__",MEDPLUM_VERSION:"3.2.27-4cec0e5ad",MODE:"production",PROD:!0,RECAPTCHA_SITE_KEY:"__RECAPTCHA_SITE_KEY__",SSR:!1},gv={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__",awsTextractEnabled:Cg==null?void 0:Cg.MEDPLUM_AWS_TEXTRACT_ENABLED};function Bu(){return gv}function MR(){return OR("registerEnabled")}function oQ(){return OR("awsTextractEnabled")}function OR(e){try{return gv[e]!==!1&&gv[e]!=="false"}catch{return!0}}function iQ(){var h,m;const e=En(),[t]=e0(),n=Te(),r=t.get("scope")||"openid",[o,s]=g.useState(),[l,u]=g.useState(!0),d=t.get("client_id");if(g.useEffect(()=>{if(!d||d==="medplum-cli")return;async function y(){try{const x=await n.get(`/auth/clientinfo/${d}`);s(x)}catch(x){Ie({id:"clientinfofail",title:"Failed to retrieve client information.",color:"red",message:Ze(x),withCloseButton:!0})}finally{u(!1)}}y().catch(console.error)},[n,d]),!d)return null;function p(y){const x=new URL(t.get("redirect_uri"));for(const b of["scope","state","nonce"])t.has(b)&&x.searchParams.set(b,t.get(b));x.searchParams.set("code",y),window.location.assign(x.toString())}return i.jsx(lP,{onCode:p,onForgotPassword:()=>e("/resetpassword"),onRegister:()=>e("/register"),googleClientId:Bu().googleClientId,clientId:d||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:!l&&i.jsxs(i.Fragment,{children:[(h=o==null?void 0:o.logo)!=null&&h.url?i.jsx("img",{src:(m=o==null?void 0:o.logo)==null?void 0:m.url,alt:"Welcome Logo",height:60,style:{width:"auto"}}):i.jsx(Do,{size:32}),i.jsx(ze,{children:(o==null?void 0:o.welcomeString)??"Sign in to Medplum"})]})})}function sQ(){const e=Te(),t=En(),n=Bu();return g.useEffect(()=>{e.getProfile()&&t("/signin?project=new")},[e,t]),MR()?i.jsxs(jz,{type:"project",projectId:"new",onSuccess:()=>t("/"),googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[i.jsx(Do,{size:32}),i.jsx(ze,{children:"Create a new account"})]}):i.jsx(it,{width:450,children:i.jsx(xs,{icon:i.jsx(Xl,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function aQ(){const e=En(),t=Te(),[n,r]=g.useState(),[o,s]=g.useState(!1),l=Bu().recaptchaSiteKey;return g.useEffect(()=>{l&&iP(l)},[l]),i.jsx(it,{width:450,children:i.jsxs(yt,{onSubmit:async u=>{let d="";l&&(d=await sP(l)),t.post("auth/resetpassword",{...u,recaptchaToken:d}).then(()=>s(!0)).catch(p=>r(Bt(p)))},children:[i.jsxs(tt,{gap:"lg",mb:"xl",align:"center",children:[i.jsx(Do,{size:32}),i.jsx(ze,{children:"Medplum Password Reset"})]}),i.jsxs(tt,{gap:"xl",children:[i.jsx(ao,{issues:Mu(n,void 0)}),!o&&i.jsxs(i.Fragment,{children:[i.jsx(Fe,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:Ct(n,"email")}),i.jsxs(be,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[i.jsx(Rt,{component:"button",type:"button",color:"dimmed",onClick:()=>e("/register"),size:"xs",children:"Register"}),i.jsx(Pe,{type:"submit",children:"Reset password"})]})]}),o&&i.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function lQ(){var s;const e=En(),t=Te(),[n,r]=g.useState();g.useEffect(()=>{t.get("auth/me",{cache:"no-cache"}).then(r).catch(l=>Ie({color:"red",message:Ze(l),autoClose:!1}))},[t]);function o(l){t.post("auth/revoke",{loginId:l}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>Ie({color:"green",message:"Login revoked"})).catch(u=>Ie({color:"red",message:Ze(u),autoClose:!1}))}return n?i.jsxs(i.Fragment,{children:[i.jsxs(it,{children:[i.jsx(ze,{children:"Security"}),i.jsxs(Ax,{children:[i.jsx(xi,{term:"ID",children:i.jsx(Rt,{href:`/${Ot(n.profile)}`,children:n.profile.id})}),i.jsx(xi,{term:"Resource Type",children:n.profile.resourceType}),i.jsx(xi,{term:"Name",children:Ql((s=n.profile.name)==null?void 0:s[0])})]})]}),i.jsxs(it,{children:[i.jsx(ze,{children:"Sessions"}),i.jsxs(Le,{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"OS"}),i.jsx("th",{children:"Browser"}),i.jsx("th",{children:"IP Address"}),i.jsx("th",{children:"Auth Method"}),i.jsx("th",{children:"Last Updated"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:n.security.sessions.map(l=>i.jsxs("tr",{children:[i.jsx("td",{children:l.os}),i.jsx("td",{children:l.browser}),i.jsx("td",{children:l.remoteAddress}),i.jsx("td",{children:l.authMethod}),i.jsx("td",{children:pr(l.lastUpdated)}),i.jsx("td",{children:i.jsx(Rt,{href:"#",onClick:()=>o(l.id),children:"Revoke"})})]},l.id))})]})]}),i.jsxs(it,{children:[i.jsx(ze,{children:"Password"}),i.jsx(Pe,{onClick:()=>e("/changepassword"),children:"Change password"})]}),i.jsxs(it,{children:[i.jsx(ze,{children:"Multi Factor Auth"}),i.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&i.jsx(Pe,{onClick:()=>e("/mfa"),children:"Enroll"})]})]}):null}function cQ(){const{id:e,secret:t}=$t(),n=Te(),[r,o]=g.useState(),[s,l]=g.useState(!1),u=Mu(r,void 0);return i.jsxs(it,{width:450,children:[i.jsx(ao,{issues:u}),i.jsxs(yt,{onSubmit:d=>{if(d.password!==d.confirmPassword){o(Qo("Passwords do not match","confirmPassword"));return}o(void 0);const p={id:e,secret:t,password:d.password};n.post("auth/setpassword",p).then(()=>l(!0)).catch(h=>o(Bt(h)))},children:[i.jsxs(Vn,{style:{flexDirection:"column"},children:[i.jsx(Do,{size:32}),i.jsx(ze,{children:"Set password"})]}),!s&&i.jsxs(tt,{children:[i.jsx(Co,{name:"password",label:"New password",required:!0,error:Ct(r,"password")}),i.jsx(Co,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Ct(r,"confirmPassword")}),i.jsx(be,{justify:"flex-end",mt:"xl",children:i.jsx(Pe,{type:"submit",children:"Set password"})})]}),s&&i.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",i.jsx(xt,{to:"/signin",children:"sign in"}),"."]})]})]})}function uQ(){const e=zp(),t=En(),[n]=e0(),r=Bu(),o=g.useCallback(()=>{const s=n.get("next");t(s!=null&&s.startsWith("/")?s:"/")},[n,t]);return g.useEffect(()=>{e&&n.has("next")&&o()},[e,n,o]),i.jsxs(lP,{onSuccess:()=>o(),onForgotPassword:()=>t("/resetpassword"),onRegister:MR()?()=>t("/register"):void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[i.jsx(Do,{size:32}),i.jsx(ze,{children:"Sign in to Medplum"}),n.get("project")==="new"&&i.jsx("div",{children:"Sign in again to create a new project"})]})}function dQ(){const e=En(),t=Li(),[n,r]=g.useState(),[o,s]=g.useState(),[l,u]=g.useState();return g.useEffect(()=>{const d=Object.fromEntries(new URLSearchParams(t.search).entries());r(d.resourceType),s(d.query),u(JSON.parse(d.fields))},[t]),!n||!o||!l?null:i.jsx(uV,{resourceType:n,checkboxesEnabled:!0,query:o,fields:l,onClick:d=>e(`/${n}/${d.resource.id}`),onAuxClick:d=>window.open(`/${n}/${d.resource.id}`,"_blank"),onBulk:d=>{e(`/bulk/${n}?ids=${d.join(",")}`)}})}function Jp(e){const t=Te(),n=ks(t),r=En(),[o,s]=g.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:Ce.EQUALS,value:"Project/"+n},{code:"profile-type",operator:Ce.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return i.jsx($u,{search:o,onClick:l=>r(`/admin/members/${l.resource.id}`),onChange:l=>s(l.definition),hideFilters:!0,hideToolbar:!0})}function fQ(){return i.jsxs(i.Fragment,{children:[i.jsx(ze,{children:"Bots"}),i.jsx(Jp,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),i.jsx(be,{justify:"flex-end",children:i.jsx(xt,{to:"/admin/bots/new",children:"Create new bot"})})]})}function pQ(){return i.jsxs(i.Fragment,{children:[i.jsx(ze,{children:"Clients"}),i.jsx(Jp,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),i.jsx(be,{justify:"flex-end",children:i.jsx(xt,{to:"/admin/clients/new",children:"Create new client"})})]})}function Zp(e){return i.jsx(ka,{resourceType:"AccessPolicy",name:"accessPolicy",defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{Mi(t)?e.onChange(Jt(t)):e.onChange(void 0)}})}function hQ(){const e=Te(),t=ks(e),[n,r]=g.useState(""),[o,s]=g.useState(""),[l,u]=g.useState(),[d,p]=g.useState(),[h,m]=g.useState(void 0);return i.jsxs(i.Fragment,{children:[i.jsx(ze,{children:"Create new Bot"}),i.jsxs(yt,{onSubmit:()=>{const y={name:n,description:o,accessPolicy:l};e.post("admin/projects/"+t+"/bot",y).then(x=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),m(x),Ie({color:"green",message:"Bot created"})}).catch(x=>{Ie({color:"red",message:Ze(x),autoClose:!1}),p(Bt(x))})},children:[!h&&i.jsxs(tt,{children:[i.jsx(Wt,{title:"Name",htmlFor:"name",outcome:d,children:i.jsx(Fe,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:y=>r(y.currentTarget.value),error:Ct(d,"name")})}),i.jsx(Wt,{title:"Description",htmlFor:"description",outcome:d,children:i.jsx(Fe,{id:"description",name:"description",onChange:y=>s(y.currentTarget.value),error:Ct(d,"description")})}),i.jsx(Wt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:d,children:i.jsx(Zp,{name:"accessPolicy",onChange:u})}),i.jsx(be,{justify:"flex-end",children:i.jsx(Pe,{type:"submit",children:"Create Bot"})})]}),h&&i.jsxs("div",{"data-testid":"success",children:[i.jsx($e,{children:"Bot created"}),i.jsxs(fr,{children:[i.jsx(fr.Item,{children:i.jsx(xt,{to:h,children:"Go to new bot"})}),i.jsx(fr.Item,{children:i.jsx(xt,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function mQ(){const e=Te(),t=ks(e),[n,r]=g.useState(""),[o,s]=g.useState(""),[l,u]=g.useState(""),[d,p]=g.useState(),[h,m]=g.useState(),[y,x]=g.useState(void 0);return i.jsxs(i.Fragment,{children:[i.jsx(ze,{children:"Create new Client"}),i.jsxs(yt,{onSubmit:()=>{const b={name:n,description:o,redirectUri:l,accessPolicy:d};e.post("admin/projects/"+t+"/client",b).then(w=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),x(w),Ie({color:"green",message:"Client created"})}).catch(w=>{Ie({color:"red",message:Ze(w),autoClose:!1}),m(Bt(w))})},children:[!y&&i.jsxs(tt,{children:[i.jsx(Wt,{title:"Name",htmlFor:"name",outcome:h,children:i.jsx(Fe,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:b=>r(b.currentTarget.value),error:Ct(h,"name")})}),i.jsx(Wt,{title:"Description",htmlFor:"description",outcome:h,children:i.jsx(Fe,{id:"description",name:"description",onChange:b=>s(b.currentTarget.value),error:Ct(h,"description")})}),i.jsx(Wt,{title:"Redirect URI",htmlFor:"redirectUri",outcome:h,children:i.jsx(Fe,{id:"redirectUri",name:"redirectUri",onChange:b=>u(b.currentTarget.value),error:Ct(h,"redirectUri")})}),i.jsx(Wt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:h,children:i.jsx(Zp,{name:"accessPolicy",onChange:p})}),i.jsx(be,{justify:"flex-end",children:i.jsx(Pe,{type:"submit",children:"Create Client"})})]}),y&&i.jsxs("div",{"data-testid":"success",children:[i.jsx($e,{children:"Client created"}),i.jsxs(fr,{children:[i.jsx(fr.Item,{children:i.jsx(xt,{to:y,children:"Go to new client"})}),i.jsx(fr.Item,{children:i.jsx(xt,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function gQ(e){return i.jsx(ka,{resourceType:"UserConfiguration",name:"userConfiguration",defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{Mi(t)?e.onChange(Jt(t)):e.onChange(void 0)}})}function vQ(){const{membershipId:e}=$t(),t=Te(),n=ks(t),r=En(),o=t.get(`admin/projects/${n}/members/${e}`).read(),[s,l]=g.useState(o.accessPolicy),[u,d]=g.useState(o.userConfiguration),[p,h]=g.useState(o.admin),[m,y]=g.useState(),[x,b]=g.useState(!1);function w(){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(j=>y(Bt(j)))}return i.jsxs(i.Fragment,{children:[i.jsx(ze,{children:"Edit membership"}),i.jsx("h3",{children:i.jsx(bl,{value:o.profile,link:!0})}),i.jsxs(yt,{onSubmit:()=>{const j={...o,accessPolicy:s,userConfiguration:u,admin:p};t.post(`admin/projects/${n}/members/${e}`,j).then(()=>b(!0)).catch(T=>y(Bt(T)))},children:[!x&&i.jsxs(tt,{children:[i.jsx(Wt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:m,children:i.jsx(Zp,{name:"accessPolicy",defaultValue:s,onChange:l})}),i.jsx(Wt,{title:"User Configuration",htmlFor:"userConfiguration",outcome:m,children:i.jsx(gQ,{name:"userConfiguration",defaultValue:u,onChange:d})}),i.jsx(Wt,{title:"Admin",htmlFor:"admin",outcome:m,children:i.jsx(rr,{id:"admin",name:"admin",defaultChecked:p,onChange:j=>h(j.currentTarget.checked)})}),i.jsxs(be,{justify:"flex-end",mt:"xl",children:[i.jsx(Pe,{type:"submit",children:"Save"}),i.jsx(Pe,{type:"button",color:"red",variant:"outline",onClick:w,children:"Remove user"})]})]}),x&&i.jsxs("div",{"data-testid":"success",children:[i.jsx("p",{children:"User updated"}),i.jsx("pre",{children:JSON.stringify(m,void 0,2)}),i.jsxs("p",{children:["Click ",i.jsx(xt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function yQ(){const e=Te(),[t,n]=g.useState(e.getProject()),[r,o]=g.useState(),[s,l]=g.useState(),[u,d]=g.useState(!1),[p,h]=g.useState(void 0),m=g.useCallback(y=>{const x={resourceType:y.resourceType,firstName:y.firstName,lastName:y.lastName,email:y.email,sendEmail:y.sendEmail==="on",accessPolicy:r,admin:y.isAdmin==="on"};e.invite(t==null?void 0:t.id,x).then(b=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),Ip(b)?l(b):h(b),d(x.sendEmail??!1),Ie({color:"green",message:"Invite success"})}).catch(b=>{Ie({color:"red",message:Ze(b),autoClose:!1}),l(Bt(b))})},[e,t,r]);return i.jsxs(yt,{onSubmit:m,children:[!p&&!s&&i.jsxs(tt,{children:[i.jsx(ze,{children:"Invite new member"}),e.isSuperAdmin()&&i.jsx(Wt,{title:"Project",htmlFor:"project",outcome:s,children:i.jsx(ka,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),i.jsx(Zt,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:Ct(s,"resourceType")}),i.jsx(Fe,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:Ct(s,"firstName")}),i.jsx(Fe,{name:"lastName",label:"Last Name",required:!0,error:Ct(s,"lastName")}),i.jsx(Fe,{name:"email",type:"email",label:"Email",required:!0,error:Ct(s,"email")}),i.jsx(Wt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:s,children:i.jsx(Zp,{name:"accessPolicy",onChange:o})}),i.jsx(rr,{name:"sendEmail",label:"Send email",defaultChecked:!0}),i.jsx(rr,{name:"isAdmin",label:"Admin"}),i.jsx(be,{justify:"flex-end",children:i.jsx(Pe,{type:"submit",children:"Invite"})})]}),s&&i.jsxs("div",{"data-testid":"success",children:[i.jsx("p",{children:"User created, email couldn't be sent"}),i.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),i.jsxs("p",{children:["Click ",i.jsx(xt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),p&&i.jsxs("div",{"data-testid":"success",children:[i.jsx($e,{children:"User created"}),u&&i.jsx($e,{children:"Email sent"}),i.jsxs(fr,{children:[i.jsx(fr.Item,{children:i.jsx(xt,{to:p,children:"Go to new membership"})}),i.jsx(fr.Item,{children:i.jsx(xt,{to:p.profile,children:"Go to new profile"})}),i.jsx(fr.Item,{children:i.jsx(xt,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function xQ(){return i.jsxs(i.Fragment,{children:[i.jsx(ze,{children:"Patients"}),i.jsx(Jp,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),i.jsx(be,{justify:"flex-end",children:i.jsx(xt,{to:"/admin/invite",children:"Invite new patient"})})]})}function bQ(){const e=Te();if(!e.isLoading()&&!e.isProjectAdmin())return i.jsx(ao,{outcome:Qk});function t(n){e.post("admin/projects/setpassword",n).then(()=>Ie({color:"green",message:"Done"})).catch(r=>Ie({color:"red",message:Ze(r),autoClose:!1}))}return i.jsxs(it,{width:600,children:[i.jsx(ze,{order:1,children:"Project Admin"}),i.jsx(Dn,{my:"lg"}),i.jsx(ze,{order:2,children:"Force Set Password"}),i.jsx($e,{children:"Sets the password for the specified user in this project."}),i.jsx($e,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),i.jsx(yt,{onSubmit:t,children:i.jsxs(tt,{children:[i.jsx(Fe,{name:"email",label:"Email",required:!0}),i.jsx(Co,{name:"password",label:"Password",required:!0}),i.jsx(Pe,{type:"submit",children:"Force Set Password"})]})})]})}function Oj(){const e=Te(),t=ks(e),n=e.get(`admin/projects/${t}`).read();return i.jsxs(i.Fragment,{children:[i.jsx(ze,{children:"Details"}),i.jsxs(Ax,{children:[i.jsx(xi,{term:"ID",children:n.project.id}),i.jsx(xi,{term:"Name",children:n.project.name})]})]})}const Lj=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function wQ(){const e=En(),n=Li().pathname.replace("/admin/","")||Lj[0],r=Te(),o=ks(r),s=g.useMemo(()=>r.get("admin/projects/"+o).read(),[r,o]);function l(u){e(`/admin/${u}`)}return i.jsxs(i.Fragment,{children:[i.jsxs(kr,{children:[i.jsx(ft,{children:i.jsxs(ft.Entry,{children:[i.jsx(ft.Key,{children:"Project"}),i.jsx(ft.Value,{children:s.project.name})]})}),i.jsx(oo,{children:i.jsx(Dt,{value:n.toLowerCase(),onChange:l,children:i.jsx(Dt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:Lj.map(u=>i.jsx(Dt.Tab,{value:u.toLowerCase(),children:u},u))})})})]}),i.jsx(it,{children:i.jsx(Zx,{})})]})}function SQ(){const e=Te(),t=ks(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=g.useState(!1),[s,l]=g.useState();return g.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),g.useEffect(()=>{n&&l(Br(n.project.secret||[]))},[e,n]),!r||!s?i.jsx("div",{children:"Loading..."}):i.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:u=>{u.preventDefault(),e.post(`admin/projects/${t}/secrets`,s).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>Ie({color:"green",message:"Saved"})).catch(console.log)},children:[i.jsx(ze,{children:"Project Secrets"}),i.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),i.jsx(Jl,{property:Ca("Project","secret"),name:"secret",path:"Project.secret",defaultValue:s,onChange:l,outcome:void 0}),i.jsx(Pe,{type:"submit",children:"Save"})]})}function jQ(){const e=Te(),t=ks(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=g.useState(!1),[s,l]=g.useState();return g.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),g.useEffect(()=>{n&&l(Br(n.project.site||[]))},[e,n]),!r||!s?i.jsx("div",{children:"Loading..."}):i.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:u=>{u.preventDefault(),e.post(`admin/projects/${t}/sites`,s).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>Ie({color:"green",message:"Saved"})).catch(d=>{var h,m,y,x;const p=Bt(d);Ie({color:"red",message:`Error ${(m=(h=p.issue)==null?void 0:h[0].details)==null?void 0:m.text} ${(x=(y=p.issue)==null?void 0:y[0].expression)==null?void 0:x[0]}`,autoClose:!1})})},children:[i.jsx(ze,{children:"Project Sites"}),i.jsx("p",{children:"Use project sites configure your project on a separate domain."}),i.jsx(Jl,{property:Ca("Project","site"),name:"site",path:"Project.site",defaultValue:s,onChange:l,outcome:void 0}),i.jsx(Pe,{type:"submit",children:"Save"})]})}function CQ(){const e=Te(),[t,{open:n,close:r}]=Yf(!1),[o,s]=g.useState(""),[l,u]=g.useState();if(!e.isLoading()&&!e.isSuperAdmin())return i.jsx(ao,{outcome:Qk});function d(){cf(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function p(){cf(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function h(){cf(e,"Rebuilding Value Sets","admin/super/valuesets")}function m(T){cf(e,"Reindexing Resources","admin/super/reindex",T)}function y(T){e.post("admin/super/removebotidjobsfromqueue",T).then(()=>Ie({color:"green",message:"Done"})).catch(P=>Ie({color:"red",message:Ze(P),autoClose:!1}))}function x(T){e.post("admin/super/purge",{...T,before:xP(T.before)}).then(()=>Ie({color:"green",message:"Done"})).catch(P=>Ie({color:"red",message:Ze(P),autoClose:!1}))}function b(T){e.post("admin/super/setpassword",T).then(()=>Ie({color:"green",message:"Done"})).catch(P=>Ie({color:"red",message:Ze(P),autoClose:!1}))}function w(T){e.post("fhir/R4/$db-stats",T.tableNames?{resourceType:"Parameters",parameter:[{name:"tableNames",valueString:T.tableNames}]}:void 0).then(P=>{var k,E;s("Database Stats"),u(i.jsx("pre",{children:(E=(k=P.parameter)==null?void 0:k.find(_=>_.name==="tableString"))==null?void 0:E.valueString})),n()}).catch(P=>Ie({color:"red",message:Ze(P),autoClose:!1}))}function j(){e.post("fhir/R4/$db-schema-diff").then(T=>{var P,k;s("Schema Diff"),u(i.jsx("pre",{children:(k=(P=T.parameter)==null?void 0:P.find(E=>E.name==="migrationString"))==null?void 0:k.valueString})),n()}).catch(T=>Ie({color:"red",message:Ze(T),autoClose:!1}))}return i.jsxs(it,{width:600,children:[i.jsx(ze,{order:1,children:"Super Admin"}),i.jsx(Dn,{my:"lg"}),i.jsx(ze,{order:2,children:"Structure Definitions"}),i.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."}),i.jsx(yt,{children:i.jsx(Pe,{onClick:d,children:"Rebuild StructureDefinitions"})}),i.jsx(Dn,{my:"lg"}),i.jsx(ze,{order:2,children:"Search Parameters"}),i.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."}),i.jsx(yt,{children:i.jsx(Pe,{onClick:p,children:"Rebuild SearchParameters"})}),i.jsx(Dn,{my:"lg"}),i.jsx(ze,{order:2,children:"Value Sets"}),i.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."}),i.jsx(yt,{children:i.jsx(Pe,{onClick:h,children:"Rebuild ValueSets"})}),i.jsx(Dn,{my:"lg"}),i.jsx(ze,{order:2,children:"Reindex Resources"}),i.jsx("p",{children:"When Medplum changes how resources are indexed, the system may require a reindex for old resources to be indexed properly."}),i.jsx(yt,{onSubmit:m,children:i.jsxs(tt,{children:[i.jsx(Wt,{title:"Resource Type",htmlFor:"resourceType",children:i.jsx(Fe,{id:"resourceType",name:"resourceType",placeholder:"Reindex Resource Type"})}),i.jsx(Wt,{title:"Search Filter",htmlFor:"filter",children:i.jsx(Fe,{id:"filter",name:"filter",placeholder:"e.g. name=Sam&birthdate=lt2000-01-01"})}),i.jsx(Pe,{type:"submit",children:"Reindex"})]})}),i.jsx(Dn,{my:"lg"}),i.jsx(ze,{order:2,children:"Purge Resources"}),i.jsx("p",{children:"As system generated resources accumulate, the system may require a purge to remove old resources."}),i.jsx(yt,{onSubmit:x,children:i.jsxs(tt,{children:[i.jsx(Wt,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:i.jsx(Zt,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),i.jsx(Wt,{title:"Purge Before",htmlFor:"before",children:i.jsx(ua,{name:"before",placeholder:"Before Date"})}),i.jsx(Pe,{type:"submit",children:"Purge"})]})}),i.jsx(Dn,{my:"lg"}),i.jsx(ze,{order:2,children:"Remove Bot ID Jobs from Queue"}),i.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),i.jsx(yt,{onSubmit:y,children:i.jsxs(tt,{children:[i.jsx(Wt,{title:"Bot ID",children:i.jsx(Fe,{name:"botId",placeholder:"Bot Id"})}),i.jsx(Pe,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),i.jsx(Dn,{my:"lg"}),i.jsx(ze,{order:2,children:"Force Set Password"}),i.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.'}),i.jsx(yt,{onSubmit:b,children:i.jsxs(tt,{children:[i.jsx(Fe,{name:"email",label:"Email",required:!0}),i.jsx(Co,{name:"password",label:"Password",required:!0}),i.jsx(Fe,{name:"projectId",label:"Project ID"}),i.jsx(Pe,{type:"submit",children:"Force Set Password"})]})}),i.jsx(Dn,{my:"lg"}),i.jsx(ze,{order:2,children:"Database Stats"}),i.jsx("p",{children:"Query current table statistics from the database."}),i.jsx(yt,{onSubmit:w,children:i.jsxs(tt,{children:[i.jsx(Wt,{title:"Table Names (comma-delimited)",htmlFor:"tableNames",children:i.jsx(Fe,{id:"tableNames",name:"tableNames",placeholder:"Observation,Observation_History"})}),i.jsx(Pe,{type:"submit",children:"Get Database Stats"})]})}),i.jsx(Dn,{my:"lg"}),i.jsx(ze,{order:2,children:"Database Schema Drift"}),i.jsx("p",{children:"Show the schema migration needed to match the expected database schema."}),i.jsx(yt,{onSubmit:j,children:i.jsx(tt,{children:i.jsx(Pe,{type:"submit",children:"Get Database Schema Drift"})})}),i.jsx(Nn,{opened:t,onClose:r,title:o,centered:!0,size:"auto",children:l})]})}function cf(e,t,n,r){Go.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(()=>{Go.update({id:n,color:"green",title:t,message:"Done",icon:i.jsx(Ss,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}).catch(s=>{Go.update({id:n,color:"red",title:t,message:Ze(s),icon:i.jsx(Il,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})})}function EQ(){return i.jsxs(i.Fragment,{children:[i.jsx(ze,{children:"Users"}),i.jsx(Jp,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),i.jsx(be,{justify:"flex-end",children:i.jsx(xt,{to:"/admin/invite",children:"Invite new user"})})]})}function kQ(){const[e]=Dl("ObservationDefinition","_count=100");return e?i.jsxs(Le,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Category"}),i.jsx("th",{children:"Code"}),i.jsx("th",{children:"Method"}),i.jsx("th",{children:"Unit"}),i.jsx("th",{children:"Precision"}),i.jsx("th",{children:"Ranges"})]})}),i.jsx("tbody",{children:e.map(t=>{var n,r,o,s;return i.jsxs("tr",{children:[i.jsx("td",{children:i.jsx(Ko,{value:(n=t.category)==null?void 0:n[0]})}),i.jsx("td",{children:i.jsx(Ko,{value:t.code})}),i.jsx("td",{children:i.jsx(Ko,{value:t.method})}),i.jsx("td",{children:(o=(r=t.quantitativeDetails)==null?void 0:r.unit)==null?void 0:o.text}),i.jsx("td",{children:(s=t.quantitativeDetails)==null?void 0:s.decimalPrecision}),i.jsx("td",{children:i.jsx(vv,{ranges:t.qualifiedInterval})})]},t.id)})})]}):i.jsx(Ur,{})}function vv(e){const{ranges:t}=e;if(!t)return null;const n=$j(t.map(o=>o.gender));if(n.length>1)return ou(n),i.jsx(i.Fragment,{children:n.map(o=>{var s;return i.jsxs(g.Fragment,{children:[i.jsx("div",{children:i.jsx("strong",{children:Ln(o)})}),i.jsx(vv,{ranges:(s=e.ranges)==null?void 0:s.filter(l=>l.gender===o)})]},o)})});const r=$j(t.map(o=>o.age&&su(o.age)));return r.length>1?(ou(r),i.jsx(i.Fragment,{children:r.map(o=>{var s;return i.jsxs(g.Fragment,{children:[i.jsx("div",{children:i.jsx("strong",{children:Ln(o)})}),i.jsx(vv,{ranges:(s=e.ranges)==null?void 0:s.filter(l=>su(l.age)===o)})]},o)})})):i.jsx(i.Fragment,{children:t.map(o=>i.jsx("table",{children:i.jsx("tbody",{children:i.jsxs("tr",{children:[i.jsx("td",{children:o.condition}),i.jsx("td",{children:i.jsx(Ox,{value:o.range})})]})})},`range-${o.condition}`))})}function $j(e){return[...new Set(e.filter(t=>!!t))]}function TQ(){const[e]=Dl("ActivityDefinition","_count=100"),[t]=Dl("ObservationDefinition","_count=100");return!e||!t?i.jsx(Ur,{}):i.jsxs(Le,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Category"}),i.jsx("th",{children:"Assay"}),e.map(n=>i.jsx("th",{children:n.name},n.id))]})}),i.jsx("tbody",{children:t.map(n=>{var r;return i.jsxs("tr",{children:[i.jsx("td",{children:i.jsx(Ko,{value:(r=n.category)==null?void 0:r[0]})}),i.jsx("td",{children:i.jsx(Ko,{value:n.code})}),e.map(o=>{var s;return i.jsx("td",{children:(s=o.observationResultRequirement)!=null&&s.find(l=>{var u;return(u=l.reference)==null?void 0:u.includes(n.id)})?"✅":""},o.id)})]},n.id)})})]})}function PQ(e){var l;const t=Te(),[n,r]=g.useState(),[o,s]=g.useState();return o?i.jsxs(i.Fragment,{children:[i.jsx("p",{children:"Request group created successfully."}),i.jsxs("ul",{children:[i.jsxs("li",{children:["Go to the"," ",i.jsx(xt,{to:o,suffix:"checklist",children:"Request Group"})]}),i.jsxs("li",{children:["Back to the ",i.jsx(xt,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):i.jsx(yt,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueString:n==null?void 0:n.reference}]}).then(s).catch(console.log)},children:i.jsxs(tt,{children:[i.jsxs(ze,{children:['Start "',e.planDefinition.title,'"']}),i.jsxs($e,{children:["Use the ",i.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),i.jsx($e,{children:"The following tasks will be created:"}),i.jsx("ul",{children:(l=e.planDefinition.action)==null?void 0:l.map((u,d)=>{var p;return i.jsxs("li",{children:[((p=u.definitionCanonical)==null?void 0:p.startsWith("Questionnaire/"))&&"Questionnaire request: ",u.title&&i.jsx(i.Fragment,{children:u.title}),u.code&&i.jsx(Ko,{value:u.code[0]})]},`action-${d}`)})}),i.jsx(Wt,{title:"Subject",children:i.jsx(Up,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),i.jsx(be,{justify:"flex-end",mt:"xl",children:i.jsx(Pe,{type:"submit",children:"Go"})})]})})}function RQ(){const{resourceType:e,id:t}=$t(),n=Kt({reference:e+"/"+t});return n?i.jsx(it,{children:i.jsx(PQ,{planDefinition:n})}):null}function _Q(){const{resourceType:e,id:t}=$t(),n=Kt({reference:e+"/"+t}),[r,o]=Dl("Questionnaire","subject-type="+e),[s,l]=Dl("ClientApplication",{_count:1e3});if(!n||o||l)return i.jsx(Ur,{});const u=s==null?void 0:s.filter(h=>DQ(e)&&!!h.launchUri);if((!r||r.length===0)&&(!u||u.length===0))return i.jsxs(it,{children:[i.jsx(ze,{children:"Apps"}),i.jsxs("p",{children:["No apps found. Contact your administrator or ",i.jsx("a",{href:"mailto:support@medplum.com",children:"Medplum Support"})," to add automation here."]})]});let d,p;return n.resourceType==="Patient"?d=Jt(n):n.resourceType==="Encounter"&&(d=n.subject,p=Jt(n)),i.jsxs(it,{children:[r==null?void 0:r.map(h=>i.jsxs("div",{children:[i.jsx(ze,{order:3,children:i.jsx(xt,{to:`/forms/${h.id}?subject=${Ot(n)}`,children:h.title||h.name})}),i.jsx($e,{children:h.description})]},h.id)),u==null?void 0:u.map(h=>i.jsxs("div",{children:[i.jsx(ze,{order:3,children:i.jsx(aH,{client:h,patient:d,encounter:p,children:h.name})}),i.jsx($e,{children:h.description})]},h.id))]})}function DQ(e){return e==="Patient"||e==="Encounter"}function IQ(){const{resourceType:e,id:t}=$t(),n=En(),[r,o]=g.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:Ce.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return i.jsx(it,{children:i.jsx($u,{search:r,onClick:s=>n(`/${s.resource.resourceType}/${s.resource.id}`),onChange:s=>o(s.definition),hideFilters:!0})})}function NQ(){const e=Te(),{resourceType:t,id:n}=$t(),r=e.readHistory(t,n).read();return i.jsx(it,{children:i.jsx(YW,{history:r})})}const AQ="_hl7Input_k5xm3_1",MQ={hl7Input:AQ};function OQ(e){return i.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 LQ(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),i.jsx("iframe",{frameBorder:"0",src:n.toString(),style:{width:"100%",height:"100%",minHeight:e.minHeight},ref:e.iframeRef,"data-testid":e.testId,onLoad:r=>{Gc(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const $Q=`{
|
|
577
|
-
"resourceType": "Patient",
|
|
578
|
-
"name": [
|
|
579
|
-
{
|
|
580
|
-
"given": [
|
|
581
|
-
"Alice"
|
|
582
|
-
],
|
|
583
|
-
"family": "Smith"
|
|
584
|
-
}
|
|
585
|
-
]
|
|
586
|
-
}`,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 zQ(){const e=Te(),{id:t}=$t(),[n,r]=g.useState(),[o,s]=g.useState(),[l,u]=g.useState($Q),[d,p]=g.useState(FQ),[h,m]=g.useState(On.FHIR_JSON),y=g.useRef(null),x=g.useRef(null),[b,w]=g.useState(!1);g.useEffect(()=>{e.readResource("Bot",t).then(async R=>{r(R),s(await BQ(e,R))}).catch(R=>Ie({color:"red",message:Ze(R),autoClose:!1}))},[e,t]);const j=g.useCallback(async()=>Gc(y.current,{command:"getValue"}),[]),T=g.useCallback(async()=>Gc(y.current,{command:"getOutput"}),[]),P=g.useCallback(async()=>h===On.FHIR_JSON?JSON.parse(l):d,[h,l,d]),k=g.useCallback(async R=>{R.preventDefault(),R.stopPropagation(),w(!0);try{const M=await j(),N=await T(),L=await e.createAttachment(M,"index.ts","text/typescript"),z=await e.createAttachment(N,"index.js","text/typescript"),q=[{op:"add",path:"/sourceCode",value:L},{op:"add",path:"/executableCode",value:z}];await e.patchResource("Bot",t,q),Ie({color:"green",message:"Saved"})}catch(M){Ie({color:"red",message:Ze(M),autoClose:!1})}finally{w(!1)}},[e,t,j,T]),E=g.useCallback(async R=>{R.preventDefault(),R.stopPropagation(),w(!0);try{await e.post(e.fhirUrl("Bot",t,"$deploy")),Ie({color:"green",message:"Deployed"})}catch(M){Ie({color:"red",message:Ze(M),autoClose:!1})}finally{w(!1)}},[e,t]),_=g.useCallback(async R=>{R.preventDefault(),R.stopPropagation(),w(!0);try{const M=await P(),N=await e.post(e.fhirUrl("Bot",t,"$execute"),M,h);await Gc(x.current,{command:"setValue",value:N}),Ie({color:"green",message:"Success"})}catch(M){Ie({color:"red",message:Ze(M),autoClose:!1})}finally{w(!1)}},[e,t,P,h]);return!n||o===void 0?null:i.jsxs(Fr,{m:0,gutter:0,style:{overflow:"hidden"},children:[i.jsx(Fr.Col,{span:8,children:i.jsxs(kr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[i.jsx(LQ,{iframeRef:y,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:o,minHeight:"528px"}),i.jsxs(be,{justify:"flex-end",gap:"xs",children:[i.jsx(Pe,{type:"button",onClick:k,loading:b,leftSection:i.jsx(VF,{size:"1rem"}),children:"Save"}),i.jsx(Pe,{type:"button",onClick:E,loading:b,leftSection:i.jsx(Ex,{size:"1rem"}),children:"Deploy"}),i.jsx(Pe,{type:"button",onClick:_,loading:b,leftSection:i.jsx(r8,{size:"1rem"}),children:"Execute"})]})]})}),i.jsxs(Fr.Col,{span:4,children:[i.jsxs(kr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[i.jsx(Zt,{data:[{label:"FHIR",value:On.FHIR_JSON},{label:"HL7",value:On.HL7_V2}],onChange:R=>m(R.currentTarget.value)}),h===On.FHIR_JSON?i.jsx(Vl,{value:l,onChange:R=>u(R),autosize:!0,minRows:15}):i.jsx("textarea",{className:MQ.hl7Input,value:d,onChange:R=>p(R.currentTarget.value),rows:15})]}),i.jsx(kr,{m:2,p:"xs",shadow:"md",children:i.jsx(OQ,{iframeRef:x,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function BQ(e,t){var n,r,o;if((n=t.sourceCode)!=null&&n.url){const s=(o=(r=t.sourceCode.url)==null?void 0:r.split("/"))==null?void 0:o.find(cT);return(await e.download(e.fhirUrl("Binary",s))).text()}return t.code??""}function Pa(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function UQ(){const e=Te(),{resourceType:t,id:n}=$t(),r={reference:t+"/"+n},o=g.useCallback(s=>{e.updateResource(Pa(s)).then(()=>{Ie({color:"green",message:"Success"})}).catch(l=>{Ie({color:"red",message:Ze(l),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return i.jsx(it,{children:i.jsx(SV,{value:r,onSubmit:o})});case"Questionnaire":return i.jsx(it,{children:i.jsx(lW,{questionnaire:r,onSubmit:o})});default:return null}}function VQ(){const{resourceType:e,id:t}=$t(),n=Kt({reference:e+"/"+t}),r=En();return n?i.jsx(it,{children:i.jsx(IW,{value:n,onStart:(o,s)=>r(`/forms/${Rl(s)}`),onEdit:(o,s,l)=>r(`/${l.reference}}`)})}):null}function WQ(){const e=Te(),{resourceType:t,id:n}=$t(),r=En();return i.jsxs(it,{children:[i.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),i.jsx(Pe,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>r(`/${t}`)).catch(o=>Ie({color:"red",message:Ze(o),autoClose:!1}))},children:"Delete"})]})}const HQ="_selectProfileBtn_tbaz6_1",qQ="_chevron_tbaz6_13",Fj={selectProfileBtn:HQ,chevron:qQ};function GQ(){var d,p;const{resourceType:e,id:t}=$t(),n=Kt({reference:e+"/"+t}),[r,o]=g.useState(),s=yu({onDropdownClose:()=>s.resetSelectedOption()}),l=g.useMemo(()=>{var h;if(vn((h=n==null?void 0:n.meta)==null?void 0:h.profile))return[i.jsx(st.Option,{value:"",children:"None"},""),...n.meta.profile.map(m=>i.jsx(st.Option,{value:m,children:m},m))]},[(d=n==null?void 0:n.meta)==null?void 0:d.profile]);if(g.useEffect(()=>{var h,m;((m=(h=n==null?void 0:n.meta)==null?void 0:h.profile)==null?void 0:m.length)===1&&o(n.meta.profile[0])},[(p=n==null?void 0:n.meta)==null?void 0:p.profile]),!n)return null;let u;return vn(l)&&(u=i.jsx(be,{justify:"flex-end",children:i.jsxs(tt,{align:"flex-end",gap:"xs",children:[i.jsxs(st,{store:s,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:h=>{o(h),s.closeDropdown()},children:[i.jsx(st.Target,{children:i.jsx(Gn,{onClick:()=>s.toggleDropdown(),children:i.jsxs(wy,{fw:"bold",fs:"sm",className:Fj.selectProfileBtn,children:[i.jsx("span",{children:"Pick profile"}),i.jsx(Cx,{stroke:1.5,className:Fj.chevron})]})})}),i.jsx(st.Dropdown,{w:"max-content",children:i.jsx(st.Options,{children:l})})]}),i.jsx(se,{children:r?i.jsxs(i.Fragment,{children:[i.jsx($e,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),i.jsx($e,{span:!0,size:"sm",children:r||"Nothing selected"})]}):i.jsx($e,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),i.jsx(it,{children:i.jsxs(tt,{gap:"xl",children:[u,i.jsx(Vx,{value:n,profileUrl:r})]})})}function QQ(){const e=Te(),{resourceType:t,id:n}=$t(),[r,o]=g.useState(),[s,l]=g.useState(),u=En(),[d,p]=g.useState();g.useEffect(()=>{e.readResource(t,n).then(x=>{o(Br(x)),l(Br(x))}).catch(x=>{p(Bt(x)),Ie({color:"red",message:Ze(x),autoClose:!1})})},[e,t,n]);const h=g.useCallback(x=>{p(void 0),e.updateResource(Pa(x)).then(()=>{u(`/${t}/${n}/details`),Ie({id:"succes",color:"green",message:"Success"})}).catch(b=>{p(Bt(b)),Ie({color:"red",message:Ze(b),autoClose:!1})})},[e,t,n,u]),m=g.useCallback(x=>{p(void 0);const b=PP.createPatch(r,x);e.patchResource(t,n,b).then(()=>{u(`/${t}/${n}/details`),Ie({id:"succes",color:"green",message:"Success"})}).catch(w=>{p(Bt(w)),Ie({color:"red",message:Ze(w),autoClose:!1})})},[e,t,n,r,u]),y=g.useCallback(()=>u(`/${t}/${n}/delete`),[u,t,n]);return s?i.jsx(it,{children:i.jsx($f,{defaultValue:s,onSubmit:h,onPatch:m,onDelete:y,outcome:d})}):null}function LR({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,o=Te(),[s,l]=g.useState();return g.useEffect(()=>{o.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(u=>{l(u.filter(Uz))}).catch(console.error)},[o,n,r]),i.jsx(Dt,{value:t==null?void 0:t.url,onChange:u=>{const d=s==null?void 0:s.find(p=>p.url===u);d&&n(d)},children:i.jsx(Dt.List,{children:s==null?void 0:s.map(u=>{var h,m;const d=(m=(h=e.meta)==null?void 0:h.profile)==null?void 0:m.includes(u.url),p=d?"This profile is present in this resource's meta.profile property.":"This profile is not included in this resource's meta.profile property.";return i.jsx(Dt.Tab,{value:u.url,title:p,rightSection:d&&i.jsx(rx,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:i.jsx(v8,{size:"90%"})}),children:u.title||u.name},u.url)})})})}function $R(e,t){const n=Te(),r=En();return{defaultValue:{resourceType:e},handleSubmit:l=>{t&&t(void 0),n.createResource(l).then(u=>r("/"+u.resourceType+"/"+u.id)).catch(u=>{t&&t(Bt(u)),Ie({color:"red",message:Ze(u),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function Eg(){const{resourceType:e}=$t(),t=Li(),[n,r]=g.useState(),{defaultValue:o,handleSubmit:s}=$R(e,r),[l,u]=g.useState(),d=t.pathname.toLowerCase().endsWith("profiles"),p=g.useCallback(h=>{const m=Pa(h);l&&mT(m,l.url),s(m)},[l,s]);return d?i.jsx(it,{children:i.jsxs(tt,{children:[i.jsx(LR,{resource:o,currentProfile:l,onChange:u}),l?i.jsx($f,{defaultValue:o,onSubmit:p,outcome:n,profileUrl:l.url},l.url):i.jsx($e,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):i.jsx(it,{children:i.jsx($f,{defaultValue:o,onSubmit:s,outcome:n})})}function KQ(){const e=Te(),{resourceType:t,id:n}=$t(),r=e.readHistory(t,n).read();return i.jsx(it,{children:i.jsx(rH,{history:r})})}function YQ(){const{resourceType:e}=$t(),[t,n]=g.useState(),{defaultValue:r,handleSubmit:o}=$R(e,n),s=g.useCallback(l=>{o(JSON.parse(l["new-resource"]))},[o]);return i.jsxs(it,{children:[t&&i.jsx(ao,{outcome:t}),i.jsxs(yt,{onSubmit:s,children:[i.jsx(Vl,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:To(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),i.jsx(be,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:i.jsx(Pe,{type:"submit",children:"OK"})})]})]})}function XQ(){const e=Te(),{resourceType:t,id:n}=$t(),r=Kt({reference:t+"/"+n}),o=En(),[s,l]=g.useState(),u=g.useCallback(d=>{e.updateResource(Pa(JSON.parse(d.resource))).then(()=>{l(void 0),o(`/${t}/${n}/details`),Ie({color:"green",message:"Success"})}).catch(p=>{Ie({color:"red",message:Ze(p),autoClose:!1})})},[e,t,n,o]);return r?i.jsxs(it,{children:[s&&i.jsx(ao,{outcome:s}),i.jsxs(yt,{onSubmit:u,children:[i.jsx(Vl,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:To(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),i.jsx(be,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:i.jsx(Pe,{type:"submit",children:"OK"})})]})]}):null}function JQ(){const{resourceType:e,id:t}=$t();return Kt({reference:e+"/"+t})?i.jsxs(it,{children:[i.jsxs(xs,{icon:i.jsx(Xl,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",i.jsx("br",{}),i.jsx(Rt,{href:`/forms/${t}`,children:`/forms/${t}`})]}),i.jsx(nR,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function ZQ(){const e=Te(),{resourceType:t,id:n}=$t(),[r,o]=g.useState(),[s,l]=g.useState();return g.useEffect(()=>{e.readResource(t,n).then(u=>o(Br(u))).catch(u=>{Ie({color:"red",message:Ze(u)})})},[e,t,n]),r?i.jsxs(it,{children:[i.jsxs(ze,{order:2,children:["Available ",t," profiles"]}),i.jsx(tt,{children:i.jsxs(i.Fragment,{children:[i.jsx(LR,{resource:r,currentProfile:s,onChange:l}),s?i.jsx(eK,{profile:s,resource:r,onResourceUpdated:u=>o(u)},s.url):i.jsx($e,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const eK=({profile:e,resource:t,onResourceUpdated:n})=>{const r=Te(),[o,s]=g.useState(),[l,u]=g.useState(()=>{var p,h;return(h=(p=t.meta)==null?void 0:p.profile)==null?void 0:h.includes(e.url)}),d=g.useCallback(p=>{s(void 0);const h=Pa(p);l?mT(h,e.url):X$(h,e.url),r.updateResource(h).then(m=>{n(m),Ie({color:"green",message:"Success"})}).catch(m=>{s(Bt(m)),Ie({color:"red",message:Ze(m),autoClose:!1})})},[r,e.url,n,l]);return i.jsxs(tt,{children:[i.jsx(Eu,{size:"md",checked:l,label:`Conform resource to ${e.title}`,onChange:p=>u(p.currentTarget.checked),"data-testid":"profile-toggle"}),l?i.jsx($f,{profileUrl:e.url,defaultValue:t,onSubmit:d,outcome:o}):i.jsx("form",{noValidate:!0,onSubmit:p=>{p.preventDefault(),d(t)},children:i.jsx(be,{justify:"flex-end",mt:"xl",children:i.jsx(Pe,{type:"submit",children:"OK"})})})]})},FR={"Create Only":"create","Update Only":"update","Delete Only":"delete","All Interactions":void 0},tK=Object.keys(FR);function nK(){const e=Te(),{id:t}=$t(),[n,r]=g.useState(),[o,s]=g.useState("create"),[l,u]=g.useState(0),d=e.searchResources("Subscription","status=active&_count=100").read().filter(h=>rK(h,t));function p(){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:Ot(n)},...o?{extension:[{url:"https://medplum.com/fhir/StructureDefinition/subscription-supported-interaction",valueCode:o}]}:void 0}).then(()=>{r(void 0),u(Date.now()),e.invalidateSearches("Subscription"),Ie({color:"green",message:"Success"})}).catch(h=>Ie({color:"red",message:Ze(h),autoClose:!1}))}return i.jsxs(it,{children:[i.jsx(ze,{children:"Bots"}),i.jsxs(tt,{children:[d.length===0&&i.jsx("p",{children:"No bots found."}),d.map(h=>{var m;return i.jsxs("div",{children:[i.jsx("h3",{children:i.jsx(Zl,{value:{reference:(m=h.channel)==null?void 0:m.endpoint},link:!0})}),i.jsxs("p",{children:["Criteria: ",h.criteria]})]},h.id)})]}),i.jsx(Dn,{}),i.jsxs(tt,{mt:10,children:[i.jsx(hu,{size:"lg",htmlFor:"bot",children:"Connect to bot"}),i.jsxs(be,{children:[i.jsx(ka,{name:"bot",resourceType:"Bot",onChange:h=>r(h)}),i.jsx(Pe,{onClick:p,children:"Connect"})]}),i.jsx(be,{children:i.jsx(Zt,{name:"subscription-trigger-event",defaultValue:"Create Only",label:"Subscription Trigger Event",data:tK,onChange:h=>s(FR[h.target.value])})})]}),i.jsx("div",{style:{display:"none"},children:l})]})}function rK(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 oK(){const{id:e}=$t(),t=En(),[n,r]=g.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:Ce.EQUALS,value:"Questionnaire/"+e}],fields:["id","_lastUpdated"]});return i.jsx(it,{children:i.jsx($u,{search:n,onClick:o=>t(`/${o.resource.resourceType}/${o.resource.id}`),onChange:o=>r(o.definition),hideFilters:!0,hideToolbar:!0})})}function iK(){const e=Te(),{resourceType:t,id:n}=$t(),r=Kt({reference:t+"/"+n}),o=g.useCallback(s=>{e.updateResource(Pa(s)).then(()=>{Ie({color:"green",message:"Success"})}).catch(l=>{Ie({color:"red",message:Ze(l),autoClose:!1})})},[e]);return r?i.jsx(it,{children:i.jsx(CW,{onSubmit:o,definition:r})}):null}function sK(){const{resourceType:e,id:t}=$t(),n=Kt({reference:e+"/"+t});return n?i.jsx(it,{children:e==="MeasureReport"?i.jsx(gV,{measureReport:n}):i.jsx(Ux,{value:n})}):null}const aK="_container_1ue98_1",lK="_entry_1ue98_14",cK="_active_1ue98_21",kg={container:aK,entry:lK,active:cK};function uK(e){const t=Te(),n=Kt(e.value),[r,o]=g.useState();return g.useEffect(()=>{if(!n)return;const s=o0(n);if(!s)return;const l="reference"in s?s.reference:Ot(s);t.search("ServiceRequest","subject="+l).then(u=>{const p=(u.entry??[]).map(h=>h.resource);RP(p),p.reverse(),o(p)}).catch(u=>Ie({color:"red",message:Ze(u),autoClose:!1}))},[t,n]),r?i.jsx("div",{"data-testid":"quick-service-requests",className:kg.container,children:r.map(s=>{var l,u,d,p,h,m,y;return i.jsxs("div",{className:It(kg.entry,{[kg.active]:s.id===(n==null?void 0:n.id)}),children:[i.jsx("p",{children:i.jsx(xt,{to:s,children:dK(s)})}),((u=(l=s.category)==null?void 0:l[0])==null?void 0:u.text)&&i.jsx("p",{children:(d=s.category[0])==null?void 0:d.text}),((m=(h=(p=s.code)==null?void 0:p.coding)==null?void 0:h[0])==null?void 0:m.code)&&i.jsx("p",{children:(y=s.code.coding[0])==null?void 0:y.code}),i.jsx("p",{children:fK(s)})]},s.id)})}):null}function dK(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function fK(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const pK="_container_1l2dh_1",hK={container:pK};function mK(e){var o,s,l,u;const t=Kt(e.valueSet);if(!t)return null;const n=[""],r=(u=(l=(s=(o=t.compose)==null?void 0:o.include)==null?void 0:s[0])==null?void 0:l.concept)==null?void 0:u.map(d=>d.code);return r&&n.push(...r),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),i.jsx("div",{className:hK.container,children:i.jsx(Zt,{defaultValue:e.defaultValue,onChange:d=>e.onChange(d.currentTarget.value),data:n})})}function gK(e){var n,r;const t=Kt(e.specimen);return t?i.jsxs(ft,{children:[i.jsxs(ft.Entry,{children:[i.jsx(ft.Key,{children:"Type"}),i.jsx(ft.Value,{children:"Specimen"})]}),i.jsxs(ft.Entry,{children:[i.jsx(ft.Key,{children:"Collected"}),i.jsx(ft.Value,{children:pr((n=t.collection)==null?void 0:n.collectedDateTime)})]}),i.jsxs(ft.Entry,{children:[i.jsx(ft.Key,{children:"Specimen Age"}),i.jsx(ft.Value,{children:vK(t)})]}),(r=t.collection)!=null&&r.collectedDateTime&&t.receivedTime?i.jsxs(ft.Entry,{children:[i.jsx(ft.Key,{children:"Specimen Stability"}),i.jsx(ft.Value,{children:yK(t)})]}):i.jsx(i.Fragment,{})]}):null}function vK(e){var o;const t=(o=e.collection)==null?void 0:o.collectedDateTime;if(!t)return;const n=new Date(t);return zR(BR(n,new Date))}function yK(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 zR(BR(t,n))}function zR(e){return e.toString().padStart(3,"0")+"D"}function BR(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function xK(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 bK=[];function wK(){var k,E,_,R,M,N,L;const e=Te(),{resourceType:t,id:n}=$t(),r={reference:t+"/"+n},o=En(),[s,l]=g.useState(),u=Kt(r,l),d=xK(t),[p,h]=g.useState(()=>{const z=window.location.pathname.split("/").pop();return z&&d.map(q=>q.toLowerCase()).includes(z)?z:d[0].toLowerCase()}),m=ln();async function y(){var G,Y;const q=(Y=(G=(await e.readHistory(t,n)).entry)==null?void 0:G.find(Q=>!!Q.resource))==null?void 0:Y.resource;q?x(q):Ie({color:"red",message:"No history to restore",autoClose:!1})}function x(z){e.updateResource(Pa(z)).then(()=>{l(void 0),Ie({color:"green",message:"Success"})}).catch(q=>{Ie({color:"red",message:Ze(q),autoClose:!1})})}if(s)return sL(s)?i.jsxs(it,{children:[i.jsx(ze,{children:"Deleted"}),i.jsx("p",{children:"The resource was deleted."}),i.jsx(Pe,{color:"red",onClick:y,children:"Restore"})]}):i.jsx(ao,{outcome:s});function b(z){z||(z=d[0].toLowerCase()),h(z),o(`/${t}/${n}/${z}`)}function w(z){const q=u,G=q.orderDetail||[];G.length===0&&G.push({}),G[0].text!==z&&(G[0].text=z,x({...q,orderDetail:G}))}const j=u&&o0(u),T=u&&HG(u),P=(_=(E=(k=e.getUserConfiguration())==null?void 0:k.option)==null?void 0:E.find(z=>z.id==="statusValueSet"))==null?void 0:_.valueString;return i.jsxs(i.Fragment,{children:[(u==null?void 0:u.resourceType)==="ServiceRequest"&&P&&i.jsx(mK,{valueSet:{reference:P},defaultValue:(M=(R=u.orderDetail)==null?void 0:R[0])==null?void 0:M.text,onChange:w},Ot(u)+"-"+((L=(N=u.orderDetail)==null?void 0:N[0])==null?void 0:L.text)),u&&i.jsx(uK,{value:u}),u&&i.jsxs(kr,{children:[j&&i.jsx(IR,{patient:j}),T&&i.jsx(gK,{specimen:T}),t!=="Patient"&&i.jsx(NR,{resource:r}),i.jsx(oo,{children:i.jsx(Dt,{value:p.toLowerCase(),onChange:b,children:i.jsx(Dt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:d.map(z=>i.jsx(Dt.Tab,{value:z.toLowerCase(),children:bK.includes(z)?i.jsxs(be,{gap:"xs",wrap:"nowrap",children:[z,i.jsx(xu,{color:m.primaryColor,size:"sm",children:"Beta"})]}):z},z))})})})]}),i.jsx(Zx,{})]})}function zj(){var T,P,k,E;const e=En(),{resourceType:t,id:n,versionId:r,tab:o}=$t(),s=Te(),[l,u]=g.useState(!0),[d,p]=g.useState(),[h,m]=g.useState();if(g.useEffect(()=>{m(void 0),u(!0),s.readHistory(t,n).then(_=>p(_)).then(()=>u(!1)).catch(_=>{m(_),u(!1)})},[s,t,n]),l)return i.jsx(Ur,{});if(!d)return i.jsxs(it,{children:[i.jsx(ze,{children:"Resource not found"}),i.jsx(xt,{to:`/${t}`,children:"Return to search page"})]});const y=d.entry??[],x=y.findIndex(_=>{var R,M;return((M=(R=_.resource)==null?void 0:R.meta)==null?void 0:M.versionId)===r});if(x===-1)return i.jsxs(it,{children:[i.jsx(ze,{children:"Version not found"}),i.jsx(xt,{to:`/${t}/${n}`,children:"Return to resource"})]});const b=y[x].resource,w=x<y.length-1?y[x+1].resource:void 0,j="diff";return i.jsxs(Dt,{value:o||j,onChange:_=>e(`/${t}/${n}/_history/${r}/${_||j}`),children:[i.jsxs(kr,{children:[i.jsx(Nu,{fluid:!0,p:"md",children:i.jsx($e,{children:`${t} ${n}`})}),i.jsxs(Dt.List,{children:[i.jsx(Dt.Tab,{value:"diff",children:"Diff"}),i.jsx(Dt.Tab,{value:"raw",children:"Raw"})]})]}),i.jsxs(it,{children:[h&&i.jsx("pre",{"data-testid":"error",children:JSON.stringify(h,void 0,2)}),i.jsx(Dt.Panel,{value:"diff",children:w?i.jsxs(i.Fragment,{children:[i.jsxs("ul",{children:[i.jsxs("li",{children:["Current: ",(T=b.meta)==null?void 0:T.versionId]}),i.jsxs("li",{children:["Previous:"," ",i.jsx(xt,{to:`/${t}/${n}/_history/${(P=w.meta)==null?void 0:P.versionId}`,children:(k=w.meta)==null?void 0:k.versionId})]})]}),i.jsx(ZW,{original:w,revised:b})]}):i.jsxs(i.Fragment,{children:[i.jsxs("ul",{children:[i.jsxs("li",{children:["Current: ",(E=b.meta)==null?void 0:E.versionId]}),i.jsx("li",{children:"Previous: (none)"})]}),i.jsx("pre",{children:JSON.stringify(b,void 0,2)})]})}),i.jsx(Dt.Panel,{value:"raw",children:i.jsx("pre",{children:JSON.stringify(b,void 0,2)})})]})]})}function SK(){const{resourceType:e,id:t}=$t(),n=En(),[r,o]=g.useState({resourceType:"Subscription",filters:[{code:"url",operator:Ce.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return i.jsx(it,{children:i.jsx(oV,{search:r,onClick:s=>n(`/${s.resource.resourceType}/${s.resource.id}`),onChange:s=>o(s.definition),hideFilters:!0})})}function jK(e){const t=Te(),{resource:n,opened:r,onClose:o}=e,[s,l]=g.useState(!1),[u,d]=g.useState(),[p,h]=g.useState(!1),m=g.useCallback(async()=>{if(n!=null&&n.id)try{await t.post(t.fhirUrl(n.resourceType,n.id,"$resend"),{subscription:s&&u?Ot(u):void 0,verbose:p}),Ie({color:"green",message:"Done"}),o()}catch(y){Ie({color:"red",message:Ze(y),autoClose:!1})}},[t,n,o,s,u,p]);return i.jsx(Nn,{opened:r,onClose:o,title:"Resend Subscriptions",children:i.jsx(yt,{onSubmit:m,children:i.jsxs(tt,{children:[i.jsx(rr,{label:"Choose subscription (all subscriptions by default)",onChange:y=>l(y.currentTarget.checked)}),s&&i.jsx(ka,{name:"subscription",resourceType:"Subscription",placeholder:"Subscription",onChange:d}),i.jsx(rr,{label:"Verbose mode",onChange:y=>h(y.currentTarget.checked)}),i.jsx(be,{justify:"flex-end",children:i.jsx(Pe,{type:"submit",children:"Resend"})})]})})})}function Bj(){const e=Te(),t=Fp(),{resourceType:n,id:r}=$t(),o={reference:n+"/"+r},[s,l]=g.useState(),u=Yf(!1);function d(P,k){return e.updateResource({...P,priority:k})}function p(P,k){d(P,"stat").then(k).catch(console.error)}function h(P,k){d(P,"routine").then(k).catch(console.error)}function m(P){t(`/${P.resourceType}/${P.id}`)}function y(P){t(`/${P.resourceType}/${P.id}/edit`)}function x(P){t(`/${P.resourceType}/${P.id}/delete`)}function b(P){l(P),u[1].open()}function w(P){var k;t(`/${P.resourceType}/${P.id}/_history/${(k=P.meta)==null?void 0:k.versionId}`)}function j(P,k){const E="aws-textract";Ie({id:E,title:"AWS Textract in Progress",message:"Extracting text... This may take a moment...",loading:!0,autoClose:!1}),e.post(e.fhirUrl(P.resourceType,P.id,"$aws-textract"),{}).then(()=>{k(),Zs({id:E,title:"AWS Textract Successful",message:"Text successfully extracted.",color:"green",icon:i.jsx(Ss,{size:"1rem"}),loading:!1,withCloseButton:!0})}).catch(_=>Zs({id:E,title:"AWS Textract Error",color:"red",message:Ze(_),icon:i.jsx(Il,{size:"1rem"}),loading:!1,withCloseButton:!0}))}function T(P){var V;const{primaryResource:k,currentResource:E,reloadTimeline:_}=P,R=E.resourceType===k.resourceType&&E.id===k.id,M=E.resourceType==="Communication"&&E.priority!=="stat",N=E.resourceType==="Communication"&&E.priority==="stat",L=R,z=!R,q=!R,G=!R,Y=(V=e.getProjectMembership())==null?void 0:V.admin,Q=Y,te=oQ()&&(E.resourceType==="DocumentReference"||E.resourceType==="Media");return i.jsxs(xe.Dropdown,{children:[i.jsx(xe.Label,{children:"Resource"}),M&&i.jsx(xe.Item,{leftSection:i.jsx(t8,{size:14}),onClick:()=>p(E,_),"aria-label":`Pin ${Ot(E)}`,children:"Pin"}),N&&i.jsx(xe.Item,{leftSection:i.jsx(n8,{size:14}),onClick:()=>h(E,_),"aria-label":`Unpin ${Ot(E)}`,children:"Unpin"}),z&&i.jsx(xe.Item,{leftSection:i.jsx(_S,{size:14}),onClick:()=>m(E),"aria-label":`Details ${Ot(E)}`,children:"Details"}),L&&i.jsx(xe.Item,{leftSection:i.jsx(_S,{size:14}),onClick:()=>w(E),"aria-label":`Details ${Ot(E)}`,children:"Details"}),q&&i.jsx(xe.Item,{leftSection:i.jsx(qT,{size:14}),onClick:()=>y(E),"aria-label":`Edit ${Ot(E)}`,children:"Edit"}),Y&&i.jsxs(i.Fragment,{children:[i.jsx(xe.Divider,{}),i.jsx(xe.Label,{children:"Admin"}),Q&&i.jsx(xe.Item,{leftSection:i.jsx(a8,{size:14}),onClick:()=>b(E),"aria-label":`Resend Subscriptions ${Ot(E)}`,children:"Resend Subscriptions"})]}),te&&i.jsxs(i.Fragment,{children:[i.jsx(xe.Divider,{}),i.jsx(xe.Label,{children:"AWS AI"}),i.jsx(xe.Item,{leftSection:i.jsx(m8,{size:14}),onClick:()=>j(E,_),"aria-label":`AWS Textract ${Ot(E)}`,children:"AWS Textract"})]}),G&&i.jsxs(i.Fragment,{children:[i.jsx(xe.Divider,{}),i.jsx(xe.Label,{children:"Danger zone"}),i.jsx(xe.Item,{color:"red",leftSection:i.jsx(Px,{size:14}),onClick:()=>x(E),"aria-label":`Delete ${Ot(E)}`,children:"Delete"})]})]})}return i.jsxs(i.Fragment,{children:[n==="Encounter"&&i.jsx(fU,{encounter:o,getMenu:T}),n==="Patient"&&i.jsx(vV,{patient:o,getMenu:T}),n==="ServiceRequest"&&i.jsx(sH,{serviceRequest:o,getMenu:T}),n!=="Encounter"&&n!=="Patient"&&n!=="ServiceRequest"&&i.jsx(dU,{resource:o,getMenu:T}),i.jsx(jK,{resource:s,opened:u[0],onClose:u[1].close},`resend-subscriptions-${s==null?void 0:s.id}`)]})}function CK(e){const{opened:t,close:n,version:r,loadingStatus:o,handleStatus:s,handleUpgrade:l}=e,[u,d]=g.useState();return g.useEffect(()=>{t&&(u||mF("app-tools-page").then(d).catch(console.error),s())},[t,u,s]),u&&r&&!o?r==="unknown"?i.jsx("p",{children:"Unable to determine the current version of the agent. Check the network connectivity of the agent."}):r.startsWith(u)?i.jsxs("p",{children:["This agent is already on the latest version (",u,")."]}):i.jsxs(i.Fragment,{children:[i.jsxs("p",{children:["Are you sure you want to upgrade this agent from version ",r," to version ",u,"?"]}),i.jsx(Pe,{onClick:()=>{l(),n()},"aria-label":"Confirm upgrade",children:"Confirm Upgrade"})]}):i.jsx(Ur,{})}function EK(){const e=Te(),{id:t}=$t(),n=g.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,o]=g.useState(!1),[s,l]=g.useState(!1),[u,d]=g.useState(!1),[p,h]=g.useState(),[m,y]=g.useState(),[x,b]=g.useState(),[w,j]=g.useState(),[T,P]=g.useState(!1),[k,E]=g.useState(!1),[_,{open:R,close:M}]=Yf(!1);g.useEffect(()=>{if(r||s||u||T){E(!0);return}E(!1)},[r,s,u,T]);const N=g.useCallback(()=>{o(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(Q=>{var te,V,O,A,B,I;h((V=(te=Q.parameter)==null?void 0:te.find(F=>F.name==="status"))==null?void 0:V.valueCode),y((A=(O=Q.parameter)==null?void 0:O.find(F=>F.name==="version"))==null?void 0:A.valueString),b((I=(B=Q.parameter)==null?void 0:B.find(F=>F.name==="lastUpdated"))==null?void 0:I.valueInstant)}).catch(Q=>Y(Ze(Q))).finally(()=>o(!1))},[e,t]),L=g.useCallback(Q=>{const te=Q.host,V=Q.pingCount||1;te&&(P(!0),e.pushToAgent(n,te,`PING ${V}`,On.PING,!0).then(O=>j(O)).catch(O=>Y(Ze(O))).finally(()=>P(!1)))},[e,n]),z=g.useCallback(()=>{l(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(Q=>{G("Agent config reloaded successfully.")}).catch(Q=>Y(Ze(Q))).finally(()=>l(!1))},[e,t]),q=g.useCallback(()=>{d(!0),e.get(e.fhirUrl("Agent",t,"$upgrade"),{cache:"reload"}).then(Q=>{G("Agent upgraded successfully.")}).catch(Q=>Y(Ze(Q))).finally(()=>d(!1))},[e,t]);function G(Q){Ie({color:"green",title:"Success",icon:i.jsx(Ss,{size:"1rem"}),message:Q})}function Y(Q){Ie({color:"red",title:"Error",message:Q,autoClose:!1})}return i.jsxs(it,{children:[i.jsx(Nn,{opened:_,onClose:M,title:"Upgrade Agent",centered:!0,children:i.jsx(CK,{opened:_,close:M,version:m,loadingStatus:r,handleStatus:N,handleUpgrade:q})}),i.jsx(ze,{order:1,children:"Agent Tools"}),i.jsxs("div",{style:{marginBottom:10},children:["Agent: ",i.jsx(Zl,{value:n,link:!0})]}),i.jsx(Dn,{my:"lg"}),i.jsx(ze,{order:2,children:"Agent Status"}),i.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."}),i.jsx(Pe,{onClick:N,loading:r,disabled:k&&!r,children:"Get Status"}),!r&&p&&i.jsx(Le,{children:i.jsxs(Le.Tbody,{children:[i.jsxs(Le.Tr,{children:[i.jsx(Le.Td,{children:"Status"}),i.jsx(Le.Td,{children:i.jsx(Bx,{status:p})})]}),i.jsxs(Le.Tr,{children:[i.jsx(Le.Td,{children:"Version"}),i.jsx(Le.Td,{children:m})]}),i.jsxs(Le.Tr,{children:[i.jsx(Le.Td,{children:"Last Updated"}),i.jsx(Le.Td,{children:pr(x,void 0,{timeZoneName:"longOffset"})})]})]})}),i.jsx(Dn,{my:"lg"}),i.jsx(ze,{order:2,children:"Reload Config"}),i.jsx("p",{children:"Reload the configuration of this agent, syncing it with the current version of the Agent resource on the Medplum server."}),i.jsx(Pe,{onClick:z,loading:s,disabled:k&&!s,"aria-label":"Reload config",children:"Reload Config"}),i.jsx(Dn,{my:"lg"}),i.jsx(ze,{order:2,children:"Upgrade Agent"}),i.jsx("p",{children:"Upgrade the version of this agent, to either the latest (default) or a specified version."}),i.jsx(Pe,{onClick:R,loading:u,disabled:k&&!u,"aria-label":"Upgrade agent",children:"Upgrade"}),i.jsx(Dn,{my:"lg"}),i.jsx(ze,{order:2,children:"Ping from Agent"}),i.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."}),i.jsx(yt,{onSubmit:L,children:i.jsxs(be,{children:[i.jsx(Fe,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:i.jsx(Cn,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:T,disabled:k&&!T,children:i.jsx(c8,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),i.jsx(Fy,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!T&&w&&i.jsxs(i.Fragment,{children:[i.jsx(ze,{order:5,mt:"sm",mb:0,children:"Last Ping"}),i.jsx("pre",{children:w})]})]})}function kK(){return i.jsx(Cq,{children:i.jsxs(qe,{errorElement:i.jsx(FG,{}),children:[i.jsx(qe,{path:"/signin",element:i.jsx(uQ,{})}),i.jsx(qe,{path:"/oauth",element:i.jsx(iQ,{})}),i.jsx(qe,{path:"/resetpassword",element:i.jsx(aQ,{})}),i.jsx(qe,{path:"/setpassword/:id/:secret",element:i.jsx(cQ,{})}),i.jsx(qe,{path:"/register",element:i.jsx(sQ,{})}),i.jsx(qe,{path:"/changepassword",element:i.jsx(OG,{})}),i.jsx(qe,{path:"/security",element:i.jsx(lQ,{})}),i.jsx(qe,{path:"/mfa",element:i.jsx(rQ,{})}),i.jsx(qe,{path:"/batch",element:i.jsx(AG,{})}),i.jsx(qe,{path:"/bulk/:resourceType",element:i.jsx(MG,{})}),i.jsx(qe,{path:"/smart",element:i.jsx(dQ,{})}),i.jsx(qe,{path:"/forms/:id",element:i.jsx(GG,{})}),i.jsx(qe,{path:"/admin/super",element:i.jsx(CQ,{})}),i.jsx(qe,{path:"/admin/config",element:i.jsx(bQ,{})}),i.jsxs(qe,{path:"/admin",element:i.jsx(wQ,{}),children:[i.jsx(qe,{path:"patients",element:i.jsx(xQ,{})}),i.jsx(qe,{path:"bots/new",element:i.jsx(hQ,{})}),i.jsx(qe,{path:"bots",element:i.jsx(fQ,{})}),i.jsx(qe,{path:"clients/new",element:i.jsx(mQ,{})}),i.jsx(qe,{path:"clients",element:i.jsx(pQ,{})}),i.jsx(qe,{path:"details",element:i.jsx(Oj,{})}),i.jsx(qe,{path:"invite",element:i.jsx(yQ,{})}),i.jsx(qe,{path:"users",element:i.jsx(EQ,{})}),i.jsx(qe,{path:"project",element:i.jsx(Oj,{})}),i.jsx(qe,{path:"secrets",element:i.jsx(SQ,{})}),i.jsx(qe,{path:"sites",element:i.jsx(jQ,{})}),i.jsx(qe,{path:"members/:membershipId",element:i.jsx(vQ,{})})]}),i.jsx(qe,{path:"/lab/assays",element:i.jsx(kQ,{})}),i.jsx(qe,{path:"/lab/panels",element:i.jsx(TQ,{})}),i.jsx(qe,{path:"/:resourceType/:id/_history/:versionId/:tab",element:i.jsx(zj,{})}),i.jsx(qe,{path:"/:resourceType/:id/_history/:versionId",element:i.jsx(zj,{})}),i.jsxs(qe,{path:"/:resourceType/new",element:i.jsx($G,{}),children:[i.jsx(qe,{index:!0,element:i.jsx(Eg,{})}),i.jsx(qe,{path:"form",element:i.jsx(Eg,{})}),i.jsx(qe,{path:"json",element:i.jsx(YQ,{})}),i.jsx(qe,{path:"profiles",element:i.jsx(Eg,{})})]}),i.jsxs(qe,{path:"/:resourceType/:id",element:i.jsx(wK,{}),children:[i.jsx(qe,{index:!0,element:i.jsx(Bj,{})}),i.jsx(qe,{path:"apply",element:i.jsx(RQ,{})}),i.jsx(qe,{path:"apps",element:i.jsx(_Q,{})}),i.jsx(qe,{path:"event",element:i.jsx(IQ,{})}),i.jsx(qe,{path:"blame",element:i.jsx(NQ,{})}),i.jsx(qe,{path:"bots",element:i.jsx(nK,{})}),i.jsx(qe,{path:"builder",element:i.jsx(UQ,{})}),i.jsx(qe,{path:"checklist",element:i.jsx(VQ,{})}),i.jsx(qe,{path:"delete",element:i.jsx(WQ,{})}),i.jsx(qe,{path:"details",element:i.jsx(GQ,{})}),i.jsx(qe,{path:"edit",element:i.jsx(QQ,{})}),i.jsx(qe,{path:"editor",element:i.jsx(zQ,{})}),i.jsx(qe,{path:"history",element:i.jsx(KQ,{})}),i.jsx(qe,{path:"json",element:i.jsx(XQ,{})}),i.jsx(qe,{path:"preview",element:i.jsx(JQ,{})}),i.jsx(qe,{path:"responses",element:i.jsx(oK,{})}),i.jsx(qe,{path:"report",element:i.jsx(sK,{})}),i.jsx(qe,{path:"ranges",element:i.jsx(iK,{})}),i.jsx(qe,{path:"subscriptions",element:i.jsx(SK,{})}),i.jsx(qe,{path:"timeline",element:i.jsx(Bj,{})}),i.jsx(qe,{path:"tools",element:i.jsx(EK,{})}),i.jsx(qe,{path:"profiles",element:i.jsx(ZQ,{})})]}),i.jsx(qe,{path:"/:resourceType",element:i.jsx(Mj,{})}),i.jsx(qe,{path:"/",element:i.jsx(Mj,{})})]})})}function TK(){const e=Te(),t=e.getUserConfiguration(),n=Li(),[r]=e0();return e.isLoading()?i.jsx(Ur,{}):i.jsx(cz,{logo:i.jsx(Do,{size:24}),pathname:n.pathname,searchParams:r,version:MT,menus:PK(t),displayAddBookmark:!!(t!=null&&t.id),children:i.jsx(g.Suspense,{fallback:i.jsx(Ur,{}),children:i.jsx(kK,{})})})}function PK(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(s=>({label:s.name,href:s.target,icon:RK(s.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:i.jsx(YF,{})}]}),t}const Uj={Patient:f8,Practitioner:QF,Organization:$F,ServiceRequest:i8,DiagnosticReport:l8,Questionnaire:GF,admin:MF,AccessPolicy:KF,Subscription:g8,batch:e8,Observation:ZF};function RK(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in Uj){const n=Uj[t];return i.jsx(n,{})}}catch{}return i.jsx(_p,{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 _K(){const e=Bu(),t=new OT({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=Pq([{path:"*",element:i.jsx(TK,{})}]),o=l=>r.navigate(l);cH.createRoot(document.getElementById("root")).render(i.jsx(g.StrictMode,{children:i.jsx(gF,{medplum:t,navigate:o,children:i.jsxs(mC,{theme:n,children:[i.jsx(Ai,{position:"bottom-right"}),i.jsx(Lq,{router:r})]})})}))}_K().catch(console.error);
|
|
587
|
-
//# sourceMappingURL=index-DeSwaR1s.js.map
|