@medplum/app 4.3.5 → 4.3.7

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.
@@ -0,0 +1,589 @@
1
+ function g4(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function fx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wv={exports:{}},ku={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var zj;function v4(){if(zj)return ku;zj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var c=null;if(o!==void 0&&(c=""+o),i.key!==void 0&&(c=""+i.key),"key"in i){o={};for(var u in i)u!=="key"&&(o[u]=i[u])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:c,ref:i!==void 0?i:null,props:o}}return ku.Fragment=t,ku.jsx=n,ku.jsxs=n,ku}var Uj;function y4(){return Uj||(Uj=1,wv.exports=v4()),wv.exports}var s=y4(),Ji=function(){return Ji=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Ji.apply(this,arguments)};function aR(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function x4(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var jv={exports:{}},bt={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Bj;function b4(){if(Bj)return bt;Bj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function y(O){return O===null||typeof O!="object"?null:(O=g&&O[g]||O["@@iterator"],typeof O=="function"?O:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,j={};function C(O,U,K){this.props=O,this.context=U,this.refs=j,this.updater=K||b}C.prototype.isReactComponent={},C.prototype.setState=function(O,U){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,U,"setState")},C.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function T(){}T.prototype=C.prototype;function _(O,U,K){this.props=O,this.context=U,this.refs=j,this.updater=K||b}var E=_.prototype=new T;E.constructor=_,S(E,C.prototype),E.isPureReactComponent=!0;var R=Array.isArray,D={H:null,A:null,T:null,S:null,V:null},k=Object.prototype.hasOwnProperty;function M(O,U,K,ee,Se,be){return K=be.ref,{$$typeof:e,type:O,key:U,ref:K!==void 0?K:null,props:be}}function L(O,U){return M(O.type,U,void 0,void 0,void 0,O.props)}function z(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function F(O){var U={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(K){return U[K]})}var Y=/\/+/g;function W(O,U){return typeof O=="object"&&O!==null&&O.key!=null?F(""+O.key):U.toString(36)}function J(){}function G(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(J,J):(O.status="pending",O.then(function(U){O.status==="pending"&&(O.status="fulfilled",O.value=U)},function(U){O.status==="pending"&&(O.status="rejected",O.reason=U)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function X(O,U,K,ee,Se){var be=typeof O;(be==="undefined"||be==="boolean")&&(O=null);var xe=!1;if(O===null)xe=!0;else switch(be){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(O.$$typeof){case e:case t:xe=!0;break;case m:return xe=O._init,X(xe(O._payload),U,K,ee,Se)}}if(xe)return Se=Se(O),xe=ee===""?"."+W(O,0):ee,R(Se)?(K="",xe!=null&&(K=xe.replace(Y,"$&/")+"/"),X(Se,U,K,"",function(nt){return nt})):Se!=null&&(z(Se)&&(Se=L(Se,K+(Se.key==null||O&&O.key===Se.key?"":(""+Se.key).replace(Y,"$&/")+"/")+xe)),U.push(Se)),1;xe=0;var Ge=ee===""?".":ee+":";if(R(O))for(var Me=0;Me<O.length;Me++)ee=O[Me],be=Ge+W(ee,Me),xe+=X(ee,U,K,be,Se);else if(Me=y(O),typeof Me=="function")for(O=Me.call(O),Me=0;!(ee=O.next()).done;)ee=ee.value,be=Ge+W(ee,Me++),xe+=X(ee,U,K,be,Se);else if(be==="object"){if(typeof O.then=="function")return X(G(O),U,K,ee,Se);throw U=String(O),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return xe}function P(O,U,K){if(O==null)return O;var ee=[],Se=0;return X(O,ee,"","",function(be){return U.call(K,be,Se++)}),ee}function I(O){if(O._status===-1){var U=O._result;U=U(),U.then(function(K){(O._status===0||O._status===-1)&&(O._status=1,O._result=K)},function(K){(O._status===0||O._status===-1)&&(O._status=2,O._result=K)}),O._status===-1&&(O._status=0,O._result=U)}if(O._status===1)return O._result.default;throw O._result}var $=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)};function H(){}return bt.Children={map:P,forEach:function(O,U,K){P(O,function(){U.apply(this,arguments)},K)},count:function(O){var U=0;return P(O,function(){U++}),U},toArray:function(O){return P(O,function(U){return U})||[]},only:function(O){if(!z(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},bt.Component=C,bt.Fragment=n,bt.Profiler=i,bt.PureComponent=_,bt.StrictMode=r,bt.Suspense=f,bt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,bt.__COMPILER_RUNTIME={__proto__:null,c:function(O){return D.H.useMemoCache(O)}},bt.cache=function(O){return function(){return O.apply(null,arguments)}},bt.cloneElement=function(O,U,K){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ee=S({},O.props),Se=O.key,be=void 0;if(U!=null)for(xe in U.ref!==void 0&&(be=void 0),U.key!==void 0&&(Se=""+U.key),U)!k.call(U,xe)||xe==="key"||xe==="__self"||xe==="__source"||xe==="ref"&&U.ref===void 0||(ee[xe]=U[xe]);var xe=arguments.length-2;if(xe===1)ee.children=K;else if(1<xe){for(var Ge=Array(xe),Me=0;Me<xe;Me++)Ge[Me]=arguments[Me+2];ee.children=Ge}return M(O.type,Se,void 0,void 0,be,ee)},bt.createContext=function(O){return O={$$typeof:c,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:o,_context:O},O},bt.createElement=function(O,U,K){var ee,Se={},be=null;if(U!=null)for(ee in U.key!==void 0&&(be=""+U.key),U)k.call(U,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(Se[ee]=U[ee]);var xe=arguments.length-2;if(xe===1)Se.children=K;else if(1<xe){for(var Ge=Array(xe),Me=0;Me<xe;Me++)Ge[Me]=arguments[Me+2];Se.children=Ge}if(O&&O.defaultProps)for(ee in xe=O.defaultProps,xe)Se[ee]===void 0&&(Se[ee]=xe[ee]);return M(O,be,void 0,void 0,null,Se)},bt.createRef=function(){return{current:null}},bt.forwardRef=function(O){return{$$typeof:u,render:O}},bt.isValidElement=z,bt.lazy=function(O){return{$$typeof:m,_payload:{_status:-1,_result:O},_init:I}},bt.memo=function(O,U){return{$$typeof:h,type:O,compare:U===void 0?null:U}},bt.startTransition=function(O){var U=D.T,K={};D.T=K;try{var ee=O(),Se=D.S;Se!==null&&Se(K,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(H,$)}catch(be){$(be)}finally{D.T=U}},bt.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},bt.use=function(O){return D.H.use(O)},bt.useActionState=function(O,U,K){return D.H.useActionState(O,U,K)},bt.useCallback=function(O,U){return D.H.useCallback(O,U)},bt.useContext=function(O){return D.H.useContext(O)},bt.useDebugValue=function(){},bt.useDeferredValue=function(O,U){return D.H.useDeferredValue(O,U)},bt.useEffect=function(O,U,K){var ee=D.H;if(typeof K=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ee.useEffect(O,U)},bt.useId=function(){return D.H.useId()},bt.useImperativeHandle=function(O,U,K){return D.H.useImperativeHandle(O,U,K)},bt.useInsertionEffect=function(O,U){return D.H.useInsertionEffect(O,U)},bt.useLayoutEffect=function(O,U){return D.H.useLayoutEffect(O,U)},bt.useMemo=function(O,U){return D.H.useMemo(O,U)},bt.useOptimistic=function(O,U){return D.H.useOptimistic(O,U)},bt.useReducer=function(O,U,K){return D.H.useReducer(O,U,K)},bt.useRef=function(O){return D.H.useRef(O)},bt.useState=function(O){return D.H.useState(O)},bt.useSyncExternalStore=function(O,U,K){return D.H.useSyncExternalStore(O,U,K)},bt.useTransition=function(){return D.H.useTransition()},bt.version="19.1.0",bt}var Vj;function hx(){return Vj||(Vj=1,jv.exports=b4()),jv.exports}var v=hx();const En=fx(v),S4=g4({__proto__:null,default:En},[v]);var hh="right-scroll-bar-position",ph="width-before-scroll-bar",w4="with-scroll-bars-hidden",j4="--removed-body-scroll-bar-size";function Cv(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function C4(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var E4=typeof window<"u"?v.useLayoutEffect:v.useEffect,Fj=new WeakMap;function T4(e,t){var n=C4(null,function(r){return e.forEach(function(i){return Cv(i,r)})});return E4(function(){var r=Fj.get(n);if(r){var i=new Set(r),o=new Set(e),c=n.current;i.forEach(function(u){o.has(u)||Cv(u,null)}),o.forEach(function(u){i.has(u)||Cv(u,c)})}Fj.set(n,e)},[e]),n}function R4(e){return e}function _4(e,t){t===void 0&&(t=R4);var n=[],r=!1,i={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(o){var c=t(o,r);return n.push(c),function(){n=n.filter(function(u){return u!==c})}},assignSyncMedium:function(o){for(r=!0;n.length;){var c=n;n=[],c.forEach(o)}n={push:function(u){return o(u)},filter:function(){return n}}},assignMedium:function(o){r=!0;var c=[];if(n.length){var u=n;n=[],u.forEach(o),c=n}var f=function(){var m=c;c=[],m.forEach(o)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(m){c.push(m),h()},filter:function(m){return c=c.filter(m),n}}}};return i}function D4(e){e===void 0&&(e={});var t=_4(null);return t.options=Ji({async:!0,ssr:!1},e),t}var oR=function(e){var t=e.sideCar,n=aR(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,Ji({},n))};oR.isSideCarExport=!0;function A4(e,t){return e.useMedium(t),oR}var sR=D4(),Ev=function(){},op=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:Ev,onWheelCapture:Ev,onTouchMoveCapture:Ev}),i=r[0],o=r[1],c=e.forwardProps,u=e.children,f=e.className,h=e.removeScrollBar,m=e.enabled,g=e.shards,y=e.sideCar,b=e.noRelative,S=e.noIsolation,j=e.inert,C=e.allowPinchZoom,T=e.as,_=T===void 0?"div":T,E=e.gapMode,R=aR(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=y,k=T4([n,t]),M=Ji(Ji({},R),i);return v.createElement(v.Fragment,null,m&&v.createElement(D,{sideCar:sR,removeScrollBar:h,shards:g,noRelative:b,noIsolation:S,inert:j,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:E}),c?v.cloneElement(v.Children.only(u),Ji(Ji({},M),{ref:k})):v.createElement(_,Ji({},M,{className:f,ref:k}),u))});op.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};op.classNames={fullWidth:ph,zeroRight:hh};var k4=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function P4(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=k4();return t&&e.setAttribute("nonce",t),e}function N4(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function O4(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var M4=function(){var e=0,t=null;return{add:function(n){e==0&&(t=P4())&&(N4(t,n),O4(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},L4=function(){var e=M4();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},lR=function(){var e=L4(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},I4={left:0,top:0,right:0,gap:0},Tv=function(e){return parseInt(e||"",10)||0},$4=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Tv(n),Tv(r),Tv(i)]},z4=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return I4;var t=$4(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])}},U4=lR(),ac="data-scroll-locked",B4=function(e,t,n,r){var i=e.left,o=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
18
+ .`.concat(w4,` {
19
+ overflow: hidden `).concat(r,`;
20
+ padding-right: `).concat(u,"px ").concat(r,`;
21
+ }
22
+ body[`).concat(ac,`] {
23
+ overflow: hidden `).concat(r,`;
24
+ overscroll-behavior: contain;
25
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
26
+ padding-left: `.concat(i,`px;
27
+ padding-top: `).concat(o,`px;
28
+ padding-right: `).concat(c,`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(hh,` {
36
+ right: `).concat(u,"px ").concat(r,`;
37
+ }
38
+
39
+ .`).concat(ph,` {
40
+ margin-right: `).concat(u,"px ").concat(r,`;
41
+ }
42
+
43
+ .`).concat(hh," .").concat(hh,` {
44
+ right: 0 `).concat(r,`;
45
+ }
46
+
47
+ .`).concat(ph," .").concat(ph,` {
48
+ margin-right: 0 `).concat(r,`;
49
+ }
50
+
51
+ body[`).concat(ac,`] {
52
+ `).concat(j4,": ").concat(u,`px;
53
+ }
54
+ `)},Hj=function(){var e=parseInt(document.body.getAttribute(ac)||"0",10);return isFinite(e)?e:0},V4=function(){v.useEffect(function(){return document.body.setAttribute(ac,(Hj()+1).toString()),function(){var e=Hj()-1;e<=0?document.body.removeAttribute(ac):document.body.setAttribute(ac,e.toString())}},[])},F4=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;V4();var o=v.useMemo(function(){return z4(i)},[i]);return v.createElement(U4,{styles:B4(o,!t,i,n?"":"!important")})},by=!1;if(typeof window<"u")try{var Xf=Object.defineProperty({},"passive",{get:function(){return by=!0,!0}});window.addEventListener("test",Xf,Xf),window.removeEventListener("test",Xf,Xf)}catch{by=!1}var ql=by?{passive:!1}:!1,H4=function(e){return e.tagName==="TEXTAREA"},cR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!H4(e)&&n[t]==="visible")},q4=function(e){return cR(e,"overflowY")},G4=function(e){return cR(e,"overflowX")},qj=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=uR(e,r);if(i){var o=dR(e,r),c=o[1],u=o[2];if(c>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},W4=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Q4=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},uR=function(e,t){return e==="v"?q4(t):G4(t)},dR=function(e,t){return e==="v"?W4(t):Q4(t)},Y4=function(e,t){return e==="h"&&t==="rtl"?-1:1},X4=function(e,t,n,r,i){var o=Y4(e,window.getComputedStyle(t).direction),c=o*r,u=n.target,f=t.contains(u),h=!1,m=c>0,g=0,y=0;do{if(!u)break;var b=dR(e,u),S=b[0],j=b[1],C=b[2],T=j-C-o*S;(S||T)&&uR(e,u)&&(g+=T,y+=S);var _=u.parentNode;u=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(m&&Math.abs(g)<1||!m&&Math.abs(y)<1)&&(h=!0),h},Kf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Gj=function(e){return[e.deltaX,e.deltaY]},Wj=function(e){return e&&"current"in e?e.current:e},K4=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Z4=function(e){return`
55
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
56
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
57
+ `)},J4=0,Gl=[];function e3(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(J4++)[0],o=v.useState(lR)[0],c=v.useRef(e);v.useEffect(function(){c.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var j=x4([e.lockRef.current],(e.shards||[]).map(Wj),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=v.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var T=Kf(j),_=n.current,E="deltaX"in j?j.deltaX:_[0]-T[0],R="deltaY"in j?j.deltaY:_[1]-T[1],D,k=j.target,M=Math.abs(E)>Math.abs(R)?"h":"v";if("touches"in j&&M==="h"&&k.type==="range")return!1;var L=qj(M,k);if(!L)return!0;if(L?D=M:(D=M==="v"?"h":"v",L=qj(M,k)),!L)return!1;if(!r.current&&"changedTouches"in j&&(E||R)&&(r.current=D),!D)return!0;var z=r.current||D;return X4(z,C,j,z==="h"?E:R)},[]),f=v.useCallback(function(j){var C=j;if(!(!Gl.length||Gl[Gl.length-1]!==o)){var T="deltaY"in C?Gj(C):Kf(C),_=t.current.filter(function(D){return D.name===C.type&&(D.target===C.target||C.target===D.shadowParent)&&K4(D.delta,T)})[0];if(_&&_.should){C.cancelable&&C.preventDefault();return}if(!_){var E=(c.current.shards||[]).map(Wj).filter(Boolean).filter(function(D){return D.contains(C.target)}),R=E.length>0?u(C,E[0]):!c.current.noIsolation;R&&C.cancelable&&C.preventDefault()}}},[]),h=v.useCallback(function(j,C,T,_){var E={name:j,delta:C,target:T,should:_,shadowParent:t3(T)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(R){return R!==E})},1)},[]),m=v.useCallback(function(j){n.current=Kf(j),r.current=void 0},[]),g=v.useCallback(function(j){h(j.type,Gj(j),j.target,u(j,e.lockRef.current))},[]),y=v.useCallback(function(j){h(j.type,Kf(j),j.target,u(j,e.lockRef.current))},[]);v.useEffect(function(){return Gl.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",f,ql),document.addEventListener("touchmove",f,ql),document.addEventListener("touchstart",m,ql),function(){Gl=Gl.filter(function(j){return j!==o}),document.removeEventListener("wheel",f,ql),document.removeEventListener("touchmove",f,ql),document.removeEventListener("touchstart",m,ql)}},[]);var b=e.removeScrollBar,S=e.inert;return v.createElement(v.Fragment,null,S?v.createElement(o,{styles:Z4(i)}):null,b?v.createElement(F4,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function t3(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const n3=A4(sR,e3);var dc=v.forwardRef(function(e,t){return v.createElement(op,Ji({},e,{ref:t,sideCar:n3}))});dc.classNames=op.classNames;function on(e){return Object.keys(e)}function Rv(e){return e&&typeof e=="object"&&!Array.isArray(e)}function px(e,t){const n={...e},r=t;return Rv(e)&&Rv(t)&&Object.keys(t).forEach(i=>{Rv(r[i])&&i in e?n[i]=px(n[i],r[i]):n[i]=r[i]}),n}function r3(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function i3(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 Gu(e){const t=i3(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 _v(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function fR(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r==="0")return`0${e}`;if(typeof r=="number"){const i=`${r/16}${e}`;return t?_v(i):i}if(typeof r=="string"){if(r===""||r.startsWith("calc(")||r.startsWith("clamp(")||r.includes("rgba("))return r;if(r.includes(","))return r.split(",").map(o=>n(o)).join(",");if(r.includes(" "))return r.split(" ").map(o=>n(o)).join(" ");if(r.includes(e))return t?_v(r):r;const i=r.replace("px","");if(!Number.isNaN(Number(i))){const o=`${Number(i)/16}${e}`;return t?_v(o):o}}return r}return n}const le=fR("rem",{shouldScale:!0}),Th=fR("em");function Wo(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function hR(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 Ga(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==v.Fragment:!1}function vr(e){const t=v.createContext(null);return[({children:i,value:o})=>s.jsx(t.Provider,{value:o,children:i}),()=>{const i=v.useContext(t);if(i===null)throw new Error(e);return i}]}function Wa(e=null){const t=v.createContext(e);return[({children:i,value:o})=>s.jsx(t.Provider,{value:o,children:i}),()=>v.useContext(t)]}function Qj(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function Rh(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function a3(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 o3(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 s3(e,t,n){return Rh(e,n)===Rh(t,n)}function pR({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:i=!1,dir:o="rtl",orientation:c}){return u=>{var S;n==null||n(u);const f=Array.from(((S=Rh(u.currentTarget,e))==null?void 0:S.querySelectorAll(t))||[]).filter(j=>s3(u.currentTarget,j,e)),h=f.findIndex(j=>u.currentTarget===j),m=o3(h,f,r),g=a3(h,f,r),y=o==="rtl"?g:m,b=o==="rtl"?m:g;switch(u.key){case"ArrowRight":{c==="horizontal"&&(u.stopPropagation(),u.preventDefault(),f[y].focus(),i&&f[y].click());break}case"ArrowLeft":{c==="horizontal"&&(u.stopPropagation(),u.preventDefault(),f[b].focus(),i&&f[b].click());break}case"ArrowUp":{c==="vertical"&&(u.stopPropagation(),u.preventDefault(),f[g].focus(),i&&f[g].click());break}case"ArrowDown":{c==="vertical"&&(u.stopPropagation(),u.preventDefault(),f[m].focus(),i&&f[m].click());break}case"Home":{u.stopPropagation(),u.preventDefault(),!f[0].disabled&&f[0].focus();break}case"End":{u.stopPropagation(),u.preventDefault();const j=f.length-1;!f[j].disabled&&f[j].focus();break}}}}const l3={app:100,modal:200,popover:300,overlay:400,max:9999};function Qr(e){return l3[e]}const _h=()=>{};function c3(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||_h:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function rt(e,t="size",n=!0){if(e!==void 0)return hR(e)?n?le(e):e:`var(--${t}-${e})`}function Nn(e){return rt(e,"mantine-spacing")}function Bt(e){return e===void 0?"var(--mantine-radius-default)":rt(e,"mantine-radius")}function On(e){return rt(e,"mantine-font-size")}function mR(e){return rt(e,"mantine-line-height",!1)}function mx(e){if(e)return rt(e,"mantine-shadow",!1)}function Rr(e,t){return n=>{e==null||e(n),t==null||t(n)}}function gx(e,t){return e in t?Gu(t[e]):Gu(e)}function Wu(e,t){const n=e.map(r=>({value:r,px:gx(r,t)}));return n.sort((r,i)=>r.px-i.px),n}function _i(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function u3(e,t,n){var r;return n?Array.from(((r=Rh(n,t))==null?void 0:r.querySelectorAll(e))||[]).findIndex(i=>i===n):null}function d3(){const[e,t]=v.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function mh(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 Dh(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function f3(e,t){if(e===t||Number.isNaN(e)&&Number.isNaN(t))return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;const n=Object.keys(e),{length:r}=n;if(r!==Object.keys(t).length)return!1;for(let i=0;i<r;i+=1){const o=n[i];if(!(o in t)||e[o]!==t[o]&&!(Number.isNaN(e[o])&&Number.isNaN(t[o])))return!1}return!0}function Yj(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Es(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function sp(e,t){const n=typeof t=="number"?t:t.delay,r=typeof t=="number"?!1:t.flushOnUnmount,i=Es(e),o=v.useRef(0),c=v.useRef(()=>{}),u=Object.assign(v.useCallback((...f)=>{window.clearTimeout(o.current);const h=()=>{o.current!==0&&(o.current=0,i(...f))};c.current=h,u.flush=h,o.current=window.setTimeout(h,n)},[i,n]),{flush:c.current});return v.useEffect(()=>()=>{window.clearTimeout(o.current),r&&u.flush()},[u,r]),u}const Xj=["mousedown","touchstart"];function h3(e,t,n){const r=v.useRef(null);return v.useEffect(()=>{const i=o=>{const{target:c}=o??{};if(Array.isArray(n)){const u=(c==null?void 0:c.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(c)&&c.tagName!=="HTML";n.every(h=>!!h&&!o.composedPath().includes(h))&&!u&&e()}else r.current&&!r.current.contains(c)&&e()};return(t||Xj).forEach(o=>document.addEventListener(o,i)),()=>{(t||Xj).forEach(o=>document.removeEventListener(o,i))}},[r,e,n]),r}function gR({timeout:e=2e3}={}){const[t,n]=v.useState(null),[r,i]=v.useState(!1),[o,c]=v.useState(null),u=m=>{window.clearTimeout(o),c(window.setTimeout(()=>i(!1),e)),i(m)};return{copy:m=>{"clipboard"in navigator?navigator.clipboard.writeText(m).then(()=>u(!0)).catch(g=>n(g)):n(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{i(!1),n(null),window.clearTimeout(o)},error:t,copied:r}}function p3(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function m3(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function vR(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,i]=v.useState(n?t:m3(e)),o=v.useRef(null);return v.useEffect(()=>{if("matchMedia"in window)return o.current=window.matchMedia(e),i(o.current.matches),p3(o.current,c=>i(c.matches))},[e]),r}function g3(e,t){return vR("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const jc=typeof document<"u"?v.useLayoutEffect:v.useEffect;function Ba(e,t){const n=v.useRef(!1);v.useEffect(()=>()=>{n.current=!1},[]),v.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function yR({opened:e,shouldReturnFocus:t=!0}){const n=v.useRef(null),r=()=>{var i;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((i=n.current)==null||i.focus({preventScroll:!0}))};return Ba(()=>{let i=-1;const o=c=>{c.key==="Tab"&&window.clearTimeout(i)};return document.addEventListener("keydown",o),e?n.current=document.activeElement:t&&(i=window.setTimeout(r,10)),()=>{window.clearTimeout(i),document.removeEventListener("keydown",o)}},[e,t]),r}const v3=/input|select|textarea|button|object/,xR="a, input, select, textarea, button, object, [tabindex]";function y3(e){return e.style.display==="none"}function x3(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(y3(n))return!1;n=n.parentNode}return!0}function bR(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function Sy(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(bR(e));return(v3.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&x3(e)}function SR(e){const t=bR(e);return(Number.isNaN(t)||t>=0)&&Sy(e)}function b3(e){return Array.from(e.querySelectorAll(xR)).filter(SR)}function S3(e,t){const n=b3(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],i=e.getRootNode();let o=r===i.activeElement||e===i.activeElement;const c=i.activeElement;if(c.tagName==="INPUT"&&c.getAttribute("type")==="radio"&&(o=n.filter(m=>m.getAttribute("type")==="radio"&&m.getAttribute("name")===c.getAttribute("name")).includes(r)),!o)return;t.preventDefault();const f=n[t.shiftKey?n.length-1:0];f&&f.focus()}function w3(e=!0){const t=v.useRef(null),n=i=>{let o=i.querySelector("[data-autofocus]");if(!o){const c=Array.from(i.querySelectorAll(xR));o=c.find(SR)||c.find(Sy)||null,!o&&Sy(i)&&(o=i)}o&&o.focus({preventScroll:!0})},r=v.useCallback(i=>{e&&i!==null&&t.current!==i&&(i?(setTimeout(()=>{i.getRootNode()&&n(i)}),t.current=i):t.current=null)},[e]);return v.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const i=o=>{o.key==="Tab"&&t.current&&S3(t.current,o)};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[e]),r}const j3=e=>(e+1)%1e6;function C3(){const[,e]=v.useReducer(j3,0);return e}const E3=En.useId||(()=>{});function T3(){const e=E3();return e?`mantine-${e.replace(/:/g,"")}`:""}function yr(e){const t=T3(),[n,r]=v.useState(t);return jc(()=>{r(Dh())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function wR(e,t,n){v.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function Qu(e,t){if(typeof e=="function")return e(t);typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function R3(...e){const t=new Map;return n=>{if(e.forEach(r=>{const i=Qu(r,n);i&&t.set(r,i)}),t.size>0)return()=>{e.forEach(r=>{const i=t.get(r);i?i():Qu(r,null)}),t.clear()}}}function Bn(...e){return v.useCallback(R3(...e),e)}function Xn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[i,o]=v.useState(t!==void 0?t:n),c=(u,...f)=>{o(u),r==null||r(u,...f)};return e!==void 0?[e,r,!0]:[i,c,!1]}function Po(e,t){const n=t-e+1;return Array.from({length:n},(r,i)=>i+e)}const Zf="dots";function _3({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:i=1,onChange:o}){const c=Math.max(Math.trunc(e),0),[u,f]=Xn({value:r,onChange:o,defaultValue:i,finalValue:i}),h=j=>{j<=0?f(1):j>c?f(c):f(j)},m=()=>h(u+1),g=()=>h(u-1),y=()=>h(1),b=()=>h(c);return{range:v.useMemo(()=>{if(t*2+3+n*2>=c)return Po(1,c);const C=Math.max(u-t,n),T=Math.min(u+t,c-n),_=C>n+2,E=T<c-(n+1);if(!_&&E){const R=t*2+n+2;return[...Po(1,R),Zf,...Po(c-(n-1),c)]}if(_&&!E){const R=n+1+2*t;return[...Po(1,n),Zf,...Po(c-R,c)]}return[...Po(1,n),Zf,...Po(C,T),Zf,...Po(c-n+1,c)]},[c,t,u]),active:u,setPage:h,next:m,previous:g,first:y,last:b}}function vx(e,t){return vR("(prefers-reduced-motion: reduce)",e,t)}function D3(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!f3(e[n],t[n]))return!1;return!0}function A3(e){const t=v.useRef([]),n=v.useRef(0);return D3(t.current,e)||(t.current=e,n.current+=1),[n.current]}function k3(e,t){v.useEffect(e,A3(t))}function lp(e=!1,t){const{onOpen:n,onClose:r}={},[i,o]=v.useState(e),c=v.useCallback(()=>{o(h=>h||(n==null||n(),!0))},[n]),u=v.useCallback(()=>{o(h=>h&&(r==null||r(),!1))},[r]),f=v.useCallback(()=>{i?u():c()},[u,c,i]);return[i,{open:c,close:u,toggle:f}]}function P3(e,t,n={autoInvoke:!1}){const r=v.useRef(null),i=v.useCallback((...c)=>{r.current||(r.current=window.setTimeout(()=>{e(c),r.current=null},t))},[t]),o=v.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return v.useEffect(()=>(n.autoInvoke&&i(),o),[o,i]),{start:i,clear:o}}function N3(e,t,n){const r=v.useRef(null),i=v.useRef(null);return v.useEffect(()=>{const o=typeof n=="function"?n():n;return(o||i.current)&&(r.current=new MutationObserver(e),r.current.observe(o||i.current,t)),()=>{var c;(c=r.current)==null||c.disconnect()}},[e,t]),i}function O3(){const[e,t]=v.useState(!1);return v.useEffect(()=>t(!0),[]),e}var M3={};function jR(){return typeof process<"u"&&M3?"production":"development"}function cp(e){var n;const t=En.version;return typeof En.version!="string"||t.startsWith("18.")?e==null?void 0:e.ref:(n=e==null?void 0:e.props)==null?void 0:n.ref}function CR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=CR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function zt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=CR(e))&&(r&&(r+=" "),r+=t);return r}const L3={};function I3(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,i])=>{t[r]?t[r]=zt(t[r],i):t[r]=i})}),t}function up({theme:e,classNames:t,props:n,stylesCtx:r}){const o=(Array.isArray(t)?t:[t]).map(c=>typeof c=="function"?c(e,n,r):c||L3);return I3(o)}function Ah({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((o,c)=>typeof c=="function"?{...o,...c(e,n,r)}:{...o,...c},{})}const yx=v.createContext(null);function Qa(){const e=v.useContext(yx);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function $3(){return Qa().cssVariablesResolver}function z3(){return Qa().classNamesPrefix}function dp(){return Qa().getStyleNonce}function U3(){return Qa().withStaticClasses}function B3(){return Qa().headless}function V3(){var e;return(e=Qa().stylesTransform)==null?void 0:e.sx}function F3(){var e;return(e=Qa().stylesTransform)==null?void 0:e.styles}function ER(){return Qa().env||"default"}function H3(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function q3(e){let t=e.replace("#","");if(t.length===3){const c=t.split("");t=[c[0],c[0],c[1],c[1],c[2],c[2]].join("")}if(t.length===8){const c=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:c}}const n=parseInt(t,16),r=n>>16&255,i=n>>8&255,o=n&255;return{r,g:i,b:o,a:1}}function G3(e){const[t,n,r,i]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:i===void 0?1:i}}function W3(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),i=parseInt(n[2],10)/100,o=parseInt(n[3],10)/100,c=n[5]?parseFloat(n[5]):void 0,u=(1-Math.abs(2*o-1))*i,f=r/60,h=u*(1-Math.abs(f%2-1)),m=o-u/2;let g,y,b;return f>=0&&f<1?(g=u,y=h,b=0):f>=1&&f<2?(g=h,y=u,b=0):f>=2&&f<3?(g=0,y=u,b=h):f>=3&&f<4?(g=0,y=h,b=u):f>=4&&f<5?(g=h,y=0,b=u):(g=u,y=0,b=h),{r:Math.round((g+m)*255),g:Math.round((y+m)*255),b:Math.round((b+m)*255),a:c||1}}function xx(e){return H3(e)?q3(e):e.startsWith("rgb")?G3(e):e.startsWith("hsl")?W3(e):{r:0,g:0,b:0,a:1}}function Jf(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:i,a:o}=xx(e),c=1-t,u=f=>Math.round(f*c);return`rgba(${u(n)}, ${u(r)}, ${u(i)}, ${o})`}function Yu(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function Dv(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function Q3(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function Y3(e){if(e.startsWith("oklch("))return(Q3(e)||0)/100;const{r:t,g:n,b:r}=xx(e),i=t/255,o=n/255,c=r/255,u=Dv(i),f=Dv(o),h=Dv(c);return .2126*u+.7152*f+.0722*h}function Pu(e,t=.179){return e.startsWith("var(")?!1:Y3(e)>t}function pi({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:Pu(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:Pu(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:Pu(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,i]=e.split("."),o=i?Number(i):void 0,c=r in t.colors;if(c){const u=o!==void 0?t.colors[r][o]:t.colors[r][Yu(t,n||"light")];return{color:r,value:u,shade:o,isThemeColor:c,isLight:Pu(u,t.luminanceThreshold),variable:i?`--mantine-color-${r}-${o}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:c,isLight:Pu(e,t.luminanceThreshold),shade:o,variable:void 0}}function Ft(e,t){const n=pi({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function wy(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=Ft(n.from,t),i=Ft(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${i} 100%)`}function ui(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const o=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${o}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:i}=xx(e);return`rgba(${n}, ${r}, ${i}, ${t})`}const Wl=ui,X3=({color:e,theme:t,variant:n,gradient:r,autoContrast:i})=>{const o=pi({color:e,theme:t}),c=typeof i=="boolean"?i:t.autoContrast;if(n==="filled"){const u=c&&o.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return o.isThemeColor?o.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:u,border:`${le(1)} solid transparent`}:{background:`var(--mantine-color-${o.color}-${o.shade})`,hover:`var(--mantine-color-${o.color}-${o.shade===9?8:o.shade+1})`,color:u,border:`${le(1)} solid transparent`}:{background:e,hover:Jf(e,.1),color:u,border:`${le(1)} solid transparent`}}if(n==="light"){if(o.isThemeColor){if(o.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`};const u=t.colors[o.color][o.shade];return{background:ui(u,.1),hover:ui(u,.12),color:`var(--mantine-color-${o.color}-${Math.min(o.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:ui(e,.1),hover:ui(e,.12),color:e,border:`${le(1)} solid transparent`}}if(n==="outline")return o.isThemeColor?o.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${le(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:ui(t.colors[o.color][o.shade],.05),color:`var(--mantine-color-${o.color}-${o.shade})`,border:`${le(1)} solid var(--mantine-color-${o.color}-${o.shade})`}:{background:"transparent",hover:ui(e,.05),color:e,border:`${le(1)} solid ${e}`};if(n==="subtle"){if(o.isThemeColor){if(o.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`};const u=t.colors[o.color][o.shade];return{background:"transparent",hover:ui(u,.12),color:`var(--mantine-color-${o.color}-${Math.min(o.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:"transparent",hover:ui(e,.12),color:e,border:`${le(1)} solid transparent`}}return n==="transparent"?o.isThemeColor?o.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${o.color}-${Math.min(o.shade,6)})`,border:`${le(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${le(1)} solid transparent`}:n==="white"?o.isThemeColor?o.shade===void 0?{background:"var(--mantine-color-white)",hover:Jf(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Jf(t.white,.01),color:`var(--mantine-color-${o.color}-${o.shade})`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Jf(t.white,.01),color:e,border:`${le(1)} solid transparent`}:n==="gradient"?{background:wy(r,t),hover:wy(r,t),color:"var(--mantine-color-white)",border:"none"}:n==="default"?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${le(1)} solid var(--mantine-color-default-border)`}:{}},K3={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"]},Kj="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",bx={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:K3,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:X3,autoContrast:!1,luminanceThreshold:.3,fontFamily:Kj,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:Kj,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:le(34),lineHeight:"1.3"},h2:{fontSize:le(26),lineHeight:"1.35"},h3:{fontSize:le(22),lineHeight:"1.4"},h4:{fontSize:le(18),lineHeight:"1.45"},h5:{fontSize:le(16),lineHeight:"1.5"},h6:{fontSize:le(14),lineHeight:"1.5"}}},fontSizes:{xs:le(12),sm:le(14),md:le(16),lg:le(18),xl:le(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:le(2),sm:le(4),md:le(8),lg:le(16),xl:le(32)},spacing:{xs:le(10),sm:le(12),md:le(16),lg:le(20),xl:le(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), 0 ${le(1)} ${le(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(10)} ${le(15)} ${le(-5)}, rgba(0, 0, 0, 0.04) 0 ${le(7)} ${le(7)} ${le(-5)}`,md:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(20)} ${le(25)} ${le(-5)}, rgba(0, 0, 0, 0.04) 0 ${le(10)} ${le(10)} ${le(-5)}`,lg:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(28)} ${le(23)} ${le(-7)}, rgba(0, 0, 0, 0.04) 0 ${le(12)} ${le(12)} ${le(-7)}`,xl:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(36)} ${le(28)} ${le(-7)}, rgba(0, 0, 0, 0.04) 0 ${le(17)} ${le(17)} ${le(-7)}`},other:{},components:{}};function Zj(e){return e==="auto"||e==="dark"||e==="light"}function Z3({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 Zj(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&&Zj(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const J3="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",Jj="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function Av(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function eC(e){if(!(e.primaryColor in e.colors))throw new Error(J3);if(typeof e.primaryShade=="object"&&(!Av(e.primaryShade.dark)||!Av(e.primaryShade.light)))throw new Error(Jj);if(typeof e.primaryShade=="number"&&!Av(e.primaryShade))throw new Error(Jj)}function eO(e,t){var r;if(!t)return eC(e),e;const n=px(e,t);return t.fontFamily&&!((r=t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),eC(n),n}const Sx=v.createContext(null),tO=()=>v.useContext(Sx)||bx;function bn(){const e=v.useContext(Sx);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 TR({theme:e,children:t,inherit:n=!0}){const r=tO(),i=v.useMemo(()=>eO(n?r:bx,e),[e,r,n]);return s.jsx(Sx.Provider,{value:i,children:t})}TR.displayName="@mantine/core/MantineThemeProvider";function nO(){const e=bn(),t=dp(),n=on(e.breakpoints).reduce((r,i)=>{const o=e.breakpoints[i].includes("px"),c=Gu(e.breakpoints[i]),u=o?`${c-.1}px`:Th(c-.1),f=o?`${c}px`:Th(c);return`${r}@media (max-width: ${u}) {.mantine-visible-from-${i} {display: none !important;}}@media (min-width: ${f}) {.mantine-hidden-from-${i} {display: none !important;}}`},"");return s.jsx("style",{"data-mantine-styles":"classes",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:n}})}function kv(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function Nu(e,t){return(Array.isArray(e)?e:[e]).reduce((r,i)=>`${i}{${r}}`,t)}function rO(e,t){const n=kv(e.variables),r=n?Nu(t,n):"",i=kv(e.dark),o=kv(e.light),c=i?Nu(t===":host"?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,i):"",u=o?Nu(t===":host"?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,o):"";return`${r}${c}${u}`}function Ya({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&pi({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function tC(e,t){return Ya({color:e.colors[e.primaryColor][Yu(e,t)],theme:e,autoContrast:null})}function eh({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n==="light"){const u=Yu(e,"light"),f={[`--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`]:Wl(e.colors[t][u],.1),[`--mantine-color-${r}-light-hover`]:Wl(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`]:Wl(e.colors[t][u],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...f}:f}const o=Yu(e,"dark"),c={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${o})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${o===9?8:o+1})`,[`--mantine-color-${r}-light`]:Wl(e.colors[t][Math.max(0,o-2)],.15),[`--mantine-color-${r}-light-hover`]:Wl(e.colors[t][Math.max(0,o-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(o-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(o-4,0)})`,[`--mantine-color-${r}-outline-hover`]:Wl(e.colors[t][Math.max(o-4,0)],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...c}:c}function iO(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function Ql(e,t,n){on(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const RR=e=>{const t=Yu(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:le(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":tC(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":tC(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)"}};Ql(r.variables,e.breakpoints,"breakpoint"),Ql(r.variables,e.spacing,"spacing"),Ql(r.variables,e.fontSizes,"font-size"),Ql(r.variables,e.lineHeights,"line-height"),Ql(r.variables,e.shadows,"shadow"),Ql(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((o,c)=>{r.variables[`--mantine-primary-color-${c}`]=`var(--mantine-color-${e.primaryColor}-${c})`}),on(e.colors).forEach(o=>{const c=e.colors[o];if(iO(c)){Object.assign(r.light,eh({theme:e,name:c.name,color:c.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,eh({theme:e,name:c.name,color:c.dark,colorScheme:"dark",withColorValues:!0}));return}c.forEach((u,f)=>{r.variables[`--mantine-color-${o}-${f}`]=u}),Object.assign(r.light,eh({theme:e,color:o,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,eh({theme:e,color:o,colorScheme:"dark",withColorValues:!1}))});const i=e.headings.sizes;return on(i).forEach(o=>{r.variables[`--mantine-${o}-font-size`]=i[o].fontSize,r.variables[`--mantine-${o}-line-height`]=i[o].lineHeight,r.variables[`--mantine-${o}-font-weight`]=i[o].fontWeight||e.headings.fontWeight}),r};function aO({theme:e,generator:t}){const n=RR(e),r=t==null?void 0:t(e);return r?px(n,r):n}const Pv=RR(bx);function oO(e){const t={variables:{},light:{},dark:{}};return on(e.variables).forEach(n=>{Pv.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),on(e.light).forEach(n=>{Pv.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),on(e.dark).forEach(n=>{Pv.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function sO(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 _R({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=bn(),r=dp(),i=$3(),o=aO({theme:n,generator:i}),c=e===":root"&&t,u=c?oO(o):o,f=rO(u,e);return f?s.jsx("style",{"data-mantine-styles":!0,nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:`${f}${c?"":sO(e)}`}}):null}_R.displayName="@mantine/CssVariables";function lO(){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 Yl(e,t){var i,o;const n=typeof window<"u"&&"matchMedia"in window&&((i=window.matchMedia("(prefers-color-scheme: dark)"))==null?void 0:i.matches),r=e!=="auto"?e:n?"dark":"light";(o=t())==null||o.setAttribute("data-mantine-color-scheme",r)}function cO({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const i=v.useRef(null),[o,c]=v.useState(()=>e.get(t)),u=r||o,f=v.useCallback(m=>{r||(Yl(m,n),c(m),e.set(m))},[e.set,u,r]),h=v.useCallback(()=>{c(t),Yl(t,n),e.clear()},[e.clear,t]);return v.useEffect(()=>(e.subscribe(f),e.unsubscribe),[e.subscribe,e.unsubscribe]),jc(()=>{Yl(e.get(t),n)},[]),v.useEffect(()=>{var g;if(r)return Yl(r,n),()=>{};r===void 0&&Yl(o,n),typeof window<"u"&&"matchMedia"in window&&(i.current=window.matchMedia("(prefers-color-scheme: dark)"));const m=y=>{o==="auto"&&Yl(y.matches?"dark":"light",n)};return(g=i.current)==null||g.addEventListener("change",m),()=>{var y;return(y=i.current)==null?void 0:y.removeEventListener("change",m)}},[o,r]),{colorScheme:u,setColorScheme:f,clearColorScheme:h}}function uO({respectReducedMotion:e,getRootElement:t}){jc(()=>{var n;e&&((n=t())==null||n.setAttribute("data-respect-reduced-motion","true"))},[e])}lO();function DR({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:i=!0,deduplicateCssVariables:o=!0,withCssVariables:c=!0,cssVariablesSelector:u=":root",classNamesPrefix:f="mantine",colorSchemeManager:h=Z3(),defaultColorScheme:m="light",getRootElement:g=()=>document.documentElement,cssVariablesResolver:y,forceColorScheme:b,stylesTransform:S,env:j}){const{colorScheme:C,setColorScheme:T,clearColorScheme:_}=cO({defaultColorScheme:m,forceColorScheme:b,manager:h,getRootElement:g});return uO({respectReducedMotion:(e==null?void 0:e.respectReducedMotion)||!1,getRootElement:g}),s.jsx(yx.Provider,{value:{colorScheme:C,setColorScheme:T,clearColorScheme:_,getRootElement:g,classNamesPrefix:f,getStyleNonce:n,cssVariablesResolver:y,cssVariablesSelector:u,withStaticClasses:r,stylesTransform:S,env:j},children:s.jsxs(TR,{theme:e,children:[c&&s.jsx(_R,{cssVariablesSelector:u,deduplicateCssVariables:o}),i&&s.jsx(nO,{}),t]})})}DR.displayName="@mantine/core/MantineProvider";function Ks({classNames:e,styles:t,props:n,stylesCtx:r}){const i=bn();return{resolvedClassNames:up({theme:i,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:Ah({theme:i,styles:t,props:n,stylesCtx:r||void 0})}}const dO={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function fO({theme:e,options:t,unstyled:n}){return zt((t==null?void 0:t.focusable)&&!n&&(e.focusClassName||dO[e.focusRing]),(t==null?void 0:t.active)&&!n&&e.activeClassName)}function hO({selector:e,stylesCtx:t,options:n,props:r,theme:i}){return up({theme:i,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||r,stylesCtx:t})[e]}function nC({selector:e,stylesCtx:t,theme:n,classNames:r,props:i}){return up({theme:n,classNames:r,props:i,stylesCtx:t})[e]}function pO({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function mO({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function gO({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(i=>`${t}-${i}-${n}`)}function vO({themeName:e,theme:t,selector:n,props:r,stylesCtx:i}){return e.map(o=>{var c,u;return(u=up({theme:t,classNames:(c=t.components[o])==null?void 0:c.classNames,props:r,stylesCtx:i}))==null?void 0:u[n]})}function yO({options:e,classes:t,selector:n,unstyled:r}){return e!=null&&e.variant&&!r?t[`${n}--${e.variant}`]:void 0}function xO({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:i,classNames:o,classes:c,unstyled:u,className:f,rootSelector:h,props:m,stylesCtx:g,withStaticClasses:y,headless:b,transformedStyles:S}){return zt(fO({theme:e,options:t,unstyled:u||b}),vO({theme:e,themeName:n,selector:r,props:m,stylesCtx:g}),yO({options:t,classes:c,selector:r,unstyled:u}),nC({selector:r,stylesCtx:g,theme:e,classNames:o,props:m}),nC({selector:r,stylesCtx:g,theme:e,classNames:S,props:m}),hO({selector:r,stylesCtx:g,options:t,props:m,theme:e}),pO({rootSelector:h,selector:r,className:f}),mO({selector:r,classes:c,unstyled:u||b}),y&&!b&&gO({themeName:n,classNamesPrefix:i,selector:r,withStaticClass:t==null?void 0:t.withStaticClass}),t==null?void 0:t.className)}function bO({theme:e,themeName:t,props:n,stylesCtx:r,selector:i}){return t.map(o=>{var c;return Ah({theme:e,styles:(c=e.components[o])==null?void 0:c.styles,props:n,stylesCtx:r})[i]}).reduce((o,c)=>({...o,...c}),{})}function jy({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...jy({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function SO(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...Wo(n[r])}}),t),{})}function wO({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:i,selector:o,themeName:c,headless:u}){var f;return(f=SO([u?{}:t==null?void 0:t(n,r,i),...c.map(h=>{var m,g,y;return(y=(g=(m=n.components)==null?void 0:m[h])==null?void 0:g.vars)==null?void 0:y.call(g,n,r,i)}),e==null?void 0:e(n,r,i)]))==null?void 0:f[o]}function jO({theme:e,themeName:t,selector:n,options:r,props:i,stylesCtx:o,rootSelector:c,styles:u,style:f,vars:h,varsResolver:m,headless:g,withStylesTransform:y}){return{...!y&&bO({theme:e,themeName:t,props:i,stylesCtx:o,selector:n}),...!y&&Ah({theme:e,styles:u,props:i,stylesCtx:o})[n],...!y&&Ah({theme:e,styles:r==null?void 0:r.styles,props:(r==null?void 0:r.props)||i,stylesCtx:o})[n],...wO({theme:e,props:i,stylesCtx:o,vars:h,varsResolver:m,selector:n,themeName:t,headless:g}),...c===n?jy({style:f,theme:e}):null,...jy({style:r==null?void 0:r.style,theme:e})}}function CO({props:e,stylesCtx:t,themeName:n}){var c;const r=bn(),i=(c=F3())==null?void 0:c();return{getTransformedStyles:u=>i?[...u.map(h=>i(h,{props:e,theme:r,ctx:t})),...n.map(h=>{var m;return i((m=r.components[h])==null?void 0:m.styles,{props:e,theme:r,ctx:t})})].filter(Boolean):[],withStylesTransform:!!i}}function Le({name:e,classes:t,props:n,stylesCtx:r,className:i,style:o,rootSelector:c="root",unstyled:u,classNames:f,styles:h,vars:m,varsResolver:g}){const y=bn(),b=z3(),S=U3(),j=B3(),C=(Array.isArray(e)?e:[e]).filter(E=>E),{withStylesTransform:T,getTransformedStyles:_}=CO({props:n,stylesCtx:r,themeName:C});return(E,R)=>({className:xO({theme:y,options:R,themeName:C,selector:E,classNamesPrefix:b,classNames:f,classes:t,unstyled:u,className:i,rootSelector:c,props:n,stylesCtx:r,withStaticClasses:S,headless:j,transformedStyles:_([R==null?void 0:R.styles,h])}),style:jO({theme:y,themeName:C,selector:E,options:R,props:n,stylesCtx:r,rootSelector:c,styles:h,style:o,vars:m,varsResolver:g,headless:j,withStylesTransform:T})})}function Zs(e,t){return typeof e=="boolean"?e:t.autoContrast}function rC(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 EO({keepTransitions:e}={}){const t=v.useRef(_h),n=v.useRef(-1),r=v.useContext(yx),i=dp(),o=v.useRef(i==null?void 0:i());if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const c=g=>{r.setColorScheme(g),t.current=e?()=>{}:rC(o.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?()=>{}:rC(o.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var g;(g=t.current)==null||g.call(t)},10)},f=g3("light",{getInitialValueInEffect:!1}),h=r.colorScheme==="auto"?f:r.colorScheme,m=v.useCallback(()=>c(h==="light"?"dark":"light"),[c,h]);return v.useEffect(()=>()=>{var g;(g=t.current)==null||g.call(t),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:c,clearColorScheme:u,toggleColorScheme:m}}function se(e,t,n){var c;const r=bn(),i=(c=r.components[e])==null?void 0:c.defaultProps,o=typeof i=="function"?i(r):i;return{...t,...o,...Wo(n)}}function Nv(e){return on(e).reduce((t,n)=>e[n]!==void 0?`${t}${r3(n)}:${e[n]};`:t,"").trim()}function TO({selector:e,styles:t,media:n,container:r}){const i=t?Nv(t):"",o=Array.isArray(n)?n.map(u=>`@media${u.query}{${e}{${Nv(u.styles)}}}`):[],c=Array.isArray(r)?r.map(u=>`@container ${u.query}{${e}{${Nv(u.styles)}}}`):[];return`${i?`${e}{${i}}`:""}${o.join("")}${c.join("")}`.trim()}function Js(e){const t=dp();return s.jsx("style",{"data-mantine-styles":"inline",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:TO(e)}})}function Xa(e){const{m:t,mx:n,my:r,mt:i,mb:o,ml:c,mr:u,me:f,ms:h,p:m,px:g,py:y,pt:b,pb:S,pl:j,pr:C,pe:T,ps:_,bd:E,bg:R,c:D,opacity:k,ff:M,fz:L,fw:z,lts:F,ta:Y,lh:W,fs:J,tt:G,td:X,w:P,miw:I,maw:$,h:H,mih:O,mah:U,bgsz:K,bgp:ee,bgr:Se,bga:be,pos:xe,top:Ge,left:Me,bottom:nt,right:ke,inset:yt,display:It,flex:$t,hiddenFrom:vt,visibleFrom:At,lightHidden:nn,darkHidden:Te,sx:De,...Qe}=e;return{styleProps:Wo({m:t,mx:n,my:r,mt:i,mb:o,ml:c,mr:u,me:f,ms:h,p:m,px:g,py:y,pt:b,pb:S,pl:j,pr:C,pe:T,ps:_,bd:E,bg:R,c:D,opacity:k,ff:M,fz:L,fw:z,lts:F,ta:Y,lh:W,fs:J,tt:G,td:X,w:P,miw:I,maw:$,h:H,mih:O,mah:U,bgsz:K,bgp:ee,bgr:Se,bga:be,pos:xe,top:Ge,left:Me,bottom:nt,right:ke,inset:yt,display:It,flex:$t,hiddenFrom:vt,visibleFrom:At,lightHidden:nn,darkHidden:Te,sx:De}),rest:Qe}}const RO={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 wx(e,t){const n=pi({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 _O(e,t){const n=pi({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:wx(e,t)}function DO(e,t){if(typeof e=="number")return le(e);if(typeof e=="string"){const[n,r,...i]=e.split(" ").filter(c=>c.trim()!=="");let o=`${le(n)}`;return r&&(o+=` ${r}`),i.length>0&&(o+=` ${wx(i.join(" "),t)}`),o.trim()}return e}const iC={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 AO(e){return typeof e=="string"&&e in iC?iC[e]:e}const kO=["h1","h2","h3","h4","h5","h6"];function PO(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&kO.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?le(e):e}function NO(e){return e}const OO=["h1","h2","h3","h4","h5","h6"];function MO(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&OO.includes(e)?`var(--mantine-${e}-line-height)`:e}function LO(e){return typeof e=="number"?le(e):e}function IO(e,t){if(typeof e=="number")return le(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return le(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const Ov={color:wx,textColor:_O,fontSize:PO,spacing:IO,identity:NO,size:LO,lineHeight:MO,fontFamily:AO,border:DO};function aC(e){return e.replace("(min-width: ","").replace("em)","")}function $O({media:e,...t}){const r=Object.keys(e).sort((i,o)=>Number(aC(i))-Number(aC(o))).map(i=>({query:i,styles:e[i]}));return{...t,media:r}}function zO(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function UO(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function BO(e){return typeof e=="object"&&e!==null?on(e).filter(t=>t!=="base"):[]}function VO(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function AR({styleProps:e,data:t,theme:n}){return $O(on(e).reduce((r,i)=>{if(i==="hiddenFrom"||i==="visibleFrom"||i==="sx")return r;const o=t[i],c=Array.isArray(o.property)?o.property:[o.property],u=UO(e[i]);if(!zO(e[i]))return c.forEach(h=>{r.inlineStyles[h]=Ov[o.type](u,n)}),r;r.hasResponsiveStyles=!0;const f=BO(e[i]);return c.forEach(h=>{u&&(r.styles[h]=Ov[o.type](u,n)),f.forEach(m=>{const g=`(min-width: ${n.breakpoints[m]})`;r.media[g]={...r.media[g],[h]:Ov[o.type](VO(e[i],m),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function ud(){return`__m__-${v.useId().replace(/:/g,"")}`}function kR(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...kR(r,t)}),{}):typeof e=="function"?e(t):e??{}}function PR(e){return e.startsWith("data-")?e:`data-${e}`}function FO(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[PR(n)]=e[n]),t},{})}function NR(e){return e?typeof e=="string"?{[PR(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...NR(n)}),{}):FO(e):null}function Cy(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Cy(r,t)}),{}):typeof e=="function"?e(t):e??{}}function HO({theme:e,style:t,vars:n,styleProps:r}){const i=Cy(t,e),o=Cy(n,e);return{...i,...o,...r}}const OR=v.forwardRef(({component:e,style:t,__vars:n,className:r,variant:i,mod:o,size:c,hiddenFrom:u,visibleFrom:f,lightHidden:h,darkHidden:m,renderRoot:g,__size:y,...b},S)=>{var L;const j=bn(),C=e||"div",{styleProps:T,rest:_}=Xa(b),E=V3(),R=(L=E==null?void 0:E())==null?void 0:L(T.sx),D=ud(),k=AR({styleProps:T,theme:j,data:RO}),M={ref:S,style:HO({theme:j,style:t,vars:n,styleProps:k.inlineStyles}),className:zt(r,R,{[D]:k.hasResponsiveStyles,"mantine-light-hidden":h,"mantine-dark-hidden":m,[`mantine-hidden-from-${u}`]:u,[`mantine-visible-from-${f}`]:f}),"data-variant":i,"data-size":hR(c)?void 0:c||void 0,size:y,...NR(o),..._};return s.jsxs(s.Fragment,{children:[k.hasResponsiveStyles&&s.jsx(Js,{selector:`.${D}`,styles:k.styles,media:k.media}),typeof g=="function"?g(M):s.jsx(C,{...M})]})});OR.displayName="@mantine/core/Box";const ce=OR;function MR(e){return e}function qO(e){const t=e;return n=>{const r=v.forwardRef((i,o)=>s.jsx(t,{...n,...i,ref:o}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r}}function ve(e){const t=v.forwardRef(e);return t.extend=MR,t.withProps=n=>{const r=v.forwardRef((i,o)=>s.jsx(t,{...n,...i,ref:o}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t}function cr(e){const t=v.forwardRef(e);return t.withProps=n=>{const r=v.forwardRef((i,o)=>s.jsx(t,{...n,...i,ref:o}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t.extend=MR,t}const GO=v.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function el(){return v.useContext(GO)}var Mv={exports:{}},rr={};/**
61
+ * @license React
62
+ * react-dom.production.js
63
+ *
64
+ * Copyright (c) Meta Platforms, Inc. and 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 oC;function WO(){if(oC)return rr;oC=1;var e=hx();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function o(f,h,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:g==null?null:""+g,children:f,containerInfo:h,implementation:m}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return rr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,rr.createPortal=function(f,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return o(f,h,null,m)},rr.flushSync=function(f){var h=c.T,m=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=h,r.p=m,r.d.f()}},rr.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},rr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},rr.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var m=h.as,g=u(m,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:b}):m==="script"&&r.d.X(f,{crossOrigin:g,integrity:y,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},rr.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=u(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},rr.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,g=u(m,h.crossOrigin);r.d.L(f,m,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},rr.preloadModule=function(f,h){if(typeof f=="string")if(h){var m=u(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},rr.requestFormReset=function(f){r.d.r(f)},rr.unstable_batchedUpdates=function(f,h){return f(h)},rr.useFormState=function(f,h,m){return c.H.useFormState(f,h,m)},rr.useFormStatus=function(){return c.H.useHostTransitionStatus()},rr.version="19.1.0",rr}var sC;function LR(){if(sC)return Mv.exports;sC=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(),Mv.exports=WO(),Mv.exports}var jx=LR();const Bu=fx(jx);function fp(){return typeof window<"u"}function Cc(e){return IR(e)?(e.nodeName||"").toLowerCase():"#document"}function _r(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ua(e){var t;return(t=(IR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function IR(e){return fp()?e instanceof Node||e instanceof _r(e).Node:!1}function vn(e){return fp()?e instanceof Element||e instanceof _r(e).Element:!1}function qr(e){return fp()?e instanceof HTMLElement||e instanceof _r(e).HTMLElement:!1}function Ey(e){return!fp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _r(e).ShadowRoot}const QO=new Set(["inline","contents"]);function dd(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=mi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!QO.has(i)}const YO=new Set(["table","td","th"]);function XO(e){return YO.has(Cc(e))}const KO=[":popover-open",":modal"];function hp(e){return KO.some(t=>{try{return e.matches(t)}catch{return!1}})}const ZO=["transform","translate","scale","rotate","perspective"],JO=["transform","translate","scale","rotate","perspective","filter"],eM=["paint","layout","strict","content"];function Cx(e){const t=pp(),n=vn(e)?mi(e):e;return ZO.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||JO.some(r=>(n.willChange||"").includes(r))||eM.some(r=>(n.contain||"").includes(r))}function tM(e){let t=Va(e);for(;qr(t)&&!Vo(t);){if(Cx(t))return t;if(hp(t))return null;t=Va(t)}return null}function pp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const nM=new Set(["html","body","#document"]);function Vo(e){return nM.has(Cc(e))}function mi(e){return _r(e).getComputedStyle(e)}function mp(e){return vn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Va(e){if(Cc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ey(e)&&e.host||ua(e);return Ey(t)?t.host:t}function $R(e){const t=Va(e);return Vo(t)?e.ownerDocument?e.ownerDocument.body:e.body:qr(t)&&dd(t)?t:$R(t)}function za(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=$R(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),c=_r(i);if(o){const u=Ty(c);return t.concat(c,c.visualViewport||[],dd(i)?i:[],u&&n?za(u):[])}return t.concat(i,za(i,[],n))}function Ty(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lC(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 Xu(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ey(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function zR(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function UR(){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 rM(e){return oM()?!1:!cC()&&e.width===0&&e.height===0||cC()&&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 iM(){return/apple/i.test(navigator.vendor)}function cC(){const e=/android/i;return e.test(zR())||e.test(UR())}function aM(){return zR().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function oM(){return UR().includes("jsdom/")}function Ry(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function sM(e){return"nativeEvent"in e}function lM(e){return e.matches("html,body")}function Ds(e){return(e==null?void 0:e.ownerDocument)||document}function Lv(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 nc(e){return"composedPath"in e?e.composedPath()[0]:e.target}const cM="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function uM(e){return qr(e)&&e.matches(cM)}const Pi=Math.min,ar=Math.max,kh=Math.round,th=Math.floor,ta=e=>({x:e,y:e}),dM={left:"right",right:"left",bottom:"top",top:"bottom"},fM={start:"end",end:"start"};function _y(e,t,n){return ar(e,Pi(t,n))}function Fa(e,t){return typeof e=="function"?e(t):e}function Ni(e){return e.split("-")[0]}function Ec(e){return e.split("-")[1]}function Ex(e){return e==="x"?"y":"x"}function Tx(e){return e==="y"?"height":"width"}const hM=new Set(["top","bottom"]);function Di(e){return hM.has(Ni(e))?"y":"x"}function Rx(e){return Ex(Di(e))}function pM(e,t,n){n===void 0&&(n=!1);const r=Ec(e),i=Rx(e),o=Tx(i);let c=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(c=Ph(c)),[c,Ph(c)]}function mM(e){const t=Ph(e);return[Dy(e),t,Dy(t)]}function Dy(e){return e.replace(/start|end/g,t=>fM[t])}const uC=["left","right"],dC=["right","left"],gM=["top","bottom"],vM=["bottom","top"];function yM(e,t,n){switch(e){case"top":case"bottom":return n?t?dC:uC:t?uC:dC;case"left":case"right":return t?gM:vM;default:return[]}}function xM(e,t,n,r){const i=Ec(e);let o=yM(Ni(e),n==="start",r);return i&&(o=o.map(c=>c+"-"+i),t&&(o=o.concat(o.map(Dy)))),o}function Ph(e){return e.replace(/left|right|bottom|top/g,t=>dM[t])}function bM(e){return{top:0,right:0,bottom:0,left:0,...e}}function _x(e){return typeof e!="number"?bM(e):{top:e,right:e,bottom:e,left:e}}function fc(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function fC(e,t,n){let{reference:r,floating:i}=e;const o=Di(t),c=Rx(t),u=Tx(c),f=Ni(t),h=o==="y",m=r.x+r.width/2-i.width/2,g=r.y+r.height/2-i.height/2,y=r[u]/2-i[u]/2;let b;switch(f){case"top":b={x:m,y:r.y-i.height};break;case"bottom":b={x:m,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:g};break;case"left":b={x:r.x-i.width,y:g};break;default:b={x:r.x,y:r.y}}switch(Ec(t)){case"start":b[c]-=y*(n&&h?-1:1);break;case"end":b[c]+=y*(n&&h?-1:1);break}return b}const SM=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:c}=n,u=o.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let h=await c.getElementRects({reference:e,floating:t,strategy:i}),{x:m,y:g}=fC(h,r,f),y=r,b={},S=0;for(let j=0;j<u.length;j++){const{name:C,fn:T}=u[j],{x:_,y:E,data:R,reset:D}=await T({x:m,y:g,initialPlacement:r,placement:y,strategy:i,middlewareData:b,rects:h,platform:c,elements:{reference:e,floating:t}});m=_??m,g=E??g,b={...b,[C]:{...b[C],...R}},D&&S<=50&&(S++,typeof D=="object"&&(D.placement&&(y=D.placement),D.rects&&(h=D.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:i}):D.rects),{x:m,y:g}=fC(h,y,f)),j=-1)}return{x:m,y:g,placement:y,strategy:i,middlewareData:b}};async function Dx(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:c,elements:u,strategy:f}=e,{boundary:h="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:y=!1,padding:b=0}=Fa(t,e),S=_x(b),C=u[y?g==="floating"?"reference":"floating":g],T=fc(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(C)))==null||n?C:C.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:h,rootBoundary:m,strategy:f})),_=g==="floating"?{x:r,y:i,width:c.floating.width,height:c.floating.height}:c.reference,E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),R=await(o.isElement==null?void 0:o.isElement(E))?await(o.getScale==null?void 0:o.getScale(E))||{x:1,y:1}:{x:1,y:1},D=fc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:_,offsetParent:E,strategy:f}):_);return{top:(T.top-D.top+S.top)/R.y,bottom:(D.bottom-T.bottom+S.bottom)/R.y,left:(T.left-D.left+S.left)/R.x,right:(D.right-T.right+S.right)/R.x}}const wM=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:c,elements:u,middlewareData:f}=t,{element:h,padding:m=0}=Fa(e,t)||{};if(h==null)return{};const g=_x(m),y={x:n,y:r},b=Rx(i),S=Tx(b),j=await c.getDimensions(h),C=b==="y",T=C?"top":"left",_=C?"bottom":"right",E=C?"clientHeight":"clientWidth",R=o.reference[S]+o.reference[b]-y[b]-o.floating[S],D=y[b]-o.reference[b],k=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h));let M=k?k[E]:0;(!M||!await(c.isElement==null?void 0:c.isElement(k)))&&(M=u.floating[E]||o.floating[S]);const L=R/2-D/2,z=M/2-j[S]/2-1,F=Pi(g[T],z),Y=Pi(g[_],z),W=F,J=M-j[S]-Y,G=M/2-j[S]/2+L,X=_y(W,G,J),P=!f.arrow&&Ec(i)!=null&&G!==X&&o.reference[S]/2-(G<W?F:Y)-j[S]/2<0,I=P?G<W?G-W:G-J:0;return{[b]:y[b]+I,data:{[b]:X,centerOffset:G-X-I,...P&&{alignmentOffset:I}},reset:P}}}),jM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:c,initialPlacement:u,platform:f,elements:h}=t,{mainAxis:m=!0,crossAxis:g=!0,fallbackPlacements:y,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:j=!0,...C}=Fa(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const T=Ni(i),_=Di(u),E=Ni(u)===u,R=await(f.isRTL==null?void 0:f.isRTL(h.floating)),D=y||(E||!j?[Ph(u)]:mM(u)),k=S!=="none";!y&&k&&D.push(...xM(u,j,S,R));const M=[u,...D],L=await Dx(t,C),z=[];let F=((r=o.flip)==null?void 0:r.overflows)||[];if(m&&z.push(L[T]),g){const G=pM(i,c,R);z.push(L[G[0]],L[G[1]])}if(F=[...F,{placement:i,overflows:z}],!z.every(G=>G<=0)){var Y,W;const G=(((Y=o.flip)==null?void 0:Y.index)||0)+1,X=M[G];if(X&&(!(g==="alignment"?_!==Di(X):!1)||F.every($=>$.overflows[0]>0&&Di($.placement)===_)))return{data:{index:G,overflows:F},reset:{placement:X}};let P=(W=F.filter(I=>I.overflows[0]<=0).sort((I,$)=>I.overflows[1]-$.overflows[1])[0])==null?void 0:W.placement;if(!P)switch(b){case"bestFit":{var J;const I=(J=F.filter($=>{if(k){const H=Di($.placement);return H===_||H==="y"}return!0}).map($=>[$.placement,$.overflows.filter(H=>H>0).reduce((H,O)=>H+O,0)]).sort(($,H)=>$[1]-H[1])[0])==null?void 0:J[0];I&&(P=I);break}case"initialPlacement":P=u;break}if(i!==P)return{reset:{placement:P}}}return{}}}};function BR(e){const t=Pi(...e.map(o=>o.left)),n=Pi(...e.map(o=>o.top)),r=ar(...e.map(o=>o.right)),i=ar(...e.map(o=>o.bottom));return{x:t,y:n,width:r-t,height:i-n}}function CM(e){const t=e.slice().sort((i,o)=>i.y-o.y),n=[];let r=null;for(let i=0;i<t.length;i++){const o=t[i];!r||o.y-r.y>r.height/2?n.push([o]):n[n.length-1].push(o),r=o}return n.map(i=>fc(BR(i)))}const EM=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:i,platform:o,strategy:c}=t,{padding:u=2,x:f,y:h}=Fa(e,t),m=Array.from(await(o.getClientRects==null?void 0:o.getClientRects(r.reference))||[]),g=CM(m),y=fc(BR(m)),b=_x(u);function S(){if(g.length===2&&g[0].left>g[1].right&&f!=null&&h!=null)return g.find(C=>f>C.left-b.left&&f<C.right+b.right&&h>C.top-b.top&&h<C.bottom+b.bottom)||y;if(g.length>=2){if(Di(n)==="y"){const F=g[0],Y=g[g.length-1],W=Ni(n)==="top",J=F.top,G=Y.bottom,X=W?F.left:Y.left,P=W?F.right:Y.right,I=P-X,$=G-J;return{top:J,bottom:G,left:X,right:P,width:I,height:$,x:X,y:J}}const C=Ni(n)==="left",T=ar(...g.map(F=>F.right)),_=Pi(...g.map(F=>F.left)),E=g.filter(F=>C?F.left===_:F.right===T),R=E[0].top,D=E[E.length-1].bottom,k=_,M=T,L=M-k,z=D-R;return{top:R,bottom:D,left:k,right:M,width:L,height:z,x:k,y:R}}return y}const j=await o.getElementRects({reference:{getBoundingClientRect:S},floating:r.floating,strategy:c});return i.reference.x!==j.reference.x||i.reference.y!==j.reference.y||i.reference.width!==j.reference.width||i.reference.height!==j.reference.height?{reset:{rects:j}}:{}}}},VR=new Set(["left","top"]);async function TM(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),c=Ni(n),u=Ec(n),f=Di(n)==="y",h=VR.has(c)?-1:1,m=o&&f?-1:1,g=Fa(t,e);let{mainAxis:y,crossAxis:b,alignmentAxis:S}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof S=="number"&&(b=u==="end"?S*-1:S),f?{x:b*m,y:y*h}:{x:y*h,y:b*m}}const RM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:c,middlewareData:u}=t,f=await TM(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+f.x,y:o+f.y,data:{...f,placement:c}}}}},_M=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:c=!1,limiter:u={fn:C=>{let{x:T,y:_}=C;return{x:T,y:_}}},...f}=Fa(e,t),h={x:n,y:r},m=await Dx(t,f),g=Di(Ni(i)),y=Ex(g);let b=h[y],S=h[g];if(o){const C=y==="y"?"top":"left",T=y==="y"?"bottom":"right",_=b+m[C],E=b-m[T];b=_y(_,b,E)}if(c){const C=g==="y"?"top":"left",T=g==="y"?"bottom":"right",_=S+m[C],E=S-m[T];S=_y(_,S,E)}const j=u.fn({...t,[y]:b,[g]:S});return{...j,data:{x:j.x-n,y:j.y-r,enabled:{[y]:o,[g]:c}}}}}},DM=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:c}=t,{offset:u=0,mainAxis:f=!0,crossAxis:h=!0}=Fa(e,t),m={x:n,y:r},g=Di(i),y=Ex(g);let b=m[y],S=m[g];const j=Fa(u,t),C=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(f){const E=y==="y"?"height":"width",R=o.reference[y]-o.floating[E]+C.mainAxis,D=o.reference[y]+o.reference[E]-C.mainAxis;b<R?b=R:b>D&&(b=D)}if(h){var T,_;const E=y==="y"?"width":"height",R=VR.has(Ni(i)),D=o.reference[g]-o.floating[E]+(R&&((T=c.offset)==null?void 0:T[g])||0)+(R?0:C.crossAxis),k=o.reference[g]+o.reference[E]+(R?0:((_=c.offset)==null?void 0:_[g])||0)-(R?C.crossAxis:0);S<D?S=D:S>k&&(S=k)}return{[y]:b,[g]:S}}}},AM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:c,elements:u}=t,{apply:f=()=>{},...h}=Fa(e,t),m=await Dx(t,h),g=Ni(i),y=Ec(i),b=Di(i)==="y",{width:S,height:j}=o.floating;let C,T;g==="top"||g==="bottom"?(C=g,T=y===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(T=g,C=y==="end"?"top":"bottom");const _=j-m.top-m.bottom,E=S-m.left-m.right,R=Pi(j-m[C],_),D=Pi(S-m[T],E),k=!t.middlewareData.shift;let M=R,L=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=_),k&&!y){const F=ar(m.left,0),Y=ar(m.right,0),W=ar(m.top,0),J=ar(m.bottom,0);b?L=S-2*(F!==0||Y!==0?F+Y:ar(m.left,m.right)):M=j-2*(W!==0||J!==0?W+J:ar(m.top,m.bottom))}await f({...t,availableWidth:L,availableHeight:M});const z=await c.getDimensions(u.floating);return S!==z.width||j!==z.height?{reset:{rects:!0}}:{}}}};function FR(e){const t=mi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=qr(e),o=i?e.offsetWidth:n,c=i?e.offsetHeight:r,u=kh(n)!==o||kh(r)!==c;return u&&(n=o,r=c),{width:n,height:r,$:u}}function Ax(e){return vn(e)?e:e.contextElement}function oc(e){const t=Ax(e);if(!qr(t))return ta(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=FR(t);let c=(o?kh(n.width):n.width)/r,u=(o?kh(n.height):n.height)/i;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const kM=ta(0);function HR(e){const t=_r(e);return!pp()||!t.visualViewport?kM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function PM(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_r(e)?!1:t}function $s(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Ax(e);let c=ta(1);t&&(r?vn(r)&&(c=oc(r)):c=oc(e));const u=PM(o,n,r)?HR(o):ta(0);let f=(i.left+u.x)/c.x,h=(i.top+u.y)/c.y,m=i.width/c.x,g=i.height/c.y;if(o){const y=_r(o),b=r&&vn(r)?_r(r):r;let S=y,j=Ty(S);for(;j&&r&&b!==S;){const C=oc(j),T=j.getBoundingClientRect(),_=mi(j),E=T.left+(j.clientLeft+parseFloat(_.paddingLeft))*C.x,R=T.top+(j.clientTop+parseFloat(_.paddingTop))*C.y;f*=C.x,h*=C.y,m*=C.x,g*=C.y,f+=E,h+=R,S=_r(j),j=Ty(S)}}return fc({width:m,height:g,x:f,y:h})}function kx(e,t){const n=mp(e).scrollLeft;return t?t.left+n:$s(ua(e)).left+n}function qR(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:kx(e,r)),o=r.top+t.scrollTop;return{x:i,y:o}}function NM(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",c=ua(r),u=t?hp(t.floating):!1;if(r===c||u&&o)return n;let f={scrollLeft:0,scrollTop:0},h=ta(1);const m=ta(0),g=qr(r);if((g||!g&&!o)&&((Cc(r)!=="body"||dd(c))&&(f=mp(r)),qr(r))){const b=$s(r);h=oc(r),m.x=b.x+r.clientLeft,m.y=b.y+r.clientTop}const y=c&&!g&&!o?qR(c,f,!0):ta(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+m.x+y.x,y:n.y*h.y-f.scrollTop*h.y+m.y+y.y}}function OM(e){return Array.from(e.getClientRects())}function MM(e){const t=ua(e),n=mp(e),r=e.ownerDocument.body,i=ar(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ar(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+kx(e);const u=-n.scrollTop;return mi(r).direction==="rtl"&&(c+=ar(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:c,y:u}}function LM(e,t){const n=_r(e),r=ua(e),i=n.visualViewport;let o=r.clientWidth,c=r.clientHeight,u=0,f=0;if(i){o=i.width,c=i.height;const h=pp();(!h||h&&t==="fixed")&&(u=i.offsetLeft,f=i.offsetTop)}return{width:o,height:c,x:u,y:f}}const IM=new Set(["absolute","fixed"]);function $M(e,t){const n=$s(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=qr(e)?oc(e):ta(1),c=e.clientWidth*o.x,u=e.clientHeight*o.y,f=i*o.x,h=r*o.y;return{width:c,height:u,x:f,y:h}}function hC(e,t,n){let r;if(t==="viewport")r=LM(e,n);else if(t==="document")r=MM(ua(e));else if(vn(t))r=$M(t,n);else{const i=HR(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return fc(r)}function GR(e,t){const n=Va(e);return n===t||!vn(n)||Vo(n)?!1:mi(n).position==="fixed"||GR(n,t)}function zM(e,t){const n=t.get(e);if(n)return n;let r=za(e,[],!1).filter(u=>vn(u)&&Cc(u)!=="body"),i=null;const o=mi(e).position==="fixed";let c=o?Va(e):e;for(;vn(c)&&!Vo(c);){const u=mi(c),f=Cx(c);!f&&u.position==="fixed"&&(i=null),(o?!f&&!i:!f&&u.position==="static"&&!!i&&IM.has(i.position)||dd(c)&&!f&&GR(e,c))?r=r.filter(m=>m!==c):i=u,c=Va(c)}return t.set(e,r),r}function UM(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const c=[...n==="clippingAncestors"?hp(t)?[]:zM(t,this._c):[].concat(n),r],u=c[0],f=c.reduce((h,m)=>{const g=hC(t,m,i);return h.top=ar(g.top,h.top),h.right=Pi(g.right,h.right),h.bottom=Pi(g.bottom,h.bottom),h.left=ar(g.left,h.left),h},hC(t,u,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function BM(e){const{width:t,height:n}=FR(e);return{width:t,height:n}}function VM(e,t,n){const r=qr(t),i=ua(t),o=n==="fixed",c=$s(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const f=ta(0);function h(){f.x=kx(i)}if(r||!r&&!o)if((Cc(t)!=="body"||dd(i))&&(u=mp(t)),r){const b=$s(t,!0,o,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}else i&&h();o&&!r&&i&&h();const m=i&&!r&&!o?qR(i,u):ta(0),g=c.left+u.scrollLeft-f.x-m.x,y=c.top+u.scrollTop-f.y-m.y;return{x:g,y,width:c.width,height:c.height}}function Iv(e){return mi(e).position==="static"}function pC(e,t){if(!qr(e)||mi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ua(e)===n&&(n=n.ownerDocument.body),n}function WR(e,t){const n=_r(e);if(hp(e))return n;if(!qr(e)){let i=Va(e);for(;i&&!Vo(i);){if(vn(i)&&!Iv(i))return i;i=Va(i)}return n}let r=pC(e,t);for(;r&&XO(r)&&Iv(r);)r=pC(r,t);return r&&Vo(r)&&Iv(r)&&!Cx(r)?n:r||tM(e)||n}const FM=async function(e){const t=this.getOffsetParent||WR,n=this.getDimensions,r=await n(e.floating);return{reference:VM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function HM(e){return mi(e).direction==="rtl"}const qM={convertOffsetParentRelativeRectToViewportRelativeRect:NM,getDocumentElement:ua,getClippingRect:UM,getOffsetParent:WR,getElementRects:FM,getClientRects:OM,getDimensions:BM,getScale:oc,isElement:vn,isRTL:HM};function QR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function GM(e,t){let n=null,r;const i=ua(e);function o(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function c(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),o();const h=e.getBoundingClientRect(),{left:m,top:g,width:y,height:b}=h;if(u||t(),!y||!b)return;const S=th(g),j=th(i.clientWidth-(m+y)),C=th(i.clientHeight-(g+b)),T=th(m),E={rootMargin:-S+"px "+-j+"px "+-C+"px "+-T+"px",threshold:ar(0,Pi(1,f))||1};let R=!0;function D(k){const M=k[0].intersectionRatio;if(M!==f){if(!R)return c();M?c(!1,M):r=setTimeout(()=>{c(!1,1e-7)},1e3)}M===1&&!QR(h,e.getBoundingClientRect())&&c(),R=!1}try{n=new IntersectionObserver(D,{...E,root:i.ownerDocument})}catch{n=new IntersectionObserver(D,E)}n.observe(e)}return c(!0),o}function WM(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,h=Ax(e),m=i||o?[...h?za(h):[],...za(t)]:[];m.forEach(T=>{i&&T.addEventListener("scroll",n,{passive:!0}),o&&T.addEventListener("resize",n)});const g=h&&u?GM(h,n):null;let y=-1,b=null;c&&(b=new ResizeObserver(T=>{let[_]=T;_&&_.target===h&&b&&(b.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var E;(E=b)==null||E.observe(t)})),n()}),h&&!f&&b.observe(h),b.observe(t));let S,j=f?$s(e):null;f&&C();function C(){const T=$s(e);j&&!QR(j,T)&&n(),j=T,S=requestAnimationFrame(C)}return n(),()=>{var T;m.forEach(_=>{i&&_.removeEventListener("scroll",n),o&&_.removeEventListener("resize",n)}),g==null||g(),(T=b)==null||T.disconnect(),b=null,f&&cancelAnimationFrame(S)}}const QM=RM,YM=_M,XM=jM,KM=AM,mC=wM,ZM=EM,JM=DM,e9=(e,t,n)=>{const r=new Map,i={platform:qM,...n},o={...i.platform,_c:r};return SM(e,t,{...i,platform:o})};var t9=typeof document<"u",n9=function(){},gh=t9?v.useLayoutEffect:n9;function Nh(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,i;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(!Nh(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Nh(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function YR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gC(e,t){const n=YR(e);return Math.round(t*n)/n}function $v(e){const t=v.useRef(e);return gh(()=>{t.current=e}),t}function r9(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:c}={},transform:u=!0,whileElementsMounted:f,open:h}=e,[m,g]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,b]=v.useState(r);Nh(y,r)||b(r);const[S,j]=v.useState(null),[C,T]=v.useState(null),_=v.useCallback($=>{$!==k.current&&(k.current=$,j($))},[]),E=v.useCallback($=>{$!==M.current&&(M.current=$,T($))},[]),R=o||S,D=c||C,k=v.useRef(null),M=v.useRef(null),L=v.useRef(m),z=f!=null,F=$v(f),Y=$v(i),W=$v(h),J=v.useCallback(()=>{if(!k.current||!M.current)return;const $={placement:t,strategy:n,middleware:y};Y.current&&($.platform=Y.current),e9(k.current,M.current,$).then(H=>{const O={...H,isPositioned:W.current!==!1};G.current&&!Nh(L.current,O)&&(L.current=O,jx.flushSync(()=>{g(O)}))})},[y,t,n,Y,W]);gh(()=>{h===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,g($=>({...$,isPositioned:!1})))},[h]);const G=v.useRef(!1);gh(()=>(G.current=!0,()=>{G.current=!1}),[]),gh(()=>{if(R&&(k.current=R),D&&(M.current=D),R&&D){if(F.current)return F.current(R,D,J);J()}},[R,D,J,F,z]);const X=v.useMemo(()=>({reference:k,floating:M,setReference:_,setFloating:E}),[_,E]),P=v.useMemo(()=>({reference:R,floating:D}),[R,D]),I=v.useMemo(()=>{const $={position:n,left:0,top:0};if(!P.floating)return $;const H=gC(P.floating,m.x),O=gC(P.floating,m.y);return u?{...$,transform:"translate("+H+"px, "+O+"px)",...YR(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:O}},[n,u,P.floating,m.x,m.y]);return v.useMemo(()=>({...m,update:J,refs:X,elements:P,floatingStyles:I}),[m,J,X,P,I])}const i9=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?mC({element:r.current,padding:i}).fn(n):{}:r?mC({element:r,padding:i}).fn(n):{}}}},XR=(e,t)=>({...QM(e),options:[e,t]}),Px=(e,t)=>({...YM(e),options:[e,t]}),vC=(e,t)=>({...JM(e),options:[e,t]}),Oh=(e,t)=>({...XM(e),options:[e,t]}),a9=(e,t)=>({...KM(e),options:[e,t]}),Hu=(e,t)=>({...ZM(e),options:[e,t]}),KR=(e,t)=>({...i9(e),options:[e,t]});function o9(e){return v.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const ZR={...S4},s9=ZR.useInsertionEffect,l9=s9||(e=>e());function $a(e){const t=v.useRef(()=>{});return l9(()=>{t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}var na=typeof document<"u"?v.useLayoutEffect:v.useEffect;let yC=!1,c9=0;const xC=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+c9++;function u9(){const[e,t]=v.useState(()=>yC?xC():void 0);return na(()=>{e==null&&t(xC())},[]),v.useEffect(()=>{yC=!0},[]),e}const d9=ZR.useId,JR=d9||u9;function f9(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(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(i=>i!==n))||[])}}}const h9=v.createContext(null),p9=v.createContext(null),Nx=()=>{var e;return((e=v.useContext(h9))==null?void 0:e.id)||null},Ox=()=>v.useContext(p9);function Mx(e){return"data-floating-ui-"+e}function zv(e){const t=v.useRef(e);return na(()=>{t.current=e}),t}const bC=Mx("safe-polygon");function vh(e,t,n){return n&&!Ry(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function m9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,events:o,elements:c}=e,{enabled:u=!0,delay:f=0,handleClose:h=null,mouseOnly:m=!1,restMs:g=0,move:y=!0}=t,b=Ox(),S=Nx(),j=zv(h),C=zv(f),T=zv(n),_=v.useRef(),E=v.useRef(-1),R=v.useRef(),D=v.useRef(-1),k=v.useRef(!0),M=v.useRef(!1),L=v.useRef(()=>{}),z=v.useRef(!1),F=v.useCallback(()=>{var I;const $=(I=i.current.openEvent)==null?void 0:I.type;return($==null?void 0:$.includes("mouse"))&&$!=="mousedown"},[i]);v.useEffect(()=>{if(!u)return;function I($){let{open:H}=$;H||(clearTimeout(E.current),clearTimeout(D.current),k.current=!0,z.current=!1)}return o.on("openchange",I),()=>{o.off("openchange",I)}},[u,o]),v.useEffect(()=>{if(!u||!j.current||!n)return;function I(H){F()&&r(!1,H,"hover")}const $=Ds(c.floating).documentElement;return $.addEventListener("mouseleave",I),()=>{$.removeEventListener("mouseleave",I)}},[c.floating,n,r,u,j,F]);const Y=v.useCallback(function(I,$,H){$===void 0&&($=!0),H===void 0&&(H="hover");const O=vh(C.current,"close",_.current);O&&!R.current?(clearTimeout(E.current),E.current=window.setTimeout(()=>r(!1,I,H),O)):$&&(clearTimeout(E.current),r(!1,I,H))},[C,r]),W=$a(()=>{L.current(),R.current=void 0}),J=$a(()=>{if(M.current){const I=Ds(c.floating).body;I.style.pointerEvents="",I.removeAttribute(bC),M.current=!1}}),G=$a(()=>i.current.openEvent?["click","mousedown"].includes(i.current.openEvent.type):!1);v.useEffect(()=>{if(!u)return;function I(U){if(clearTimeout(E.current),k.current=!1,m&&!Ry(_.current)||g>0&&!vh(C.current,"open"))return;const K=vh(C.current,"open",_.current);K?E.current=window.setTimeout(()=>{T.current||r(!0,U,"hover")},K):n||r(!0,U,"hover")}function $(U){if(G())return;L.current();const K=Ds(c.floating);if(clearTimeout(D.current),z.current=!1,j.current&&i.current.floatingContext){n||clearTimeout(E.current),R.current=j.current({...i.current.floatingContext,tree:b,x:U.clientX,y:U.clientY,onClose(){J(),W(),G()||Y(U,!0,"safe-polygon")}});const Se=R.current;K.addEventListener("mousemove",Se),L.current=()=>{K.removeEventListener("mousemove",Se)};return}(_.current==="touch"?!Xu(c.floating,U.relatedTarget):!0)&&Y(U)}function H(U){G()||i.current.floatingContext&&(j.current==null||j.current({...i.current.floatingContext,tree:b,x:U.clientX,y:U.clientY,onClose(){J(),W(),G()||Y(U)}})(U))}if(vn(c.domReference)){var O;const U=c.domReference;return n&&U.addEventListener("mouseleave",H),(O=c.floating)==null||O.addEventListener("mouseleave",H),y&&U.addEventListener("mousemove",I,{once:!0}),U.addEventListener("mouseenter",I),U.addEventListener("mouseleave",$),()=>{var K;n&&U.removeEventListener("mouseleave",H),(K=c.floating)==null||K.removeEventListener("mouseleave",H),y&&U.removeEventListener("mousemove",I),U.removeEventListener("mouseenter",I),U.removeEventListener("mouseleave",$)}}},[c,u,e,m,g,y,Y,W,J,r,n,T,b,C,j,i,G]),na(()=>{var I;if(u&&n&&(I=j.current)!=null&&I.__options.blockPointerEvents&&F()){M.current=!0;const H=c.floating;if(vn(c.domReference)&&H){var $;const O=Ds(c.floating).body;O.setAttribute(bC,"");const U=c.domReference,K=b==null||($=b.nodesRef.current.find(ee=>ee.id===S))==null||($=$.context)==null?void 0:$.elements.floating;return K&&(K.style.pointerEvents=""),O.style.pointerEvents="none",U.style.pointerEvents="auto",H.style.pointerEvents="auto",()=>{O.style.pointerEvents="",U.style.pointerEvents="",H.style.pointerEvents=""}}}},[u,n,S,c,b,j,F]),na(()=>{n||(_.current=void 0,z.current=!1,W(),J())},[n,W,J]),v.useEffect(()=>()=>{W(),clearTimeout(E.current),clearTimeout(D.current),J()},[u,c.domReference,W,J]);const X=v.useMemo(()=>{function I($){_.current=$.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove($){const{nativeEvent:H}=$;function O(){!k.current&&!T.current&&r(!0,H,"hover")}m&&!Ry(_.current)||n||g===0||z.current&&$.movementX**2+$.movementY**2<2||(clearTimeout(D.current),_.current==="touch"?O():(z.current=!0,D.current=window.setTimeout(O,g)))}}},[m,r,n,T,g]),P=v.useMemo(()=>({onMouseEnter(){clearTimeout(E.current)},onMouseLeave(I){G()||Y(I.nativeEvent,!1)}}),[Y,G]);return v.useMemo(()=>u?{reference:X,floating:P}:{},[u,X,P])}const Ay=()=>{},e2=v.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Ay,setState:Ay,isInstantPhase:!1}),g9=()=>v.useContext(e2);function v9(e){const{children:t,delay:n,timeoutMs:r=0}=e,[i,o]=v.useReducer((f,h)=>({...f,...h}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=v.useRef(null),u=v.useCallback(f=>{o({currentId:f})},[]);return na(()=>{i.currentId?c.current===null?c.current=i.currentId:i.isInstantPhase||o({isInstantPhase:!0}):(i.isInstantPhase&&o({isInstantPhase:!1}),c.current=null)},[i.currentId,i.isInstantPhase]),v.createElement(e2.Provider,{value:v.useMemo(()=>({...i,setState:o,setCurrentId:u}),[i,u])},t)}function y9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:i}=e,{id:o,enabled:c=!0}=t,u=o??i,f=g9(),{currentId:h,setCurrentId:m,initialDelay:g,setState:y,timeoutMs:b}=f;return na(()=>{c&&h&&(y({delay:{open:1,close:vh(g,"close")}}),h!==u&&r(!1))},[c,u,r,y,h,g]),na(()=>{function S(){r(!1),y({delay:g,currentId:null})}if(c&&h&&!n&&h===u){if(b){const j=window.setTimeout(S,b);return()=>{clearTimeout(j)}}S()}},[c,n,y,h,u,r,g,b]),na(()=>{c&&(m===Ay||!n||m(u))},[c,n,m,u]),f}function Uv(e,t){let n=e.filter(i=>{var o;return i.parentId===t&&((o=i.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(i=>{var o;return(o=r)==null?void 0:o.some(c=>{var u;return i.parentId===c.id&&((u=i.context)==null?void 0:u.open)})}),n=n.concat(r);return n}const x9="data-floating-ui-focusable",b9={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},S9={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},SC=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 w9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:o}=e,{enabled:c=!0,escapeKey:u=!0,outsidePress:f=!0,outsidePressEvent:h="pointerdown",referencePress:m=!1,referencePressEvent:g="pointerdown",ancestorScroll:y=!1,bubbles:b,capture:S}=t,j=Ox(),C=$a(typeof f=="function"?f:()=>!1),T=typeof f=="function"?C:f,_=v.useRef(!1),E=v.useRef(!1),{escapeKey:R,outsidePress:D}=SC(b),{escapeKey:k,outsidePress:M}=SC(S),L=v.useRef(!1),z=$a(X=>{var P;if(!n||!c||!u||X.key!=="Escape"||L.current)return;const I=(P=o.current.floatingContext)==null?void 0:P.nodeId,$=j?Uv(j.nodesRef.current,I):[];if(!R&&(X.stopPropagation(),$.length>0)){let H=!0;if($.forEach(O=>{var U;if((U=O.context)!=null&&U.open&&!O.context.dataRef.current.__escapeKeyBubbles){H=!1;return}}),!H)return}r(!1,sM(X)?X.nativeEvent:X,"escape-key")}),F=$a(X=>{var P;const I=()=>{var $;z(X),($=nc(X))==null||$.removeEventListener("keydown",I)};(P=nc(X))==null||P.addEventListener("keydown",I)}),Y=$a(X=>{var P;const I=_.current;_.current=!1;const $=E.current;if(E.current=!1,h==="click"&&$||I||typeof T=="function"&&!T(X))return;const H=nc(X),O="["+Mx("inert")+"]",U=Ds(i.floating).querySelectorAll(O);let K=vn(H)?H:null;for(;K&&!Vo(K);){const xe=Va(K);if(Vo(xe)||!vn(xe))break;K=xe}if(U.length&&vn(H)&&!lM(H)&&!Xu(H,i.floating)&&Array.from(U).every(xe=>!Xu(K,xe)))return;if(qr(H)&&G){const xe=H.clientWidth>0&&H.scrollWidth>H.clientWidth,Ge=H.clientHeight>0&&H.scrollHeight>H.clientHeight;let Me=Ge&&X.offsetX>H.clientWidth;if(Ge&&mi(H).direction==="rtl"&&(Me=X.offsetX<=H.offsetWidth-H.clientWidth),Me||xe&&X.offsetY>H.clientHeight)return}const ee=(P=o.current.floatingContext)==null?void 0:P.nodeId,Se=j&&Uv(j.nodesRef.current,ee).some(xe=>{var Ge;return Lv(X,(Ge=xe.context)==null?void 0:Ge.elements.floating)});if(Lv(X,i.floating)||Lv(X,i.domReference)||Se)return;const be=j?Uv(j.nodesRef.current,ee):[];if(be.length>0){let xe=!0;if(be.forEach(Ge=>{var Me;if((Me=Ge.context)!=null&&Me.open&&!Ge.context.dataRef.current.__outsidePressBubbles){xe=!1;return}}),!xe)return}r(!1,X,"outside-press")}),W=$a(X=>{var P;const I=()=>{var $;Y(X),($=nc(X))==null||$.removeEventListener(h,I)};(P=nc(X))==null||P.addEventListener(h,I)});v.useEffect(()=>{if(!n||!c)return;o.current.__escapeKeyBubbles=R,o.current.__outsidePressBubbles=D;let X=-1;function P(U){r(!1,U,"ancestor-scroll")}function I(){window.clearTimeout(X),L.current=!0}function $(){X=window.setTimeout(()=>{L.current=!1},pp()?5:0)}const H=Ds(i.floating);u&&(H.addEventListener("keydown",k?F:z,k),H.addEventListener("compositionstart",I),H.addEventListener("compositionend",$)),T&&H.addEventListener(h,M?W:Y,M);let O=[];return y&&(vn(i.domReference)&&(O=za(i.domReference)),vn(i.floating)&&(O=O.concat(za(i.floating))),!vn(i.reference)&&i.reference&&i.reference.contextElement&&(O=O.concat(za(i.reference.contextElement)))),O=O.filter(U=>{var K;return U!==((K=H.defaultView)==null?void 0:K.visualViewport)}),O.forEach(U=>{U.addEventListener("scroll",P,{passive:!0})}),()=>{u&&(H.removeEventListener("keydown",k?F:z,k),H.removeEventListener("compositionstart",I),H.removeEventListener("compositionend",$)),T&&H.removeEventListener(h,M?W:Y,M),O.forEach(U=>{U.removeEventListener("scroll",P)}),window.clearTimeout(X)}},[o,i,u,T,h,n,r,y,c,R,D,z,k,F,Y,M,W]),v.useEffect(()=>{_.current=!1},[T,h]);const J=v.useMemo(()=>({onKeyDown:z,[b9[g]]:X=>{m&&r(!1,X.nativeEvent,"reference-press")}}),[z,r,m,g]),G=v.useMemo(()=>({onKeyDown:z,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[S9[h]]:()=>{_.current=!0}}),[z,h]);return v.useMemo(()=>c?{reference:J,floating:G}:{},[c,J,G])}function j9(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=JR(),o=v.useRef({}),[c]=v.useState(()=>f9()),u=Nx()!=null,[f,h]=v.useState(r.reference),m=$a((b,S,j)=>{o.current.openEvent=b?S:void 0,c.emit("openchange",{open:b,event:S,reason:j,nested:u}),n==null||n(b,S,j)}),g=v.useMemo(()=>({setPositionReference:h}),[]),y=v.useMemo(()=>({reference:f||r.reference||null,floating:r.floating||null,domReference:r.reference}),[f,r.reference,r.floating]);return v.useMemo(()=>({dataRef:o,open:t,onOpenChange:m,elements:y,events:c,floatingId:i,refs:g}),[t,m,y,c,i,g])}function Lx(e){e===void 0&&(e={});const{nodeId:t}=e,n=j9({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[o,c]=v.useState(null),[u,f]=v.useState(null),m=(i==null?void 0:i.domReference)||o,g=v.useRef(null),y=Ox();na(()=>{m&&(g.current=m)},[m]);const b=r9({...e,elements:{...i,...u&&{reference:u}}}),S=v.useCallback(E=>{const R=vn(E)?{getBoundingClientRect:()=>E.getBoundingClientRect(),contextElement:E}:E;f(R),b.refs.setReference(R)},[b.refs]),j=v.useCallback(E=>{(vn(E)||E===null)&&(g.current=E,c(E)),(vn(b.refs.reference.current)||b.refs.reference.current===null||E!==null&&!vn(E))&&b.refs.setReference(E)},[b.refs]),C=v.useMemo(()=>({...b.refs,setReference:j,setPositionReference:S,domReference:g}),[b.refs,j,S]),T=v.useMemo(()=>({...b.elements,domReference:m}),[b.elements,m]),_=v.useMemo(()=>({...b,...r,refs:C,elements:T,nodeId:t}),[b,C,T,t,r]);return na(()=>{r.dataRef.current.floatingContext=_;const E=y==null?void 0:y.nodesRef.current.find(R=>R.id===t);E&&(E.context=_)}),v.useMemo(()=>({...b,context:_,refs:C,elements:T}),[b,C,T,_])}function C9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,dataRef:o,elements:c}=e,{enabled:u=!0,visibleOnly:f=!0}=t,h=v.useRef(!1),m=v.useRef(),g=v.useRef(!0);v.useEffect(()=>{if(!u)return;const b=_r(c.domReference);function S(){!n&&qr(c.domReference)&&c.domReference===lC(Ds(c.domReference))&&(h.current=!0)}function j(){g.current=!0}return b.addEventListener("blur",S),b.addEventListener("keydown",j,!0),()=>{b.removeEventListener("blur",S),b.removeEventListener("keydown",j,!0)}},[c.domReference,n,u]),v.useEffect(()=>{if(!u)return;function b(S){let{reason:j}=S;(j==="reference-press"||j==="escape-key")&&(h.current=!0)}return i.on("openchange",b),()=>{i.off("openchange",b)}},[i,u]),v.useEffect(()=>()=>{clearTimeout(m.current)},[]);const y=v.useMemo(()=>({onPointerDown(b){rM(b.nativeEvent)||(g.current=!1)},onMouseLeave(){h.current=!1},onFocus(b){if(h.current)return;const S=nc(b.nativeEvent);if(f&&vn(S))try{if(iM()&&aM())throw Error();if(!S.matches(":focus-visible"))return}catch{if(!g.current&&!uM(S))return}r(!0,b.nativeEvent,"focus")},onBlur(b){h.current=!1;const S=b.relatedTarget,j=b.nativeEvent,C=vn(S)&&S.hasAttribute(Mx("focus-guard"))&&S.getAttribute("data-type")==="outside";m.current=window.setTimeout(()=>{var T;const _=lC(c.domReference?c.domReference.ownerDocument:document);!S&&_===c.domReference||Xu((T=o.current.floatingContext)==null?void 0:T.refs.floating.current,_)||Xu(c.domReference,_)||C||r(!1,j,"focus")})}}),[o,c.domReference,r,f]);return v.useMemo(()=>u?{reference:y}:{},[u,y])}const wC="active",jC="selected";function Bv(e,t,n){const r=new Map,i=n==="item";let o=e;if(i&&e){const{[wC]:c,[jC]:u,...f}=e;o=f}return{...n==="floating"&&{tabIndex:-1,[x9]:""},...o,...t.map(c=>{const u=c?c[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((c,u)=>(u&&Object.entries(u).forEach(f=>{let[h,m]=f;if(!(i&&[wC,jC].includes(h)))if(h.indexOf("on")===0){if(r.has(h)||r.set(h,[]),typeof m=="function"){var g;(g=r.get(h))==null||g.push(m),c[h]=function(){for(var y,b=arguments.length,S=new Array(b),j=0;j<b;j++)S[j]=arguments[j];return(y=r.get(h))==null?void 0:y.map(C=>C(...S)).find(C=>C!==void 0)}}}else c[h]=m}),c),{})}}function E9(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),i=v.useCallback(u=>Bv(u,e,"reference"),t),o=v.useCallback(u=>Bv(u,e,"floating"),n),c=v.useCallback(u=>Bv(u,e,"item"),r);return v.useMemo(()=>({getReferenceProps:i,getFloatingProps:o,getItemProps:c}),[i,o,c])}const T9=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function R9(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:i}=e,{enabled:o=!0,role:c="dialog"}=t,u=(n=T9.get(c))!=null?n:c,f=JR(),m=Nx()!=null,g=v.useMemo(()=>u==="tooltip"||c==="label"?{["aria-"+(c==="label"?"labelledby":"describedby")]:r?i:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":u==="alertdialog"?"dialog":u,"aria-controls":r?i:void 0,...u==="listbox"&&{role:"combobox"},...u==="menu"&&{id:f},...u==="menu"&&m&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[u,i,m,r,f,c]),y=v.useMemo(()=>{const S={id:i,...u&&{role:u}};return u==="tooltip"||c==="label"?S:{...S,...u==="menu"&&{"aria-labelledby":f}}},[u,i,f,c]),b=v.useCallback(S=>{let{active:j,selected:C}=S;const T={role:"option",...j&&{id:i+"-option"}};switch(c){case"select":return{...T,"aria-selected":j&&C};case"combobox":return{...T,...j&&{"aria-selected":!0}}}return{}},[i,c]);return v.useMemo(()=>o?{reference:g,floating:y,item:b}:{},[o,g,y,b])}const[_9,yi]=vr("ScrollArea.Root component was not found in tree");function hc(e,t){const n=Es(t);jc(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}const D9=v.forwardRef((e,t)=>{const{style:n,...r}=e,i=yi(),[o,c]=v.useState(0),[u,f]=v.useState(0),h=!!(o&&u);return hc(i.scrollbarX,()=>{var g;const m=((g=i.scrollbarX)==null?void 0:g.offsetHeight)||0;i.onCornerHeightChange(m),f(m)}),hc(i.scrollbarY,()=>{var g;const m=((g=i.scrollbarY)==null?void 0:g.offsetWidth)||0;i.onCornerWidthChange(m),c(m)}),h?s.jsx("div",{...r,ref:t,style:{...n,width:o,height:u}}):null}),A9=v.forwardRef((e,t)=>{const n=yi(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(D9,{...e,ref:t}):null}),k9={scrollHideDelay:1e3,type:"hover"},t2=v.forwardRef((e,t)=>{const n=se("ScrollAreaRoot",k9,e),{type:r,scrollHideDelay:i,scrollbars:o,...c}=n,[u,f]=v.useState(null),[h,m]=v.useState(null),[g,y]=v.useState(null),[b,S]=v.useState(null),[j,C]=v.useState(null),[T,_]=v.useState(0),[E,R]=v.useState(0),[D,k]=v.useState(!1),[M,L]=v.useState(!1),z=Bn(t,F=>f(F));return s.jsx(_9,{value:{type:r,scrollHideDelay:i,scrollArea:u,viewport:h,onViewportChange:m,content:g,onContentChange:y,scrollbarX:b,onScrollbarXChange:S,scrollbarXEnabled:D,onScrollbarXEnabledChange:k,scrollbarY:j,onScrollbarYChange:C,scrollbarYEnabled:M,onScrollbarYEnabledChange:L,onCornerWidthChange:_,onCornerHeightChange:R},children:s.jsx(ce,{...c,ref:z,__vars:{"--sa-corner-width":o!=="xy"?"0px":`${T}px`,"--sa-corner-height":o!=="xy"?"0px":`${E}px`}})})});t2.displayName="@mantine/core/ScrollAreaRoot";function n2(e,t){const n=e/t;return Number.isNaN(n)?0:n}function gp(e){const t=n2(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function r2(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 P9(e,[t,n]){return Math.min(n,Math.max(t,e))}function CC(e,t,n="ltr"){const r=gp(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,c=t.content-t.viewport,u=o-r,f=n==="ltr"?[0,c]:[c*-1,0],h=P9(e,f);return r2([0,c],[0,u])(h)}function N9(e,t,n,r="ltr"){const i=gp(n),o=i/2,c=t||o,u=i-c,f=n.scrollbar.paddingStart+c,h=n.scrollbar.size-n.scrollbar.paddingEnd-u,m=n.content-n.viewport,g=r==="ltr"?[0,m]:[m*-1,0];return r2([f,h],g)(e)}function i2(e,t){return e>0&&e<t}function Uo(e){return e?parseInt(e,10):0}function Ls(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e==null||e(r),(n===!1||!r.defaultPrevented)&&(t==null||t(r))}}const[O9,a2]=vr("ScrollAreaScrollbar was not found in tree"),o2=v.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:f,onWheelScroll:h,onResize:m,...g}=e,y=yi(),[b,S]=v.useState(null),j=Bn(t,L=>S(L)),C=v.useRef(null),T=v.useRef(""),{viewport:_}=y,E=n.content-n.viewport,R=Es(h),D=Es(u),k=sp(m,10),M=L=>{if(C.current){const z=L.clientX-C.current.left,F=L.clientY-C.current.top;f({x:z,y:F})}};return v.useEffect(()=>{const L=z=>{const F=z.target;(b==null?void 0:b.contains(F))&&R(z,E)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[_,b,E,R]),v.useEffect(D,[n,D]),hc(b,k),hc(y.content,k),s.jsx(O9,{value:{scrollbar:b,hasThumb:r,onThumbChange:Es(i),onThumbPointerUp:Es(o),onThumbPositionChange:D,onThumbPointerDown:Es(c)},children:s.jsx("div",{...g,ref:j,"data-mantine-scrollbar":!0,style:{position:"absolute",...g.style},onPointerDown:Ls(e.onPointerDown,L=>{L.preventDefault(),L.button===0&&(L.target.setPointerCapture(L.pointerId),C.current=b.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",M(L))}),onPointerMove:Ls(e.onPointerMove,M),onPointerUp:Ls(e.onPointerUp,L=>{const z=L.target;z.hasPointerCapture(L.pointerId)&&(L.preventDefault(),z.releasePointerCapture(L.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=T.current,C.current=null}})})}),s2=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:i,...o}=e,c=yi(),[u,f]=v.useState(),h=v.useRef(null),m=Bn(t,h,c.onScrollbarXChange);return v.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),s.jsx(o2,{"data-orientation":"horizontal",...o,ref:m,sizes:n,style:{...i,"--sa-thumb-width":`${gp(n)}px`},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,y)=>{if(c.viewport){const b=c.viewport.scrollLeft+g.deltaX;e.onWheelScroll(b),i2(b,y)&&g.preventDefault()}},onResize:()=>{h.current&&c.viewport&&u&&r({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:Uo(u.paddingLeft),paddingEnd:Uo(u.paddingRight)}})}})});s2.displayName="@mantine/core/ScrollAreaScrollbarX";const l2=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:i,...o}=e,c=yi(),[u,f]=v.useState(),h=v.useRef(null),m=Bn(t,h,c.onScrollbarYChange);return v.useEffect(()=>{h.current&&f(window.getComputedStyle(h.current))},[]),s.jsx(o2,{...o,"data-orientation":"vertical",ref:m,sizes:n,style:{"--sa-thumb-height":`${gp(n)}px`,...i},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,y)=>{if(c.viewport){const b=c.viewport.scrollTop+g.deltaY;e.onWheelScroll(b),i2(b,y)&&g.preventDefault()}},onResize:()=>{h.current&&c.viewport&&u&&r({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:Uo(u.paddingTop),paddingEnd:Uo(u.paddingBottom)}})}})});l2.displayName="@mantine/core/ScrollAreaScrollbarY";const vp=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:i}=el(),o=yi(),c=v.useRef(null),u=v.useRef(0),[f,h]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=n2(f.viewport,f.content),g={...r,sizes:f,onSizesChange:h,hasThumb:m>0&&m<1,onThumbChange:b=>{c.current=b},onThumbPointerUp:()=>{u.current=0},onThumbPointerDown:b=>{u.current=b}},y=(b,S)=>N9(b,u.current,f,S);return n==="horizontal"?s.jsx(s2,{...g,ref:t,onThumbPositionChange:()=>{if(o.viewport&&c.current){const b=o.viewport.scrollLeft,S=CC(b,f,i);c.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:b=>{o.viewport&&(o.viewport.scrollLeft=b)},onDragScroll:b=>{o.viewport&&(o.viewport.scrollLeft=y(b,i))}}):n==="vertical"?s.jsx(l2,{...g,ref:t,onThumbPositionChange:()=>{if(o.viewport&&c.current){const b=o.viewport.scrollTop,S=CC(b,f);f.scrollbar.size===0?c.current.style.setProperty("--thumb-opacity","0"):c.current.style.setProperty("--thumb-opacity","1"),c.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:b=>{o.viewport&&(o.viewport.scrollTop=b)},onDragScroll:b=>{o.viewport&&(o.viewport.scrollTop=y(b))}}):null});vp.displayName="@mantine/core/ScrollAreaScrollbarVisible";const Ix=v.forwardRef((e,t)=>{const n=yi(),{forceMount:r,...i}=e,[o,c]=v.useState(!1),u=e.orientation==="horizontal",f=sp(()=>{if(n.viewport){const h=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;c(u?h:m)}},10);return hc(n.viewport,f),hc(n.content,f),r||o?s.jsx(vp,{"data-state":o?"visible":"hidden",...i,ref:t}):null});Ix.displayName="@mantine/core/ScrollAreaScrollbarAuto";const c2=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=yi(),[o,c]=v.useState(!1);return v.useEffect(()=>{const{scrollArea:u}=i;let f=0;if(u){const h=()=>{window.clearTimeout(f),c(!0)},m=()=>{f=window.setTimeout(()=>c(!1),i.scrollHideDelay)};return u.addEventListener("pointerenter",h),u.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",h),u.removeEventListener("pointerleave",m)}}},[i.scrollArea,i.scrollHideDelay]),n||o?s.jsx(Ix,{"data-state":o?"visible":"hidden",...r,ref:t}):null});c2.displayName="@mantine/core/ScrollAreaScrollbarHover";const M9=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=yi(),o=e.orientation==="horizontal",[c,u]=v.useState("hidden"),f=sp(()=>u("idle"),100);return v.useEffect(()=>{if(c==="idle"){const h=window.setTimeout(()=>u("hidden"),i.scrollHideDelay);return()=>window.clearTimeout(h)}},[c,i.scrollHideDelay]),v.useEffect(()=>{const{viewport:h}=i,m=o?"scrollLeft":"scrollTop";if(h){let g=h[m];const y=()=>{const b=h[m];g!==b&&(u("scrolling"),f()),g=b};return h.addEventListener("scroll",y),()=>h.removeEventListener("scroll",y)}},[i.viewport,o,f]),n||c!=="hidden"?s.jsx(vp,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ls(e.onPointerEnter,()=>u("interacting")),onPointerLeave:Ls(e.onPointerLeave,()=>u("idle"))}):null}),ky=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=yi(),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:c}=i,u=e.orientation==="horizontal";return v.useEffect(()=>(u?o(!0):c(!0),()=>{u?o(!1):c(!1)}),[u,o,c]),i.type==="hover"?s.jsx(c2,{...r,ref:t,forceMount:n}):i.type==="scroll"?s.jsx(M9,{...r,ref:t,forceMount:n}):i.type==="auto"?s.jsx(Ix,{...r,ref:t,forceMount:n}):i.type==="always"?s.jsx(vp,{...r,ref:t}):null});ky.displayName="@mantine/core/ScrollAreaScrollbar";function L9(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},c=n.left!==o.left,u=n.top!==o.top;(c||u)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)}const u2=v.forwardRef((e,t)=>{const{style:n,...r}=e,i=yi(),o=a2(),{onThumbPositionChange:c}=o,u=Bn(t,m=>o.onThumbChange(m)),f=v.useRef(void 0),h=sp(()=>{f.current&&(f.current(),f.current=void 0)},100);return v.useEffect(()=>{const{viewport:m}=i;if(m){const g=()=>{if(h(),!f.current){const y=L9(m,c);f.current=y,c()}};return c(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[i.viewport,h,c]),s.jsx("div",{"data-state":o.hasThumb?"visible":"hidden",...r,ref:u,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:Ls(e.onPointerDownCapture,m=>{const y=m.target.getBoundingClientRect(),b=m.clientX-y.left,S=m.clientY-y.top;o.onThumbPointerDown({x:b,y:S})}),onPointerUp:Ls(e.onPointerUp,o.onThumbPointerUp)})});u2.displayName="@mantine/core/ScrollAreaThumb";const Py=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=a2();return n||i.hasThumb?s.jsx(u2,{ref:t,...r}):null});Py.displayName="@mantine/core/ScrollAreaThumb";const d2=v.forwardRef(({children:e,style:t,...n},r)=>{const i=yi(),o=Bn(r,i.onViewportChange);return s.jsx(ce,{...n,ref:o,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...t},children:s.jsx("div",{style:{minWidth:"100%"},ref:i.onContentChange,children:e})})});d2.displayName="@mantine/core/ScrollAreaViewport";var $x={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const f2={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},I9=(e,{scrollbarSize:t,overscrollBehavior:n})=>({root:{"--scrollarea-scrollbar-size":le(t),"--scrollarea-over-scroll-behavior":n}}),Yr=ve((e,t)=>{const n=se("ScrollArea",f2,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,scrollbarSize:f,vars:h,type:m,scrollHideDelay:g,viewportProps:y,viewportRef:b,onScrollPositionChange:S,children:j,offsetScrollbars:C,scrollbars:T,onBottomReached:_,onTopReached:E,overscrollBehavior:R,...D}=n,[k,M]=v.useState(!1),[L,z]=v.useState(!1),[F,Y]=v.useState(!1),W=Le({name:"ScrollArea",props:n,classes:$x,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:h,varsResolver:I9}),J=v.useRef(null),G=o9([b,J]);return v.useEffect(()=>{if(!J.current||C!=="present")return;const X=J.current,P=new ResizeObserver(()=>{const{scrollHeight:I,clientHeight:$,scrollWidth:H,clientWidth:O}=X;z(I>$),Y(H>O)});return P.observe(X),()=>P.disconnect()},[J,C]),s.jsxs(t2,{type:m==="never"?"always":m,scrollHideDelay:g,ref:t,scrollbars:T,...W("root"),...D,children:[s.jsx(d2,{...y,...W("viewport",{style:y==null?void 0:y.style}),ref:G,"data-offset-scrollbars":C===!0?"xy":C||void 0,"data-scrollbars":T||void 0,"data-horizontal-hidden":C==="present"&&!F?"true":void 0,"data-vertical-hidden":C==="present"&&!L?"true":void 0,onScroll:X=>{var H;(H=y==null?void 0:y.onScroll)==null||H.call(y,X),S==null||S({x:X.currentTarget.scrollLeft,y:X.currentTarget.scrollTop});const{scrollTop:P,scrollHeight:I,clientHeight:$}=X.currentTarget;P-(I-$)>=-.6&&(_==null||_()),P===0&&(E==null||E())},children:j}),(T==="xy"||T==="x")&&s.jsx(ky,{...W("scrollbar"),orientation:"horizontal","data-hidden":m==="never"||C==="present"&&!F?!0:void 0,forceMount:!0,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:s.jsx(Py,{...W("thumb")})}),(T==="xy"||T==="y")&&s.jsx(ky,{...W("scrollbar"),orientation:"vertical","data-hidden":m==="never"||C==="present"&&!L?!0:void 0,forceMount:!0,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:s.jsx(Py,{...W("thumb")})}),s.jsx(A9,{...W("corner"),"data-hovered":k||void 0,"data-hidden":m==="never"||void 0})]})});Yr.displayName="@mantine/core/ScrollArea";const yp=ve((e,t)=>{const{children:n,classNames:r,styles:i,scrollbarSize:o,scrollHideDelay:c,type:u,dir:f,offsetScrollbars:h,viewportRef:m,onScrollPositionChange:g,unstyled:y,variant:b,viewportProps:S,scrollbars:j,style:C,vars:T,onBottomReached:_,onTopReached:E,...R}=se("ScrollAreaAutosize",f2,e);return s.jsx(ce,{...R,ref:t,style:[{display:"flex",overflow:"auto"},C],children:s.jsx(ce,{style:{display:"flex",flexDirection:"column",flex:1},children:s.jsx(Yr,{classNames:r,styles:i,scrollHideDelay:c,scrollbarSize:o,type:u,dir:f,offsetScrollbars:h,viewportRef:m,onScrollPositionChange:g,unstyled:y,variant:b,viewportProps:S,vars:T,scrollbars:j,onBottomReached:_,onTopReached:E,children:n})})})});Yr.classes=$x;yp.displayName="@mantine/core/ScrollAreaAutosize";yp.classes=$x;Yr.Autosize=yp;var h2={root:"m_87cf2631"};const $9={__staticSelector:"UnstyledButton"},tr=cr((e,t)=>{const n=se("UnstyledButton",$9,e),{className:r,component:i="button",__staticSelector:o,unstyled:c,classNames:u,styles:f,style:h,...m}=n,g=Le({name:o,props:n,classes:h2,className:r,style:h,classNames:u,styles:f,unstyled:c});return s.jsx(ce,{...g("root",{focusable:!0}),component:i,ref:t,type:i==="button"?"button":void 0,...m})});tr.classes=h2;tr.displayName="@mantine/core/UnstyledButton";var p2={root:"m_515a97f8"};const z9={},zx=ve((e,t)=>{const n=se("VisuallyHidden",z9,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,...h}=n,m=Le({name:"VisuallyHidden",classes:p2,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u});return s.jsx(ce,{component:"span",ref:t,...m("root"),...h})});zx.classes=p2;zx.displayName="@mantine/core/VisuallyHidden";var m2={root:"m_1b7284a3"};const U9={},B9=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:Bt(t),"--paper-shadow":mx(n)}}),lr=cr((e,t)=>{const n=se("Paper",U9,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,withBorder:f,vars:h,radius:m,shadow:g,variant:y,mod:b,...S}=n,j=Le({name:"Paper",props:n,classes:m2,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:h,varsResolver:B9});return s.jsx(ce,{ref:t,mod:[{"data-with-border":f},b],...j("root"),variant:y,...S})});lr.classes=m2;lr.displayName="@mantine/core/Paper";function g2(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),i=n==="right"?"left":"right";return r===void 0?i:`${i}-${r}`}return t}function EC(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function TC(e,t,n,r,i){return e==="center"||r==="center"?{left:t}:e==="end"?{[i==="ltr"?"right":"left"]:n}:e==="start"?{[i==="ltr"?"left":"right"]:n}:{}}const V9={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function F9({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,arrowX:o,arrowY:c,dir:u}){const[f,h="center"]=e.split("-"),m={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[V9[f]]:r},g=-t/2;return f==="left"?{...m,...EC(h,c,n,i),right:g,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:f==="right"?{...m,...EC(h,c,n,i),left:g,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:f==="top"?{...m,...TC(h,o,n,i,u),bottom:g,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:f==="bottom"?{...m,...TC(h,o,n,i,u),top:g,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const Ux=v.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,visible:o,arrowX:c,arrowY:u,style:f,...h},m)=>{const{dir:g}=el();return o?s.jsx("div",{...h,ref:m,style:{...f,...F9({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,dir:g,arrowX:c,arrowY:u})}}):null});Ux.displayName="@mantine/core/FloatingArrow";var v2={root:"m_9814e45f"};const H9={zIndex:Qr("modal")},q9=(e,{gradient:t,color:n,backgroundOpacity:r,blur:i,radius:o,zIndex:c})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&ui(n||"#000",r??.6)||void 0,"--overlay-filter":i?`blur(${le(i)})`:void 0,"--overlay-radius":o===void 0?void 0:Bt(o),"--overlay-z-index":c==null?void 0:c.toString()}}),pc=cr((e,t)=>{const n=se("Overlay",H9,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,fixed:h,center:m,children:g,radius:y,zIndex:b,gradient:S,blur:j,color:C,backgroundOpacity:T,mod:_,...E}=n,R=Le({name:"Overlay",props:n,classes:v2,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:q9});return s.jsx(ce,{ref:t,...R("root"),mod:[{center:m,fixed:h},_],...E,children:g})});pc.classes=v2;pc.displayName="@mantine/core/Overlay";function Vv(e){const t=document.createElement("div");return t.setAttribute("data-portal","true"),typeof e.className=="string"&&t.classList.add(...e.className.split(" ").filter(Boolean)),typeof e.style=="object"&&Object.assign(t.style,e.style),typeof e.id=="string"&&t.setAttribute("id",e.id),t}function G9({target:e,reuseTargetNode:t,...n}){if(e)return typeof e=="string"?document.querySelector(e)||Vv(n):e;if(t){const r=document.querySelector("[data-mantine-shared-portal-node]");if(r)return r;const i=Vv(n);return i.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(i),i}return Vv(n)}const W9={},y2=ve((e,t)=>{const{children:n,target:r,reuseTargetNode:i,...o}=se("Portal",W9,e),[c,u]=v.useState(!1),f=v.useRef(null);return jc(()=>(u(!0),f.current=G9({target:r,reuseTargetNode:i,...o}),Qu(t,f.current),!r&&!i&&f.current&&document.body.appendChild(f.current),()=>{!r&&!i&&f.current&&document.body.removeChild(f.current)}),[r]),!c||!f.current?null:jx.createPortal(s.jsx(s.Fragment,{children:n}),f.current)});y2.displayName="@mantine/core/Portal";const Qo=ve(({withinPortal:e=!0,children:t,...n},r)=>ER()==="test"||!e?s.jsx(s.Fragment,{children:t}):s.jsx(y2,{ref:r,...n,children:t}));Qo.displayName="@mantine/core/OptionalPortal";const Ou=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),nh={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(30px)"},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-30px)"},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(30px)"},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-30px)"},transitionProperty:"opacity, transform"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:{...Ou("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...Ou("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...Ou("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...Ou("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...Ou("top"),common:{transformOrigin:"top right"}}},RC={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function Q9({transition:e,state:t,duration:n,timingFunction:r}){const i={WebkitBackfaceVisibility:"hidden",willChange:"transform, opacity",transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in nh?{transitionProperty:nh[e].transitionProperty,...i,...nh[e].common,...nh[e][RC[t]]}:{}:{transitionProperty:e.transitionProperty,...i,...e.common,...e[RC[t]]}}function Y9({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:i,onExit:o,onEntered:c,onExited:u,enterDelay:f,exitDelay:h}){const m=bn(),g=vx(),y=m.respectReducedMotion?g:!1,[b,S]=v.useState(y?0:e),[j,C]=v.useState(r?"entered":"exited"),T=v.useRef(-1),_=v.useRef(-1),E=v.useRef(-1);function R(){window.clearTimeout(T.current),window.clearTimeout(_.current),cancelAnimationFrame(E.current)}const D=M=>{R();const L=M?i:o,z=M?c:u,F=y?0:M?e:t;S(F),F===0?(typeof L=="function"&&L(),typeof z=="function"&&z(),C(M?"entered":"exited")):E.current=requestAnimationFrame(()=>{Bu.flushSync(()=>{C(M?"pre-entering":"pre-exiting")}),E.current=requestAnimationFrame(()=>{typeof L=="function"&&L(),C(M?"entering":"exiting"),T.current=window.setTimeout(()=>{typeof z=="function"&&z(),C(M?"entered":"exited")},F)})})},k=M=>{if(R(),typeof(M?f:h)!="number"){D(M);return}_.current=window.setTimeout(()=>{D(M)},M?f:h)};return Ba(()=>{k(r)},[r]),v.useEffect(()=>()=>{R()},[]),{transitionDuration:b,transitionStatus:j,transitionTimingFunction:n||"ease"}}function da({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:i,children:o,timingFunction:c="ease",onExit:u,onEntered:f,onEnter:h,onExited:m,enterDelay:g,exitDelay:y}){const b=ER(),{transitionDuration:S,transitionStatus:j,transitionTimingFunction:C}=Y9({mounted:i,exitDuration:r,duration:n,timingFunction:c,onExit:u,onEntered:f,onEnter:h,onExited:m,enterDelay:g,exitDelay:y});return S===0||b==="test"?i?s.jsx(s.Fragment,{children:o({})}):e?o({display:"none"}):null:j==="exited"?e?o({display:"none"}):null:s.jsx(s.Fragment,{children:o(Q9({transition:t,duration:S,state:j,timingFunction:C}))})}da.displayName="@mantine/core/Transition";const[X9,x2]=vr("Popover component was not found in the tree");function xp({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const i=w3(t),o=Bn(i,r);return Ga(e)?v.cloneElement(e,{[n]:o}):e}function b2(e){return s.jsx(zx,{tabIndex:-1,"data-autofocus":!0,...e})}xp.displayName="@mantine/core/FocusTrap";b2.displayName="@mantine/core/FocusTrapInitialFocus";xp.InitialFocus=b2;var S2={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const K9={},Bx=ve((e,t)=>{var C,T,_,E;const n=se("PopoverDropdown",K9,e),{className:r,style:i,vars:o,children:c,onKeyDownCapture:u,variant:f,classNames:h,styles:m,...g}=n,y=x2(),b=yR({opened:y.opened,shouldReturnFocus:y.returnFocus}),S=y.withRoles?{"aria-labelledby":y.getTargetId(),id:y.getDropdownId(),role:"dialog",tabIndex:-1}:{},j=Bn(t,y.floating);return y.disabled?null:s.jsx(Qo,{...y.portalProps,withinPortal:y.withinPortal,children:s.jsx(da,{mounted:y.opened,...y.transitionProps,transition:((C=y.transitionProps)==null?void 0:C.transition)||"fade",duration:((T=y.transitionProps)==null?void 0:T.duration)??150,keepMounted:y.keepMounted,exitDuration:typeof((_=y.transitionProps)==null?void 0:_.exitDuration)=="number"?y.transitionProps.exitDuration:(E=y.transitionProps)==null?void 0:E.duration,children:R=>s.jsx(xp,{active:y.trapFocus&&y.opened,innerRef:j,children:s.jsxs(ce,{...S,...g,variant:f,onKeyDownCapture:c3(()=>{var D,k;(D=y.onClose)==null||D.call(y),(k=y.onDismiss)==null||k.call(y)},{active:y.closeOnEscape,onTrigger:b,onKeyDown:u}),"data-position":y.placement,"data-fixed":y.floatingStrategy==="fixed"||void 0,...y.getStyles("dropdown",{className:r,props:n,classNames:h,styles:m,style:[{...R,zIndex:y.zIndex,top:y.y??0,left:y.x??0,width:y.width==="target"?void 0:le(y.width)},y.resolvedStyles.dropdown,m==null?void 0:m.dropdown,i]}),children:[c,s.jsx(Ux,{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:h,styles:m})})]})})})})});Bx.classes=S2;Bx.displayName="@mantine/core/PopoverDropdown";const Z9={refProp:"ref",popupType:"dialog"},w2=ve((e,t)=>{const{children:n,refProp:r,popupType:i,...o}=se("PopoverTarget",Z9,e);if(!Ga(n))throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const c=o,u=x2(),f=Bn(u.reference,cp(n),t),h=u.withRoles?{"aria-haspopup":i,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:u.getTargetId()}:{};return v.cloneElement(n,{...c,...h,...u.targetProps,className:zt(u.targetProps.className,c.className,n.props.className),[r]:f,...u.controlled?null:{onClick:u.onToggle}})});w2.displayName="@mantine/core/PopoverTarget";function j2({opened:e,floating:t,position:n,positionDependencies:r}){const[i,o]=v.useState(0);v.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current&&e)return WM(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,i,n]),Ba(()=>{t.update()},r),Ba(()=>{o(c=>c+1)},[e])}function J9(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 e5(e,t){const n=J9(e.middlewares),r=[XR(e.offset)];return n.shift&&r.push(Px(typeof n.shift=="boolean"?{limiter:vC(),padding:5}:{limiter:vC(),padding:5,...n.shift})),n.flip&&r.push(typeof n.flip=="boolean"?Oh():Oh(n.flip)),n.inline&&r.push(typeof n.inline=="boolean"?Hu():Hu(n.inline)),r.push(KR({element:e.arrowRef,padding:e.arrowOffset})),(n.size||e.width==="target")&&r.push(a9({...typeof n.size=="boolean"?{}:n.size,apply({rects:i,availableWidth:o,availableHeight:c,...u}){var m;const h=((m=t().refs.floating.current)==null?void 0:m.style)??{};n.size&&(typeof n.size=="object"&&n.size.apply?n.size.apply({rects:i,availableWidth:o,availableHeight:c,...u}):Object.assign(h,{maxWidth:`${o}px`,maxHeight:`${c}px`})),e.width==="target"&&Object.assign(h,{width:`${i.reference.width}px`})}})),r}function t5(e){const[t,n]=Xn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=v.useRef(t),i=()=>{t&&!e.disabled&&n(!1)},o=()=>!e.disabled&&n(!t),c=Lx({strategy:e.strategy,placement:e.position,middleware:e5(e,()=>c)});return j2({opened:t,position:e.position,positionDependencies:e.positionDependencies||[],floating:c}),Ba(()=>{var u;(u=e.onPositionChange)==null||u.call(e,c.placement)},[c.placement]),Ba(()=>{var u,f;t!==r.current&&(t?(f=e.onOpen)==null||f.call(e):(u=e.onClose)==null||u.call(e)),r.current=t},[t,e.onClose,e.onOpen]),{floating:c,controlled:typeof e.opened=="boolean",opened:t,onClose:i,onToggle:o}}const n5={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:Qr("popover"),__staticSelector:"Popover",width:"max-content"},r5=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:Bt(t),"--popover-shadow":mx(n)}});function Li(e){var ze,xt,ht,qt,kt,cn;const t=se("Popover",n5,e),{children:n,position:r,offset:i,onPositionChange:o,positionDependencies:c,opened:u,transitionProps:f,onExitTransitionEnd:h,onEnterTransitionEnd:m,width:g,middlewares:y,withArrow:b,arrowSize:S,arrowOffset:j,arrowRadius:C,arrowPosition:T,unstyled:_,classNames:E,styles:R,closeOnClickOutside:D,withinPortal:k,portalProps:M,closeOnEscape:L,clickOutsideEvents:z,trapFocus:F,onClose:Y,onDismiss:W,onOpen:J,onChange:G,zIndex:X,radius:P,shadow:I,id:$,defaultOpened:H,__staticSelector:O,withRoles:U,disabled:K,returnFocus:ee,variant:Se,keepMounted:be,vars:xe,floatingStrategy:Ge,withOverlay:Me,overlayProps:nt,...ke}=t,yt=Le({name:O,props:t,classes:S2,classNames:E,styles:R,unstyled:_,rootSelector:"dropdown",vars:xe,varsResolver:r5}),{resolvedStyles:It}=Ks({classNames:E,styles:R,props:t}),$t=v.useRef(null),[vt,At]=v.useState(null),[nn,Te]=v.useState(null),{dir:De}=el(),Qe=yr($),Re=t5({middlewares:y,width:g,position:g2(De,r),offset:typeof i=="number"?i+(b?S/2:0):i,arrowRef:$t,arrowOffset:j,onPositionChange:o,positionDependencies:c,opened:u,defaultOpened:H,onChange:G,onOpen:J,onClose:Y,onDismiss:W,strategy:Ge,disabled:K});h3(()=>{D&&(Re.onClose(),W==null||W())},z,[vt,nn]);const me=v.useCallback(Ct=>{At(Ct),Re.floating.refs.setReference(Ct)},[Re.floating.refs.setReference]),ge=v.useCallback(Ct=>{Te(Ct),Re.floating.refs.setFloating(Ct)},[Re.floating.refs.setFloating]),Ne=v.useCallback(()=>{var Ct;(Ct=f==null?void 0:f.onExited)==null||Ct.call(f),h==null||h()},[f==null?void 0:f.onExited,h]),we=v.useCallback(()=>{var Ct;(Ct=f==null?void 0:f.onEntered)==null||Ct.call(f),m==null||m()},[f==null?void 0:f.onEntered,m]);return s.jsxs(X9,{value:{returnFocus:ee,disabled:K,controlled:Re.controlled,reference:me,floating:ge,x:Re.floating.x,y:Re.floating.y,arrowX:(ht=(xt=(ze=Re.floating)==null?void 0:ze.middlewareData)==null?void 0:xt.arrow)==null?void 0:ht.x,arrowY:(cn=(kt=(qt=Re.floating)==null?void 0:qt.middlewareData)==null?void 0:kt.arrow)==null?void 0:cn.y,opened:Re.opened,arrowRef:$t,transitionProps:{...f,onExited:Ne,onEntered:we},width:g,withArrow:b,arrowSize:S,arrowOffset:j,arrowRadius:C,arrowPosition:T,placement:Re.floating.placement,trapFocus:F,withinPortal:k,portalProps:M,zIndex:X,radius:P,shadow:I,closeOnEscape:L,onDismiss:W,onClose:Re.onClose,onToggle:Re.onToggle,getTargetId:()=>`${Qe}-target`,getDropdownId:()=>`${Qe}-dropdown`,withRoles:U,targetProps:ke,__staticSelector:O,classNames:E,styles:R,unstyled:_,variant:Se,keepMounted:be,getStyles:yt,resolvedStyles:It,floatingStrategy:Ge},children:[n,Me&&s.jsx(da,{transition:"fade",mounted:Re.opened,duration:(f==null?void 0:f.duration)||250,exitDuration:(f==null?void 0:f.exitDuration)||250,children:Ct=>s.jsx(Qo,{withinPortal:k,children:s.jsx(pc,{...nt,...yt("overlay",{className:nt==null?void 0:nt.className,style:[Ct,nt==null?void 0:nt.style]})})})})]})}Li.Target=w2;Li.Dropdown=Bx;Li.displayName="@mantine/core/Popover";Li.extend=e=>e;var Ai={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 C2=v.forwardRef(({className:e,...t},n)=>s.jsxs(ce,{component:"span",className:zt(Ai.barsLoader,e),...t,ref:n,children:[s.jsx("span",{className:Ai.bar}),s.jsx("span",{className:Ai.bar}),s.jsx("span",{className:Ai.bar})]}));C2.displayName="@mantine/core/Bars";const E2=v.forwardRef(({className:e,...t},n)=>s.jsxs(ce,{component:"span",className:zt(Ai.dotsLoader,e),...t,ref:n,children:[s.jsx("span",{className:Ai.dot}),s.jsx("span",{className:Ai.dot}),s.jsx("span",{className:Ai.dot})]}));E2.displayName="@mantine/core/Dots";const T2=v.forwardRef(({className:e,...t},n)=>s.jsx(ce,{component:"span",className:zt(Ai.ovalLoader,e),...t,ref:n}));T2.displayName="@mantine/core/Oval";const R2={bars:C2,oval:T2,dots:E2},i5={loaders:R2,type:"oval"},a5=(e,{size:t,color:n})=>({root:{"--loader-size":rt(t,"loader-size"),"--loader-color":n?Ft(n,e):void 0}}),Ar=ve((e,t)=>{const n=se("Loader",i5,e),{size:r,color:i,type:o,vars:c,className:u,style:f,classNames:h,styles:m,unstyled:g,loaders:y,variant:b,children:S,...j}=n,C=Le({name:"Loader",props:n,classes:Ai,className:u,style:f,classNames:h,styles:m,unstyled:g,vars:c,varsResolver:a5});return S?s.jsx(ce,{...C("root"),ref:t,...j,children:S}):s.jsx(ce,{...C("root"),ref:t,component:y[o],variant:b,size:r,...j})});Ar.defaultLoaders=R2;Ar.classes=Ai;Ar.displayName="@mantine/core/Loader";var Tc={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const _C={orientation:"horizontal"},o5=(e,{borderWidth:t})=>({group:{"--ai-border-width":le(t)}}),Vx=ve((e,t)=>{const n=se("ActionIconGroup",_C,e),{className:r,style:i,classNames:o,styles:c,unstyled:u,orientation:f,vars:h,borderWidth:m,variant:g,mod:y,...b}=se("ActionIconGroup",_C,e),S=Le({name:"ActionIconGroup",props:n,classes:Tc,className:r,style:i,classNames:o,styles:c,unstyled:u,vars:h,varsResolver:o5,rootSelector:"group"});return s.jsx(ce,{...S("group"),ref:t,variant:g,mod:[{"data-orientation":f},y],role:"group",...b})});Vx.classes=Tc;Vx.displayName="@mantine/core/ActionIconGroup";const DC={},s5=(e,{radius:t,color:n,gradient:r,variant:i,autoContrast:o,size:c})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:o});return{groupSection:{"--section-height":rt(c,"section-height"),"--section-padding-x":rt(c,"section-padding-x"),"--section-fz":On(c),"--section-radius":t===void 0?void 0:Bt(t),"--section-bg":n||i?u.background:void 0,"--section-color":u.color,"--section-bd":n||i?u.border:void 0}}},Fx=ve((e,t)=>{const n=se("ActionIconGroupSection",DC,e),{className:r,style:i,classNames:o,styles:c,unstyled:u,vars:f,variant:h,gradient:m,radius:g,autoContrast:y,...b}=se("ActionIconGroupSection",DC,e),S=Le({name:"ActionIconGroupSection",props:n,classes:Tc,className:r,style:i,classNames:o,styles:c,unstyled:u,vars:f,varsResolver:s5,rootSelector:"groupSection"});return s.jsx(ce,{...S("groupSection"),ref:t,variant:h,...b})});Fx.classes=Tc;Fx.displayName="@mantine/core/ActionIconGroupSection";const l5={},c5=(e,{size:t,radius:n,variant:r,gradient:i,color:o,autoContrast:c})=>{const u=e.variantColorResolver({color:o||e.primaryColor,theme:e,gradient:i,variant:r||"filled",autoContrast:c});return{root:{"--ai-size":rt(t,"ai-size"),"--ai-radius":n===void 0?void 0:Bt(n),"--ai-bg":o||r?u.background:void 0,"--ai-hover":o||r?u.hover:void 0,"--ai-hover-color":o||r?u.hoverColor:void 0,"--ai-color":u.color,"--ai-bd":o||r?u.border:void 0}}},An=cr((e,t)=>{const n=se("ActionIcon",l5,e),{className:r,unstyled:i,variant:o,classNames:c,styles:u,style:f,loading:h,loaderProps:m,size:g,color:y,radius:b,__staticSelector:S,gradient:j,vars:C,children:T,disabled:_,"data-disabled":E,autoContrast:R,mod:D,...k}=n,M=Le({name:["ActionIcon",S],props:n,className:r,style:f,classes:Tc,classNames:c,styles:u,unstyled:i,vars:C,varsResolver:c5});return s.jsxs(tr,{...M("root",{active:!_&&!h&&!E}),...k,unstyled:i,variant:o,size:g,disabled:_||h,ref:t,mod:[{loading:h,disabled:_||E},D],children:[s.jsx(da,{mounted:!!h,transition:"slide-down",duration:150,children:L=>s.jsx(ce,{component:"span",...M("loader",{style:L}),"aria-hidden":!0,children:s.jsx(Ar,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...m})})}),s.jsx(ce,{component:"span",mod:{loading:h},...M("icon"),children:T})]})});An.classes=Tc;An.displayName="@mantine/core/ActionIcon";An.Group=Vx;An.GroupSection=Fx;const _2=v.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...n},r)=>s.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:e,height:e},ref:r,...n,children:s.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}));_2.displayName="@mantine/core/CloseIcon";var D2={root:"m_86a44da5","root--subtle":"m_220c80f2"};const u5={variant:"subtle"},d5=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":rt(t,"cb-size"),"--cb-radius":n===void 0?void 0:Bt(n),"--cb-icon-size":le(r)}}),Yo=cr((e,t)=>{const n=se("CloseButton",u5,e),{iconSize:r,children:i,vars:o,radius:c,className:u,classNames:f,style:h,styles:m,unstyled:g,"data-disabled":y,disabled:b,variant:S,icon:j,mod:C,__staticSelector:T,..._}=n,E=Le({name:T||"CloseButton",props:n,className:u,style:h,classes:D2,classNames:f,styles:m,unstyled:g,vars:o,varsResolver:d5});return s.jsxs(tr,{ref:t,..._,unstyled:g,variant:S,disabled:b,mod:[{disabled:b||y},C],...E("root",{variant:S,active:!b&&!y}),children:[j||s.jsx(_2,{}),i]})});Yo.classes=D2;Yo.displayName="@mantine/core/CloseButton";function f5(e){return v.Children.toArray(e).filter(Boolean)}var A2={root:"m_4081bf90"};const h5={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},p5=(e,{grow:t,preventGrowOverflow:n,gap:r,align:i,justify:o,wrap:c},{childWidth:u})=>({root:{"--group-child-width":t&&n?u:void 0,"--group-gap":Nn(r),"--group-align":i,"--group-justify":o,"--group-wrap":c}}),je=ve((e,t)=>{const n=se("Group",h5,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,children:f,gap:h,align:m,justify:g,wrap:y,grow:b,preventGrowOverflow:S,vars:j,variant:C,__size:T,mod:_,...E}=n,R=f5(f),D=R.length,k=Nn(h??"md"),L={childWidth:`calc(${100/D}% - (${k} - ${k} / ${D}))`},z=Le({name:"Group",props:n,stylesCtx:L,className:i,style:o,classes:A2,classNames:r,styles:c,unstyled:u,vars:j,varsResolver:p5});return s.jsx(ce,{...z("root"),ref:t,variant:C,mod:[{grow:b},_],size:T,...E,children:R})});je.classes=A2;je.displayName="@mantine/core/Group";const[m5,Ka]=vr("ModalBase component was not found in tree");function g5({opened:e,transitionDuration:t}){const[n,r]=v.useState(e),i=v.useRef(-1),c=vx()?0:t;return v.useEffect(()=>(e?(r(!0),window.clearTimeout(i.current)):c===0?r(!1):i.current=window.setTimeout(()=>r(!1),c),()=>window.clearTimeout(i.current)),[e,c]),n}function v5({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:i,onClose:o,returnFocus:c}){const u=yr(e),[f,h]=v.useState(!1),[m,g]=v.useState(!1),y=typeof(t==null?void 0:t.duration)=="number"?t==null?void 0:t.duration:200,b=g5({opened:n,transitionDuration:y});return wR("keydown",S=>{var j;S.key==="Escape"&&i&&!S.isComposing&&n&&((j=S.target)==null?void 0:j.getAttribute("data-mantine-stop-propagation"))!=="true"&&o()},{capture:!0}),yR({opened:n,shouldReturnFocus:r&&c}),{_id:u,titleMounted:f,bodyMounted:m,shouldLockScroll:b,setTitleMounted:h,setBodyMounted:g}}const k2=v.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:i,onExitTransitionEnd:o,onEnterTransitionEnd:c,trapFocus:u,closeOnEscape:f,returnFocus:h,closeOnClickOutside:m,withinPortal:g,portalProps:y,lockScroll:b,children:S,zIndex:j,shadow:C,padding:T,__vars:_,unstyled:E,removeScrollProps:R,...D},k)=>{const{_id:M,titleMounted:L,bodyMounted:z,shouldLockScroll:F,setTitleMounted:Y,setBodyMounted:W}=v5({id:r,transitionProps:i,opened:t,trapFocus:u,closeOnEscape:f,onClose:n,returnFocus:h}),{key:J,...G}=R||{};return s.jsx(Qo,{...y,withinPortal:g,children:s.jsx(m5,{value:{opened:t,onClose:n,closeOnClickOutside:m,onExitTransitionEnd:o,onEnterTransitionEnd:c,transitionProps:{...i,keepMounted:e},getTitleId:()=>`${M}-title`,getBodyId:()=>`${M}-body`,titleMounted:L,bodyMounted:z,setTitleMounted:Y,setBodyMounted:W,trapFocus:u,closeOnEscape:f,zIndex:j,unstyled:E},children:s.jsx(dc,{enabled:F&&b,...G,children:s.jsx(ce,{ref:k,...D,__vars:{..._,"--mb-z-index":(j||Qr("modal")).toString(),"--mb-shadow":mx(C),"--mb-padding":Nn(T)},children:S})},J)})})});k2.displayName="@mantine/core/ModalBase";function y5(){const e=Ka();return v.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var mc={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const P2=v.forwardRef(({className:e,...t},n)=>{const r=y5(),i=Ka();return s.jsx(ce,{ref:n,...t,id:r,className:zt({[mc.body]:!i.unstyled},e)})});P2.displayName="@mantine/core/ModalBaseBody";const N2=v.forwardRef(({className:e,onClick:t,...n},r)=>{const i=Ka();return s.jsx(Yo,{ref:r,...n,onClick:o=>{i.onClose(),t==null||t(o)},className:zt({[mc.close]:!i.unstyled},e),unstyled:i.unstyled})});N2.displayName="@mantine/core/ModalBaseCloseButton";const O2=v.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:i,...o},c)=>{const u=Ka();return s.jsx(da,{mounted:u.opened,transition:"pop",...u.transitionProps,onExited:()=>{var f,h,m;(f=u.onExitTransitionEnd)==null||f.call(u),(m=(h=u.transitionProps)==null?void 0:h.onExited)==null||m.call(h)},onEntered:()=>{var f,h,m;(f=u.onEnterTransitionEnd)==null||f.call(u),(m=(h=u.transitionProps)==null?void 0:h.onEntered)==null||m.call(h)},...e,children:f=>s.jsx("div",{...n,className:zt({[mc.inner]:!u.unstyled},n.className),children:s.jsx(xp,{active:u.opened&&u.trapFocus,innerRef:c,children:s.jsx(lr,{...o,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:[i,f],className:zt({[mc.content]:!u.unstyled},t),unstyled:u.unstyled,children:o.children})})})})});O2.displayName="@mantine/core/ModalBaseContent";const M2=v.forwardRef(({className:e,...t},n)=>{const r=Ka();return s.jsx(ce,{component:"header",ref:n,className:zt({[mc.header]:!r.unstyled},e),...t})});M2.displayName="@mantine/core/ModalBaseHeader";const x5={duration:200,timingFunction:"ease",transition:"fade"};function b5(e){const t=Ka();return{...x5,...t.transitionProps,...e}}const L2=v.forwardRef(({onClick:e,transitionProps:t,style:n,visible:r,...i},o)=>{const c=Ka(),u=b5(t);return s.jsx(da,{mounted:r!==void 0?r:c.opened,...u,transition:"fade",children:f=>s.jsx(pc,{ref:o,fixed:!0,style:[n,f],zIndex:c.zIndex,unstyled:c.unstyled,onClick:h=>{e==null||e(h),c.closeOnClickOutside&&c.onClose()},...i})})});L2.displayName="@mantine/core/ModalBaseOverlay";function S5(){const e=Ka();return v.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const I2=v.forwardRef(({className:e,...t},n)=>{const r=S5(),i=Ka();return s.jsx(ce,{component:"h2",ref:n,className:zt({[mc.title]:!i.unstyled},e),...t,id:r})});I2.displayName="@mantine/core/ModalBaseTitle";function w5({children:e}){return s.jsx(s.Fragment,{children:e})}const[j5,C5]=Wa({size:"sm"}),E5={},$2=ve((e,t)=>{const n=se("InputClearButton",E5,e),{size:r,variant:i,vars:o,classNames:c,styles:u,...f}=n,h=C5(),{resolvedClassNames:m,resolvedStyles:g}=Ks({classNames:c,styles:u,props:n});return s.jsx(Yo,{variant:i||"transparent",ref:t,size:r||(h==null?void 0:h.size)||"sm",classNames:m,styles:g,__staticSelector:"InputClearButton",...f})});$2.displayName="@mantine/core/InputClearButton";const[T5,Rc]=Wa({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var xi={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 AC={},R5=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${On(t)} - ${le(2)})`}}),bp=ve((e,t)=>{const n=se("InputDescription",AC,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,size:h,__staticSelector:m,__inheritStyles:g=!0,variant:y,...b}=se("InputDescription",AC,n),S=Rc(),j=Le({name:["InputWrapper",m],props:n,classes:xi,className:i,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"description",vars:f,varsResolver:R5}),C=g&&(S==null?void 0:S.getStyles)||j;return s.jsx(ce,{component:"p",ref:t,variant:y,size:h,...C("description",S!=null&&S.getStyles?{className:i,style:o}:void 0),...b})});bp.classes=xi;bp.displayName="@mantine/core/InputDescription";const _5={},D5=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${On(t)} - ${le(2)})`}}),Sp=ve((e,t)=>{const n=se("InputError",_5,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,size:h,__staticSelector:m,__inheritStyles:g=!0,variant:y,...b}=n,S=Le({name:["InputWrapper",m],props:n,classes:xi,className:i,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"error",vars:f,varsResolver:D5}),j=Rc(),C=g&&(j==null?void 0:j.getStyles)||S;return s.jsx(ce,{component:"p",ref:t,variant:y,size:h,...C("error",j!=null&&j.getStyles?{className:i,style:o}:void 0),...b})});Sp.classes=xi;Sp.displayName="@mantine/core/InputError";const kC={labelElement:"label"},A5=(e,{size:t})=>({label:{"--input-label-size":On(t),"--input-asterisk-color":void 0}}),fd=ve((e,t)=>{const n=se("InputLabel",kC,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,labelElement:h,size:m,required:g,htmlFor:y,onMouseDown:b,children:S,__staticSelector:j,variant:C,mod:T,..._}=se("InputLabel",kC,n),E=Le({name:["InputWrapper",j],props:n,classes:xi,className:i,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"label",vars:f,varsResolver:A5}),R=Rc(),D=(R==null?void 0:R.getStyles)||E;return s.jsxs(ce,{...D("label",R!=null&&R.getStyles?{className:i,style:o}:void 0),component:h,variant:C,size:m,ref:t,htmlFor:h==="label"?y:void 0,mod:[{required:g},T],onMouseDown:k=>{b==null||b(k),!k.defaultPrevented&&k.detail>1&&k.preventDefault()},..._,children:[S,g&&s.jsx("span",{...D("required"),"aria-hidden":!0,children:" *"})]})});fd.classes=xi;fd.displayName="@mantine/core/InputLabel";const PC={},Hx=ve((e,t)=>{const n=se("InputPlaceholder",PC,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,__staticSelector:h,variant:m,error:g,mod:y,...b}=se("InputPlaceholder",PC,n),S=Le({name:["InputPlaceholder",h],props:n,classes:xi,className:i,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"placeholder"});return s.jsx(ce,{...S("placeholder"),mod:[{error:!!g},y],component:"span",variant:m,ref:t,...b})});Hx.classes=xi;Hx.displayName="@mantine/core/InputPlaceholder";function k5(e,{hasDescription:t,hasError:n}){const r=e.findIndex(f=>f==="input"),i=e.slice(0,r),o=e.slice(r+1),c=t&&i.includes("description")||n&&i.includes("error");return{offsetBottom:t&&o.includes("description")||n&&o.includes("error"),offsetTop:c}}const P5={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},N5=(e,{size:t})=>({label:{"--input-label-size":On(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${On(t)} - ${le(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${On(t)} - ${le(2)})`}}),qx=ve((e,t)=>{const n=se("InputWrapper",P5,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,size:h,variant:m,__staticSelector:g,inputContainer:y,inputWrapperOrder:b,label:S,error:j,description:C,labelProps:T,descriptionProps:_,errorProps:E,labelElement:R,children:D,withAsterisk:k,id:M,required:L,__stylesApiProps:z,mod:F,...Y}=n,W=Le({name:["InputWrapper",g],props:z||n,classes:xi,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:N5}),J={size:h,variant:m,__staticSelector:g},G=yr(M),X=typeof k=="boolean"?k:L,P=(E==null?void 0:E.id)||`${G}-error`,I=(_==null?void 0:_.id)||`${G}-description`,$=G,H=!!j&&typeof j!="boolean",O=!!C,U=`${H?P:""} ${O?I:""}`,K=U.trim().length>0?U.trim():void 0,ee=(T==null?void 0:T.id)||`${G}-label`,Se=S&&s.jsx(fd,{labelElement:R,id:ee,htmlFor:$,required:X,...J,...T,children:S},"label"),be=O&&s.jsx(bp,{..._,...J,size:(_==null?void 0:_.size)||J.size,id:(_==null?void 0:_.id)||I,children:C},"description"),xe=s.jsx(v.Fragment,{children:y(D)},"input"),Ge=H&&v.createElement(Sp,{...E,...J,size:(E==null?void 0:E.size)||J.size,key:"error",id:(E==null?void 0:E.id)||P},j),Me=b.map(nt=>{switch(nt){case"label":return Se;case"input":return xe;case"description":return be;case"error":return Ge;default:return null}});return s.jsx(T5,{value:{getStyles:W,describedBy:K,inputId:$,labelId:ee,...k5(b,{hasDescription:O,hasError:H})},children:s.jsx(ce,{ref:t,variant:m,size:h,mod:[{error:!!j},F],...W("root"),...Y,children:Me})})});qx.classes=xi;qx.displayName="@mantine/core/InputWrapper";const O5={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},M5=(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":rt(t.size,"input-height"),"--input-fz":On(t.size),"--input-radius":t.radius===void 0?void 0:Bt(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?le(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?le(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?rt(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),pn=cr((e,t)=>{const n=se("Input",O5,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,required:f,__staticSelector:h,__stylesApiProps:m,size:g,wrapperProps:y,error:b,disabled:S,leftSection:j,leftSectionProps:C,leftSectionWidth:T,rightSection:_,rightSectionProps:E,rightSectionWidth:R,rightSectionPointerEvents:D,leftSectionPointerEvents:k,variant:M,vars:L,pointer:z,multiline:F,radius:Y,id:W,withAria:J,withErrorStyles:G,mod:X,inputSize:P,__clearSection:I,__clearable:$,__defaultRightSection:H,...O}=n,{styleProps:U,rest:K}=Xa(O),ee=Rc(),Se={offsetBottom:ee==null?void 0:ee.offsetBottom,offsetTop:ee==null?void 0:ee.offsetTop},be=Le({name:["Input",h],props:m||n,classes:xi,className:i,style:o,classNames:r,styles:c,unstyled:u,stylesCtx:Se,rootSelector:"wrapper",vars:L,varsResolver:M5}),xe=J?{required:f,disabled:S,"aria-invalid":!!b,"aria-describedby":ee==null?void 0:ee.describedBy,id:(ee==null?void 0:ee.inputId)||W}:{},Ge=_||$&&I||H;return s.jsx(j5,{value:{size:g||"sm"},children:s.jsxs(ce,{...be("wrapper"),...U,...y,mod:[{error:!!b&&G,pointer:z,disabled:S,multiline:F,"data-with-right-section":!!Ge,"data-with-left-section":!!j},X],variant:M,size:g,children:[j&&s.jsx("div",{...C,"data-position":"left",...be("section",{className:C==null?void 0:C.className,style:C==null?void 0:C.style}),children:j}),s.jsx(ce,{component:"input",...K,...xe,ref:t,required:f,mod:{disabled:S,error:!!b&&G},variant:M,__size:P,...be("input")}),Ge&&s.jsx("div",{...E,"data-position":"right",...be("section",{className:E==null?void 0:E.className,style:E==null?void 0:E.style}),children:Ge})]})})});pn.classes=xi;pn.Wrapper=qx;pn.Label=fd;pn.Error=Sp;pn.Description=bp;pn.Placeholder=Hx;pn.ClearButton=$2;pn.displayName="@mantine/core/Input";function L5(e,t,n){const r=se(e,t,n),{label:i,description:o,error:c,required:u,classNames:f,styles:h,className:m,unstyled:g,__staticSelector:y,__stylesApiProps:b,errorProps:S,labelProps:j,descriptionProps:C,wrapperProps:T,id:_,size:E,style:R,inputContainer:D,inputWrapperOrder:k,withAsterisk:M,variant:L,vars:z,mod:F,...Y}=r,{styleProps:W,rest:J}=Xa(Y),G={label:i,description:o,error:c,required:u,classNames:f,className:m,__staticSelector:y,__stylesApiProps:b||r,errorProps:S,labelProps:j,descriptionProps:C,unstyled:g,styles:h,size:E,style:R,inputContainer:D,inputWrapperOrder:k,withAsterisk:M,variant:L,id:_,mod:F,...T};return{...J,classNames:f,styles:h,unstyled:g,wrapperProps:{...G,...W},inputProps:{required:u,classNames:f,styles:h,unstyled:g,size:E,__staticSelector:y,__stylesApiProps:b||r,error:c,variant:L,id:_}}}const I5={__staticSelector:"InputBase",withAria:!0},Pr=cr((e,t)=>{const{inputProps:n,wrapperProps:r,...i}=L5("InputBase",I5,e);return s.jsx(pn.Wrapper,{...r,children:s.jsx(pn,{...n,...i,ref:t})})});Pr.classes={...pn.classes,...pn.Wrapper.classes};Pr.displayName="@mantine/core/InputBase";const $5={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 z2={root:"m_8bffd616"};const z5={},Fo=cr((e,t)=>{const n=se("Flex",z5,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,gap:h,rowGap:m,columnGap:g,align:y,justify:b,wrap:S,direction:j,...C}=n,T=Le({name:"Flex",classes:z2,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f}),_=bn(),E=ud(),R=AR({styleProps:{gap:h,rowGap:m,columnGap:g,align:y,justify:b,wrap:S,direction:j},theme:_,data:$5});return s.jsxs(s.Fragment,{children:[R.hasResponsiveStyles&&s.jsx(Js,{selector:`.${E}`,styles:R.styles,media:R.media}),s.jsx(ce,{ref:t,...T("root",{className:E,style:Wo(R.inlineStyles)}),...C})]})});Fo.classes=z2;Fo.displayName="@mantine/core/Flex";function U5(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 B5({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const i=v.useRef(-1),[o,c]=v.useState(!1),[u,f]=v.useState(typeof r=="boolean"?r:!1),h=()=>{if(!e||!t||!n.current)return;const b=e.getBoundingClientRect(),S=t.getBoundingClientRect(),j=window.getComputedStyle(e),C=window.getComputedStyle(t),T=Uo(j.borderTopWidth)+Uo(C.borderTopWidth),_=Uo(j.borderLeftWidth)+Uo(C.borderLeftWidth),E={top:b.top-S.top-T,left:b.left-S.left-_,width:b.width,height:b.height};n.current.style.transform=`translateY(${E.top}px) translateX(${E.left}px)`,n.current.style.width=`${E.width}px`,n.current.style.height=`${E.height}px`},m=()=>{window.clearTimeout(i.current),n.current&&(n.current.style.transitionDuration="0ms"),h(),i.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},g=v.useRef(null),y=v.useRef(null);return v.useEffect(()=>{if(h(),e)return g.current=new ResizeObserver(m),g.current.observe(e),t&&(y.current=new ResizeObserver(m),y.current.observe(t)),()=>{var b,S;(b=g.current)==null||b.disconnect(),(S=y.current)==null||S.disconnect()}},[t,e]),v.useEffect(()=>{if(t){const b=S=>{U5(S.target,t)&&(m(),f(!1))};return t.addEventListener("transitionend",b),()=>{t.removeEventListener("transitionend",b)}}},[t]),P3(()=>{jR()!=="test"&&c(!0)},20,{autoInvoke:!0}),N3(b=>{b.forEach(S=>{S.type==="attributes"&&S.attributeName==="dir"&&m()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:o,hidden:u}}var U2={root:"m_96b553a6"};const V5={},F5=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),Gx=ve((e,t)=>{const n=se("FloatingIndicator",V5,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,target:h,parent:m,transitionDuration:g,mod:y,displayAfterTransitionEnd:b,...S}=n,j=Le({name:"FloatingIndicator",classes:U2,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:F5}),C=v.useRef(null),{initialized:T,hidden:_}=B5({target:h,parent:m,ref:C,displayAfterTransitionEnd:b}),E=Bn(t,C);return!h||!m?null:s.jsx(ce,{ref:E,mod:[{initialized:T,hidden:_},y],...j("root"),...S})});Gx.displayName="@mantine/core/FloatingIndicator";Gx.classes=U2;var B2={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 H5={},q5=(e,{radius:t,color:n,variant:r,autoContrast:i})=>{const o=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||"light",autoContrast:i});return{root:{"--alert-radius":t===void 0?void 0:Bt(t),"--alert-bg":n||r?o.background:void 0,"--alert-color":o.color,"--alert-bd":n||r?o.border:void 0}}},Za=ve((e,t)=>{const n=se("Alert",H5,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,radius:h,color:m,title:g,children:y,id:b,icon:S,withCloseButton:j,onClose:C,closeButtonLabel:T,variant:_,autoContrast:E,...R}=n,D=Le({name:"Alert",classes:B2,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:q5}),k=yr(b),M=g&&`${k}-title`||void 0,L=`${k}-body`;return s.jsx(ce,{id:k,...D("root",{variant:_}),variant:_,ref:t,...R,role:"alert","aria-describedby":L,"aria-labelledby":M,children:s.jsxs("div",{...D("wrapper"),children:[S&&s.jsx("div",{...D("icon"),children:S}),s.jsxs("div",{...D("body"),children:[g&&s.jsx("div",{...D("title"),"data-with-close-button":j||void 0,children:s.jsx("span",{id:M,...D("label"),children:g})}),y&&s.jsx("div",{id:L,...D("message"),"data-variant":_,children:y})]}),j&&s.jsx(Yo,{...D("closeButton"),onClick:C,variant:"transparent",size:16,iconSize:16,"aria-label":T,unstyled:u})]})})});Za.classes=B2;Za.displayName="@mantine/core/Alert";var V2={root:"m_b6d8b162"};function G5(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const W5={inherit:!1},Q5=(e,{variant:t,lineClamp:n,gradient:r,size:i,color:o})=>({root:{"--text-fz":On(i),"--text-lh":mR(i),"--text-gradient":t==="gradient"?wy(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":o?Ft(o,e):void 0}}),_e=cr((e,t)=>{const n=se("Text",W5,e),{lineClamp:r,truncate:i,inline:o,inherit:c,gradient:u,span:f,__staticSelector:h,vars:m,className:g,style:y,classNames:b,styles:S,unstyled:j,variant:C,mod:T,size:_,...E}=n,R=Le({name:["Text",h],props:n,classes:V2,className:g,style:y,classNames:b,styles:S,unstyled:j,vars:m,varsResolver:Q5});return s.jsx(ce,{...R("root",{focusable:!0}),ref:t,component:f?"span":"p",variant:C,mod:[{"data-truncate":G5(i),"data-line-clamp":typeof r=="number","data-inline":o,"data-inherit":c},T],size:_,...E})});_e.classes=V2;_e.displayName="@mantine/core/Text";var F2={root:"m_849cf0da"};const Y5={underline:"hover"},Pt=cr((e,t)=>{const{underline:n,className:r,unstyled:i,mod:o,...c}=se("Anchor",Y5,e);return s.jsx(_e,{component:"a",ref:t,className:zt({[F2.root]:!i},r),...c,mod:[{underline:n},o],__staticSelector:"Anchor",unstyled:i})});Pt.classes=F2;Pt.displayName="@mantine/core/Anchor";const[X5,_c]=vr("AppShell was not found in tree");var Xo={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const K5={},Wx=ve((e,t)=>{const n=se("AppShellAside",K5,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,withBorder:h,zIndex:m,mod:g,...y}=n,b=_c();return b.disabled?null:s.jsx(ce,{component:"aside",ref:t,mod:[{"with-border":h??b.withBorder},g],...b.getStyles("aside",{className:i,classNames:r,styles:c,style:o}),...y,__vars:{"--app-shell-aside-z-index":`calc(${m??b.zIndex} + 1)`}})});Wx.classes=Xo;Wx.displayName="@mantine/core/AppShellAside";const Z5={},Qx=ve((e,t)=>{var S;const n=se("AppShellFooter",Z5,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,withBorder:h,zIndex:m,mod:g,...y}=n,b=_c();return b.disabled?null:s.jsx(ce,{component:"footer",ref:t,mod:[{"with-border":h??b.withBorder},g],...b.getStyles("footer",{className:zt({[dc.classNames.zeroRight]:b.offsetScrollbars},i),classNames:r,styles:c,style:o}),...y,__vars:{"--app-shell-footer-z-index":(S=m??b.zIndex)==null?void 0:S.toString()}})});Qx.classes=Xo;Qx.displayName="@mantine/core/AppShellFooter";const J5={},Yx=ve((e,t)=>{var S;const n=se("AppShellHeader",J5,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,withBorder:h,zIndex:m,mod:g,...y}=n,b=_c();return b.disabled?null:s.jsx(ce,{component:"header",ref:t,mod:[{"with-border":h??b.withBorder},g],...b.getStyles("header",{className:zt({[dc.classNames.zeroRight]:b.offsetScrollbars},i),classNames:r,styles:c,style:o}),...y,__vars:{"--app-shell-header-z-index":(S=m??b.zIndex)==null?void 0:S.toString()}})});Yx.classes=Xo;Yx.displayName="@mantine/core/AppShellHeader";const e7={},Xx=ve((e,t)=>{const n=se("AppShellMain",e7,e),{classNames:r,className:i,style:o,styles:c,vars:u,...f}=n,h=_c();return s.jsx(ce,{component:"main",ref:t,...h.getStyles("main",{className:i,style:o,classNames:r,styles:c}),...f})});Xx.classes=Xo;Xx.displayName="@mantine/core/AppShellMain";function hd(e){return typeof e=="object"?e.base:e}function pd(e){const t=typeof e=="object"&&e!==null&&typeof e.base<"u"&&Object.keys(e).length===1;return typeof e=="number"||typeof e=="string"||t}function md(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function t7({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:i}){var f,h,m;const o=r==null?void 0:r.width,c="translateX(var(--app-shell-aside-width))",u="translateX(calc(var(--app-shell-aside-width) * -1))";if(r!=null&&r.breakpoint&&!((f=r==null?void 0:r.collapsed)!=null&&f.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"),pd(o)){const g=le(hd(o));e["--app-shell-aside-width"]=g,e["--app-shell-aside-offset"]=g}if(md(o)&&(typeof o.base<"u"&&(e["--app-shell-aside-width"]=le(o.base),e["--app-shell-aside-offset"]=le(o.base)),on(o).forEach(g=>{g!=="base"&&(t[g]=t[g]||{},t[g]["--app-shell-aside-width"]=le(o[g]),t[g]["--app-shell-aside-offset"]=le(o[g]))})),(h=r==null?void 0:r.collapsed)!=null&&h.desktop){const g=r.breakpoint;t[g]=t[g]||{},t[g]["--app-shell-aside-transform"]=c,t[g]["--app-shell-aside-transform-rtl"]=u,t[g]["--app-shell-aside-offset"]="0px !important"}if((m=r==null?void 0:r.collapsed)!=null&&m.mobile){const g=gx(r.breakpoint,i.breakpoints)-.1;n[g]=n[g]||{},n[g]["--app-shell-aside-width"]="100%",n[g]["--app-shell-aside-offset"]="0px",n[g]["--app-shell-aside-transform"]=c,n[g]["--app-shell-aside-transform-rtl"]=u}}function n7({baseStyles:e,minMediaStyles:t,footer:n}){const r=n==null?void 0:n.height,i="translateY(var(--app-shell-footer-height))",o=(n==null?void 0:n.offset)??!0;if(pd(r)){const c=le(hd(r));e["--app-shell-footer-height"]=c,o&&(e["--app-shell-footer-offset"]=c)}md(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=le(r.base),o&&(e["--app-shell-footer-offset"]=le(r.base))),on(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-footer-height"]=le(r[c]),o&&(t[c]["--app-shell-footer-offset"]=le(r[c])))})),n!=null&&n.collapsed&&(e["--app-shell-footer-transform"]=i,e["--app-shell-footer-offset"]="0px !important")}function r7({baseStyles:e,minMediaStyles:t,header:n}){const r=n==null?void 0:n.height,i="translateY(calc(var(--app-shell-header-height) * -1))",o=(n==null?void 0:n.offset)??!0;if(pd(r)){const c=le(hd(r));e["--app-shell-header-height"]=c,o&&(e["--app-shell-header-offset"]=c)}md(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=le(r.base),o&&(e["--app-shell-header-offset"]=le(r.base))),on(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-header-height"]=le(r[c]),o&&(t[c]["--app-shell-header-offset"]=le(r[c])))})),n!=null&&n.collapsed&&(e["--app-shell-header-transform"]=i,e["--app-shell-header-offset"]="0px !important")}function i7({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:i}){var f,h,m;const o=r==null?void 0:r.width,c="translateX(calc(var(--app-shell-navbar-width) * -1))",u="translateX(var(--app-shell-navbar-width))";if(r!=null&&r.breakpoint&&!((f=r==null?void 0:r.collapsed)!=null&&f.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"),pd(o)){const g=le(hd(o));e["--app-shell-navbar-width"]=g,e["--app-shell-navbar-offset"]=g}if(md(o)&&(typeof o.base<"u"&&(e["--app-shell-navbar-width"]=le(o.base),e["--app-shell-navbar-offset"]=le(o.base)),on(o).forEach(g=>{g!=="base"&&(t[g]=t[g]||{},t[g]["--app-shell-navbar-width"]=le(o[g]),t[g]["--app-shell-navbar-offset"]=le(o[g]))})),(h=r==null?void 0:r.collapsed)!=null&&h.desktop){const g=r.breakpoint;t[g]=t[g]||{},t[g]["--app-shell-navbar-transform"]=c,t[g]["--app-shell-navbar-transform-rtl"]=u,t[g]["--app-shell-navbar-offset"]="0px !important"}if((m=r==null?void 0:r.collapsed)!=null&&m.mobile){const g=gx(r.breakpoint,i.breakpoints)-.1;n[g]=n[g]||{},n[g]["--app-shell-navbar-width"]="100%",n[g]["--app-shell-navbar-offset"]="0px",n[g]["--app-shell-navbar-transform"]=c,n[g]["--app-shell-navbar-transform-rtl"]=u}}function Fv(e){return Number(e)===0?"0px":Nn(e)}function a7({padding:e,baseStyles:t,minMediaStyles:n}){pd(e)&&(t["--app-shell-padding"]=Fv(hd(e))),md(e)&&(e.base&&(t["--app-shell-padding"]=Fv(e.base)),on(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=Fv(e[r]))}))}function o7({navbar:e,header:t,footer:n,aside:r,padding:i,theme:o}){const c={},u={},f={};i7({baseStyles:f,minMediaStyles:c,maxMediaStyles:u,navbar:e,theme:o}),t7({baseStyles:f,minMediaStyles:c,maxMediaStyles:u,aside:r,theme:o}),r7({baseStyles:f,minMediaStyles:c,header:t}),n7({baseStyles:f,minMediaStyles:c,footer:n}),a7({baseStyles:f,minMediaStyles:c,padding:i});const h=Wu(on(c),o.breakpoints).map(y=>({query:`(min-width: ${Th(y.px)})`,styles:c[y.value]})),m=Wu(on(u),o.breakpoints).map(y=>({query:`(max-width: ${Th(y.px)})`,styles:u[y.value]})),g=[...h,...m];return{baseStyles:f,media:g}}function s7({navbar:e,header:t,aside:n,footer:r,padding:i}){const o=bn(),c=Qa(),{media:u,baseStyles:f}=o7({navbar:e,header:t,footer:r,aside:n,padding:i,theme:o});return s.jsx(Js,{media:u,styles:f,selector:c.cssVariablesSelector})}const l7={},Kx=ve((e,t)=>{const n=se("AppShellNavbar",l7,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,withBorder:h,zIndex:m,mod:g,...y}=n,b=_c();return b.disabled?null:s.jsx(ce,{component:"nav",ref:t,mod:[{"with-border":h??b.withBorder},g],...b.getStyles("navbar",{className:i,classNames:r,styles:c,style:o}),...y,__vars:{"--app-shell-navbar-z-index":`calc(${m??b.zIndex} + 1)`}})});Kx.classes=Xo;Kx.displayName="@mantine/core/AppShellNavbar";const c7={},Zx=cr((e,t)=>{const n=se("AppShellSection",c7,e),{classNames:r,className:i,style:o,styles:c,vars:u,grow:f,mod:h,...m}=n,g=_c();return s.jsx(ce,{ref:t,mod:[{grow:f},h],...g.getStyles("section",{className:i,style:o,classNames:r,styles:c}),...m})});Zx.classes=Xo;Zx.displayName="@mantine/core/AppShellSection";function u7({transitionDuration:e,disabled:t}){const[n,r]=v.useState(!0),i=v.useRef(-1),o=v.useRef(-1);return wR("resize",()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),200)}),jc(()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),e||0)},[t,e]),n}const d7={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Qr("app")},f7=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),Dr=ve((e,t)=>{const n=se("AppShell",d7,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,navbar:h,withBorder:m,padding:g,transitionDuration:y,transitionTimingFunction:b,header:S,zIndex:j,layout:C,disabled:T,aside:_,footer:E,offsetScrollbars:R=C!=="alt",mod:D,...k}=n,M=Le({name:"AppShell",classes:Xo,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:f7}),L=u7({disabled:T,transitionDuration:y});return s.jsxs(X5,{value:{getStyles:M,withBorder:m,zIndex:j,disabled:T,offsetScrollbars:R},children:[s.jsx(s7,{navbar:h,header:S,aside:_,footer:E,padding:g}),s.jsx(ce,{ref:t,...M("root"),mod:[{resizing:L,layout:C,disabled:T},D],...k})]})});Dr.classes=Xo;Dr.displayName="@mantine/core/AppShell";Dr.Navbar=Kx;Dr.Header=Yx;Dr.Main=Xx;Dr.Aside=Wx;Dr.Footer=Qx;Dr.Section=Zx;function H2(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=>H2(t))}:e}function q2(e){return e?e.map(t=>H2(t)):[]}function G2(e){return e.reduce((t,n)=>"group"in n?{...t,...G2(n.items)}:(t[n.value]=n,t),{})}var kr={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 h7={error:null},p7=(e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":rt(t,"combobox-chevron-size"),"--combobox-chevron-color":n?Ft(n,e):void 0}}),wp=ve((e,t)=>{const n=se("ComboboxChevron",h7,e),{size:r,error:i,style:o,className:c,classNames:u,styles:f,unstyled:h,vars:m,mod:g,...y}=n,b=Le({name:"ComboboxChevron",classes:kr,props:n,style:o,className:c,classNames:u,styles:f,unstyled:h,vars:m,varsResolver:p7,rootSelector:"chevron"});return s.jsx(ce,{component:"svg",...y,...b("chevron"),size:r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:i},g],ref:t,children:s.jsx("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});wp.classes=kr;wp.displayName="@mantine/core/ComboboxChevron";const[m7,bi]=vr("Combobox component was not found in tree"),W2=v.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...i},o)=>s.jsx(pn.ClearButton,{ref:o,tabIndex:-1,"aria-hidden":!0,...i,onMouseDown:c=>{c.preventDefault(),t==null||t(c)},onClick:c=>{r(),n==null||n(c)}}));W2.displayName="@mantine/core/ComboboxClearButton";const g7={},Jx=ve((e,t)=>{const{classNames:n,styles:r,className:i,style:o,hidden:c,...u}=se("ComboboxDropdown",g7,e),f=bi();return s.jsx(Li.Dropdown,{...u,ref:t,role:"presentation","data-hidden":c||void 0,...f.getStyles("dropdown",{className:i,style:o,classNames:n,styles:r})})});Jx.classes=kr;Jx.displayName="@mantine/core/ComboboxDropdown";const v7={refProp:"ref"},Q2=ve((e,t)=>{const{children:n,refProp:r}=se("ComboboxDropdownTarget",v7,e);if(bi(),!Ga(n))throw new Error("Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return s.jsx(Li.Target,{ref:t,refProp:r,children:n})});Q2.displayName="@mantine/core/ComboboxDropdownTarget";const y7={},e0=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:o,vars:c,...u}=se("ComboboxEmpty",y7,e),f=bi();return s.jsx(ce,{ref:t,...f.getStyles("empty",{className:r,classNames:n,styles:o,style:i}),...u})});e0.classes=kr;e0.displayName="@mantine/core/ComboboxEmpty";function t0({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:i,autoComplete:o}){const c=bi(),[u,f]=v.useState(null),h=g=>{if(e==null||e(g),!c.readOnly&&t){if(g.nativeEvent.isComposing)return;if(g.nativeEvent.code==="ArrowDown"&&(g.preventDefault(),c.store.dropdownOpened?f(c.store.selectNextOption()):(c.store.openDropdown("keyboard"),f(c.store.selectActiveOption()),c.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),g.nativeEvent.code==="ArrowUp"&&(g.preventDefault(),c.store.dropdownOpened?f(c.store.selectPreviousOption()):(c.store.openDropdown("keyboard"),f(c.store.selectActiveOption()),c.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),g.nativeEvent.code==="Enter"||g.nativeEvent.code==="NumpadEnter"){if(g.nativeEvent.keyCode===229)return;const y=c.store.getSelectedOptionIndex();c.store.dropdownOpened&&y!==-1?(g.preventDefault(),c.store.clickSelectedOption()):i==="button"&&(g.preventDefault(),c.store.openDropdown("keyboard"))}g.key==="Escape"&&c.store.closeDropdown("keyboard"),g.nativeEvent.code==="Space"&&i==="button"&&(g.preventDefault(),c.store.toggleDropdown("keyboard"))}};return{...n?{"aria-haspopup":"listbox","aria-expanded":r&&!!(c.store.listId&&c.store.dropdownOpened)||void 0,"aria-controls":c.store.dropdownOpened?c.store.listId:void 0,"aria-activedescendant":c.store.dropdownOpened&&u||void 0,autoComplete:o,"data-expanded":c.store.dropdownOpened||void 0,"data-mantine-stop-propagation":c.store.dropdownOpened||void 0}:{},onKeyDown:h}}const x7={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},Y2=ve((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:i,withAriaAttributes:o,withExpandedAttribute:c,targetType:u,autoComplete:f,...h}=se("ComboboxEventsTarget",x7,e);if(!Ga(n))throw new Error("Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const m=bi(),g=t0({targetType:u,withAriaAttributes:o,withKeyboardNavigation:i,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f});return v.cloneElement(n,{...g,...h,[r]:Bn(t,m.store.targetRef,cp(n))})});Y2.displayName="@mantine/core/ComboboxEventsTarget";const b7={},n0=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:o,vars:c,...u}=se("ComboboxFooter",b7,e),f=bi();return s.jsx(ce,{ref:t,...f.getStyles("footer",{className:r,classNames:n,style:i,styles:o}),...u,onMouseDown:h=>{h.preventDefault()}})});n0.classes=kr;n0.displayName="@mantine/core/ComboboxFooter";const S7={},r0=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:o,vars:c,children:u,label:f,...h}=se("ComboboxGroup",S7,e),m=bi();return s.jsxs(ce,{ref:t,...m.getStyles("group",{className:r,classNames:n,style:i,styles:o}),...h,children:[f&&s.jsx("div",{...m.getStyles("groupLabel",{classNames:n,styles:o}),children:f}),u]})});r0.classes=kr;r0.displayName="@mantine/core/ComboboxGroup";const w7={},i0=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:o,vars:c,...u}=se("ComboboxHeader",w7,e),f=bi();return s.jsx(ce,{ref:t,...f.getStyles("header",{className:r,classNames:n,style:i,styles:o}),...u,onMouseDown:h=>{h.preventDefault()}})});i0.classes=kr;i0.displayName="@mantine/core/ComboboxHeader";function X2({value:e,valuesDivider:t=",",...n}){return s.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}X2.displayName="@mantine/core/ComboboxHiddenInput";const j7={},a0=ve((e,t)=>{const n=se("ComboboxOption",j7,e),{classNames:r,className:i,style:o,styles:c,vars:u,onClick:f,id:h,active:m,onMouseDown:g,onMouseOver:y,disabled:b,selected:S,mod:j,...C}=n,T=bi(),_=v.useId(),E=h||_;return s.jsx(ce,{...T.getStyles("option",{className:i,classNames:r,styles:c,style:o}),...C,ref:t,id:E,mod:["combobox-option",{"combobox-active":m,"combobox-disabled":b,"combobox-selected":S},j],role:"option",onClick:R=>{var D;b?R.preventDefault():((D=T.onOptionSubmit)==null||D.call(T,n.value,n),f==null||f(R))},onMouseDown:R=>{R.preventDefault(),g==null||g(R)},onMouseOver:R=>{T.resetSelectionOnOptionHover&&T.store.resetSelectedOption(),y==null||y(R)}})});a0.classes=kr;a0.displayName="@mantine/core/ComboboxOption";const C7={},o0=ve((e,t)=>{const n=se("ComboboxOptions",C7,e),{classNames:r,className:i,style:o,styles:c,id:u,onMouseDown:f,labelledBy:h,...m}=n,g=bi(),y=yr(u);return v.useEffect(()=>{g.store.setListId(y)},[y]),s.jsx(ce,{ref:t,...g.getStyles("options",{className:i,style:o,classNames:r,styles:c}),...m,id:y,role:"listbox","aria-labelledby":h,onMouseDown:b=>{b.preventDefault(),f==null||f(b)}})});o0.classes=kr;o0.displayName="@mantine/core/ComboboxOptions";const E7={withAriaAttributes:!0,withKeyboardNavigation:!0},s0=ve((e,t)=>{const n=se("ComboboxSearch",E7,e),{classNames:r,styles:i,unstyled:o,vars:c,withAriaAttributes:u,onKeyDown:f,withKeyboardNavigation:h,size:m,...g}=n,y=bi(),b=y.getStyles("search"),S=t0({targetType:"input",withAriaAttributes:u,withKeyboardNavigation:h,withExpandedAttribute:!1,onKeyDown:f,autoComplete:"off"});return s.jsx(pn,{ref:Bn(t,y.store.searchRef),classNames:[{input:b.className},r],styles:[{input:b.style},i],size:m||y.size,...S,...g,__staticSelector:"Combobox"})});s0.classes=kr;s0.displayName="@mantine/core/ComboboxSearch";const T7={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},K2=ve((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:i,withAriaAttributes:o,withExpandedAttribute:c,targetType:u,autoComplete:f,...h}=se("ComboboxTarget",T7,e);if(!Ga(n))throw new Error("Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const m=bi(),g=t0({targetType:u,withAriaAttributes:o,withKeyboardNavigation:i,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f}),y=v.cloneElement(n,{...g,...h});return s.jsx(Li.Target,{ref:Bn(t,m.store.targetRef),children:y})});K2.displayName="@mantine/core/ComboboxTarget";function R7(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 _7(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 D7(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function gd({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:i,loop:o=!0,scrollBehavior:c="instant"}={}){const[u,f]=Xn({value:t,defaultValue:e,finalValue:!1,onChange:n}),h=v.useRef(null),m=v.useRef(-1),g=v.useRef(null),y=v.useRef(null),b=v.useRef(-1),S=v.useRef(-1),j=v.useRef(-1),C=v.useCallback((P="unknown")=>{u||(f(!0),i==null||i(P))},[f,i,u]),T=v.useCallback((P="unknown")=>{u&&(f(!1),r==null||r(P))},[f,r,u]),_=v.useCallback((P="unknown")=>{u?T(P):C(P)},[T,C,u]),E=v.useCallback(()=>{const P=document.querySelector(`#${h.current} [data-combobox-selected]`);P==null||P.removeAttribute("data-combobox-selected"),P==null||P.removeAttribute("aria-selected")},[]),R=v.useCallback(P=>{const I=document.getElementById(h.current),$=I==null?void 0:I.querySelectorAll("[data-combobox-option]");if(!$)return null;const H=P>=$.length?0:P<0?$.length-1:P;return m.current=H,$!=null&&$[H]&&!$[H].hasAttribute("data-combobox-disabled")?(E(),$[H].setAttribute("data-combobox-selected","true"),$[H].setAttribute("aria-selected","true"),$[H].scrollIntoView({block:"nearest",behavior:c}),$[H].id):null},[c,E]),D=v.useCallback(()=>{const P=document.querySelector(`#${h.current} [data-combobox-active]`);if(P){const I=document.querySelectorAll(`#${h.current} [data-combobox-option]`),$=Array.from(I).findIndex(H=>H===P);return R($)}return R(0)},[R]),k=v.useCallback(()=>R(_7(m.current,document.querySelectorAll(`#${h.current} [data-combobox-option]`),o)),[R,o]),M=v.useCallback(()=>R(R7(m.current,document.querySelectorAll(`#${h.current} [data-combobox-option]`),o)),[R,o]),L=v.useCallback(()=>R(D7(document.querySelectorAll(`#${h.current} [data-combobox-option]`))),[R]),z=v.useCallback((P="selected",I)=>{j.current=window.setTimeout(()=>{var O;const $=document.querySelectorAll(`#${h.current} [data-combobox-option]`),H=Array.from($).findIndex(U=>U.hasAttribute(`data-combobox-${P}`));m.current=H,I!=null&&I.scrollIntoView&&((O=$[H])==null||O.scrollIntoView({block:"nearest",behavior:c}))},0)},[]),F=v.useCallback(()=>{m.current=-1,E()},[E]),Y=v.useCallback(()=>{const P=document.querySelectorAll(`#${h.current} [data-combobox-option]`),I=P==null?void 0:P[m.current];I==null||I.click()},[]),W=v.useCallback(P=>{h.current=P},[]),J=v.useCallback(()=>{b.current=window.setTimeout(()=>g.current.focus(),0)},[]),G=v.useCallback(()=>{S.current=window.setTimeout(()=>y.current.focus(),0)},[]),X=v.useCallback(()=>m.current,[]);return v.useEffect(()=>()=>{window.clearTimeout(b.current),window.clearTimeout(S.current),window.clearTimeout(j.current)},[]),{dropdownOpened:u,openDropdown:C,closeDropdown:T,toggleDropdown:_,selectedOptionIndex:m.current,getSelectedOptionIndex:X,selectOption:R,selectFirstOption:L,selectActiveOption:D,selectNextOption:k,selectPreviousOption:M,resetSelectedOption:F,updateSelectedOptionIndex:z,listId:h.current,setListId:W,clickSelectedOption:Y,searchRef:g,focusSearchInput:J,targetRef:y,focusTarget:G}}const A7={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},k7=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":On(t),"--combobox-option-padding":rt(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:le(n),"--combobox-option-fz":On(t),"--combobox-option-padding":rt(t,"combobox-option-padding")}});function ct(e){const t=se("Combobox",A7,e),{classNames:n,styles:r,unstyled:i,children:o,store:c,vars:u,onOptionSubmit:f,onClose:h,size:m,dropdownPadding:g,resetSelectionOnOptionHover:y,__staticSelector:b,readOnly:S,...j}=t,C=gd(),T=c||C,_=Le({name:b||"Combobox",classes:kr,props:t,classNames:n,styles:r,unstyled:i,vars:u,varsResolver:k7}),E=()=>{h==null||h(),T.closeDropdown()};return s.jsx(m7,{value:{getStyles:_,store:T,onOptionSubmit:f,size:m,resetSelectionOnOptionHover:y,readOnly:S},children:s.jsx(Li,{opened:T.dropdownOpened,...j,onChange:R=>!R&&E(),withRoles:!1,unstyled:i,children:o})})}const P7=e=>e;ct.extend=P7;ct.classes=kr;ct.displayName="@mantine/core/Combobox";ct.Target=K2;ct.Dropdown=Jx;ct.Options=o0;ct.Option=a0;ct.Search=s0;ct.Empty=e0;ct.Chevron=wp;ct.Footer=n0;ct.Header=i0;ct.EventsTarget=Y2;ct.DropdownTarget=Q2;ct.Group=r0;ct.ClearButton=W2;ct.HiddenInput=X2;var Z2={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const J2=Z2,jp=v.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:i,unstyled:o,children:c,label:u,description:f,id:h,disabled:m,error:g,size:y,labelPosition:b="left",bodyElement:S="div",labelElement:j="label",variant:C,style:T,vars:_,mod:E,...R},D)=>{const k=Le({name:e,props:t,className:n,style:T,classes:Z2,classNames:r,styles:i,unstyled:o});return s.jsx(ce,{...k("root"),ref:D,__vars:{"--label-fz":On(y),"--label-lh":rt(y,"label-lh")},mod:[{"label-position":b},E],variant:C,size:y,...R,children:s.jsxs(ce,{component:S,htmlFor:S==="label"?h:void 0,...k("body"),children:[c,s.jsxs("div",{...k("labelWrapper"),"data-disabled":m||void 0,children:[u&&s.jsx(ce,{component:j,htmlFor:j==="label"?h:void 0,...k("label"),"data-disabled":m||void 0,children:u}),f&&s.jsx(pn.Description,{size:y,__inheritStyles:!1,...k("description"),children:f}),g&&typeof g!="boolean"&&s.jsx(pn.Error,{size:y,__inheritStyles:!1,...k("error"),children:g})]})]})})});jp.displayName="@mantine/core/InlineInput";const e_=v.createContext(null),N7=e_.Provider,t_=()=>v.useContext(e_),[O7,M7]=Wa();var n_={card:"m_26775b0a"};const L7={withBorder:!0},I7=(e,{radius:t})=>({card:{"--card-radius":Bt(t)}}),l0=ve((e,t)=>{const n=se("CheckboxCard",L7,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,checked:h,mod:m,withBorder:g,value:y,onClick:b,defaultChecked:S,onChange:j,...C}=n,T=Le({name:"CheckboxCard",classes:n_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:I7,rootSelector:"card"}),_=t_(),E=typeof h=="boolean"?h:_?_.value.includes(y||""):void 0,[R,D]=Xn({value:E,defaultValue:S,finalValue:!1,onChange:j});return s.jsx(O7,{value:{checked:R},children:s.jsx(tr,{ref:t,mod:[{"with-border":g,checked:R},m],...T("card"),...C,role:"checkbox","aria-checked":R,onClick:k=>{b==null||b(k),_==null||_.onChange(y||""),D(!R)}})})});l0.displayName="@mantine/core/CheckboxCard";l0.classes=n_;function c0({children:e,role:t}){const n=Rc();return n?s.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):s.jsx(s.Fragment,{children:e})}const $7={},u0=ve((e,t)=>{const{value:n,defaultValue:r,onChange:i,size:o,wrapperProps:c,children:u,readOnly:f,...h}=se("CheckboxGroup",$7,e),[m,g]=Xn({value:n,defaultValue:r,finalValue:[],onChange:i}),y=b=>{const S=typeof b=="string"?b:b.currentTarget.value;!f&&g(m.includes(S)?m.filter(j=>j!==S):[...m,S])};return s.jsx(N7,{value:{value:m,onChange:y,size:o},children:s.jsx(pn.Wrapper,{size:o,ref:t,...c,...h,labelElement:"div",__staticSelector:"CheckboxGroup",children:s.jsx(c0,{role:"group",children:u})})})});u0.classes=pn.Wrapper.classes;u0.displayName="@mantine/core/CheckboxGroup";function Cp({size:e,style:t,...n}){const r=e!==void 0?{width:le(e),height:le(e),...t}:t;return s.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n,children:s.jsx("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function r_({indeterminate:e,...t}){return e?s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t,children:s.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):s.jsx(Cp,{...t})}var i_={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const z7={icon:r_},U7=(e,{radius:t,color:n,size:r,iconColor:i,variant:o,autoContrast:c})=>{const u=pi({color:n||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{indicator:{"--checkbox-size":rt(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Bt(t),"--checkbox-color":o==="outline"?f:Ft(n,e),"--checkbox-icon-color":i?Ft(i,e):Zs(c,e)?Ya({color:n,theme:e,autoContrast:c}):void 0}}},d0=ve((e,t)=>{const n=se("CheckboxIndicator",z7,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,icon:h,indeterminate:m,radius:g,color:y,iconColor:b,autoContrast:S,checked:j,mod:C,variant:T,disabled:_,...E}=n,R=h,D=Le({name:"CheckboxIndicator",classes:i_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:U7,rootSelector:"indicator"}),k=M7(),M=typeof j=="boolean"||typeof m=="boolean"?j||m:(k==null?void 0:k.checked)||!1;return s.jsx(ce,{ref:t,...D("indicator",{variant:T}),variant:T,mod:[{checked:M,disabled:_},C],...E,children:s.jsx(R,{indeterminate:m,...D("icon")})})});d0.displayName="@mantine/core/CheckboxIndicator";d0.classes=i_;var a_={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const B7={labelPosition:"right",icon:r_},V7=(e,{radius:t,color:n,size:r,iconColor:i,variant:o,autoContrast:c})=>{const u=pi({color:n||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{root:{"--checkbox-size":rt(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Bt(t),"--checkbox-color":o==="outline"?f:Ft(n,e),"--checkbox-icon-color":i?Ft(i,e):Zs(c,e)?Ya({color:n,theme:e,autoContrast:c}):void 0}}},Un=ve((e,t)=>{const n=se("Checkbox",B7,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,color:h,label:m,id:g,size:y,radius:b,wrapperProps:S,checked:j,labelPosition:C,description:T,error:_,disabled:E,variant:R,indeterminate:D,icon:k,rootRef:M,iconColor:L,onChange:z,autoContrast:F,mod:Y,...W}=n,J=t_(),G=y||(J==null?void 0:J.size),X=k,P=Le({name:"Checkbox",props:n,classes:a_,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:V7}),{styleProps:I,rest:$}=Xa(W),H=yr(g),O=J?{checked:J.value.includes($.value),onChange:ee=>{J.onChange(ee),z==null||z(ee)}}:{},U=v.useRef(null),K=t||U;return v.useEffect(()=>{K&&"current"in K&&K.current&&(K.current.indeterminate=D||!1)},[D,K]),s.jsx(jp,{...P("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:H,size:G,labelPosition:C,label:m,description:T,error:_,disabled:E,classNames:r,styles:c,unstyled:u,"data-checked":O.checked||j||void 0,variant:R,ref:M,mod:Y,...I,...S,children:s.jsxs(ce,{...P("inner"),mod:{"data-label-position":C},children:[s.jsx(ce,{component:"input",id:H,ref:K,checked:j,disabled:E,mod:{error:!!_,indeterminate:D},...P("input",{focusable:!0,variant:R}),onChange:z,...$,...O,type:"checkbox"}),s.jsx(X,{indeterminate:D,...P("icon")})]})})});Un.classes={...a_,...J2};Un.displayName="@mantine/core/Checkbox";Un.Group=u0;Un.Indicator=d0;Un.Card=l0;function gc(e){return"group"in e}function o_({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),i=[];for(let o=0;o<e.length;o+=1){const c=e[o];if(i.length===n)return i;gc(c)&&i.push({group:c.group,items:o_({options:c.items,search:t,limit:n-i.length})}),gc(c)||c.label.toLowerCase().includes(r)&&i.push(c)}return i}function F7(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 s_(e,t=new Set){if(Array.isArray(e))for(const n of e)if(gc(n))s_(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 H7(e,t){return Array.isArray(e)?e.includes(t):e===t}function l_({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:i,renderOption:o}){if(!gc(e)){const u=H7(n,e.value),f=t&&u&&s.jsx(Cp,{className:kr.optionsDropdownCheckIcon}),h=s.jsxs(s.Fragment,{children:[r==="left"&&f,s.jsx("span",{children:e.label}),r==="right"&&f]});return s.jsx(ct.Option,{value:e.value,disabled:e.disabled,className:zt({[kr.optionsDropdownOption]:!i}),"data-reverse":r==="right"||void 0,"data-checked":u||void 0,"aria-selected":u,active:u,children:typeof o=="function"?o({option:e,checked:u}):h})}const c=e.items.map(u=>s.jsx(l_,{data:u,value:n,unstyled:i,withCheckIcon:t,checkIconPosition:r,renderOption:o},u.value));return s.jsx(ct.Group,{label:e.group,children:c})}function q7({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:o,maxDropdownHeight:c,withScrollArea:u=!0,filterOptions:f=!0,withCheckIcon:h=!1,value:m,checkIconPosition:g,nothingFoundMessage:y,unstyled:b,labelId:S,renderOption:j,scrollAreaProps:C,"aria-label":T}){s_(e);const E=typeof i=="string"?(r||o_)({options:e,search:f?i:"",limit:o??1/0}):e,R=F7(E),D=E.map(k=>s.jsx(l_,{data:k,withCheckIcon:h,value:m,checkIconPosition:g,unstyled:b,renderOption:j},gc(k)?k.group:k.value));return s.jsx(ct.Dropdown,{hidden:t||n&&R,"data-composed":!0,children:s.jsxs(ct.Options,{labelledBy:S,"aria-label":T,children:[u?s.jsx(Yr.Autosize,{mah:c??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...C,children:D}):D,R&&y&&s.jsx(ct.Empty,{children:y})]})})}const c_=v.createContext(null),G7=c_.Provider;function W7(){return{withinGroup:!!v.useContext(c_)}}var Ep={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const Q7={},Y7=(e,{spacing:t})=>({group:{"--ag-spacing":Nn(t)}}),f0=ve((e,t)=>{const n=se("AvatarGroup",Q7,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,spacing:h,...m}=n,g=Le({name:"AvatarGroup",classes:Ep,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:Y7,rootSelector:"group"});return s.jsx(G7,{value:!0,children:s.jsx(ce,{ref:t,...g("group"),...m})})});f0.classes=Ep;f0.displayName="@mantine/core/AvatarGroup";function X7(e){return s.jsx("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function K7(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 Z7=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function J7(e,t=Z7){const n=K7(e),r=Math.abs(n)%t.length;return t[r]}function eL(e,t=2){const n=e.split(" ");return n.length===1?e.slice(0,t).toUpperCase():n.map(r=>r[0]).slice(0,t).join("").toUpperCase()}const tL={},nL=(e,{size:t,radius:n,variant:r,gradient:i,color:o,autoContrast:c,name:u,allowedInitialsColors:f})=>{const h=o==="initials"&&typeof u=="string"?J7(u,f):o,m=e.variantColorResolver({color:h||"gray",theme:e,gradient:i,variant:r||"light",autoContrast:c});return{root:{"--avatar-size":rt(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:Bt(n),"--avatar-bg":h||r?m.background:void 0,"--avatar-color":h||r?m.color:void 0,"--avatar-bd":h||r?m.border:void 0}}},zs=cr((e,t)=>{const n=se("Avatar",tL,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,src:h,alt:m,radius:g,color:y,gradient:b,imageProps:S,children:j,autoContrast:C,mod:T,name:_,allowedInitialsColors:E,...R}=n,D=W7(),[k,M]=v.useState(!h),L=Le({name:"Avatar",props:n,classes:Ep,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:nL});return v.useEffect(()=>M(!h),[h]),s.jsx(ce,{...L("root"),mod:[{"within-group":D.withinGroup},T],ref:t,...R,children:k?s.jsx("span",{...L("placeholder"),title:m,children:j||typeof _=="string"&&eL(_)||s.jsx(X7,{})}):s.jsx("img",{...S,...L("image"),src:h,alt:m,onError:z=>{var F;M(!0),(F=S==null?void 0:S.onError)==null||F.call(S,z)}})})});zs.classes=Ep;zs.displayName="@mantine/core/Avatar";zs.Group=f0;var u_={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const rL={},iL=(e,{radius:t,color:n,gradient:r,variant:i,size:o,autoContrast:c})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:c});return{root:{"--badge-height":rt(o,"badge-height"),"--badge-padding-x":rt(o,"badge-padding-x"),"--badge-fz":rt(o,"badge-fz"),"--badge-radius":t===void 0?void 0:Bt(t),"--badge-bg":n||i?u.background:void 0,"--badge-color":n||i?u.color:void 0,"--badge-bd":n||i?u.border:void 0,"--badge-dot-color":i==="dot"?Ft(n,e):void 0}}},Tp=cr((e,t)=>{const n=se("Badge",rL,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,radius:h,color:m,gradient:g,leftSection:y,rightSection:b,children:S,variant:j,fullWidth:C,autoContrast:T,circle:_,mod:E,...R}=n,D=Le({name:"Badge",props:n,classes:u_,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:iL});return s.jsxs(ce,{variant:j,mod:[{block:C,circle:_,"with-right-section":!!b,"with-left-section":!!y},E],...D("root",{variant:j}),ref:t,...R,children:[y&&s.jsx("span",{...D("section"),"data-position":"left",children:y}),s.jsx("span",{...D("label"),children:S}),b&&s.jsx("span",{...D("section"),"data-position":"right",children:b})]})});Tp.classes=u_;Tp.displayName="@mantine/core/Badge";var d_={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const aL={iconSize:48},oL=(e,{color:t,iconSize:n,radius:r})=>{const i=pi({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),o=pi({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":ui(o.value,.07),"--bq-bg-dark":ui(i.value,.06),"--bq-bd":Ft(t,e),"--bq-icon-size":le(n),"--bq-radius":Bt(r)}}},h0=ve((e,t)=>{const n=se("Blockquote",aL,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,children:h,icon:m,iconSize:g,cite:y,...b}=n,S=Le({name:"Blockquote",classes:d_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:oL});return s.jsxs(ce,{component:"blockquote",ref:t,...S("root"),...b,children:[m&&s.jsx("span",{...S("icon"),children:m}),h,y&&s.jsx("cite",{...S("cite"),children:y})]})});h0.classes=d_;h0.displayName="@mantine/core/Blockquote";var Dc={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const NC={orientation:"horizontal"},sL=(e,{borderWidth:t})=>({group:{"--button-border-width":le(t)}}),p0=ve((e,t)=>{const n=se("ButtonGroup",NC,e),{className:r,style:i,classNames:o,styles:c,unstyled:u,orientation:f,vars:h,borderWidth:m,variant:g,mod:y,...b}=se("ButtonGroup",NC,e),S=Le({name:"ButtonGroup",props:n,classes:Dc,className:r,style:i,classNames:o,styles:c,unstyled:u,vars:h,varsResolver:sL,rootSelector:"group"});return s.jsx(ce,{...S("group"),ref:t,variant:g,mod:[{"data-orientation":f},y],role:"group",...b})});p0.classes=Dc;p0.displayName="@mantine/core/ButtonGroup";const OC={},lL=(e,{radius:t,color:n,gradient:r,variant:i,autoContrast:o,size:c})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:o});return{groupSection:{"--section-height":rt(c,"section-height"),"--section-padding-x":rt(c,"section-padding-x"),"--section-fz":c!=null&&c.includes("compact")?On(c.replace("compact-","")):On(c),"--section-radius":t===void 0?void 0:Bt(t),"--section-bg":n||i?u.background:void 0,"--section-color":u.color,"--section-bd":n||i?u.border:void 0}}},m0=ve((e,t)=>{const n=se("ButtonGroupSection",OC,e),{className:r,style:i,classNames:o,styles:c,unstyled:u,vars:f,variant:h,gradient:m,radius:g,autoContrast:y,...b}=se("ButtonGroupSection",OC,e),S=Le({name:"ButtonGroupSection",props:n,classes:Dc,className:r,style:i,classNames:o,styles:c,unstyled:u,vars:f,varsResolver:lL,rootSelector:"groupSection"});return s.jsx(ce,{...S("groupSection"),ref:t,variant:h,...b})});m0.classes=Dc;m0.displayName="@mantine/core/ButtonGroupSection";const cL={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${le(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},uL={},dL=(e,{radius:t,color:n,gradient:r,variant:i,size:o,justify:c,autoContrast:u})=>{const f=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:u});return{root:{"--button-justify":c,"--button-height":rt(o,"button-height"),"--button-padding-x":rt(o,"button-padding-x"),"--button-fz":o!=null&&o.includes("compact")?On(o.replace("compact-","")):On(o),"--button-radius":t===void 0?void 0:Bt(t),"--button-bg":n||i?f.background:void 0,"--button-hover":n||i?f.hover:void 0,"--button-color":f.color,"--button-bd":n||i?f.border:void 0,"--button-hover-color":n||i?f.hoverColor:void 0}}},Pe=cr((e,t)=>{const n=se("Button",uL,e),{style:r,vars:i,className:o,color:c,disabled:u,children:f,leftSection:h,rightSection:m,fullWidth:g,variant:y,radius:b,loading:S,loaderProps:j,gradient:C,classNames:T,styles:_,unstyled:E,"data-disabled":R,autoContrast:D,mod:k,...M}=n,L=Le({name:"Button",props:n,classes:Dc,className:o,style:r,classNames:T,styles:_,unstyled:E,vars:i,varsResolver:dL}),z=!!h,F=!!m;return s.jsxs(tr,{ref:t,...L("root",{active:!u&&!S&&!R}),unstyled:E,variant:y,disabled:u||S,mod:[{disabled:u||R,loading:S,block:g,"with-left-section":z,"with-right-section":F},k],...M,children:[s.jsx(da,{mounted:!!S,transition:cL,duration:150,children:Y=>s.jsx(ce,{component:"span",...L("loader",{style:Y}),"aria-hidden":!0,children:s.jsx(Ar,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...j})})}),s.jsxs("span",{...L("inner"),children:[h&&s.jsx(ce,{component:"span",...L("section"),mod:{position:"left"},children:h}),s.jsx(ce,{component:"span",mod:{loading:S},...L("label"),children:f}),m&&s.jsx(ce,{component:"span",...L("section"),mod:{position:"right"},children:m})]})]})});Pe.classes=Dc;Pe.displayName="@mantine/core/Button";Pe.Group=p0;Pe.GroupSection=m0;var f_={root:"m_4451eb3a"};const fL={},er=cr((e,t)=>{const n=se("Center",fL,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,inline:h,mod:m,...g}=n,y=Le({name:"Center",props:n,classes:f_,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f});return s.jsx(ce,{ref:t,mod:[{inline:h},m],...y("root"),...g})});er.classes=f_;er.displayName="@mantine/core/Center";const[hL,pL]=Wa(),mL={};function h_(e){const{value:t,defaultValue:n,onChange:r,multiple:i,children:o}=se("ChipGroup",mL,e),[c,u]=Xn({value:t,defaultValue:n,finalValue:i?[]:null,onChange:r}),f=m=>Array.isArray(c)?c.includes(m):m===c,h=m=>{const g=m.currentTarget.value;Array.isArray(c)?u(c.includes(g)?c.filter(y=>y!==g):[...c,g]):u(g)};return s.jsx(hL,{value:{isChipSelected:f,onChange:h,multiple:i},children:o})}h_.displayName="@mantine/core/ChipGroup";var p_={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 gL={type:"checkbox"},vL=(e,{size:t,radius:n,variant:r,color:i,autoContrast:o})=>{const c=e.variantColorResolver({color:i||e.primaryColor,theme:e,variant:r||"filled",autoContrast:o});return{root:{"--chip-fz":On(t),"--chip-size":rt(t,"chip-size"),"--chip-radius":n===void 0?void 0:Bt(n),"--chip-checked-padding":rt(t,"chip-checked-padding"),"--chip-padding":rt(t,"chip-padding"),"--chip-icon-size":rt(t,"chip-icon-size"),"--chip-bg":i||r?c.background:void 0,"--chip-hover":i||r?c.hover:void 0,"--chip-color":i||r?c.color:void 0,"--chip-bd":i||r?c.border:void 0,"--chip-spacing":rt(t,"chip-spacing")}}},Ku=ve((e,t)=>{const n=se("Chip",gL,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,id:h,checked:m,defaultChecked:g,onChange:y,value:b,wrapperProps:S,type:j,disabled:C,children:T,size:_,variant:E,icon:R,rootRef:D,autoContrast:k,mod:M,...L}=n,z=Le({name:"Chip",classes:p_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:vL}),F=pL(),Y=yr(h),{styleProps:W,rest:J}=Xa(L),[G,X]=Xn({value:m,defaultValue:g,finalValue:!1,onChange:y}),P=F?{checked:F.isChipSelected(b),onChange:$=>{F.onChange($),y==null||y($.currentTarget.checked)},type:F.multiple?"checkbox":"radio"}:{},I=P.checked||G;return s.jsxs(ce,{size:_,variant:E,ref:D,mod:M,...z("root"),...W,...S,children:[s.jsx("input",{type:j,...z("input"),checked:I,onChange:$=>X($.currentTarget.checked),id:Y,disabled:C,ref:t,value:b,...P,...J}),s.jsxs("label",{htmlFor:Y,"data-checked":I||void 0,"data-disabled":C||void 0,...z("label",{variant:E||"filled"}),children:[I&&s.jsx("span",{...z("iconWrapper"),children:R||s.jsx(Cp,{...z("checkIcon")})}),s.jsx("span",{children:T})]})]})});Ku.classes=p_;Ku.displayName="@mantine/core/Chip";Ku.Group=h_;var m_={root:"m_b183c0a2"};const yL={},xL=(e,{color:t})=>({root:{"--code-bg":t?Ft(t,e):void 0}}),g0=ve((e,t)=>{const n=se("Code",yL,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,color:h,block:m,variant:g,mod:y,...b}=n,S=Le({name:"Code",props:n,classes:m_,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:xL});return s.jsx(ce,{component:m?"pre":"code",variant:g,ref:t,mod:[{block:m},y],...S("root"),...b,dir:"ltr"})});g0.classes=m_;g0.displayName="@mantine/core/Code";var g_={root:"m_7485cace"};const bL={},SL=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:rt(t,"container-size")}}),v0=ve((e,t)=>{const n=se("Container",bL,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,fluid:h,mod:m,...g}=n,y=Le({name:"Container",classes:g_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:SL});return s.jsx(ce,{ref:t,mod:[{fluid:h},m],...y("root"),...g})});v0.classes=g_;v0.displayName="@mantine/core/Container";const wL={timeout:1e3};function v_(e){const{children:t,timeout:n,value:r,...i}=se("CopyButton",wL,e),o=gR({timeout:n}),c=()=>o.copy(r);return s.jsx(s.Fragment,{children:t({copy:c,copied:o.copied,...i})})}v_.displayName="@mantine/core/CopyButton";var y_={root:"m_3eebeb36",label:"m_9e365f20"};const jL={orientation:"horizontal"},CL=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?Ft(t,e):void 0,"--divider-border-style":n,"--divider-size":rt(r,"divider-size")}}),Cn=ve((e,t)=>{const n=se("Divider",jL,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,color:h,orientation:m,label:g,labelPosition:y,mod:b,...S}=n,j=Le({name:"Divider",classes:y_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:CL});return s.jsx(ce,{ref:t,mod:[{orientation:m,"with-label":!!g},b],...j("root"),...S,role:"separator",children:g&&s.jsx(ce,{component:"span",mod:{position:y},...j("label"),children:g})})});Cn.classes=y_;Cn.displayName="@mantine/core/Divider";function EL({open:e,close:t,openDelay:n,closeDelay:r}){const i=v.useRef(-1),o=v.useRef(-1),c=()=>{window.clearTimeout(i.current),window.clearTimeout(o.current)},u=()=>{c(),n===0||n===void 0?e():i.current=window.setTimeout(e,n)},f=()=>{c(),r===0||r===void 0?t():o.current=window.setTimeout(t,r)};return v.useEffect(()=>c,[]),{openDropdown:u,closeDropdown:f}}const[MC,x_]=vr("Grid component was not found in tree"),Ny=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,LC=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":Ny(e,t),IC=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},$C=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function TL({span:e,order:t,offset:n,selector:r}){var b;const i=bn(),o=x_(),c=o.breakpoints||i.breakpoints,f=_i(e)===void 0?12:_i(e),h=Wo({"--col-order":(b=_i(t))==null?void 0:b.toString(),"--col-flex-grow":IC(f,o.grow),"--col-flex-basis":Ny(f,o.columns),"--col-width":f==="content"?"auto":void 0,"--col-max-width":LC(f,o.columns,o.grow),"--col-offset":$C(_i(n),o.columns)}),m=on(c).reduce((S,j)=>{var C;return S[j]||(S[j]={}),typeof t=="object"&&t[j]!==void 0&&(S[j]["--col-order"]=(C=t[j])==null?void 0:C.toString()),typeof e=="object"&&e[j]!==void 0&&(S[j]["--col-flex-grow"]=IC(e[j],o.grow),S[j]["--col-flex-basis"]=Ny(e[j],o.columns),S[j]["--col-width"]=e[j]==="content"?"auto":void 0,S[j]["--col-max-width"]=LC(e[j],o.columns,o.grow)),typeof n=="object"&&n[j]!==void 0&&(S[j]["--col-offset"]=$C(n[j],o.columns)),S},{}),y=Wu(on(m),c).filter(S=>on(m[S.value]).length>0).map(S=>({query:o.type==="container"?`mantine-grid (min-width: ${c[S.value]})`:`(min-width: ${c[S.value]})`,styles:m[S.value]}));return s.jsx(Js,{styles:h,media:o.type==="container"?void 0:y,container:o.type==="container"?y:void 0,selector:r})}var y0={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const RL={span:12},x0=ve((e,t)=>{const n=se("GridCol",RL,e),{classNames:r,className:i,style:o,styles:c,vars:u,span:f,order:h,offset:m,...g}=n,y=x_(),b=ud();return s.jsxs(s.Fragment,{children:[s.jsx(TL,{selector:`.${b}`,span:f,order:h,offset:m}),s.jsx(ce,{ref:t,...y.getStyles("col",{className:zt(i,b),style:o,classNames:r,styles:c}),...g})]})});x0.classes=y0;x0.displayName="@mantine/core/GridCol";function zC({gutter:e,selector:t,breakpoints:n,type:r}){const i=bn(),o=n||i.breakpoints,c=Wo({"--grid-gutter":Nn(_i(e))}),u=on(o).reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--grid-gutter"]=Nn(e[g])),m),{}),h=Wu(on(u),o).filter(m=>on(u[m.value]).length>0).map(m=>({query:r==="container"?`mantine-grid (min-width: ${o[m.value]})`:`(min-width: ${o[m.value]})`,styles:u[m.value]}));return s.jsx(Js,{styles:c,media:r==="container"?void 0:h,container:r==="container"?h:void 0,selector:t})}const _L={gutter:"md",grow:!1,columns:12},DL=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),or=ve((e,t)=>{const n=se("Grid",_L,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,grow:h,gutter:m,columns:g,align:y,justify:b,children:S,breakpoints:j,type:C,...T}=n,_=Le({name:"Grid",classes:y0,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:DL}),E=ud();return C==="container"&&j?s.jsxs(MC,{value:{getStyles:_,grow:h,columns:g||12,breakpoints:j,type:C},children:[s.jsx(zC,{selector:`.${E}`,...n}),s.jsx("div",{..._("container"),children:s.jsx(ce,{ref:t,..._("root",{className:E}),...T,children:s.jsx("div",{..._("inner"),children:S})})})]}):s.jsxs(MC,{value:{getStyles:_,grow:h,columns:g||12,breakpoints:j,type:C},children:[s.jsx(zC,{selector:`.${E}`,...n}),s.jsx(ce,{ref:t,..._("root",{className:E}),...T,children:s.jsx("div",{..._("inner"),children:S})})]})});or.classes=y0;or.displayName="@mantine/core/Grid";or.Col=x0;function Mh(){return Mh=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},Mh.apply(null,arguments)}function b0(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var AL=v.useLayoutEffect,kL=function(t){var n=En.useRef(t);return AL(function(){n.current=t}),n},UC=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},PL=function(t,n){var r=En.useRef();return En.useCallback(function(i){t.current=i,r.current&&UC(r.current,null),r.current=n,n&&UC(n,i)},[n])},BC={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},NL=function(t){Object.keys(BC).forEach(function(n){t.style.setProperty(n,BC[n],"important")})},VC=NL,fr=null,FC=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function OL(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),fr||(fr=document.createElement("textarea"),fr.setAttribute("tabindex","-1"),fr.setAttribute("aria-hidden","true"),VC(fr)),fr.parentNode===null&&document.body.appendChild(fr);var i=e.paddingSize,o=e.borderSize,c=e.sizingStyle,u=c.boxSizing;Object.keys(c).forEach(function(y){var b=y;fr.style[b]=c[b]}),VC(fr),fr.value=t;var f=FC(fr,e);fr.value=t,f=FC(fr,e),fr.value="x";var h=fr.scrollHeight-i,m=h*n;u==="border-box"&&(m=m+i+o),f=Math.max(m,f);var g=h*r;return u==="border-box"&&(g=g+i+o),f=Math.min(g,f),[f,h]}var HC=function(){},ML=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},LL=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],IL=!!document.documentElement.currentStyle,$L=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=ML(LL,n),i=r.boxSizing;if(i==="")return null;IL&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var o=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),c=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:o,borderSize:c}},zL=$L;function S0(e,t,n){var r=kL(n);v.useLayoutEffect(function(){var i=function(c){return r.current(c)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var UL=function(t,n){S0(document.body,"reset",function(r){t.current.form===r.target&&n(r)})},BL=function(t){S0(window,"resize",t)},VL=function(t){S0(document.fonts,"loadingdone",t)},FL=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],HL=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,o=t.minRows,c=t.onChange,u=c===void 0?HC:c,f=t.onHeightChange,h=f===void 0?HC:f,m=b0(t,FL),g=m.value!==void 0,y=v.useRef(null),b=PL(y,n),S=v.useRef(0),j=v.useRef(),C=function(){var E=y.current,R=r&&j.current?j.current:zL(E);if(R){j.current=R;var D=OL(R,E.value||E.placeholder||"x",o,i),k=D[0],M=D[1];S.current!==k&&(S.current=k,E.style.setProperty("height",k+"px","important"),h(k,{rowHeight:M}))}},T=function(E){g||C(),u(E)};return v.useLayoutEffect(C),UL(y,function(){if(!g){var _=y.current.value;requestAnimationFrame(function(){var E=y.current;E&&_!==E.value&&C()})}}),BL(C),VL(C),v.createElement("textarea",Mh({},m,{onChange:T,ref:b}))},qL=v.forwardRef(HL);const GL={},tl=ve((e,t)=>{const{autosize:n,maxRows:r,minRows:i,__staticSelector:o,resize:c,...u}=se("Textarea",GL,e),f=n&&jR()!=="test",h=f?{maxRows:r,minRows:i}:{};return s.jsx(Pr,{component:f?qL:"textarea",ref:t,...u,__staticSelector:o||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":c},...h})});tl.classes=Pr.classes;tl.displayName="@mantine/core/Textarea";function qC(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const WL={serialize:JSON.stringify,deserialize:JSON.parse},Ac=ve((e,t)=>{const{value:n,defaultValue:r,onChange:i,formatOnBlur:o,validationError:c,serialize:u,deserialize:f,onFocus:h,onBlur:m,readOnly:g,error:y,...b}=se("JsonInput",WL,e),[S,j]=Xn({value:n,defaultValue:r,finalValue:"",onChange:i}),[C,T]=v.useState(qC(S,f)),_=R=>{h==null||h(R),T(!0)},E=R=>{typeof m=="function"&&m(R);const D=qC(R.currentTarget.value,f);o&&!g&&D&&R.currentTarget.value.trim()!==""&&j(u(f(R.currentTarget.value),null,2)),T(D)};return s.jsx(tl,{value:S,onChange:R=>j(R.currentTarget.value),onFocus:_,onBlur:E,ref:t,readOnly:g,...b,autoComplete:"off",__staticSelector:"JsonInput",error:C?y:c||!0,"data-monospace":!0})});Ac.classes=Pr.classes;Ac.displayName="@mantine/core/JsonInput";const[QL,YL]=vr("List component was not found in tree");var w0={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const XL={},j0=ve((e,t)=>{const n=se("ListItem",XL,e),{classNames:r,className:i,style:o,styles:c,vars:u,icon:f,children:h,mod:m,...g}=n,y=YL(),b=f||y.icon,S={classNames:r,styles:c};return s.jsx(ce,{...y.getStyles("item",{...S,className:i,style:o}),component:"li",mod:[{"with-icon":!!b,centered:y.center},m],ref:t,...g,children:s.jsxs("div",{...y.getStyles("itemWrapper",S),children:[b&&s.jsx("span",{...y.getStyles("itemIcon",S),children:b}),s.jsx("span",{...y.getStyles("itemLabel",S),children:h})]})})});j0.classes=w0;j0.displayName="@mantine/core/ListItem";const KL={type:"unordered"},ZL=(e,{size:t,spacing:n})=>({root:{"--list-fz":On(t),"--list-lh":mR(t),"--list-spacing":Nn(n)}}),mr=ve((e,t)=>{const n=se("List",KL,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,children:h,type:m,withPadding:g,icon:y,spacing:b,center:S,listStyleType:j,mod:C,...T}=n,_=Le({name:"List",classes:w0,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:ZL});return s.jsx(QL,{value:{center:S,icon:y,getStyles:_},children:s.jsx(ce,{..._("root",{style:{listStyleType:j}}),component:m==="unordered"?"ul":"ol",mod:[{"with-padding":g},C],ref:t,...T,children:h})})});mr.classes=w0;mr.displayName="@mantine/core/List";mr.Item=j0;var b_={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const GC={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Qr("overlay")},JL=(e,{zIndex:t})=>({root:{"--lo-z-index":t==null?void 0:t.toString()}}),Rp=ve((e,t)=>{const n=se("LoadingOverlay",GC,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,transitionProps:h,loaderProps:m,overlayProps:g,visible:y,zIndex:b,...S}=n,j=bn(),C=Le({name:"LoadingOverlay",classes:b_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:JL}),T={...GC.overlayProps,...g};return s.jsx(da,{transition:"fade",...h,mounted:!!y,children:_=>s.jsxs(ce,{...C("root",{style:_}),ref:t,...S,children:[s.jsx(Ar,{...C("loader"),unstyled:u,...m}),s.jsx(pc,{...T,...C("overlay"),darkHidden:!0,unstyled:u,color:(g==null?void 0:g.color)||j.white}),s.jsx(pc,{...T,...C("overlay"),lightHidden:!0,unstyled:u,color:(g==null?void 0:g.color)||j.colors.dark[5]})]})})});Rp.classes=b_;Rp.displayName="@mantine/core/LoadingOverlay";const[eI,vd]=vr("Menu component was not found in the tree");var kc={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504"};const tI={},C0=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:o,vars:c,...u}=se("MenuDivider",tI,e),f=vd();return s.jsx(ce,{ref:t,...f.getStyles("divider",{className:r,style:i,styles:o,classNames:n}),...u})});C0.classes=kc;C0.displayName="@mantine/core/MenuDivider";const nI={},E0=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:o,vars:c,onMouseEnter:u,onMouseLeave:f,onKeyDown:h,children:m,...g}=se("MenuDropdown",nI,e),y=v.useRef(null),b=vd(),S=Rr(h,T=>{var _,E;(T.key==="ArrowUp"||T.key==="ArrowDown")&&(T.preventDefault(),(E=(_=y.current)==null?void 0:_.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||E.focus())}),j=Rr(u,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.openDropdown()),C=Rr(f,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.closeDropdown());return s.jsxs(Li.Dropdown,{...g,onMouseEnter:j,onMouseLeave:C,role:"menu","aria-orientation":"vertical",ref:Bn(t,y),...b.getStyles("dropdown",{className:r,style:i,styles:o,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:S,children:[b.withInitialFocusPlaceholder&&s.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),m]})});E0.classes=kc;E0.displayName="@mantine/core/MenuDropdown";const rI={},T0=cr((e,t)=>{const{classNames:n,className:r,style:i,styles:o,vars:c,color:u,closeMenuOnClick:f,leftSection:h,rightSection:m,children:g,disabled:y,"data-disabled":b,...S}=se("MenuItem",rI,e),j=vd(),C=bn(),{dir:T}=el(),_=v.useRef(null),E=j.getItemIndex(_.current),R=S,D=Rr(R.onMouseLeave,()=>j.setHovered(-1)),k=Rr(R.onMouseEnter,()=>j.setHovered(j.getItemIndex(_.current))),M=Rr(R.onClick,()=>{b||(typeof f=="boolean"?f&&j.closeDropdownImmediately():j.closeOnItemClick&&j.closeDropdownImmediately())}),L=Rr(R.onFocus,()=>j.setHovered(j.getItemIndex(_.current))),z=u?C.variantColorResolver({color:u,theme:C,variant:"light"}):void 0,F=u?pi({color:u,theme:C}):null;return s.jsxs(tr,{...S,unstyled:j.unstyled,tabIndex:j.menuItemTabIndex,onFocus:L,...j.getStyles("item",{className:r,style:i,styles:o,classNames:n}),ref:Bn(_,t),role:"menuitem",disabled:y,"data-menu-item":!0,"data-disabled":y||b||void 0,"data-hovered":j.hovered===E?!0:void 0,"data-mantine-stop-propagation":!0,onMouseEnter:k,onMouseLeave:D,onClick:M,onKeyDown:pR({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:j.loop,dir:T,orientation:"vertical",onKeyDown:R.onKeyDown}),__vars:{"--menu-item-color":F!=null&&F.isThemeColor&&(F==null?void 0:F.shade)===void 0?`var(--mantine-color-${F.color}-6)`:z==null?void 0:z.color,"--menu-item-hover":z==null?void 0:z.hover},children:[h&&s.jsx("div",{...j.getStyles("itemSection",{styles:o,classNames:n}),"data-position":"left",children:h}),g&&s.jsx("div",{...j.getStyles("itemLabel",{styles:o,classNames:n}),children:g}),m&&s.jsx("div",{...j.getStyles("itemSection",{styles:o,classNames:n}),"data-position":"right",children:m})]})});T0.classes=kc;T0.displayName="@mantine/core/MenuItem";const iI={},R0=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:o,vars:c,...u}=se("MenuLabel",iI,e),f=vd();return s.jsx(ce,{ref:t,...f.getStyles("label",{className:r,style:i,styles:o,classNames:n}),...u})});R0.classes=kc;R0.displayName="@mantine/core/MenuLabel";const aI={refProp:"ref"},S_=v.forwardRef((e,t)=>{const{children:n,refProp:r,...i}=se("MenuTarget",aI,e);if(!Ga(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 o=vd(),c=n.props,u=Rr(c.onClick,()=>{o.trigger==="click"?o.toggleDropdown():o.trigger==="click-hover"&&(o.setOpenedViaClick(!0),o.opened||o.openDropdown())}),f=Rr(c.onMouseEnter,()=>(o.trigger==="hover"||o.trigger==="click-hover")&&o.openDropdown()),h=Rr(c.onMouseLeave,()=>{(o.trigger==="hover"||o.trigger==="click-hover"&&!o.openedViaClick)&&o.closeDropdown()});return s.jsx(Li.Target,{refProp:r,popupType:"menu",ref:t,...i,children:v.cloneElement(n,{onClick:u,onMouseEnter:f,onMouseLeave:h,"data-expanded":o.opened?!0:void 0})})});S_.displayName="@mantine/core/MenuTarget";const oI={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function Ce(e){const t=se("Menu",oI,e),{children:n,onOpen:r,onClose:i,opened:o,defaultOpened:c,trapFocus:u,onChange:f,closeOnItemClick:h,loop:m,closeOnEscape:g,trigger:y,openDelay:b,closeDelay:S,classNames:j,styles:C,unstyled:T,variant:_,vars:E,menuItemTabIndex:R,keepMounted:D,withInitialFocusPlaceholder:k,...M}=t,L=Le({name:"Menu",classes:kc,props:t,classNames:j,styles:C,unstyled:T}),[z,{setHovered:F,resetHovered:Y}]=d3(),[W,J]=Xn({value:o,defaultValue:c,finalValue:!1,onChange:f}),[G,X]=v.useState(!1),P=()=>{J(!1),X(!1),W&&(i==null||i())},I=()=>{J(!0),!W&&(r==null||r())},$=()=>{W?P():I()},{openDropdown:H,closeDropdown:O}=EL({open:I,close:P,closeDelay:S,openDelay:b}),U=Se=>u3("[data-menu-item]","[data-menu-dropdown]",Se),{resolvedClassNames:K,resolvedStyles:ee}=Ks({classNames:j,styles:C,props:t});return Ba(()=>{Y()},[W]),s.jsx(eI,{value:{getStyles:L,opened:W,toggleDropdown:$,getItemIndex:U,hovered:z,setHovered:F,openedViaClick:G,setOpenedViaClick:X,closeOnItemClick:h,closeDropdown:y==="click"?P:O,openDropdown:y==="click"?I:H,closeDropdownImmediately:P,loop:m,trigger:y,unstyled:T,menuItemTabIndex:R,withInitialFocusPlaceholder:k},children:s.jsx(Li,{...M,opened:W,onChange:$,defaultOpened:c,trapFocus:D?!1:u,closeOnEscape:g,__staticSelector:"Menu",classNames:K,styles:ee,unstyled:T,variant:_,keepMounted:D,children:n})})}Ce.extend=e=>e;Ce.withProps=qO(Ce);Ce.classes=kc;Ce.displayName="@mantine/core/Menu";Ce.Item=T0;Ce.Label=R0;Ce.Dropdown=E0;Ce.Target=S_;Ce.Divider=C0;const[sI,Pc]=vr("Modal component was not found in tree");var Ja={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const lI={},_p=ve((e,t)=>{const n=se("ModalBody",lI,e),{classNames:r,className:i,style:o,styles:c,vars:u,...f}=n,h=Pc();return s.jsx(P2,{ref:t,...h.getStyles("body",{classNames:r,style:o,styles:c,className:i}),...f})});_p.classes=Ja;_p.displayName="@mantine/core/ModalBody";const cI={},Dp=ve((e,t)=>{const n=se("ModalCloseButton",cI,e),{classNames:r,className:i,style:o,styles:c,vars:u,...f}=n,h=Pc();return s.jsx(N2,{ref:t,...h.getStyles("close",{classNames:r,style:o,styles:c,className:i}),...f})});Dp.classes=Ja;Dp.displayName="@mantine/core/ModalCloseButton";const uI={},Ap=ve((e,t)=>{const n=se("ModalContent",uI,e),{classNames:r,className:i,style:o,styles:c,vars:u,children:f,__hidden:h,...m}=n,g=Pc(),y=g.scrollAreaComponent||w5;return s.jsx(O2,{...g.getStyles("content",{className:i,style:o,styles:c,classNames:r}),innerProps:g.getStyles("inner",{className:i,style:o,styles:c,classNames:r}),"data-full-screen":g.fullScreen||void 0,"data-modal-content":!0,"data-hidden":h||void 0,ref:t,...m,children:s.jsx(y,{style:{maxHeight:g.fullScreen?"100dvh":`calc(100dvh - (${le(g.yOffset)} * 2))`},children:f})})});Ap.classes=Ja;Ap.displayName="@mantine/core/ModalContent";const dI={},kp=ve((e,t)=>{const n=se("ModalHeader",dI,e),{classNames:r,className:i,style:o,styles:c,vars:u,...f}=n,h=Pc();return s.jsx(M2,{ref:t,...h.getStyles("header",{classNames:r,style:o,styles:c,className:i}),...f})});kp.classes=Ja;kp.displayName="@mantine/core/ModalHeader";const fI={},Pp=ve((e,t)=>{const n=se("ModalOverlay",fI,e),{classNames:r,className:i,style:o,styles:c,vars:u,...f}=n,h=Pc();return s.jsx(L2,{ref:t,...h.getStyles("overlay",{classNames:r,style:o,styles:c,className:i}),...f})});Pp.classes=Ja;Pp.displayName="@mantine/core/ModalOverlay";const hI={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Qr("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},pI=(e,{radius:t,size:n,yOffset:r,xOffset:i})=>({root:{"--modal-radius":t===void 0?void 0:Bt(t),"--modal-size":rt(n,"modal-size"),"--modal-y-offset":le(r),"--modal-x-offset":le(i)}}),Np=ve((e,t)=>{const n=se("ModalRoot",hI,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,yOffset:h,scrollAreaComponent:m,radius:g,fullScreen:y,centered:b,xOffset:S,__staticSelector:j,...C}=n,T=Le({name:j,classes:Ja,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:pI});return s.jsx(sI,{value:{yOffset:h,scrollAreaComponent:m,getStyles:T,fullScreen:y},children:s.jsx(k2,{ref:t,...T("root"),"data-full-screen":y||void 0,"data-centered":b||void 0,"data-offset-scrollbars":m===Yr.Autosize||void 0,unstyled:u,...C})})});Np.classes=Ja;Np.displayName="@mantine/core/ModalRoot";const[mI,gI]=Wa();function w_({children:e}){const[t,n]=v.useState([]),[r,i]=v.useState(Qr("modal"));return s.jsx(mI,{value:{stack:t,addModal:(o,c)=>{n(u=>[...new Set([...u,o])]),i(u=>typeof c=="number"&&typeof u=="number"?Math.max(u,c):u)},removeModal:o=>n(c=>c.filter(u=>u!==o)),getZIndex:o=>`calc(${r} + ${t.indexOf(o)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}w_.displayName="@mantine/core/ModalStack";const vI={},Op=ve((e,t)=>{const n=se("ModalTitle",vI,e),{classNames:r,className:i,style:o,styles:c,vars:u,...f}=n,h=Pc();return s.jsx(I2,{ref:t,...h.getStyles("title",{classNames:r,style:o,styles:c,className:i}),...f})});Op.classes=Ja;Op.displayName="@mantine/core/ModalTitle";const yI={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Qr("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Vn=ve((e,t)=>{const{title:n,withOverlay:r,overlayProps:i,withCloseButton:o,closeButtonProps:c,children:u,radius:f,opened:h,stackId:m,zIndex:g,...y}=se("Modal",yI,e),b=gI(),S=!!n||o,j=b&&m?{closeOnEscape:b.currentId===m,trapFocus:b.currentId===m,zIndex:b.getZIndex(m)}:{},C=r===!1?!1:m&&b?b.currentId===m:h;return v.useEffect(()=>{b&&m&&(h?b.addModal(m,g||Qr("modal")):b.removeModal(m))},[h,m,g]),s.jsxs(Np,{ref:t,radius:f,opened:h,zIndex:b&&m?b.getZIndex(m):g,...y,...j,children:[r&&s.jsx(Pp,{visible:C,transitionProps:b&&m?{duration:0}:void 0,...i}),s.jsxs(Ap,{radius:f,__hidden:b&&m&&h?m!==b.currentId:!1,children:[S&&s.jsxs(kp,{children:[n&&s.jsx(Op,{children:n}),o&&s.jsx(Dp,{...c})]}),s.jsx(_p,{children:u})]})]})});Vn.classes=Ja;Vn.displayName="@mantine/core/Modal";Vn.Root=Np;Vn.Overlay=Pp;Vn.Content=Ap;Vn.Body=_p;Vn.Header=kp;Vn.Title=Op;Vn.CloseButton=Dp;Vn.Stack=w_;const[xI,_0]=Wa(),[bI,SI]=Wa();var Mp={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const wI={},jI=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?rt(t):rt(n,"pg-gap")}}),D0=ve((e,t)=>{const n=se("PillGroup",wI,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,size:h,disabled:m,...g}=n,y=_0(),b=(y==null?void 0:y.size)||h||void 0,S=Le({name:"PillGroup",classes:Mp,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:jI,stylesCtx:{size:b},rootSelector:"group"});return s.jsx(bI,{value:{size:b,disabled:m},children:s.jsx(ce,{ref:t,size:b,...S("group"),...g})})});D0.classes=Mp;D0.displayName="@mantine/core/PillGroup";const CI={variant:"default"},EI=(e,{radius:t},{size:n})=>({root:{"--pill-fz":rt(n,"pill-fz"),"--pill-height":rt(n,"pill-height"),"--pill-radius":t===void 0?void 0:Bt(t)}}),Us=ve((e,t)=>{const n=se("Pill",CI,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,variant:h,children:m,withRemoveButton:g,onRemove:y,removeButtonProps:b,radius:S,size:j,disabled:C,mod:T,..._}=n,E=SI(),R=_0(),D=j||(E==null?void 0:E.size)||void 0,k=(R==null?void 0:R.variant)==="filled"?"contrast":h||"default",M=Le({name:"Pill",classes:Mp,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:EI,stylesCtx:{size:D}});return s.jsxs(ce,{component:"span",ref:t,variant:k,size:D,...M("root",{variant:k}),mod:[{"with-remove":g&&!C,disabled:C||(E==null?void 0:E.disabled)},T],..._,children:[s.jsx("span",{...M("label"),children:m}),g&&s.jsx(Yo,{variant:"transparent",radius:S,tabIndex:-1,"aria-hidden":!0,unstyled:u,...b,...M("remove",{className:b==null?void 0:b.className,style:b==null?void 0:b.style}),onMouseDown:L=>{var z;L.preventDefault(),L.stopPropagation(),(z=b==null?void 0:b.onMouseDown)==null||z.call(b,L)},onClick:L=>{var z;L.stopPropagation(),y==null||y(),(z=b==null?void 0:b.onClick)==null||z.call(b,L)}})]})});Us.classes=Mp;Us.displayName="@mantine/core/Pill";Us.Group=D0;var j_={field:"m_45c4369d"};const TI={type:"visible"},A0=ve((e,t)=>{const n=se("PillsInputField",TI,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,type:h,disabled:m,id:g,pointer:y,mod:b,...S}=n,j=_0(),C=Rc(),T=Le({name:"PillsInputField",classes:j_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"field"}),_=m||(j==null?void 0:j.disabled);return s.jsx(ce,{component:"input",ref:Bn(t,j==null?void 0:j.fieldRef),"data-type":h,disabled:_,mod:[{disabled:_,pointer:y},b],...T("field"),...S,id:(C==null?void 0:C.inputId)||g,"aria-invalid":j==null?void 0:j.hasError,"aria-describedby":C==null?void 0:C.describedBy,type:"text",onMouseDown:E=>!y&&E.stopPropagation()})});A0.classes=j_;A0.displayName="@mantine/core/PillsInputField";const RI={},vc=ve((e,t)=>{const n=se("PillsInput",RI,e),{children:r,onMouseDown:i,onClick:o,size:c,disabled:u,__staticSelector:f,error:h,variant:m,...g}=n,y=v.useRef(null);return s.jsx(xI,{value:{fieldRef:y,size:c,disabled:u,hasError:!!h,variant:m},children:s.jsx(Pr,{size:c,error:h,variant:m,component:"div",ref:t,onMouseDown:b=>{var S;b.preventDefault(),i==null||i(b),(S=y.current)==null||S.focus()},onClick:b=>{var j;b.preventDefault();const S=b.currentTarget.closest("fieldset");S!=null&&S.disabled||((j=y.current)==null||j.focus(),o==null||o(b))},...g,multiline:!0,disabled:u,__staticSelector:f||"PillsInput",withAria:!1,children:r})})});vc.displayName="@mantine/core/PillsInput";vc.Field=A0;function _I({data:e,value:t}){const n=t.map(i=>i.trim().toLowerCase());return e.reduce((i,o)=>(gc(o)?i.push({group:o.group,items:o.items.filter(c=>n.indexOf(c.value.toLowerCase().trim())===-1)}):n.indexOf(o.value.toLowerCase().trim())===-1&&i.push(o),i),[])}const DI={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},Lp=ve((e,t)=>{const n=se("MultiSelect",DI,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,size:h,value:m,defaultValue:g,onChange:y,onKeyDown:b,variant:S,data:j,dropdownOpened:C,defaultDropdownOpened:T,onDropdownOpen:_,onDropdownClose:E,selectFirstOptionOnChange:R,onOptionSubmit:D,comboboxProps:k,filter:M,limit:L,withScrollArea:z,maxDropdownHeight:F,searchValue:Y,defaultSearchValue:W,onSearchChange:J,readOnly:G,disabled:X,onFocus:P,onBlur:I,radius:$,rightSection:H,rightSectionWidth:O,rightSectionPointerEvents:U,rightSectionProps:K,leftSection:ee,leftSectionWidth:Se,leftSectionPointerEvents:be,leftSectionProps:xe,inputContainer:Ge,inputWrapperOrder:Me,withAsterisk:nt,labelProps:ke,descriptionProps:yt,errorProps:It,wrapperProps:$t,description:vt,label:At,error:nn,maxValues:Te,searchable:De,nothingFoundMessage:Qe,withCheckIcon:Re,checkIconPosition:me,hidePickedOptions:ge,withErrorStyles:Ne,name:we,form:ze,id:xt,clearable:ht,clearButtonProps:qt,hiddenInputProps:kt,placeholder:cn,hiddenInputValuesDivider:Ct,required:Bi,mod:Si,renderOption:ma,onRemove:Fn,onClear:wi,scrollAreaProps:Kr,chevronColor:ul,...ga}=n,ao=yr(xt),Vi=q2(j),br=G2(Vi),Gn=gd({opened:C,defaultOpened:T,onDropdownOpen:_,onDropdownClose:()=>{E==null||E(),Gn.resetSelectedOption()}}),{styleProps:va,rest:{type:oo,autoComplete:ts,...ns}}=Xa(ga),[V,Z]=Xn({value:m,defaultValue:g,finalValue:[],onChange:y}),[ae,he]=Xn({value:Y,defaultValue:W,finalValue:"",onChange:J}),Ee=et=>{he(et),Gn.resetSelectedOption()},Ue=Le({name:"MultiSelect",classes:{},props:n,classNames:r,styles:c,unstyled:u}),{resolvedClassNames:We,resolvedStyles:Fe}=Ks({props:n,styles:c,classNames:r}),Ze=et=>{b==null||b(et),et.key===" "&&!De&&(et.preventDefault(),Gn.toggleDropdown()),et.key==="Backspace"&&ae.length===0&&V.length>0&&(Fn==null||Fn(V[V.length-1]),Z(V.slice(0,V.length-1)))},it=V.map((et,un)=>{var mn,dt;return s.jsx(Us,{withRemoveButton:!G&&!((mn=br[et])!=null&&mn.disabled),onRemove:()=>{Z(V.filter(Gt=>et!==Gt)),Fn==null||Fn(et)},unstyled:u,disabled:X,...Ue("pill"),children:((dt=br[et])==null?void 0:dt.label)||et},`${et}-${un}`)});v.useEffect(()=>{R&&Gn.selectFirstOption()},[R,ae]);const Je=s.jsx(ct.ClearButton,{...qt,onClear:()=>{wi==null||wi(),Z([]),Ee("")}}),Ye=_I({data:Vi,value:V}),at=ht&&V.length>0&&!X&&!G;return s.jsxs(s.Fragment,{children:[s.jsxs(ct,{store:Gn,classNames:We,styles:Fe,unstyled:u,size:h,readOnly:G,__staticSelector:"MultiSelect",onOptionSubmit:et=>{D==null||D(et),Ee(""),Gn.updateSelectedOptionIndex("selected"),V.includes(br[et].value)?(Z(V.filter(un=>un!==br[et].value)),Fn==null||Fn(br[et].value)):V.length<Te&&Z([...V,br[et].value])},...k,children:[s.jsx(ct.DropdownTarget,{children:s.jsx(vc,{...va,__staticSelector:"MultiSelect",classNames:We,styles:Fe,unstyled:u,size:h,className:i,style:o,variant:S,disabled:X,radius:$,__defaultRightSection:s.jsx(ct.Chevron,{size:h,error:nn,unstyled:u,color:ul}),__clearSection:Je,__clearable:at,rightSection:H,rightSectionPointerEvents:U||(Je?"all":"none"),rightSectionWidth:O,rightSectionProps:K,leftSection:ee,leftSectionWidth:Se,leftSectionPointerEvents:be,leftSectionProps:xe,inputContainer:Ge,inputWrapperOrder:Me,withAsterisk:nt,labelProps:ke,descriptionProps:yt,errorProps:It,wrapperProps:$t,description:vt,label:At,error:nn,withErrorStyles:Ne,__stylesApiProps:{...n,rightSectionPointerEvents:U||(at?"all":"none"),multiline:!0},pointer:!De,onClick:()=>De?Gn.openDropdown():Gn.toggleDropdown(),"data-expanded":Gn.dropdownOpened||void 0,id:ao,required:Bi,mod:Si,children:s.jsxs(Us.Group,{disabled:X,unstyled:u,...Ue("pillsList"),children:[it,s.jsx(ct.EventsTarget,{autoComplete:ts,children:s.jsx(vc.Field,{...ns,ref:t,id:ao,placeholder:cn,type:!De&&!cn?"hidden":"visible",...Ue("inputField"),unstyled:u,onFocus:et=>{P==null||P(et),De&&Gn.openDropdown()},onBlur:et=>{I==null||I(et),Gn.closeDropdown(),Ee("")},onKeyDown:Ze,value:ae,onChange:et=>{Ee(et.currentTarget.value),De&&Gn.openDropdown(),R&&Gn.selectFirstOption()},disabled:X,readOnly:G||!De,pointer:!De})})]})})}),s.jsx(q7,{data:ge?Ye:Vi,hidden:G||X,filter:M,search:ae,limit:L,hiddenWhenEmpty:!Qe,withScrollArea:z,maxDropdownHeight:F,filterOptions:De,value:V,checkIconPosition:me,withCheckIcon:Re,nothingFoundMessage:Qe,unstyled:u,labelId:At?`${ao}-label`:void 0,"aria-label":At?void 0:ga["aria-label"],renderOption:ma,scrollAreaProps:Kr})]}),s.jsx(ct.HiddenInput,{name:we,valuesDivider:Ct,value:V,form:ze,disabled:X,...kt})]})});Lp.classes={...Pr.classes,...ct.classes};Lp.displayName="@mantine/core/MultiSelect";function AI(e){return"group"in e}function k0({data:e}){if(AI(e)){const i=e.items.map(o=>s.jsx(k0,{data:o},o.value));return s.jsx("optgroup",{label:e.group,children:i})}const{value:t,label:n,...r}=e;return s.jsx("option",{value:e.value,...r,children:e.label},e.value)}k0.displayName="@mantine/core/NativeSelectOption";const kI={rightSectionPointerEvents:"none"},sn=ve((e,t)=>{const{data:n,children:r,size:i,error:o,rightSection:c,unstyled:u,...f}=se("NativeSelect",kI,e),h=q2(n).map((m,g)=>s.jsx(k0,{data:m},g));return s.jsx(Pr,{component:"select",ref:t,...f,__staticSelector:"NativeSelect",size:i,pointer:!0,error:o,unstyled:u,rightSection:c||s.jsx(wp,{size:i,error:o,unstyled:u}),children:r||h})});sn.classes=Pr.classes;sn.displayName="@mantine/core/NativeSelect";var C_={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const PI={withCloseButton:!0},NI=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:Bt(t),"--notification-color":n?Ft(n,e):void 0}}),P0=ve((e,t)=>{const n=se("Notification",PI,e),{className:r,color:i,radius:o,loading:c,withCloseButton:u,withBorder:f,title:h,icon:m,children:g,onClose:y,closeButtonProps:b,classNames:S,style:j,styles:C,unstyled:T,variant:_,vars:E,mod:R,loaderProps:D,role:k,...M}=n,L=Le({name:"Notification",classes:C_,props:n,className:r,style:j,classNames:S,styles:C,unstyled:T,vars:E,varsResolver:NI});return s.jsxs(ce,{...L("root"),mod:[{"data-with-icon":!!m||c,"data-with-border":f},R],ref:t,variant:_,role:k||"alert",...M,children:[m&&!c&&s.jsx("div",{...L("icon"),children:m}),c&&s.jsx(Ar,{size:28,color:i,...D,...L("loader")}),s.jsxs("div",{...L("body"),children:[h&&s.jsx("div",{...L("title"),children:h}),s.jsx(ce,{...L("description"),mod:{"data-with-title":!!h},children:g})]}),u&&s.jsx(Yo,{iconSize:16,color:"gray",...b,unstyled:T,onClick:y,...L("closeButton")})]})});P0.classes=C_;P0.displayName="@mantine/core/Notification";function E_(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var Zu;(function(e){e.event="event",e.props="prop"})(Zu||(Zu={}));function $o(){}function OI(e){var t,n=void 0;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t&&r.length===t.length&&r.every(function(o,c){return o===t[c]})||(t=r,n=e.apply(void 0,r)),n}}function Ju(e){return!!(e||"").match(/\d/)}function sc(e){return e==null}function MI(e){return typeof e=="number"&&isNaN(e)}function T_(e){return sc(e)||MI(e)||typeof e=="number"&&!isFinite(e)}function R_(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function LI(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 II(e,t,n){var r=LI(n),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(r,"$1"+t)}function $I(e){var t=v.useRef(e);t.current=e;var n=v.useRef(function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t.current.apply(t,r)});return n.current}function N0(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var i=e.split("."),o=i[0],c=i[1]||"";return{beforeDecimal:o,afterDecimal:c,hasNegation:n,addNegation:r}}function zI(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",i=n[1]||"";return(t?"-":"")+r+(i?"."+i:"")}function __(e,t,n){for(var r="",i=n?"0":"",o=0;o<=t-1;o++)r+=e[o]||i;return r}function WC(e,t){return Array(t+1).join(e)}function D_(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),i=r[0],o=r[1];if(o=Number(o),!o)return n+i;i=i.replace(".","");var c=1+o,u=i.length;return c<0?i="0."+WC("0",Math.abs(c))+i:c>=u?i=i+WC("0",c-u):i=(i.substring(0,c)||"0")+"."+i.substring(c),n+i}function QC(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=N0(e),o=i.beforeDecimal,c=i.afterDecimal,u=i.hasNegation,f=parseFloat("0."+(c||"0")),h=c.length<=t?"0."+c:f.toFixed(t),m=h.split("."),g=o;o&&Number(m[0])&&(g=o.split("").reverse().reduce(function(j,C,T){return j.length>T?(Number(j[0])+Number(C)).toString()+j.substring(1,j.length):C+j},m[0]));var y=__(m[1]||"",t,n),b=u?"-":"",S=r?".":"";return""+b+g+S+y}function Ts(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 A_=OI(function(e,t){for(var n=0,r=0,i=e.length,o=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[o-1-r]&&o-r>n&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:o-r}}}),UI=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function BI(e,t,n){return Math.min(Math.max(e,t),n)}function Hv(e){return Math.max(e.selectionStart,e.selectionEnd)}function VI(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function FI(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function HI(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function qI(e,t,n,r,i,o,c){c===void 0&&(c=HI);var u=i.findIndex(function(R){return R}),f=e.slice(0,u);!t&&!n.startsWith(f)&&(t=f,n=f+n,r=r+f.length);for(var h=n.length,m=e.length,g={},y=new Array(h),b=0;b<h;b++){y[b]=-1;for(var S=0,j=m;S<j;S++){var C=c({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:b,formattedValueIndex:S});if(C&&g[S]!==!0){y[b]=S,g[S]=!0;break}}}for(var T=r;T<h&&(y[T]===-1||!o(n[T]));)T++;var _=T===h||y[T]===-1?m:y[T];for(T=r-1;T>0&&y[T]===-1;)T--;var E=T===-1||y[T]===-1?0:y[T]+1;return E>_?_:r-E<_-r?E:_}function YC(e,t,n,r){var i=e.length;if(t=BI(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function GI(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(Ju(e[n])||Ju(e[n-1]));return t}function k_(e,t,n,r,i,o){o===void 0&&(o=$o);var c=$I(function(S,j){var C,T;return T_(S)?(T="",C=""):typeof S=="number"||j?(T=typeof S=="number"?D_(S):S,C=r(T)):(T=i(S,void 0),C=r(T)),{formattedValue:C,numAsString:T}}),u=v.useState(function(){return c(sc(e)?t:e,n)}),f=u[0],h=u[1],m=function(S,j){S.formattedValue!==f.formattedValue&&h({formattedValue:S.formattedValue,numAsString:S.value}),o(S,j)},g=e,y=n;sc(e)&&(g=f.numAsString,y=!0);var b=c(g,y);return v.useMemo(function(){h(b)},[b.formattedValue]),[f,m]}function WI(e){return e.replace(/[^0-9]/g,"")}function QI(e){return e}function YI(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,i=e.renderText,o=e.getInputRef,c=e.format;c===void 0&&(c=QI);var u=e.removeFormatting;u===void 0&&(u=WI);var f=e.defaultValue,h=e.valueIsNumericString,m=e.onValueChange,g=e.isAllowed,y=e.onChange;y===void 0&&(y=$o);var b=e.onKeyDown;b===void 0&&(b=$o);var S=e.onMouseUp;S===void 0&&(S=$o);var j=e.onFocus;j===void 0&&(j=$o);var C=e.onBlur;C===void 0&&(C=$o);var T=e.value,_=e.getCaretBoundary;_===void 0&&(_=GI);var E=e.isValidInputCharacter;E===void 0&&(E=Ju);var R=e.isCharacterSame,D=E_(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),k=k_(T,f,!!h,c,u,m),M=k[0],L=M.formattedValue,z=M.numAsString,F=k[1],Y=v.useRef(),W=v.useRef({formattedValue:L,numAsString:z}),J=function(Te,De){W.current={formattedValue:Te.formattedValue,numAsString:Te.value},F(Te,De)},G=v.useState(!1),X=G[0],P=G[1],I=v.useRef(null),$=v.useRef({setCaretTimeout:null,focusTimeout:null});v.useEffect(function(){return P(!0),function(){clearTimeout($.current.setCaretTimeout),clearTimeout($.current.focusTimeout)}},[]);var H=c,O=function(Te,De){var Qe=parseFloat(De);return{formattedValue:Te,value:De,floatValue:isNaN(Qe)?void 0:Qe}},U=function(Te,De,Qe){Te.selectionStart===0&&Te.selectionEnd===Te.value.length||(Ts(Te,De),$.current.setCaretTimeout=setTimeout(function(){Te.value===Qe&&Te.selectionStart!==De&&Ts(Te,De)},0))},K=function(Te,De,Qe){return YC(Te,De,_(Te),Qe)},ee=function(Te,De,Qe){var Re=_(De),me=qI(De,L,Te,Qe,Re,E,R);return me=YC(De,me,Re),me},Se=function(Te){var De=Te.formattedValue;De===void 0&&(De="");var Qe=Te.input,Re=Te.source,me=Te.event,ge=Te.numAsString,Ne;if(Qe){var we=Te.inputValue||Qe.value,ze=Hv(Qe);Qe.value=De,Ne=ee(we,De,ze),Ne!==void 0&&U(Qe,Ne,De)}De!==L&&J(O(De,ge),{event:me,source:Re})};v.useEffect(function(){var Te=W.current,De=Te.formattedValue,Qe=Te.numAsString;(L!==De||z!==Qe)&&J(O(L,z),{event:void 0,source:Zu.props})},[L,z]);var be=I.current?Hv(I.current):void 0,xe=typeof window<"u"?v.useLayoutEffect:v.useEffect;xe(function(){var Te=I.current;if(L!==W.current.formattedValue&&Te){var De=ee(W.current.formattedValue,L,be);Te.value=L,U(Te,De,L)}},[L]);var Ge=function(Te,De,Qe){var Re=De.target,me=Y.current?UI(Y.current,Re.selectionEnd):A_(L,Te),ge=Object.assign(Object.assign({},me),{lastValue:L}),Ne=u(Te,ge),we=H(Ne);if(Ne=u(we,void 0),g&&!g(O(we,Ne))){var ze=De.target,xt=Hv(ze),ht=ee(Te,L,xt);return ze.value=L,U(ze,ht,L),!1}return Se({formattedValue:we,numAsString:Ne,inputValue:Te,event:De,source:Qe,input:De.target}),!0},Me=function(Te,De){De===void 0&&(De=0);var Qe=Te.selectionStart,Re=Te.selectionEnd;Y.current={selectionStart:Qe,selectionEnd:Re+De}},nt=function(Te){var De=Te.target,Qe=De.value,Re=Ge(Qe,Te,Zu.event);Re&&y(Te),Y.current=void 0},ke=function(Te){var De=Te.target,Qe=Te.key,Re=De.selectionStart,me=De.selectionEnd,ge=De.value;ge===void 0&&(ge="");var Ne;Qe==="ArrowLeft"||Qe==="Backspace"?Ne=Math.max(Re-1,0):Qe==="ArrowRight"?Ne=Math.min(Re+1,ge.length):Qe==="Delete"&&(Ne=Re);var we=0;Qe==="Delete"&&Re===me&&(we=1);var ze=Qe==="ArrowLeft"||Qe==="ArrowRight";if(Ne===void 0||Re!==me&&!ze){b(Te),Me(De,we);return}var xt=Ne;if(ze){var ht=Qe==="ArrowLeft"?"left":"right";xt=K(ge,Ne,ht),xt!==Ne&&Te.preventDefault()}else Qe==="Delete"&&!E(ge[Ne])?xt=K(ge,Ne,"right"):Qe==="Backspace"&&!E(ge[Ne])&&(xt=K(ge,Ne,"left"));xt!==Ne&&U(De,xt,ge),b(Te),Me(De,we)},yt=function(Te){var De=Te.target,Qe=function(){var Re=De.selectionStart,me=De.selectionEnd,ge=De.value;if(ge===void 0&&(ge=""),Re===me){var Ne=K(ge,Re);Ne!==Re&&U(De,Ne,ge)}};Qe(),requestAnimationFrame(function(){Qe()}),S(Te),Me(De)},It=function(Te){Te.persist&&Te.persist();var De=Te.target,Qe=Te.currentTarget;I.current=De,$.current.focusTimeout=setTimeout(function(){var Re=De.selectionStart,me=De.selectionEnd,ge=De.value;ge===void 0&&(ge="");var Ne=K(ge,Re);Ne!==Re&&!(Re===0&&me===ge.length)&&U(De,Ne,ge),j(Object.assign(Object.assign({},Te),{currentTarget:Qe}))},0)},$t=function(Te){I.current=null,clearTimeout($.current.focusTimeout),clearTimeout($.current.setCaretTimeout),C(Te)},vt=X&&VI()?"numeric":void 0,At=Object.assign({inputMode:vt},D,{type:t,value:L,onChange:nt,onKeyDown:ke,onMouseUp:yt,onFocus:It,onBlur:$t});if(n==="text")return i?En.createElement(En.Fragment,null,i(L,D)||null):En.createElement("span",Object.assign({},D,{ref:o}),L);if(r){var nn=r;return En.createElement(nn,Object.assign({},At,{ref:o}))}return En.createElement("input",Object.assign({},At,{ref:o}))}function XC(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i="");var o=t.suffix;o===void 0&&(o="");var c=t.allowNegative,u=t.thousandsGroupStyle;if(u===void 0&&(u="thousand"),e===""||e==="-")return e;var f=Ip(t),h=f.thousandSeparator,m=f.decimalSeparator,g=n!==0&&e.indexOf(".")!==-1||n&&r,y=N0(e,c),b=y.beforeDecimal,S=y.afterDecimal,j=y.addNegation;return n!==void 0&&(S=__(S,n,!!r)),h&&(b=II(b,h,u)),i&&(b=i+b),o&&(S=S+o),j&&(b="-"+b),e=b+(g&&m||"")+S,e}function Ip(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 XI(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),i=n.test(e),o=r.test(e);return e=e.replace(/-/g,""),i&&!o&&t&&(e="-"+e),e}function KI(e,t){return new RegExp("(^-)|[0-9]|"+R_(e),"g")}function ZI(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function JI(e,t,n){var r;t===void 0&&(t=FI(e));var i=n.allowNegative,o=n.prefix;o===void 0&&(o="");var c=n.suffix;c===void 0&&(c="");var u=n.decimalScale,f=t.from,h=t.to,m=h.start,g=h.end,y=Ip(n),b=y.allowedDecimalSeparators,S=y.decimalSeparator,j=e[g]===S;if(Ju(e)&&(e===o||e===c)&&t.lastValue==="")return e;if(g-m===1&&b.indexOf(e[m])!==-1){var C=u===0?"":S;e=e.substring(0,m)+C+e.substring(m+1,e.length)}var T=function(I,$,H){var O=!1,U=!1;o.startsWith("-")?O=!1:I.startsWith("--")?(O=!1,U=!0):c.startsWith("-")&&I.length===c.length?O=!1:I[0]==="-"&&(O=!0);var K=O?1:0;return U&&(K=2),K&&(I=I.substring(K),$-=K,H-=K),{value:I,start:$,end:H,hasNegation:O}},_=T(e,m,g),E=_.hasNegation;r=_,e=r.value,m=r.start,g=r.end;var R=T(t.lastValue,f.start,f.end),D=R.start,k=R.end,M=R.value,L=e.substring(m,g);e.length&&M.length&&(D>M.length-c.length||k<o.length)&&!(L&&c.startsWith(L))&&(e=M);var z=0;e.startsWith(o)?z+=o.length:m<o.length&&(z=m),e=e.substring(z),g-=z;var F=e.length,Y=e.length-c.length;e.endsWith(c)?F=Y:(g>Y||g>e.length-c.length)&&(F=g),e=e.substring(0,F),e=XI(E?"-"+e:e,i),e=(e.match(KI(S))||[]).join("");var W=e.indexOf(S);e=e.replace(new RegExp(R_(S),"g"),function(I,$){return $===W?".":""});var J=N0(e,i),G=J.beforeDecimal,X=J.afterDecimal,P=J.addNegation;return h.end-h.start<f.end-f.start&&G===""&&j&&!parseFloat(X)&&(e=P?"-":""),e}function e6(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var i=Array.from({length:e.length+1}).map(function(){return!0}),o=e[0]==="-";i.fill(!1,0,n.length+(o?1:0));var c=e.length;return i.fill(!1,c-r.length+1,c+1),i}function t6(e){var t=Ip(e),n=t.thousandSeparator,r=t.decimalSeparator,i=e.prefix;i===void 0&&(i="");var o=e.allowNegative;if(o===void 0&&(o=!0),n===r)throw new Error(`
69
+ Decimal separator can't be same as thousand separator.
70
+ thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
71
+ decimalSeparator: `+r+` (default value for decimalSeparator is .)
72
+ `);return i.startsWith("-")&&o&&(console.error(`
73
+ Prefix can't start with '-' when allowNegative is true.
74
+ prefix: `+i+`
75
+ allowNegative: `+o+`
76
+ `),o=!1),Object.assign(Object.assign({},e),{allowNegative:o})}function n6(e){e=t6(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=$o);var o=e.onBlur;o===void 0&&(o=$o);var c=e.thousandSeparator,u=e.decimalScale,f=e.fixedDecimalScale,h=e.prefix;h===void 0&&(h="");var m=e.defaultValue,g=e.value,y=e.valueIsNumericString,b=e.onValueChange,S=E_(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),j=Ip(e),C=j.decimalSeparator,T=j.allowedDecimalSeparators,_=function(P){return XC(P,e)},E=function(P,I){return JI(P,I,e)},R=sc(g)?m:g,D=y??ZI(R,h,t);sc(g)?sc(m)||(D=D||typeof m=="number"):D=D||typeof g=="number";var k=function(P){return T_(P)?P:(typeof P=="number"&&(P=D_(P)),D&&typeof u=="number"?QC(P,u,!!f):P)},M=k_(k(g),k(m),!!D,_,E,b),L=M[0],z=L.numAsString,F=L.formattedValue,Y=M[1],W=function(P){var I=P.target,$=P.key,H=I.selectionStart,O=I.selectionEnd,U=I.value;if(U===void 0&&(U=""),($==="Backspace"||$==="Delete")&&O<h.length){P.preventDefault();return}if(H!==O){i(P);return}$==="Backspace"&&U[0]==="-"&&H===h.length+1&&n&&Ts(I,1),u&&f&&($==="Backspace"&&U[H-1]===C?(Ts(I,H-1),P.preventDefault()):$==="Delete"&&U[H]===C&&P.preventDefault()),T!=null&&T.includes($)&&U[H]===C&&Ts(I,H+1);var K=c===!0?",":c;$==="Backspace"&&U[H-1]===K&&Ts(I,H-1),$==="Delete"&&U[H]===K&&Ts(I,H+1),i(P)},J=function(P){var I=z;if(I.match(/\d/g)||(I=""),r||(I=zI(I)),f&&u&&(I=QC(I,u,f)),I!==z){var $=XC(I,e);Y({formattedValue:$,value:I,floatValue:parseFloat(I)},{event:P,source:Zu.event})}o(P)},G=function(P){return P===C?!0:Ju(P)},X=function(P){var I=P.currentValue,$=P.lastValue,H=P.formattedValue,O=P.currentValueIndex,U=P.formattedValueIndex,K=I[O],ee=H[U],Se=A_($,I),be=Se.to,xe=function(Ge){return E(Ge).indexOf(".")+h.length};return g===0&&f&&u&&I[be.start]===C&&xe(I)<O&&xe(H)>U?!1:O>=be.start&&O<be.end&&T&&T.includes(K)&&ee===C?!0:K===ee};return Object.assign(Object.assign({},S),{value:F,valueIsNumericString:!1,isValidInputCharacter:G,isCharacterSame:X,onValueChange:Y,format:_,removeFormatting:E,getCaretBoundary:function(P){return e6(P,e)},onKeyDown:W,onBlur:J})}function r6(e){var t=n6(e);return En.createElement(YI,Object.assign({},t))}function KC({direction:e,style:t,...n}){return s.jsx("svg",{style:{width:"var(--ni-chevron-size)",height:"var(--ni-chevron-size)",transform:e==="up"?"rotate(180deg)":void 0,...t},viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:s.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}var Oy={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const i6=/^(0\.0*|-0(\.0*)?)$/,a6=/^-?0\d+(\.\d+)?\.?$/;function My(e){return typeof e=="string"&&e!==""&&!Number.isNaN(Number(e))}function qv(e){return typeof e=="number"?e<Number.MAX_SAFE_INTEGER:e===""||My(e)&&Number(e)<Number.MAX_SAFE_INTEGER}function o6(e){return e.toString().replace(".","").length}function s6(e,t){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&o6(t)<14&&t!==""}function ZC(e,t,n){if(e===void 0)return!0;const r=t===void 0||e>=t,i=n===void 0||e<=n;return r&&i}const l6={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},c6=(e,{size:t})=>({controls:{"--ni-chevron-size":rt(t,"ni-chevron-size")}});function u6(e,t,n){const r=e.toString().replace(/^0+/,""),i=parseFloat(r);return Number.isNaN(i)?r:i>Number.MAX_SAFE_INTEGER?t!==void 0?String(t):r:mh(i,n,t)}const $p=ve((e,t)=>{const n=se("NumberInput",l6,e),{className:r,classNames:i,styles:o,unstyled:c,vars:u,onChange:f,onValueChange:h,value:m,defaultValue:g,max:y,min:b,step:S,hideControls:j,rightSection:C,isAllowed:T,clampBehavior:_,onBlur:E,allowDecimal:R,decimalScale:D,onKeyDown:k,onKeyDownCapture:M,handlersRef:L,startValue:z,disabled:F,rightSectionPointerEvents:Y,allowNegative:W,readOnly:J,size:G,rightSectionWidth:X,stepHoldInterval:P,stepHoldDelay:I,allowLeadingZeros:$,withKeyboardEvents:H,trimLeadingZeroesOnBlur:O,...U}=n,K=Le({name:"NumberInput",classes:Oy,props:n,classNames:i,styles:o,unstyled:c,vars:u,varsResolver:c6}),{resolvedClassNames:ee,resolvedStyles:Se}=Ks({classNames:i,styles:o,props:n}),[be,xe]=Xn({value:m,defaultValue:g,finalValue:"",onChange:f}),Ge=I!==void 0&&P!==void 0,Me=v.useRef(null),nt=v.useRef(null),ke=v.useRef(0),yt=(we,ze)=>{ze.source==="event"&&xe(s6(we.floatValue,we.value)&&!i6.test(we.value)&&!($&&a6.test(we.value))?we.floatValue:we.value),h==null||h(we,ze)},It=we=>{const ze=String(we).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return ze?Math.max(0,(ze[1]?ze[1].length:0)-(ze[2]?+ze[2]:0)):0},$t=we=>{Me.current&&typeof we<"u"&&Me.current.setSelectionRange(we,we)},vt=v.useRef(_h);vt.current=()=>{if(!qv(be))return;let we;const ze=It(be),xt=It(S),ht=Math.max(ze,xt),qt=10**ht;if(!My(be)&&(typeof be!="number"||Number.isNaN(be)))we=mh(z,b,y);else if(y!==void 0){const cn=(Math.round(Number(be)*qt)+Math.round(S*qt))/qt;we=cn<=y?cn:y}else we=(Math.round(Number(be)*qt)+Math.round(S*qt))/qt;const kt=we.toFixed(ht);xe(parseFloat(kt)),h==null||h({floatValue:parseFloat(kt),formattedValue:kt,value:kt},{source:"increment"}),setTimeout(()=>{var cn;return $t((cn=Me.current)==null?void 0:cn.value.length)},0)};const At=v.useRef(_h);At.current=()=>{if(!qv(be))return;let we;const ze=b!==void 0?b:W?Number.MIN_SAFE_INTEGER:0,xt=It(be),ht=It(S),qt=Math.max(xt,ht),kt=10**qt;if(!My(be)&&typeof be!="number"||Number.isNaN(be))we=mh(z,ze,y);else{const Ct=(Math.round(Number(be)*kt)-Math.round(S*kt))/kt;we=ze!==void 0&&Ct<ze?ze:Ct}const cn=we.toFixed(qt);xe(parseFloat(cn)),h==null||h({floatValue:parseFloat(cn),formattedValue:cn,value:cn},{source:"decrement"}),setTimeout(()=>{var Ct;return $t((Ct=Me.current)==null?void 0:Ct.value.length)},0)};const nn=we=>{k==null||k(we),!(J||!H)&&(we.key==="ArrowUp"&&(we.preventDefault(),vt.current()),we.key==="ArrowDown"&&(we.preventDefault(),At.current()))},Te=we=>{if(M==null||M(we),we.key==="Backspace"){const ze=Me.current;ze.selectionStart===0&&ze.selectionStart===ze.selectionEnd&&(we.preventDefault(),window.setTimeout(()=>$t(0),0))}},De=we=>{let ze=be;_==="blur"&&typeof ze=="number"&&(ze=mh(ze,b,y)),O&&typeof ze=="string"&&It(ze)<15&&(ze=u6(ze,y,b)),be!==ze&&xe(ze),E==null||E(we)};Qu(L,{increment:vt.current,decrement:At.current});const Qe=we=>{we?vt.current():At.current(),ke.current+=1},Re=we=>{if(Qe(we),Ge){const ze=typeof P=="number"?P:P(ke.current);nt.current=window.setTimeout(()=>Re(we),ze)}},me=(we,ze)=>{var xt;we.preventDefault(),(xt=Me.current)==null||xt.focus(),Qe(ze),Ge&&(nt.current=window.setTimeout(()=>Re(ze),I))},ge=()=>{nt.current&&window.clearTimeout(nt.current),nt.current=null,ke.current=0},Ne=s.jsxs("div",{...K("controls"),children:[s.jsx(tr,{...K("control"),tabIndex:-1,"aria-hidden":!0,disabled:F||typeof be=="number"&&y!==void 0&&be>=y,mod:{direction:"up"},onMouseDown:we=>we.preventDefault(),onPointerDown:we=>{me(we,!0)},onPointerUp:ge,onPointerLeave:ge,children:s.jsx(KC,{direction:"up"})}),s.jsx(tr,{...K("control"),tabIndex:-1,"aria-hidden":!0,disabled:F||typeof be=="number"&&b!==void 0&&be<=b,mod:{direction:"down"},onMouseDown:we=>we.preventDefault(),onPointerDown:we=>{me(we,!1)},onPointerUp:ge,onPointerLeave:ge,children:s.jsx(KC,{direction:"down"})})]});return s.jsx(Pr,{component:r6,allowNegative:W,className:zt(Oy.root,r),size:G,...U,readOnly:J,disabled:F,value:be,getInputRef:Bn(t,Me),onValueChange:yt,rightSection:j||J||!qv(be)?C:C||Ne,classNames:ee,styles:Se,unstyled:c,__staticSelector:"NumberInput",decimalScale:R?D:0,onKeyDown:nn,onKeyDownCapture:Te,rightSectionPointerEvents:Y??(F?"none":void 0),rightSectionWidth:X??`var(--ni-right-section-width-${G||"sm"})`,allowLeadingZeros:$,onBlur:De,isAllowed:we=>_==="strict"?T?T(we)&&ZC(we.floatValue,b,y):ZC(we.floatValue,b,y):T?T(we):!0})});$p.classes={...Pr.classes,...Oy};$p.displayName="@mantine/core/NumberInput";const[d6,zp]=vr("Pagination.Root component was not found in tree");var yd={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const f6={withPadding:!0},xd=ve((e,t)=>{const n=se("PaginationControl",f6,e),{classNames:r,className:i,style:o,styles:c,vars:u,active:f,disabled:h,withPadding:m,mod:g,...y}=n,b=zp(),S=h||b.disabled;return s.jsx(tr,{ref:t,disabled:S,mod:[{active:f,disabled:S,"with-padding":m},g],...b.getStyles("control",{className:i,style:o,classNames:r,styles:c,active:!S}),...y})});xd.classes=yd;xd.displayName="@mantine/core/PaginationControl";function bd({style:e,children:t,path:n,...r}){return s.jsx("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)",...e},...r,children:s.jsx("path",{d:n,fill:"currentColor"})})}const h6=e=>s.jsx(bd,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),p6=e=>s.jsx(bd,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),m6=e=>s.jsx(bd,{...e,path:"M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z"}),g6=e=>s.jsx(bd,{...e,path:"M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z"}),v6=e=>s.jsx(bd,{...e,path:"M2 8c0-.733.6-1.333 1.333-1.333.734 0 1.334.6 1.334 1.333s-.6 1.333-1.334 1.333C2.6 9.333 2 8.733 2 8zm9.333 0c0-.733.6-1.333 1.334-1.333C13.4 6.667 14 7.267 14 8s-.6 1.333-1.333 1.333c-.734 0-1.334-.6-1.334-1.333zM6.667 8c0-.733.6-1.333 1.333-1.333s1.333.6 1.333 1.333S8.733 9.333 8 9.333 6.667 8.733 6.667 8z"}),y6={icon:v6},Up=ve((e,t)=>{const n=se("PaginationDots",y6,e),{classNames:r,className:i,style:o,styles:c,vars:u,icon:f,...h}=n,m=zp(),g=f;return s.jsx(ce,{ref:t,...m.getStyles("dots",{className:i,style:o,styles:c,classNames:r}),...h,children:s.jsx(g,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});Up.classes=yd;Up.displayName="@mantine/core/PaginationDots";function Bp({icon:e,name:t,action:n,type:r}){const i={icon:e},o=v.forwardRef((c,u)=>{const{icon:f,...h}=se(t,i,c),m=f,g=zp(),y=r==="next"?g.active===g.total:g.active===1;return s.jsx(xd,{disabled:g.disabled||y,ref:u,onClick:g[n],withPadding:!1,...h,children:s.jsx(m,{className:"mantine-rotate-rtl",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});return o.displayName=`@mantine/core/${t}`,o}const P_=Bp({icon:h6,name:"PaginationNext",action:"onNext",type:"next"}),N_=Bp({icon:p6,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),O_=Bp({icon:m6,name:"PaginationFirst",action:"onFirst",type:"previous"}),M_=Bp({icon:g6,name:"PaginationLast",action:"onLast",type:"next"});function O0({dotsIcon:e}){const t=zp(),n=t.range.map((r,i)=>{var o,c,u;return r==="dots"?s.jsx(Up,{icon:e},i):s.jsx(xd,{active:r===t.active,"aria-current":r===t.active?"page":void 0,onClick:()=>t.onChange(r),disabled:t.disabled,...(o=t.getItemProps)==null?void 0:o.call(t,r),children:((u=(c=t.getItemProps)==null?void 0:c.call(t,r))==null?void 0:u.children)??r},i)});return s.jsx(s.Fragment,{children:n})}O0.displayName="@mantine/core/PaginationItems";const x6={siblings:1,boundaries:1},b6=(e,{size:t,radius:n,color:r,autoContrast:i})=>({root:{"--pagination-control-radius":n===void 0?void 0:Bt(n),"--pagination-control-size":rt(t,"pagination-control-size"),"--pagination-control-fz":On(t),"--pagination-active-bg":r?Ft(r,e):void 0,"--pagination-active-color":Zs(i,e)?Ya({color:r,theme:e,autoContrast:i}):void 0}}),Vp=ve((e,t)=>{const n=se("PaginationRoot",x6,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,total:h,value:m,defaultValue:g,onChange:y,disabled:b,siblings:S,boundaries:j,color:C,radius:T,onNextPage:_,onPreviousPage:E,onFirstPage:R,onLastPage:D,getItemProps:k,autoContrast:M,...L}=n,z=Le({name:"Pagination",classes:yd,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:b6}),{range:F,setPage:Y,next:W,previous:J,active:G,first:X,last:P}=_3({page:m,initialPage:g,onChange:y,total:h,siblings:S,boundaries:j}),I=Rr(_,W),$=Rr(E,J),H=Rr(R,X),O=Rr(D,P);return s.jsx(d6,{value:{total:h,range:F,active:G,disabled:b,getItemProps:k,onChange:Y,onNext:I,onPrevious:$,onFirst:H,onLast:O,getStyles:z},children:s.jsx(ce,{ref:t,...z("root"),...L})})});Vp.classes=yd;Vp.displayName="@mantine/core/PaginationRoot";const S6={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8},Ii=ve((e,t)=>{const n=se("Pagination",S6,e),{withEdges:r,withControls:i,getControlProps:o,nextIcon:c,previousIcon:u,lastIcon:f,firstIcon:h,dotsIcon:m,total:g,gap:y,hideWithOnePage:b,withPages:S,...j}=n;return g<=0||b&&g===1?null:s.jsx(Vp,{ref:t,total:g,...j,children:s.jsxs(je,{gap:y,children:[r&&s.jsx(O_,{icon:h,...o==null?void 0:o("first")}),i&&s.jsx(N_,{icon:u,...o==null?void 0:o("previous")}),S&&s.jsx(O0,{dotsIcon:m}),i&&s.jsx(P_,{icon:c,...o==null?void 0:o("next")}),r&&s.jsx(M_,{icon:f,...o==null?void 0:o("last")})]})})});Ii.classes=yd;Ii.displayName="@mantine/core/Pagination";Ii.Root=Vp;Ii.Control=xd;Ii.Dots=Up;Ii.First=O_;Ii.Last=M_;Ii.Next=P_;Ii.Previous=N_;Ii.Items=O0;const w6=({reveal:e})=>s.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:"var(--psi-icon-size)",height:"var(--psi-icon-size)"},children:s.jsx("path",{d:e?"M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z":"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})});var Ly={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const j6={visibilityToggleIcon:w6},C6=(e,{size:t})=>({root:{"--psi-icon-size":rt(t,"psi-icon-size"),"--psi-button-size":rt(t,"psi-button-size")}}),ki=ve((e,t)=>{const n=se("PasswordInput",j6,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,required:h,error:m,leftSection:g,disabled:y,id:b,variant:S,inputContainer:j,description:C,label:T,size:_,errorProps:E,descriptionProps:R,labelProps:D,withAsterisk:k,inputWrapperOrder:M,wrapperProps:L,radius:z,rightSection:F,rightSectionWidth:Y,rightSectionPointerEvents:W,leftSectionWidth:J,visible:G,defaultVisible:X,onVisibilityChange:P,visibilityToggleIcon:I,visibilityToggleButtonProps:$,rightSectionProps:H,leftSectionProps:O,leftSectionPointerEvents:U,withErrorStyles:K,mod:ee,...Se}=n,be=yr(b),[xe,Ge]=Xn({value:G,defaultValue:X,finalValue:!1,onChange:P}),Me=()=>Ge(!xe),nt=Le({name:"PasswordInput",classes:Ly,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:C6}),{resolvedClassNames:ke,resolvedStyles:yt}=Ks({classNames:r,styles:c,props:n}),{styleProps:It,rest:$t}=Xa(Se),vt=I,At=(E==null?void 0:E.id)||`${be}-error`,nn=(R==null?void 0:R.id)||`${be}-description`,Qe=`${!!m&&typeof m!="boolean"?At:""} ${!!C?nn:""}`,Re=Qe.trim().length>0?Qe.trim():void 0,me=s.jsx(An,{...nt("visibilityToggle"),disabled:y,radius:z,"aria-hidden":!$,tabIndex:-1,...$,variant:($==null?void 0:$.variant)??"subtle",color:"gray",unstyled:u,onTouchEnd:ge=>{var Ne;ge.preventDefault(),(Ne=$==null?void 0:$.onTouchEnd)==null||Ne.call($,ge),Me()},onMouseDown:ge=>{var Ne;ge.preventDefault(),(Ne=$==null?void 0:$.onMouseDown)==null||Ne.call($,ge),Me()},onKeyDown:ge=>{var Ne;(Ne=$==null?void 0:$.onKeyDown)==null||Ne.call($,ge),ge.key===" "&&(ge.preventDefault(),Me())},children:s.jsx(vt,{reveal:xe})});return s.jsx(pn.Wrapper,{required:h,id:be,label:T,error:m,description:C,size:_,classNames:ke,styles:yt,__staticSelector:"PasswordInput",unstyled:u,withAsterisk:k,inputWrapperOrder:M,inputContainer:j,variant:S,labelProps:{...D,htmlFor:be},descriptionProps:{...R,id:nn},errorProps:{...E,id:At},mod:ee,...nt("root"),...It,...L,children:s.jsx(pn,{component:"div",error:m,leftSection:g,size:_,classNames:{...ke,input:zt(Ly.input,ke.input)},styles:yt,radius:z,disabled:y,__staticSelector:"PasswordInput",rightSectionWidth:Y,rightSection:F??me,variant:S,unstyled:u,leftSectionWidth:J,rightSectionPointerEvents:W||"all",rightSectionProps:H,leftSectionProps:O,leftSectionPointerEvents:U,withAria:!1,withErrorStyles:K,children:s.jsx("input",{required:h,"data-invalid":!!m||void 0,"data-with-left-section":!!g||void 0,...nt("innerInput"),disabled:y,id:be,ref:t,...$t,"aria-describedby":Re,autoComplete:$t.autoComplete||"off",type:xe?"text":"password"})})})});ki.classes={...Pr.classes,...Ly};ki.displayName="@mantine/core/PasswordInput";const[E6,L_]=Wa(),[T6,R6]=Wa();var I_={card:"m_9dc8ae12"};const _6={withBorder:!0},D6=(e,{radius:t})=>({card:{"--card-radius":Bt(t)}}),M0=ve((e,t)=>{const n=se("RadioCard",_6,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,checked:h,mod:m,withBorder:g,value:y,onClick:b,name:S,onKeyDown:j,...C}=n,T=Le({name:"RadioCard",classes:I_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:D6,rootSelector:"card"}),{dir:_}=el(),E=L_(),R=typeof h=="boolean"?h:(E==null?void 0:E.value)===y||!1,D=S||(E==null?void 0:E.name),k=M=>{if(j==null||j(M),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(M.nativeEvent.code)){M.preventDefault();const L=Array.from(document.querySelectorAll(`[role="radio"][name="${D||"__mantine"}"]`)),z=L.findIndex(W=>W===M.target),F=z+1>=L.length?0:z+1,Y=z-1<0?L.length-1:z-1;M.nativeEvent.code==="ArrowDown"&&(L[F].focus(),L[F].click()),M.nativeEvent.code==="ArrowUp"&&(L[Y].focus(),L[Y].click()),M.nativeEvent.code==="ArrowLeft"&&(L[_==="ltr"?Y:F].focus(),L[_==="ltr"?Y:F].click()),M.nativeEvent.code==="ArrowRight"&&(L[_==="ltr"?F:Y].focus(),L[_==="ltr"?F:Y].click())}};return s.jsx(T6,{value:{checked:R},children:s.jsx(tr,{ref:t,mod:[{"with-border":g,checked:R},m],...T("card"),...C,role:"radio","aria-checked":R,name:D,onClick:M=>{b==null||b(M),E==null||E.onChange(y||"")},onKeyDown:k})})});M0.displayName="@mantine/core/RadioCard";M0.classes=I_;const A6={},L0=ve((e,t)=>{const{value:n,defaultValue:r,onChange:i,size:o,wrapperProps:c,children:u,name:f,readOnly:h,...m}=se("RadioGroup",A6,e),g=yr(f),[y,b]=Xn({value:n,defaultValue:r,finalValue:"",onChange:i}),S=j=>!h&&b(typeof j=="string"?j:j.currentTarget.value);return s.jsx(E6,{value:{value:y,onChange:S,size:o,name:g},children:s.jsx(pn.Wrapper,{size:o,ref:t,...c,...m,labelElement:"div",__staticSelector:"RadioGroup",children:s.jsx(c0,{role:"radiogroup",children:u})})})});L0.classes=pn.Wrapper.classes;L0.displayName="@mantine/core/RadioGroup";function $_({size:e,style:t,...n}){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:{width:le(e),height:le(e),...t},"aria-hidden":!0,...n,children:s.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}var z_={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const k6={icon:$_},P6=(e,{radius:t,color:n,size:r,iconColor:i,variant:o,autoContrast:c})=>{const u=pi({color:n||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{indicator:{"--radio-size":rt(r,"radio-size"),"--radio-radius":t===void 0?void 0:Bt(t),"--radio-color":o==="outline"?f:Ft(n,e),"--radio-icon-size":rt(r,"radio-icon-size"),"--radio-icon-color":i?Ft(i,e):Zs(c,e)?Ya({color:n,theme:e,autoContrast:c}):void 0}}},I0=ve((e,t)=>{const n=se("RadioIndicator",k6,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,icon:h,radius:m,color:g,iconColor:y,autoContrast:b,checked:S,mod:j,variant:C,disabled:T,..._}=n,E=h,R=Le({name:"RadioIndicator",classes:z_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:P6,rootSelector:"indicator"}),D=R6(),k=typeof S=="boolean"?S:(D==null?void 0:D.checked)||!1;return s.jsx(ce,{ref:t,...R("indicator",{variant:C}),variant:C,mod:[{checked:k,disabled:T},j],..._,children:s.jsx(E,{...R("icon")})})});I0.displayName="@mantine/core/RadioIndicator";I0.classes=z_;var U_={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const N6={labelPosition:"right"},O6=(e,{size:t,radius:n,color:r,iconColor:i,variant:o,autoContrast:c})=>{const u=pi({color:r||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{root:{"--radio-size":rt(t,"radio-size"),"--radio-radius":n===void 0?void 0:Bt(n),"--radio-color":o==="outline"?f:Ft(r,e),"--radio-icon-color":i?Ft(i,e):Zs(c,e)?Ya({color:r,theme:e,autoContrast:c}):void 0,"--radio-icon-size":rt(t,"radio-icon-size")}}},Bs=ve((e,t)=>{const n=se("Radio",N6,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,id:h,size:m,label:g,labelPosition:y,description:b,error:S,radius:j,color:C,variant:T,disabled:_,wrapperProps:E,icon:R=$_,rootRef:D,iconColor:k,onChange:M,mod:L,...z}=n,F=Le({name:"Radio",classes:U_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:O6}),Y=L_(),W=(Y==null?void 0:Y.size)??m,J=n.size?m:W,{styleProps:G,rest:X}=Xa(z),P=yr(h),I=Y?{checked:Y.value===X.value,name:X.name??Y.name,onChange:$=>{Y.onChange($),M==null||M($)}}:{};return s.jsx(jp,{...F("root"),__staticSelector:"Radio",__stylesApiProps:n,id:P,size:J,labelPosition:y,label:g,description:b,error:S,disabled:_,classNames:r,styles:c,unstyled:u,"data-checked":I.checked||void 0,variant:T,ref:D,mod:L,...G,...E,children:s.jsxs(ce,{...F("inner"),mod:{"label-position":y},children:[s.jsx(ce,{...F("radio",{focusable:!0,variant:T}),onChange:M,...X,...I,component:"input",mod:{error:!!S},ref:t,id:P,disabled:_,type:"radio"}),s.jsx(R,{...F("icon"),"aria-hidden":!0})]})})});Bs.classes=U_;Bs.displayName="@mantine/core/Radio";Bs.Group=L0;Bs.Card=M0;Bs.Indicator=I0;const M6={duration:100,transition:"fade"};function L6(e,t){return{...M6,...t,...e}}function I6({offset:e,position:t,defaultOpened:n}){const[r,i]=v.useState(n),o=v.useRef(null),{x:c,y:u,elements:f,refs:h,update:m,placement:g}=Lx({placement:t,middleware:[Px({crossAxis:!0,padding:5,rootBoundary:"document"})]}),y=g.includes("right")?e:t.includes("left")?e*-1:0,b=g.includes("bottom")?e:t.includes("top")?e*-1:0,S=v.useCallback(({clientX:j,clientY:C})=>{h.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:j,y:C,left:j+y,top:C+b,right:j,bottom:C}}})},[f.reference]);return v.useEffect(()=>{if(h.floating.current){const j=o.current;j.addEventListener("mousemove",S);const C=za(h.floating.current);return C.forEach(T=>{T.addEventListener("scroll",m)}),()=>{j.removeEventListener("mousemove",S),C.forEach(T=>{T.removeEventListener("scroll",m)})}}},[f.reference,h.floating.current,m,S,r]),{handleMouseMove:S,x:c,y:u,opened:r,setOpened:i,boundaryRef:o,floating:h.setFloating}}var Fp={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const $6={refProp:"ref",withinPortal:!0,offset:10,defaultOpened:!1,position:"right",zIndex:Qr("popover")},z6=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Bt(t),"--tooltip-bg":n?Ft(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),$0=ve((e,t)=>{const n=se("TooltipFloating",$6,e),{children:r,refProp:i,withinPortal:o,style:c,className:u,classNames:f,styles:h,unstyled:m,radius:g,color:y,label:b,offset:S,position:j,multiline:C,zIndex:T,disabled:_,defaultOpened:E,variant:R,vars:D,portalProps:k,...M}=n,L=bn(),z=Le({name:"TooltipFloating",props:n,classes:Fp,className:u,style:c,classNames:f,styles:h,unstyled:m,rootSelector:"tooltip",vars:D,varsResolver:z6}),{handleMouseMove:F,x:Y,y:W,opened:J,boundaryRef:G,floating:X,setOpened:P}=I6({offset:S,position:j,defaultOpened:E});if(!Ga(r))throw new Error("[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const I=Bn(G,cp(r),t),$=r.props,H=U=>{var K;(K=$.onMouseEnter)==null||K.call($,U),F(U),P(!0)},O=U=>{var K;(K=$.onMouseLeave)==null||K.call($,U),P(!1)};return s.jsxs(s.Fragment,{children:[s.jsx(Qo,{...k,withinPortal:o,children:s.jsx(ce,{...M,...z("tooltip",{style:{...kR(c,L),zIndex:T,display:!_&&J?"block":"none",top:(W&&Math.round(W))??"",left:(Y&&Math.round(Y))??""}}),variant:R,ref:X,mod:{multiline:C},children:b})}),v.cloneElement(r,{...$,[i]:I,onMouseEnter:H,onMouseLeave:O})]})});$0.classes=Fp;$0.displayName="@mantine/core/TooltipFloating";const B_=v.createContext(!1),U6=B_.Provider,B6=()=>v.useContext(B_),V6={openDelay:0,closeDelay:0};function z0(e){const{openDelay:t,closeDelay:n,children:r}=se("TooltipGroup",V6,e);return s.jsx(U6,{value:!0,children:s.jsx(v9,{delay:{open:t,close:n},children:r})})}z0.displayName="@mantine/core/TooltipGroup";z0.extend=e=>e;function F6(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 H6(e){const t=F6(e.middlewares),n=[XR(e.offset)];return t.shift&&n.push(Px(typeof t.shift=="boolean"?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip=="boolean"?Oh():Oh(t.flip)),n.push(KR({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline=="boolean"?Hu():Hu(t.inline)):e.inline&&n.push(Hu()),n}function q6(e){var k,M,L;const[t,n]=v.useState(e.defaultOpened),i=typeof e.opened=="boolean"?e.opened:t,o=B6(),c=yr(),u=v.useCallback(z=>{n(z),z&&_(c)},[c]),{x:f,y:h,context:m,refs:g,update:y,placement:b,middlewareData:{arrow:{x:S,y:j}={}}}=Lx({strategy:e.strategy,placement:e.position,open:i,onOpenChange:u,middleware:H6(e)}),{delay:C,currentId:T,setCurrentId:_}=y9(m,{id:c}),{getReferenceProps:E,getFloatingProps:R}=E9([m9(m,{enabled:(k=e.events)==null?void 0:k.hover,delay:o?C:{open:e.openDelay,close:e.closeDelay},mouseOnly:!((M=e.events)!=null&&M.touch)}),C9(m,{enabled:(L=e.events)==null?void 0:L.focus,visibleOnly:!0}),R9(m,{role:"tooltip"}),w9(m,{enabled:typeof e.opened>"u"})]);j2({opened:i,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:g,update:y}}),Ba(()=>{var z;(z=e.onPositionChange)==null||z.call(e,b)},[b]);const D=i&&T&&T!==c;return{x:f,y:h,arrowX:S,arrowY:j,reference:g.setReference,floating:g.setFloating,getFloatingProps:R,getReferenceProps:E,isGroupPhase:D,opened:i,placement:b}}const JC={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:Qr("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},G6=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Bt(t),"--tooltip-bg":n?Ft(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),nl=ve((e,t)=>{const n=se("Tooltip",JC,e),{children:r,position:i,refProp:o,label:c,openDelay:u,closeDelay:f,onPositionChange:h,opened:m,defaultOpened:g,withinPortal:y,radius:b,color:S,classNames:j,styles:C,unstyled:T,style:_,className:E,withArrow:R,arrowSize:D,arrowOffset:k,arrowRadius:M,arrowPosition:L,offset:z,transitionProps:F,multiline:Y,events:W,zIndex:J,disabled:G,positionDependencies:X,onClick:P,onMouseEnter:I,onMouseLeave:$,inline:H,variant:O,keepMounted:U,vars:K,portalProps:ee,mod:Se,floatingStrategy:be,middlewares:xe,...Ge}=se("Tooltip",JC,n),{dir:Me}=el(),nt=v.useRef(null),ke=q6({position:g2(Me,i),closeDelay:f,openDelay:u,onPositionChange:h,opened:m,defaultOpened:g,events:W,arrowRef:nt,arrowOffset:k,offset:typeof z=="number"?z+(R?D/2:0):z,positionDependencies:[...X,r],inline:H,strategy:be,middlewares:xe}),yt=Le({name:"Tooltip",props:n,classes:Fp,className:E,style:_,classNames:j,styles:C,unstyled:T,rootSelector:"tooltip",vars:K,varsResolver:G6});if(!Ga(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 It=Bn(ke.reference,cp(r),t),$t=L6(F,{duration:100,transition:"fade"}),vt=r.props;return s.jsxs(s.Fragment,{children:[s.jsx(Qo,{...ee,withinPortal:y,children:s.jsx(da,{...$t,keepMounted:U,mounted:!G&&!!ke.opened,duration:ke.isGroupPhase?10:$t.duration,children:At=>s.jsxs(ce,{...Ge,"data-fixed":be==="fixed"||void 0,variant:O,mod:[{multiline:Y},Se],...ke.getFloatingProps({ref:ke.floating,className:yt("tooltip").className,style:{...yt("tooltip").style,...At,zIndex:J,top:ke.y??0,left:ke.x??0}}),children:[c,s.jsx(Ux,{ref:nt,arrowX:ke.arrowX,arrowY:ke.arrowY,visible:R,position:ke.placement,arrowSize:D,arrowOffset:k,arrowRadius:M,arrowPosition:L,...yt("arrow")})]})})}),v.cloneElement(r,ke.getReferenceProps({onClick:P,onMouseEnter:I,onMouseLeave:$,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,className:zt(E,vt.className),...vt,[o]:It}))]})});nl.classes=Fp;nl.displayName="@mantine/core/Tooltip";nl.Floating=$0;nl.Group=z0;function W6({size:e,thickness:t,sum:n,value:r,root:i,offset:o}){const c=(e*.9-t*2)/2,u=Math.PI*c*2/100,f=i||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:c||0,transform:i?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:f,strokeDashoffset:i?0:o||0}}function V_({size:e,value:t,offset:n,sum:r,thickness:i,root:o,color:c,lineRoundCaps:u,tooltip:f,getStyles:h,display:m,...g}){const y=bn();return s.jsx(nl.Floating,{disabled:!f,label:f,children:s.jsx(ce,{component:"circle",...g,...h("curve"),__vars:{"--curve-color":c?Ft(c,y):void 0},fill:"none",strokeLinecap:u?"round":"butt",...W6({sum:r,size:e,thickness:i,value:t,offset:n,root:o})})})}V_.displayName="@mantine/core/Curve";function Q6({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:i}){const o=n.reduce((m,g)=>m+g.value,0),c=Math.PI*((e*.9-t*2)/2)*2;let u=c;const f=[],h=[];for(let m=0;m<n.length;m+=1)f.push({sum:o,offset:u,data:n[m],root:!1}),u-=n[m].value/100*c;if(f.push({sum:o,offset:u,data:{color:i},root:!0}),h.push({...f[f.length-1],lineRoundCaps:!1}),f.length>2){h.push({...f[0],lineRoundCaps:r}),h.push({...f[f.length-2],lineRoundCaps:r});for(let m=1;m<=f.length-3;m+=1)h.push({...f[m],lineRoundCaps:!1})}else h.push({...f[0],lineRoundCaps:r});return h}var F_={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function Y6(e,t){return Math.min(e||12,(t||120)/4)}const X6={size:120,thickness:12},K6=(e,{size:t,thickness:n,transitionDuration:r})=>({root:{"--rp-size":le(t),"--rp-label-offset":le(n*2),"--rp-transition-duration":r?`${r}ms`:void 0}}),Hp=ve((e,t)=>{const n=se("RingProgress",X6,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,label:h,sections:m,size:g,thickness:y,roundCaps:b,rootColor:S,transitionDuration:j,...C}=n,T=Le({name:"RingProgress",classes:F_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:K6}),_=Y6(y,g),E=Q6({size:g,thickness:_,sections:m,renderRoundedLineCaps:b,rootColor:S}).map(({data:R,sum:D,root:k,lineRoundCaps:M,offset:L},z)=>v.createElement(V_,{...R,key:z,size:g,thickness:_,sum:D,offset:L,color:R==null?void 0:R.color,root:k,lineRoundCaps:M,getStyles:T}));return s.jsxs(ce,{...T("root"),size:g,ref:t,...C,children:[s.jsx("svg",{...T("svg"),children:E}),h&&s.jsx("div",{...T("label"),children:h})]})});Hp.classes=F_;Hp.displayName="@mantine/core/RingProgress";var H_={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const Z6={withItemsBorders:!0},J6=(e,{radius:t,color:n,transitionDuration:r,size:i,transitionTimingFunction:o})=>({root:{"--sc-radius":t===void 0?void 0:Bt(t),"--sc-color":n?Ft(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":o,"--sc-padding":rt(i,"sc-padding"),"--sc-font-size":On(i)}}),qp=ve((e,t)=>{var Me,nt;const n=se("SegmentedControl",Z6,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,data:h,value:m,defaultValue:g,onChange:y,size:b,name:S,disabled:j,readOnly:C,fullWidth:T,orientation:_,radius:E,color:R,transitionDuration:D,transitionTimingFunction:k,variant:M,autoContrast:L,withItemsBorders:z,mod:F,...Y}=n,W=Le({name:"SegmentedControl",props:n,classes:H_,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:J6}),J=bn(),G=h.map(ke=>typeof ke=="string"?{label:ke,value:ke}:ke),X=O3(),[P,I]=v.useState(Dh()),[$,H]=v.useState(null),[O,U]=v.useState({}),K=(ke,yt)=>{O[yt]=ke,U(O)},[ee,Se]=Xn({value:m,defaultValue:g,finalValue:Array.isArray(h)?((Me=G.find(ke=>!ke.disabled))==null?void 0:Me.value)??((nt=h[0])==null?void 0:nt.value)??null:null,onChange:y}),be=yr(S),xe=G.map(ke=>v.createElement(ce,{...W("control"),mod:{active:ee===ke.value,orientation:_},key:ke.value},v.createElement("input",{...W("input"),disabled:j||ke.disabled,type:"radio",name:be,value:ke.value,id:`${be}-${ke.value}`,checked:ee===ke.value,onChange:()=>!C&&Se(ke.value),"data-focus-ring":J.focusRing,key:`${ke.value}-input`}),v.createElement(ce,{component:"label",...W("label"),mod:{active:ee===ke.value&&!(j||ke.disabled),disabled:j||ke.disabled,"read-only":C},htmlFor:`${be}-${ke.value}`,ref:yt=>K(yt,ke.value),__vars:{"--sc-label-color":R!==void 0?Ya({color:R,theme:J,autoContrast:L}):void 0},key:`${ke.value}-label`},s.jsx("span",{...W("innerLabel"),children:ke.label})))),Ge=Bn(t,ke=>H(ke));return k3(()=>{I(Dh())},[h.length]),h.length===0?null:s.jsxs(ce,{...W("root"),variant:M,size:b,ref:Ge,mod:[{"full-width":T,orientation:_,initialized:X,"with-items-borders":z},F],...Y,role:"radiogroup","data-disabled":j,children:[typeof ee=="string"&&s.jsx(Gx,{target:O[ee],parent:$,component:"span",transitionDuration:"var(--sc-transition-duration)",...W("indicator")},P),xe]})});qp.classes=H_;qp.displayName="@mantine/core/SegmentedControl";function e$({spacing:e,verticalSpacing:t,cols:n,selector:r}){var m;const i=bn(),o=t===void 0?e:t,c=Wo({"--sg-spacing-x":Nn(_i(e)),"--sg-spacing-y":Nn(_i(o)),"--sg-cols":(m=_i(n))==null?void 0:m.toString()}),u=on(i.breakpoints).reduce((g,y)=>(g[y]||(g[y]={}),typeof e=="object"&&e[y]!==void 0&&(g[y]["--sg-spacing-x"]=Nn(e[y])),typeof o=="object"&&o[y]!==void 0&&(g[y]["--sg-spacing-y"]=Nn(o[y])),typeof n=="object"&&n[y]!==void 0&&(g[y]["--sg-cols"]=n[y]),g),{}),h=Wu(on(u),i.breakpoints).filter(g=>on(u[g.value]).length>0).map(g=>({query:`(min-width: ${i.breakpoints[g.value]})`,styles:u[g.value]}));return s.jsx(Js,{styles:c,media:h,selector:r})}function Gv(e){return typeof e=="object"&&e!==null?on(e):[]}function t$(e){return e.sort((t,n)=>Gu(t)-Gu(n))}function n$({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...Gv(e),...Gv(t),...Gv(n)]));return t$(r)}function r$({spacing:e,verticalSpacing:t,cols:n,selector:r}){var h;const i=t===void 0?e:t,o=Wo({"--sg-spacing-x":Nn(_i(e)),"--sg-spacing-y":Nn(_i(i)),"--sg-cols":(h=_i(n))==null?void 0:h.toString()}),c=n$({spacing:e,verticalSpacing:t,cols:n}),u=c.reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--sg-spacing-x"]=Nn(e[g])),typeof i=="object"&&i[g]!==void 0&&(m[g]["--sg-spacing-y"]=Nn(i[g])),typeof n=="object"&&n[g]!==void 0&&(m[g]["--sg-cols"]=n[g]),m),{}),f=c.map(m=>({query:`simple-grid (min-width: ${m})`,styles:u[m]}));return s.jsx(Js,{styles:o,container:f,selector:r})}var q_={container:"m_925c2d2c",root:"m_2415a157"};const i$={cols:1,spacing:"md",type:"media"},U0=ve((e,t)=>{const n=se("SimpleGrid",i$,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,cols:h,verticalSpacing:m,spacing:g,type:y,...b}=n,S=Le({name:"SimpleGrid",classes:q_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f}),j=ud();return y==="container"?s.jsxs(s.Fragment,{children:[s.jsx(r$,{...n,selector:`.${j}`}),s.jsx("div",{...S("container"),children:s.jsx(ce,{ref:t,...S("root",{className:j}),...b})})]}):s.jsxs(s.Fragment,{children:[s.jsx(e$,{...n,selector:`.${j}`}),s.jsx(ce,{ref:t,...S("root",{className:j}),...b})]})});U0.classes=q_;U0.displayName="@mantine/core/SimpleGrid";const a$={},Gp=ve((e,t)=>{const{w:n,h:r,miw:i,mih:o,...c}=se("Space",a$,e);return s.jsx(ce,{ref:t,...c,w:n,miw:i??n,h:r,mih:o??r})});Gp.displayName="@mantine/core/Space";var G_={root:"m_6d731127"};const o$={gap:"md",align:"stretch",justify:"flex-start"},s$=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":Nn(t),"--stack-align":n,"--stack-justify":r}}),qe=ve((e,t)=>{const n=se("Stack",o$,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,align:h,justify:m,gap:g,variant:y,...b}=n,S=Le({name:"Stack",props:n,classes:G_,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:s$});return s.jsx(ce,{ref:t,...S("root"),variant:y,...b})});qe.classes=G_;qe.displayName="@mantine/core/Stack";const[l$,c$]=vr("Stepper component was not found in tree"),Lh=()=>null;Lh.displayName="@mantine/core/StepperCompleted";var B0={root:"m_cbb4ea7e",steps:"m_aaf89d0b",separator:"m_2a371ac9",content:"m_78da155d",step:"m_cbb57068","step--horizontal":"m_f56b1e2c","step--vertical":"m_833edb7e",verticalSeparator:"m_6496b3f3",stepWrapper:"m_818e70b",stepIcon:"m_1959ad01",stepCompletedIcon:"m_a79331dc",stepBody:"m_1956aa2a",stepLabel:"m_12051f6c",stepDescription:"m_164eea74"};const rh=(e,t)=>typeof e=="function"?s.jsx(e,{step:t||0}):e,u$={withIcon:!0,allowStepClick:!0,iconPosition:"left"},V0=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:o,vars:c,step:u,state:f,color:h,icon:m,completedIcon:g,progressIcon:y,label:b,description:S,withIcon:j,iconSize:C,loading:T,allowStepClick:_,allowStepSelect:E,iconPosition:R,orientation:D,mod:k,...M}=se("StepperStep",u$,e),L=c$(),z=bn(),F={classNames:n,styles:o},Y=f==="stepCompleted"?null:f==="stepProgress"?y:m,W={"data-progress":f==="stepProgress"||void 0,"data-completed":f==="stepCompleted"||void 0};return s.jsxs(tr,{...L.getStyles("step",{className:r,style:i,variant:L.orientation,...F}),mod:[{"icon-position":R||L.iconPosition,"allow-click":_},k],ref:t,...W,...M,__vars:{"--step-color":h?Ft(h,z):void 0},tabIndex:_?0:-1,children:[j&&s.jsxs("span",{...L.getStyles("stepWrapper",F),children:[s.jsxs("span",{...L.getStyles("stepIcon",F),...W,children:[s.jsx(da,{mounted:f==="stepCompleted",transition:"pop",duration:200,children:J=>s.jsx("span",{...L.getStyles("stepCompletedIcon",{style:J,...F}),children:T?s.jsx(Ar,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...L.getStyles("stepLoader",F)}):rh(g,u)||s.jsx(Cp,{size:"60%"})})}),f!=="stepCompleted"?T?s.jsx(Ar,{...L.getStyles("stepLoader",F),size:"calc(var(--stepper-icon-size) / 2)",color:h}):rh(Y||m,u):null]}),D==="vertical"&&s.jsx("span",{...L.getStyles("verticalSeparator",F),"data-active":f==="stepCompleted"||void 0})]}),(b||S)&&s.jsxs("span",{...L.getStyles("stepBody",F),"data-orientation":L.orientation,"data-icon-position":R||L.iconPosition,children:[b&&s.jsx("span",{...L.getStyles("stepLabel",F),children:rh(b,u)}),S&&s.jsx("span",{...L.getStyles("stepDescription",F),children:rh(S,u)})]})]})});V0.classes=B0;V0.displayName="@mantine/core/StepperStep";const d$={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},f$=(e,{color:t,iconSize:n,size:r,contentPadding:i,radius:o,autoContrast:c})=>({root:{"--stepper-color":t?Ft(t,e):void 0,"--stepper-icon-color":Zs(c,e)?Ya({color:t,theme:e,autoContrast:c}):void 0,"--stepper-icon-size":n===void 0?rt(r,"stepper-icon-size"):le(n),"--stepper-content-padding":Nn(i),"--stepper-radius":o===void 0?void 0:Bt(o),"--stepper-fz":On(r),"--stepper-spacing":Nn(r)}}),yc=ve((e,t)=>{var $,H,O;const n=se("Stepper",d$,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,children:h,onStepClick:m,active:g,icon:y,completedIcon:b,progressIcon:S,color:j,iconSize:C,contentPadding:T,orientation:_,iconPosition:E,size:R,radius:D,allowNextStepsSelect:k,wrap:M,autoContrast:L,...z}=n,F=Le({name:"Stepper",classes:B0,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:f$}),Y=v.Children.toArray(h),W=Y.filter(U=>U.type!==Lh),J=Y.find(U=>U.type===Lh),G=W.reduce((U,K,ee)=>{const Se=g===ee?"stepProgress":g>ee?"stepCompleted":"stepInactive",xe=typeof m!="function"?!1:typeof K.props.allowStepSelect=="boolean"?K.props.allowStepSelect:Se==="stepCompleted"||k;return U.push(v.cloneElement(K,{icon:K.props.icon||y||ee+1,key:ee,step:ee,state:Se,onClick:()=>xe&&(m==null?void 0:m(ee)),allowStepClick:xe,completedIcon:K.props.completedIcon||b,progressIcon:K.props.progressIcon||S,color:K.props.color||j,iconSize:C,iconPosition:K.props.iconPosition||E,orientation:_})),_==="horizontal"&&ee!==W.length-1&&U.push(v.createElement("div",{...F("separator"),"data-active":ee<g||void 0,"data-orientation":_,key:`separator-${ee}`})),U},[]),X=(H=($=W[g])==null?void 0:$.props)==null?void 0:H.children,P=(O=J==null?void 0:J.props)==null?void 0:O.children,I=g>W.length-1?P:X;return s.jsx(l$,{value:{getStyles:F,orientation:_,iconPosition:E},children:s.jsxs(ce,{...F("root"),ref:t,size:R,...z,children:[s.jsx(ce,{...F("steps"),mod:{orientation:_,"icon-position":E,wrap:M&&_!=="vertical"},children:G}),I&&s.jsx("div",{...F("content"),children:I})]})})});yc.classes=B0;yc.displayName="@mantine/core/Stepper";yc.Completed=Lh;yc.Step=V0;const W_=v.createContext(null),h$=W_.Provider,p$=()=>v.useContext(W_),m$={},F0=ve((e,t)=>{const{value:n,defaultValue:r,onChange:i,size:o,wrapperProps:c,children:u,readOnly:f,...h}=se("SwitchGroup",m$,e),[m,g]=Xn({value:n,defaultValue:r,finalValue:[],onChange:i}),y=b=>{const S=b.currentTarget.value;!f&&g(m.includes(S)?m.filter(j=>j!==S):[...m,S])};return s.jsx(h$,{value:{value:m,onChange:y,size:o},children:s.jsx(pn.Wrapper,{size:o,ref:t,...c,...h,labelElement:"div",__staticSelector:"SwitchGroup",children:s.jsx(c0,{role:"group",children:u})})})});F0.classes=pn.Wrapper.classes;F0.displayName="@mantine/core/SwitchGroup";var Q_={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const g$={labelPosition:"right"},v$=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:Bt(t),"--switch-height":rt(r,"switch-height"),"--switch-width":rt(r,"switch-width"),"--switch-thumb-size":rt(r,"switch-thumb-size"),"--switch-label-font-size":rt(r,"switch-label-font-size"),"--switch-track-label-padding":rt(r,"switch-track-label-padding"),"--switch-color":n?Ft(n,e):void 0}}),Sd=ve((e,t)=>{const n=se("Switch",g$,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,color:h,label:m,offLabel:g,onLabel:y,id:b,size:S,radius:j,wrapperProps:C,thumbIcon:T,checked:_,defaultChecked:E,onChange:R,labelPosition:D,description:k,error:M,disabled:L,variant:z,rootRef:F,mod:Y,...W}=n,J=p$(),G=S||(J==null?void 0:J.size),X=Le({name:"Switch",props:n,classes:Q_,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:v$}),{styleProps:P,rest:I}=Xa(W),$=yr(b),H=J?{checked:J.value.includes(I.value),onChange:J.onChange}:{},[O,U]=Xn({value:H.checked??_,defaultValue:E,finalValue:!1});return s.jsxs(jp,{...X("root"),__staticSelector:"Switch",__stylesApiProps:n,id:$,size:G,labelPosition:D,label:m,description:k,error:M,disabled:L,bodyElement:"label",labelElement:"span",classNames:r,styles:c,unstyled:u,"data-checked":H.checked||_||void 0,variant:z,ref:F,mod:Y,...P,...C,children:[s.jsx("input",{...I,disabled:L,checked:O,"data-checked":H.checked||_||void 0,onChange:K=>{var ee;J?(ee=H.onChange)==null||ee.call(H,K):R==null||R(K),U(K.currentTarget.checked)},id:$,ref:t,type:"checkbox",role:"switch",...X("input")}),s.jsxs(ce,{"aria-hidden":"true",component:"span",mod:{error:M,"label-position":D,"without-labels":!y&&!g},...X("track"),children:[s.jsx(ce,{component:"span",mod:"reduce-motion",...X("thumb"),children:T}),s.jsx("span",{...X("trackLabel"),children:O?y:g})]})]})});Sd.classes={...Q_,...J2};Sd.displayName="@mantine/core/Switch";Sd.Group=F0;const[y$,x$]=vr("Table component was not found in the tree");var wd={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 b$(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 rl(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=ve((i,o)=>{const c=se(n,{},i),{classNames:u,className:f,style:h,styles:m,...g}=c,y=x$();return s.jsx(ce,{component:e,ref:o,...b$(y,t),...y.getStyles(e,{className:f,classNames:u,style:h,styles:m,props:c}),...g})});return r.displayName=`@mantine/core/${n}`,r.classes=wd,r}const Iy=rl("th",{columnBorder:!0}),Y_=rl("td",{columnBorder:!0}),yh=rl("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),X_=rl("thead",{stickyHeader:!0}),K_=rl("tbody"),Z_=rl("tfoot"),J_=rl("caption",{captionSide:!0});function H0({data:e}){return s.jsxs(s.Fragment,{children:[e.caption&&s.jsx(J_,{children:e.caption}),e.head&&s.jsx(X_,{children:s.jsx(yh,{children:e.head.map((t,n)=>s.jsx(Iy,{children:t},n))})}),e.body&&s.jsx(K_,{children:e.body.map((t,n)=>s.jsx(yh,{children:t.map((r,i)=>s.jsx(Y_,{children:r},i))},n))}),e.foot&&s.jsx(Z_,{children:s.jsx(yh,{children:e.foot.map((t,n)=>s.jsx(Iy,{children:t},n))})})]})}H0.displayName="@mantine/core/TableDataRenderer";const S$={type:"scrollarea"},w$=(e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":le(t),"--table-max-height":le(n),"--table-overflow":r==="native"?"auto":void 0}}),q0=ve((e,t)=>{const n=se("TableScrollContainer",S$,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,children:h,minWidth:m,maxHeight:g,type:y,scrollAreaProps:b,...S}=n,j=Le({name:"TableScrollContainer",classes:wd,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:w$,rootSelector:"scrollContainer"});return s.jsx(ce,{component:y==="scrollarea"?Yr:"div",...y==="scrollarea"?g?{offsetScrollbars:"xy",...b}:{offsetScrollbars:"x",...b}:{},ref:t,...j("scrollContainer"),...S,children:s.jsx("div",{...j("scrollContainerInner"),children:h})})});q0.classes=wd;q0.displayName="@mantine/core/TableScrollContainer";const j$={withRowBorders:!0,verticalSpacing:7},C$=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:i,borderColor:o,stripedColor:c,highlightOnHoverColor:u,striped:f,highlightOnHover:h,stickyHeaderOffset:m,stickyHeader:g})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":Nn(r),"--table-vertical-spacing":Nn(i),"--table-border-color":o?Ft(o,e):void 0,"--table-striped-color":f&&c?Ft(c,e):void 0,"--table-highlight-on-hover-color":h&&u?Ft(u,e):void 0,"--table-sticky-header-offset":g?le(m):void 0}}),ye=ve((e,t)=>{const n=se("Table",j$,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,horizontalSpacing:h,verticalSpacing:m,captionSide:g,stripedColor:y,highlightOnHoverColor:b,striped:S,highlightOnHover:j,withColumnBorders:C,withRowBorders:T,withTableBorder:_,borderColor:E,layout:R,variant:D,data:k,children:M,stickyHeader:L,stickyHeaderOffset:z,mod:F,tabularNums:Y,...W}=n,J=Le({name:"Table",props:n,className:i,style:o,classes:wd,classNames:r,styles:c,unstyled:u,rootSelector:"table",vars:f,varsResolver:C$});return s.jsx(y$,{value:{getStyles:J,stickyHeader:L,striped:S===!0?"odd":S||void 0,highlightOnHover:j,withColumnBorders:C,withRowBorders:T,captionSide:g||"bottom"},children:s.jsx(ce,{component:"table",variant:D,ref:t,mod:[{"data-with-table-border":_,"data-tabular-nums":Y},F],...J("table"),...W,children:M||!!k&&s.jsx(H0,{data:k})})})});ye.classes=wd;ye.displayName="@mantine/core/Table";ye.Td=Y_;ye.Th=Iy;ye.Tr=yh;ye.Thead=X_;ye.Tbody=K_;ye.Tfoot=Z_;ye.Caption=J_;ye.ScrollContainer=q0;ye.DataRenderer=H0;const[E$,G0]=vr("Tabs component was not found in the tree");var jd={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 T$={},W0=ve((e,t)=>{const n=se("TabsList",T$,e),{children:r,className:i,grow:o,justify:c,classNames:u,styles:f,style:h,mod:m,...g}=n,y=G0();return s.jsx(ce,{...g,...y.getStyles("list",{className:i,style:h,classNames:u,styles:f,props:n,variant:y.variant}),ref:t,role:"tablist",variant:y.variant,mod:[{grow:o,orientation:y.orientation,placement:y.orientation==="vertical"&&y.placement,inverted:y.inverted},m],"aria-orientation":y.orientation,__vars:{"--tabs-justify":c},children:r})});W0.classes=jd;W0.displayName="@mantine/core/TabsList";const R$={},Q0=ve((e,t)=>{const n=se("TabsPanel",R$,e),{children:r,className:i,value:o,classNames:c,styles:u,style:f,mod:h,keepMounted:m,...g}=n,y=G0(),b=y.value===o,S=y.keepMounted||m||b?r:null;return s.jsx(ce,{...g,...y.getStyles("panel",{className:i,classNames:c,styles:u,style:[f,b?void 0:{display:"none"}],props:n}),ref:t,mod:[{orientation:y.orientation},h],role:"tabpanel",id:y.getPanelId(o),"aria-labelledby":y.getTabId(o),children:S})});Q0.classes=jd;Q0.displayName="@mantine/core/TabsPanel";const _$={},Y0=ve((e,t)=>{const n=se("TabsTab",_$,e),{className:r,children:i,rightSection:o,leftSection:c,value:u,onClick:f,onKeyDown:h,disabled:m,color:g,style:y,classNames:b,styles:S,vars:j,mod:C,tabIndex:T,..._}=n,E=bn(),{dir:R}=el(),D=G0(),k=u===D.value,M=z=>{D.onChange(D.allowTabDeactivation&&u===D.value?null:u),f==null||f(z)},L={classNames:b,styles:S,props:n};return s.jsxs(tr,{..._,...D.getStyles("tab",{className:r,style:y,variant:D.variant,...L}),disabled:m,unstyled:D.unstyled,variant:D.variant,mod:[{active:k,disabled:m,orientation:D.orientation,inverted:D.inverted,placement:D.orientation==="vertical"&&D.placement},C],ref:t,role:"tab",id:D.getTabId(u),"aria-selected":k,tabIndex:T!==void 0?T:k||D.value===null?0:-1,"aria-controls":D.getPanelId(u),onClick:M,__vars:{"--tabs-color":g?Ft(g,E):void 0},onKeyDown:pR({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:D.activateTabWithKeyboard,loop:D.loop,orientation:D.orientation||"horizontal",dir:R,onKeyDown:h}),children:[c&&s.jsx("span",{...D.getStyles("tabSection",L),"data-position":"left",children:c}),i&&s.jsx("span",{...D.getStyles("tabLabel",L),children:i}),o&&s.jsx("span",{...D.getStyles("tabSection",L),"data-position":"right",children:o})]})});Y0.classes=jd;Y0.displayName="@mantine/core/TabsTab";const eE="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",D$={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},A$=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":Bt(t),"--tabs-color":Ft(n,e),"--tabs-text-color":Zs(r,e)?Ya({color:n,theme:e,autoContrast:r}):void 0}}),Rt=ve((e,t)=>{const n=se("Tabs",D$,e),{defaultValue:r,value:i,onChange:o,orientation:c,children:u,loop:f,id:h,activateTabWithKeyboard:m,allowTabDeactivation:g,variant:y,color:b,radius:S,inverted:j,placement:C,keepMounted:T,classNames:_,styles:E,unstyled:R,className:D,style:k,vars:M,autoContrast:L,mod:z,...F}=n,Y=yr(h),[W,J]=Xn({value:i,defaultValue:r,finalValue:null,onChange:o}),G=Le({name:"Tabs",props:n,classes:jd,className:D,style:k,classNames:_,styles:E,unstyled:R,vars:M,varsResolver:A$});return s.jsx(E$,{value:{placement:C,value:W,orientation:c,id:Y,loop:f,activateTabWithKeyboard:m,getTabId:Qj(`${Y}-tab`,eE),getPanelId:Qj(`${Y}-panel`,eE),onChange:J,allowTabDeactivation:g,variant:y,color:b,radius:S,inverted:j,keepMounted:T,unstyled:R,getStyles:G},children:s.jsx(ce,{ref:t,id:Y,variant:y,mod:[{orientation:c,inverted:c==="horizontal"&&j,placement:c==="vertical"&&C},z],...G("root"),...F,children:u})})});Rt.classes=jd;Rt.displayName="@mantine/core/Tabs";Rt.Tab=Y0;Rt.Panel=Q0;Rt.List=W0;const k$={},$e=ve((e,t)=>{const n=se("TextInput",k$,e);return s.jsx(Pr,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});$e.classes=Pr.classes;$e.displayName="@mantine/core/TextInput";var eD={root:"m_7341320d"};const P$={},N$=(e,{size:t,radius:n,variant:r,gradient:i,color:o,autoContrast:c})=>{const u=e.variantColorResolver({color:o||e.primaryColor,theme:e,gradient:i,variant:r||"filled",autoContrast:c});return{root:{"--ti-size":rt(t,"ti-size"),"--ti-radius":n===void 0?void 0:Bt(n),"--ti-bg":o||r?u.background:void 0,"--ti-color":o||r?u.color:void 0,"--ti-bd":o||r?u.border:void 0}}},X0=ve((e,t)=>{const n=se("ThemeIcon",P$,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,autoContrast:h,...m}=n,g=Le({name:"ThemeIcon",classes:eD,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:N$});return s.jsx(ce,{ref:t,...g("root"),...m})});X0.classes=eD;X0.displayName="@mantine/core/ThemeIcon";const O$=["h1","h2","h3","h4","h5","h6"],M$=["xs","sm","md","lg","xl"];function L$(e,t){const n=t!==void 0?t:`h${e}`;return O$.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:M$.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:le(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var tD={root:"m_8a5d1357"};const I$={order:1},$$=(e,{order:t,size:n,lineClamp:r,textWrap:i})=>{const o=L$(t,n);return{root:{"--title-fw":o.fontWeight,"--title-lh":o.lineHeight,"--title-fz":o.fontSize,"--title-line-clamp":typeof r=="number"?r.toString():void 0,"--title-text-wrap":i}}},Ie=ve((e,t)=>{const n=se("Title",I$,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,order:f,vars:h,size:m,variant:g,lineClamp:y,textWrap:b,mod:S,...j}=n,C=Le({name:"Title",props:n,classes:tD,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:h,varsResolver:$$});return[1,2,3,4,5,6].includes(f)?s.jsx(ce,{...C("root"),component:`h${f}`,variant:g,ref:t,mod:[{order:f,"data-line-clamp":typeof y=="number"},S],size:m,...j}):null});Ie.classes=tD;Ie.displayName="@mantine/core/Title";function z$(e){let t=e,n=!1;const r=new Set;return{getState(){return t},updateState(i){t=typeof i=="function"?i(t):i},setState(i){this.updateState(i),r.forEach(o=>o(t))},initialize(i){n||(t=i,n=!0)},subscribe(i){return r.add(i),()=>r.delete(i)}}}function U$(e){return v.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function B$(e,t,n){const r=[],i=[],o={};for(const c of e){const u=c.position||t;o[u]=o[u]||0,o[u]+=1,o[u]<=n?i.push(c):r.push(c)}return{notifications:i,queue:r}}const V$=()=>z$({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),il=V$(),F$=(e=il)=>U$(e);function Nc(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]),i=B$(r,n.defaultPosition,n.limit);e.setState({notifications:i.notifications,queue:i.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function Oe(e,t=il){const n=e.id||Dh();return Nc(t,r=>e.id&&r.some(i=>i.id===e.id)?r:[...r,{...e,id:n}]),n}function nD(e,t=il){return Nc(t,n=>n.filter(r=>{var i;return r.id===e?((i=r.onClose)==null||i.call(r,r),!1):!0})),e}function As(e,t=il){return Nc(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function H$(e=il){Nc(e,()=>[])}function q$(e=il){Nc(e,t=>t.slice(0,e.getState().limit))}const fi={show:Oe,hide:nD,update:As,clean:H$,cleanQueue:q$,updateState:Nc};function $y(e,t){return $y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},$y(e,t)}function rD(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,$y(e,t)}var Wv={exports:{}},Qv,tE;function G$(){if(tE)return Qv;tE=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Qv=e,Qv}var Yv,nE;function W$(){if(nE)return Yv;nE=1;var e=G$();function t(){}function n(){}return n.resetWarningCache=t,Yv=function(){function r(c,u,f,h,m,g){if(g!==e){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Yv}var rE;function Q$(){return rE||(rE=1,Wv.exports=W$()()),Wv.exports}var Y$=Q$();const an=fx(Y$),iE={disabled:!1},Ih=En.createContext(null);var X$=function(t){return t.scrollTop},Vu="unmounted",js="exited",Cs="entering",rc="entered",zy="exiting",eo=function(e){rD(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var c=i,u=c&&!c.isMounting?r.enter:r.appear,f;return o.appearStatus=null,r.in?u?(f=js,o.appearStatus=Cs):f=rc:r.unmountOnExit||r.mountOnEnter?f=Vu:f=js,o.state={status:f},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var c=i.in;return c&&o.status===Vu?{status:js}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var c=this.state.status;this.props.in?c!==Cs&&c!==rc&&(o=Cs):(c===Cs||c===rc)&&(o=zy)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,c,u;return o=c=u=i,i!=null&&typeof i!="number"&&(o=i.exit,c=i.enter,u=i.appear!==void 0?i.appear:c),{exit:o,enter:c,appear:u}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===Cs){if(this.props.unmountOnExit||this.props.mountOnEnter){var c=this.props.nodeRef?this.props.nodeRef.current:Bu.findDOMNode(this);c&&X$(c)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===js&&this.setState({status:Vu})},n.performEnter=function(i){var o=this,c=this.props.enter,u=this.context?this.context.isMounting:i,f=this.props.nodeRef?[u]:[Bu.findDOMNode(this),u],h=f[0],m=f[1],g=this.getTimeouts(),y=u?g.appear:g.enter;if(!i&&!c||iE.disabled){this.safeSetState({status:rc},function(){o.props.onEntered(h)});return}this.props.onEnter(h,m),this.safeSetState({status:Cs},function(){o.props.onEntering(h,m),o.onTransitionEnd(y,function(){o.safeSetState({status:rc},function(){o.props.onEntered(h,m)})})})},n.performExit=function(){var i=this,o=this.props.exit,c=this.getTimeouts(),u=this.props.nodeRef?void 0:Bu.findDOMNode(this);if(!o||iE.disabled){this.safeSetState({status:js},function(){i.props.onExited(u)});return}this.props.onExit(u),this.safeSetState({status:zy},function(){i.props.onExiting(u),i.onTransitionEnd(c.exit,function(){i.safeSetState({status:js},function(){i.props.onExited(u)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,c=!0;return this.nextCallback=function(u){c&&(c=!1,o.nextCallback=null,i(u))},this.nextCallback.cancel=function(){c=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var c=this.props.nodeRef?this.props.nodeRef.current:Bu.findDOMNode(this),u=i==null&&!this.props.addEndListener;if(!c||u){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var f=this.props.nodeRef?[this.nextCallback]:[c,this.nextCallback],h=f[0],m=f[1];this.props.addEndListener(h,m)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Vu)return null;var o=this.props,c=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var u=b0(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return En.createElement(Ih.Provider,{value:null},typeof c=="function"?c(i,u):En.cloneElement(En.Children.only(c),u))},t}(En.Component);eo.contextType=Ih;eo.propTypes={};function Xl(){}eo.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Xl,onEntering:Xl,onEntered:Xl,onExit:Xl,onExiting:Xl,onExited:Xl};eo.UNMOUNTED=Vu;eo.EXITED=js;eo.ENTERING=Cs;eo.ENTERED=rc;eo.EXITING=zy;function K$(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function K0(e,t){var n=function(o){return t&&v.isValidElement(o)?t(o):o},r=Object.create(null);return e&&v.Children.map(e,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function Z$(e,t){e=e||{},t=t||{};function n(m){return m in t?t[m]:e[m]}var r=Object.create(null),i=[];for(var o in e)o in t?i.length&&(r[o]=i,i=[]):i.push(o);var c,u={};for(var f in t){if(r[f])for(c=0;c<r[f].length;c++){var h=r[f][c];u[r[f][c]]=n(h)}u[f]=n(f)}for(c=0;c<i.length;c++)u[i[c]]=n(i[c]);return u}function ks(e,t,n){return n[t]!=null?n[t]:e.props[t]}function J$(e,t){return K0(e.children,function(n){return v.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:ks(n,"appear",e),enter:ks(n,"enter",e),exit:ks(n,"exit",e)})})}function ez(e,t,n){var r=K0(e.children),i=Z$(t,r);return Object.keys(i).forEach(function(o){var c=i[o];if(v.isValidElement(c)){var u=o in t,f=o in r,h=t[o],m=v.isValidElement(h)&&!h.props.in;f&&(!u||m)?i[o]=v.cloneElement(c,{onExited:n.bind(null,c),in:!0,exit:ks(c,"exit",e),enter:ks(c,"enter",e)}):!f&&u&&!m?i[o]=v.cloneElement(c,{in:!1}):f&&u&&v.isValidElement(h)&&(i[o]=v.cloneElement(c,{onExited:n.bind(null,c),in:h.props.in,exit:ks(c,"exit",e),enter:ks(c,"enter",e)}))}}),i}var tz=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},nz={component:"div",childFactory:function(t){return t}},Mo=function(e){rD(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var c=o.handleExited.bind(K$(o));return o.state={contextValue:{isMounting:!0},handleExited:c,firstRender:!0},o}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(i,o){var c=o.children,u=o.handleExited,f=o.firstRender;return{children:f?J$(i,u):ez(i,c,u),firstRender:!1}},n.handleExited=function(i,o){var c=K0(this.props.children);i.key in c||(i.props.onExited&&i.props.onExited(o),this.mounted&&this.setState(function(u){var f=Mh({},u.children);return delete f[i.key],{children:f}}))},n.render=function(){var i=this.props,o=i.component,c=i.childFactory,u=b0(i,["component","childFactory"]),f=this.state.contextValue,h=tz(this.state.children).map(c);return delete u.appear,delete u.enter,delete u.exit,o===null?En.createElement(Ih.Provider,{value:f},h):En.createElement(Ih.Provider,{value:f},En.createElement(o,u,h))},t}(En.Component);Mo.propTypes={};Mo.defaultProps=nz;const iD=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function rz(e,t){return e.reduce((n,r)=>(n[r.position||t].push(r),n),iD.reduce((n,r)=>(n[r]=[],n),{}))}const aE={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},iz={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function az({state:e,maxHeight:t,position:n,transitionDuration:r}){const[i,o]=n.split("-"),c=o==="center"?`${i}-center`:o,u={opacity:0,maxHeight:t,transform:aE[c],transitionDuration:`${r}ms, ${r}ms, ${r}ms`,transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"},f={opacity:1,transform:iz[c]},h={opacity:0,maxHeight:0,transform:aE[c]};return{...u,...{entering:f,entered:f,exiting:h,exited:h}[e]}}function oz(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const aD=v.forwardRef(({data:e,onHide:t,autoClose:n,...r},i)=>{const{autoClose:o,message:c,...u}=e,f=oz(n,e.autoClose),h=v.useRef(-1),m=()=>window.clearTimeout(h.current),g=()=>{t(e.id),m()},y=()=>{typeof f=="number"&&(h.current=window.setTimeout(g,f))};return v.useEffect(()=>{var b;(b=e.onOpen)==null||b.call(e,e)},[]),v.useEffect(()=>(y(),m),[f]),s.jsx(P0,{...r,...u,onClose:g,ref:i,onMouseEnter:m,onMouseLeave:y,children:c})});aD.displayName="@mantine/notifications/NotificationContainer";var oD={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const sz=eo,lz={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:Qr("overlay"),store:il,withinPortal:!0},cz=(e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t==null?void 0:t.toString(),"--notifications-container-width":le(n)}}),to=ve((e,t)=>{const n=se("Notifications",lz,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,position:h,autoClose:m,transitionDuration:g,containerWidth:y,notificationMaxHeight:b,limit:S,zIndex:j,store:C,portalProps:T,withinPortal:_,...E}=n,R=bn(),D=F$(C),k=C3(),M=vx(),L=v.useRef({}),z=v.useRef(0),Y=(R.respectReducedMotion?M:!1)?1:g,W=Le({name:"Notifications",classes:oD,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:cz});v.useEffect(()=>{C==null||C.updateState(X=>({...X,limit:S||5,defaultPosition:h}))},[S,h]),Ba(()=>{D.notifications.length>z.current&&setTimeout(()=>k(),0),z.current=D.notifications.length},[D.notifications]);const J=rz(D.notifications,h),G=iD.reduce((X,P)=>(X[P]=J[P].map(({style:I,...$})=>s.jsx(sz,{timeout:Y,onEnter:()=>L.current[$.id].offsetHeight,nodeRef:{current:L.current[$.id]},children:H=>s.jsx(aD,{ref:O=>{L.current[$.id]=O},data:$,onHide:O=>nD(O,C),autoClose:m,...W("notification",{style:{...az({state:H,position:P,transitionDuration:Y,maxHeight:b}),...I}})})},$.id)),X),{});return s.jsxs(Qo,{withinPortal:_,...T,children:[s.jsx(ce,{...W("root"),"data-position":"top-center",ref:t,...E,children:s.jsx(Mo,{children:G["top-center"]})}),s.jsx(ce,{...W("root"),"data-position":"top-left",...E,children:s.jsx(Mo,{children:G["top-left"]})}),s.jsx(ce,{...W("root",{className:dc.classNames.fullWidth}),"data-position":"top-right",...E,children:s.jsx(Mo,{children:G["top-right"]})}),s.jsx(ce,{...W("root",{className:dc.classNames.fullWidth}),"data-position":"bottom-right",...E,children:s.jsx(Mo,{children:G["bottom-right"]})}),s.jsx(ce,{...W("root"),"data-position":"bottom-left",...E,children:s.jsx(Mo,{children:G["bottom-left"]})}),s.jsx(ce,{...W("root"),"data-position":"bottom-center",...E,children:s.jsx(Mo,{children:G["bottom-center"]})})]})});to.classes=oD;to.displayName="@mantine/notifications/Notifications";to.show=fi.show;to.hide=fi.hide;to.update=fi.update;to.clean=fi.clean;to.cleanQueue=fi.cleanQueue;to.updateState=fi.updateState;class uz{constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class Cd{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`(${this.left.toString()} ${this.operator} ${this.right.toString()})`}}class dz{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(i,o){const c=i.consumeAndParse(n);return r(o,c)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(i,o,c){const u=i.consumeAndParse(n);return r(o,c,u)},precedence:n})}construct(t){return new fz(t,this.prefixParselets,this.infixParselets)}}class fz{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 i=r.parse(this,n);for(;t>this.getPrecedence();){const o=this.consume();i=this.getInfixParselet(o).parse(this,i,o)}return i}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,i;if(!this.tokens.length)throw Error("Cant consume unknown more tokens.");if(t&&((r=this.peek())==null?void 0:r.id)!==t){const o=this.peek();throw Error(`Expected ${t} but got "${o.id}" (${o.value}) at line ${o.line} column ${o.column}.`)}if(n&&((i=this.peek())==null?void 0:i.value)!==n){const o=this.peek();throw Error(`Expected "${n}" but got "${o.value}" at line ${o.line} column ${o.column}.`)}return this.tokens.shift()}peek(){return this.tokens.length>0?this.tokens[0]:void 0}removeComments(){this.tokens=this.tokens.filter(t=>t.id!=="Comment")}getInfixParselet(t){return this.infixParselets[t.id==="Symbol"?t.value:t.id]}}class sD{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 $i="http://hl7.org",lD="ok",hz="created",pz="gone",mz="not-modified",gz="not-found",vz="unauthorized",yz="forbidden",xz="accepted",bz={resourceType:"OperationOutcome",id:lD,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},Sz={resourceType:"OperationOutcome",id:gz,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},ed={resourceType:"OperationOutcome",id:vz,issue:[{severity:"error",code:"login",details:{text:"Unauthorized"}}]},wz={...ed,issue:[...ed.issue,{severity:"error",code:"expired",details:{text:"Token expired"}}]},oE={...ed,issue:[...ed.issue,{severity:"error",code:"invalid",details:{text:"Token not issued for this audience"}}]},Z0={resourceType:"OperationOutcome",id:yz,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function ra(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},...t?{expression:[t]}:void 0}]}}function yn(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function jz(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function Cz(e){return!e||typeof e!="object"?!1:e instanceof Error||typeof DOMException<"u"&&e instanceof DOMException?!0:Object.prototype.toString.call(e)==="[object Error]"}function Wp(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function cD(e){return e.id===lD||e.id===hz||e.id===mz||e.id===xz}function Ez(e){return e.id===pz}class ft extends Error{constructor(t,n){super(uD(t)),this.outcome=t,this.cause=n}}function Kt(e){return e instanceof ft?e.outcome:Wp(e)?e:ra(Ke(e))}function Ke(e){return e?typeof e=="string"?e:Cz(e)?e.message:Wp(e)?uD(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function uD(e){var n;const t=((n=e.issue)==null?void 0:n.map(dD))??[];return t.length>0?t.join("; "):"Unknown error"}function dD(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 Tz(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 Rz(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(([i,o])=>[i,Tz(i,o)])),constraints:[],innerTypes:[]};return t}const _z={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},Dz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},Az={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"}]}}},kz={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"}]}}},Pz={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"}]}}},Nz={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"}]}}},Oz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},Mz={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"}]}}},Lz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},Iz={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"}]}}},$z={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"}]}}},zz={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"}]}}},Uz={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"}]}}},Bz={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"}]}}},Vz={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"}]}}},Fz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},direction:{min:1,type:[{code:"code"}]}}},Hz={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"}]}}},qz={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"]}]}}},Gz={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"]}]}}},Wz={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"}]}}},Qz={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"}]}}},Yz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},path:{min:1,type:[{code:"string"}]}}},Xz={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"}]}}},Kz={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"}]}}},Zz={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"}]}}},Jz={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"}]}}},e8={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"]}]}}},t8={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"]}]}}},n8={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"}]}}},r8={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"}]}}},i8={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"}]}}},a8={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"}]}}},o8={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"]}]}}},s8={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"}]}}},l8={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"}]}}},c8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},u8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},d8={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"]}]}}},f8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},h8={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"}]}}},p8={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"}]}}},m8={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"}]}}},g8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},v8={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"]}]}}},y8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},x8={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"}]}}},b8={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"]}]}}},S8={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"}]}}},w8={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"}]}}},j8={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"}]}}},C8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},lowLimit:{type:[{code:"Quantity"}]},highLimit:{type:[{code:"Quantity"}]}}},E8={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"}]}}},T8={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"}]}}},R8={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"}]}}},_8={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"]}]}}},D8={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"}]}}},A8={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"}]}}},k8={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"}]}}},P8={Element:_z,BackboneElement:Dz,Address:Az,Age:kz,Annotation:Pz,Attachment:Nz,CodeableConcept:Oz,Coding:Mz,ContactDetail:Lz,ContactPoint:Iz,Contributor:$z,Count:zz,DataRequirement:Uz,DataRequirementCodeFilter:Bz,DataRequirementDateFilter:Vz,DataRequirementSort:Fz,Distance:Hz,Dosage:qz,DosageDoseAndRate:Gz,Duration:Wz,ElementDefinition:Qz,ElementDefinitionSlicingDiscriminator:Yz,ElementDefinitionSlicing:Xz,ElementDefinitionBase:Kz,ElementDefinitionType:Zz,ElementDefinitionExample:Jz,ElementDefinitionConstraint:e8,ElementDefinitionBinding:t8,ElementDefinitionMapping:n8,Expression:r8,Extension:i8,HumanName:a8,Identifier:o8,MarketingStatus:s8,Meta:l8,Money:c8,Narrative:u8,ParameterDefinition:d8,Period:f8,Population:h8,ProdCharacteristic:p8,ProductShelfLife:m8,Quantity:g8,Range:v8,Ratio:y8,Reference:x8,RelatedArtifact:b8,SampledData:S8,Signature:w8,SubstanceAmount:j8,SubstanceAmountReferenceRange:C8,Timing:E8,TimingRepeat:T8,TriggerDefinition:R8,UsageContext:_8,MoneyQuantity:D8,SimpleQuantity:A8,IdentityProvider:k8};function N8(e){return new M8(e).parse()}const $h=Rz(P8),J0=Object.create(null),sE=Object.create(null),O8={"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 fD(e){let t;return t=sE[e],t||(t=sE[e]=Object.create(null)),t}function lE(e){var r;const n=(Array.isArray(e)?e:((r=e.entry)==null?void 0:r.map(i=>i.resource))??[]).filter(i=>(i==null?void 0:i.resourceType)==="StructureDefinition");CU(n);for(const i of n)hD(i)}function hD(e){var o,c;if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=N8(e),n=O8[e.url];let r,i;n?(r=$h,i=n):e.url===`http://hl7.org/fhir/StructureDefinition/${e.type}`||e.url===`https://medplum.com/fhir/StructureDefinition/${e.type}`||(o=e.type)!=null&&o.startsWith("http://")||(c=e.type)!=null&&c.startsWith("https://")?(r=$h,i=e.type):(r=fD(e.url),i=e.type),r[i]=t;for(const u of t.innerTypes)u.parentType=t,r[u.name]=u;J0[e.url]=t}function pD(e){return!!$h[e]}function Qp(e,t){if(t){const n=fD(t)[e];if(n)return n}return $h[e]}function mD(e,t){const n=Qp(e,t);if(!n)throw new ft(ra("Unknown data type: "+e));return n}function eb(e){return!!J0[e]}function Oc(e){return J0[e]}class M8{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,version:t.version,kind:t.kind,description:$8(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){var n,r,i,o,c;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=Xv(t,this.slicingContext.path);this.slicingContext.current.elements[u]=this.parseElementDefinition(t)}}else{const u=this.parseElementDefinition(t);this.checkFieldEnter(t,u);let f=this.backboneContext;for(;f;){if((i=t.path)!=null&&i.startsWith(f.path+".")){f.type.elements[Xv(t,f.path)]=u;break}f=f.parent}if(!f){const h=Xv(t,this.root.path);t.isSummary&&((o=this.resourceSchema.summaryProperties)==null||o.add(h.replace("[x]",""))),u.min>0&&((c=this.resourceSchema.mandatoryProperties)==null||c.add(h.replace("[x]",""))),this.resourceSchema.elements[h]=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&&!Kl(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,i,o;for(;this.backboneContext&&!Kl((r=this.backboneContext)==null?void 0:r.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;const n=vE(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:Kl((i=this.backboneContext)==null?void 0:i.path,t.path)?this.backboneContext:(o=this.backboneContext)==null?void 0:o.parent}}enterSlice(t,n){var r,i,o,c;I8(t)&&!((r=this.peek())!=null&&r.sliceName)||(n.slicing={discriminator:(((i=t.slicing)==null?void 0:i.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:((o=t.slicing)==null?void 0:o.ordered)??!1,rule:(c=t.slicing)==null?void 0:c.rules},this.slicingContext={field:n.slicing,path:t.path??""})}checkFieldExit(t=void 0){if(this.backboneContext&&!Kl(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&&!Kl(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,i,o,c;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),f=this.elementIndex[u];return f?{...f,id:t.id,path:t.path,min:t.min??f.min,max:t.max??f.max,base:{path:((n=f.base)==null?void 0:n.path)??u,min:((r=t.base)==null?void 0:r.min)??((i=f.base)==null?void 0:i.min)??f.min,max:((o=t.base)==null?void 0:o.max)??((c=f.base)==null?void 0:c.max)??f.max},contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){var r;const n=this.peek();return!!(Kl(t==null?void 0:t.path,n==null?void 0:n.path)&&((r=t.type)!=null&&r.some(i=>["BackboneElement","Element"].includes(i.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 i;let r;return(n.code==="BackboneElement"||n.code==="Element")&&(r=vE(t)),r||(r=(i=fa(n,"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type"))==null?void 0:i.valueUrl),r||(r=n.code??""),{code:r,targetProfile:n.targetProfile,profile:n.profile}})}parseElementDefinition(t){var o,c;const n=cE(t.max),r=(o=t.base)!=null&&o.max?cE(t.base.max):n,i={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||((c=t.base)==null?void 0:c.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:uE(xc(i,"fixed[x]")),pattern:uE(xc(i,"pattern[x]")),binding:t.binding}}}function cE(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function Xv(e,t=""){return L8(e.path,t)}function L8(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function Kl(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function uE(e){return Array.isArray(e)&&e.length>0?e[0]:Rn(e)?void 0:e}function I8(e){var n,r;const t=(n=e.slicing)==null?void 0:n.discriminator;return!!((r=e.type)!=null&&r.some(i=>i.code==="Extension")&&(t==null?void 0:t.length)===1&&t[0].type==="value"&&t[0].path==="url")}function $8(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 z8(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n!=null&&n.withPath?U8:xc,[i,...o]=t.split(".");let c=[r(e,i,n)];for(const u of o){const f=[];for(const h of c)if(Array.isArray(h))for(const m of h)f.push(r(m,u,n));else(n!=null&&n.withPath&&h&&h.value!==void 0||!(n!=null&&n.withPath)&&h!==void 0)&&f.push(r(h,u,n));c=f}return c}function U8(e,t,n){const r=e.path;return B8(xc(e,t,n),r,t)}function B8(e,t,n){const r=t?t+".":"";return e===void 0?{type:"undefined",value:void 0,path:`${r}${n}`}:Array.isArray(e)?e.map((i,o)=>({...i,path:`${r}${n}[${o}]`})):{...e,path:`${r}${n}`}}const gD={date:/^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1]))?)?$/,dateTime:/^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1])(T([01]\d|2[0-3])(:[0-5]\d:([0-5]\d|60)(\.\d{1,9})?)?)?)?(Z|[+-]((0\d|1[0-3]):[0-5]\d|14:00)?)?)?$/};function V8(e,t,n,r){var c;if(Array.isArray(e))return!1;let i;t.path==="$this"?i=n:i=(r??n.elements)[t.path];const o=n.type;switch(t.type){case"value":case"pattern":if(!e||!i)return!1;if(i.pattern)return rb(e,i.pattern);if(i.fixed)return sa(e,i.fixed);if(((c=i.binding)==null?void 0:c.strength)==="required"&&i.binding.valueSet)return!0;break;case"type":return!e||!(o!=null&&o.length)?!1:o.some(u=>u.code===e.type)}return!1}function Xe(e){return[{type:ie.boolean,value:e}]}function Gr(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:ie.integer,value:e}:typeof e=="number"?{type:ie.decimal,value:e}:typeof e=="boolean"?{type:ie.boolean,value:e}:typeof e=="string"?{type:ie.string,value:e}:hi(e)?{type:ie.Quantity,value:e}:ha(e)?{type:e.resourceType,value:e}:DD(e)?{type:ie.CodeableConcept,value:e}:_D(e)?{type:ie.Coding,value:e}:{type:ie.BackboneElement,value:e}}function ea(e){return e.length===0?!1:!!e[0].value}function Ha(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 xc(e,t,n){if(!e.value)return;const r=Ko(e.type,t,n==null?void 0:n.profileUrl);return r?vD(e,t,r):Ed(e,t)}function vD(e,t,n){const r=e.value,i=n.type;if(!i||i.length===0)return;let o,c="undefined",u;const f=n.path.lastIndexOf("."),h=n.path.substring(f+1);for(const m of i){const g=h.replace("[x]",Ln(m.code));if(o=r[g],u=r["_"+g],o!==void 0||u!==void 0){c=m.code;break}}if(u)if(Array.isArray(o)){o=o.slice();for(let m=0;m<Math.max(o.length,u.length);m++)o[m]=pE(o[m],u[m])}else o=pE(o,u);if(!Rn(o))return(c==="Element"||c==="BackboneElement")&&(c=n.type[0].code),Array.isArray(o)?o.map(m=>dE(m,c)):dE(o,c)}function dE(e,t){return t==="Resource"&&ha(e)&&(t=e.resourceType),{type:t,value:e}}function Ed(e,t){const n=e.value;if(!n||typeof n!="object")return;let r;if(t in n){const i=n[t];Array.isArray(i)?r=i.map(Gr):r=Gr(i)}else{const i=t.endsWith("[x]")?t.substring(0,t.length-3):t;for(const o of Object.values(ie)){const c=i+Ln(o);if(c in n){const u=n[c];Array.isArray(u)?r=u.map(f=>({type:o,value:f})):r={type:o,value:u};break}}}if(Array.isArray(r)){if(r.length===0||Rn(r[0]))return}else if(Rn(r))return;return r}function yD(e){const t=[];for(const n of e){let r=!1;for(const i of t)if(ea(Yp(n,i))){r=!0;break}r||t.push(n)}return t}function F8(e){return Xe(!ea(e))}function H8(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Xe(!1):Xe(e.every((n,r)=>ea(Yp(n,t[r]))))}function q8(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Xe(!0):Xe(e.some((n,r)=>!ea(Yp(n,t[r]))))}function Yp(e,t){var i,o;const n=(i=e.value)==null?void 0:i.valueOf(),r=(o=t.value)==null?void 0:o.valueOf();return typeof n=="number"&&typeof r=="number"?Xe(Math.abs(n-r)<1e-8):hi(n)&&hi(r)?Xe(CD(n,r)):Xe(typeof n=="object"&&typeof r=="object"?tb(e,t):n===r)}function xD(e,t){return e.length===0&&t.length===0?Xe(!0):e.length!==t.length?Xe(!1):(e.sort(fE),t.sort(fE),Xe(e.every((n,r)=>ea(G8(n,t[r])))))}function G8(e,t){const{type:n,value:r}=e,{type:i,value:o}=t,c=r==null?void 0:r.valueOf(),u=o==null?void 0:o.valueOf();return typeof c=="number"&&typeof u=="number"?Xe(Math.abs(c-u)<.01):hi(c)&&hi(u)?Xe(CD(c,u)):Xe(n==="Coding"&&i==="Coding"?typeof c!="object"||typeof u!="object"?!1:c.code===u.code&&c.system===u.system:typeof c=="object"&&typeof u=="object"?tb({...c,id:void 0},{...u,id:void 0}):typeof c=="string"&&typeof u=="string"?c.toLowerCase()===u.toLowerCase():c===u)}function fE(e,t){var i,o;const n=(i=e.value)==null?void 0:i.valueOf(),r=(o=t.value)==null?void 0:o.valueOf();return typeof n=="number"&&typeof r=="number"?n-r:typeof n=="string"&&typeof r=="string"?n.localeCompare(r):0}function bD(e,t){const{value:n}=e;if(n==null)return!1;let r=t;switch(r.startsWith("System.")&&(r=r.substring(7)),r.startsWith("FHIR.")&&(r=r.substring(5)),r){case"Boolean":return typeof n=="boolean";case"Decimal":case"Integer":return typeof n=="number";case"Date":return SD(n);case"DateTime":return td(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return wD(n);case"Quantity":return hi(n);default:return e.type===r||typeof n=="object"&&(n==null?void 0:n.resourceType)===r}}function SD(e){return typeof e=="string"&&!!gD.date.exec(e)}function td(e){return typeof e=="string"&&!!gD.dateTime.exec(e)}function wD(e){return!!(e&&typeof e=="object"&&("start"in e&&td(e.start)||"end"in e&&td(e.end)))}function jD(e){if(e){if(SD(e)||td(e))return{start:ih(e,"0000-01-01T00:00:00.000Z"),end:ih(e,"xxxx-12-31T23:59:59.999Z")};if(wD(e))return{start:e.start?ih(e.start,"0000-01-01T00:00:00.000Z"):void 0,end:e.end?ih(e.end,"xxxx-12-31T23:59:59.999Z"):void 0}}}function ih(e,t){return e.includes("+",10)||e.includes("-",10)?new Date(e).toISOString():e+t.substring(e.length)}function hi(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function CD(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 tb(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const o=e[i],c=t[i];if(hE(o)&&hE(c)){if(!tb(o,c))return!1}else if(o!==c)return!1}return!0}function hE(e){return e!==null&&typeof e=="object"}function pE(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return W8(e??{},t)}return e}function W8(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function ED(e,t){return ha(e,t)&&"id"in e&&typeof e.id=="string"}function tn(e){const t=Mt(e)??"undefined/undefined",n=qa(e);return n===t?{reference:t}:{reference:t,display:n}}function Mt(e){if(no(e))return e.reference;if(ED(e))return`${e.resourceType}/${e.id}`}function Vs(e){if(e)return no(e)?e.reference.split("/")[1]:e.id}function Q8(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function qa(e){if(Q8(e)){const t=Y8(e);if(t)return t}if(e.resourceType==="Device"){const t=X8(e);if(t)return t}if(e.resourceType==="MedicationRequest"&&e.medicationCodeableConcept)return Ho(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]),DD(t))return Ho(t);if(oU(t))return t.text}return Mt(e)??""}function Y8(e){const t=e.name;if(t&&t.length>0)return Mc(t[0])}function X8(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function K8(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=mE(n);if(r)return r}else return mE(t)}function mE(e){var t;if(e.url&&((t=e.contentType)!=null&&t.startsWith("image/")))return e.url}function TD(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 i=n.getUTCFullYear(),o=n.getUTCMonth(),c=n.getUTCDate(),u=r.getUTCFullYear(),f=r.getUTCMonth(),h=r.getUTCDate();let m=u-i;(f<o||f===o&&h<c)&&m--;let g=u*12+f-(i*12+o);h<c&&g--;const y=Math.floor((r.getTime()-n.getTime())/(1e3*60*60*24));return{years:m,months:g,days:y}}function Z8(e,t){const{years:n,months:r,days:i}=TD(e,t);return n>=2?n.toString().padStart(3,"0")+"Y":r>=1?r.toString().padStart(3,"0")+"M":i.toString().padStart(3,"0")+"D"}function fa(e,...t){var r;let n=e;for(let i=0;i<t.length&&n;i++)n=(r=n==null?void 0:n.extension)==null?void 0:r.find(o=>o.url===t[i]);return n}function Oi(e,t){const n=nb(e);return JSON.stringify(n,null,t?2:void 0)??""}function nb(e){if(!(e==null||e===""))return typeof e=="object"?Array.isArray(e)?J8(e):eU(e):e}function J8(e){const t=e.length;if(t===0)return;let n,r=0;for(let i=0;i<t;i++){const o=e[i],c=nb(o);c!==o&&!n&&(n=Array.from(e)),c===void 0?n&&(n[i]=null):(n&&(n[i]=c),r++)}if(r!==0)return n??e}function eU(e){let t,n=0;for(const r in e){const i=e[r],o=nb(i);o!==i&&!t&&(t={...e}),o===void 0?t&&delete t[r]:(t&&(t[r]=o),n++)}if(n!==0)return t??e}function Rn(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!Tn(e):!1}function Tn(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 sa(e,t,n){return e===t||Rn(e)&&Rn(t)?!0:Rn(e)||Rn(t)?!1:Array.isArray(e)&&Array.isArray(t)?tU(e,t):Array.isArray(e)||Array.isArray(t)?!1:sr(e)&&sr(t)?nU(e,t,n):(sr(e)||sr(t),!1)}function tU(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!sa(e[n],t[n]))return!1;return!0}function nU(e,t,n){const r=new Set;Object.keys(e).forEach(i=>r.add(i)),Object.keys(t).forEach(i=>r.add(i)),n==="meta"&&(r.delete("versionId"),r.delete("lastUpdated"),r.delete("author"));for(const i of r){const o=e[i],c=t[i];if(!sa(o,c,i))return!1}return!0}function rb(e,t){return Rn(e)?!0:Rn(t)?!1:Array.isArray(e)&&Array.isArray(t)?rU(e,t):Array.isArray(e)||Array.isArray(t)?!1:sr(e)&&sr(t)?iU(e,t):sr(e)||sr(t)?!1:e===t}function rU(e,t){return t.every(n=>e.some(r=>rb(r,n)))}function iU(e,t){return Object.entries(t).every(([n,r])=>n in e&&rb(e[n],r))}function Wr(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function RD(e){return/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i.test(e)}function sr(e){return e!==null&&typeof e=="object"}function aU(e){return typeof e=="string"}function _D(e){return sr(e)&&"code"in e&&typeof e.code=="string"}function DD(e){return sr(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(_D)}function oU(e){return sr(e)&&"text"in e&&typeof e.text=="string"}const AD=[];for(let e=0;e<256;e++)AD.push(e.toString(16).padStart(2,"0"));function sU(e){const t=kD(e),n=new Uint8Array(t),r=new Array(n.length);for(let i=0;i<n.length;i++)r[i]=AD[n[i]];return r.join("")}function lU(e){const t=kD(e),n=new Uint8Array(t),r=new Array(n.length);for(let i=0;i<n.length;i++)r[i]=String.fromCharCode(n[i]);return window.btoa(r.join(""))}function kD(e){return ArrayBuffer.isView(e)?e.buffer:e}function Ln(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function ib(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function Ps(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function cU(e,t){var n,r;return(r=(n=e.coding)==null?void 0:n.find(i=>i.system===t))==null?void 0:r.code}function uU(e){if(e!==void 0)return Array.isArray(e)?e:[e]}const gE=e=>new Promise(t=>{setTimeout(t,e)});function Uy(e,t,n){const r=[];for(let i=0;i<n-1;i++){const o=e.indexOf(t);if(o<0)break;r.push(e.slice(0,o)),e=e.slice(o+t.length)}return r.push(e),r}function dU(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function Mu(e,t){return e?(e.push(t),e):[t]}function nd(e){return e.sort((t,n)=>t.localeCompare(n))}function ab(e){return e.endsWith("/")?e:e+"/"}function fU(e){return e.startsWith("/")?e.slice(1):e}function Ki(e,t){return new URL(fU(t),ab(e.toString())).toString()}function hU(e,t){return Ki(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function pU(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 PD(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 mU(e,t){var n,r;if((r=(n=e==null?void 0:e.meta)==null?void 0:n.profile)!=null&&r.includes(t)){const i=e.meta.profile.indexOf(t);e.meta.profile.splice(i,1)}return e}function Fs(e){var t;if(!e)return"";switch(e.type){case"Address":return ND(e.value);case"CodeableConcept":return Ho(e.value);case"Coding":return Td(e.value);case"ContactPoint":return e.value.value;case"HumanName":return Mc(e.value);case"Quantity":return Ns(e.value);case"Reference":return gU(e.value);default:return((t=e.value)==null?void 0:t.toString())??""}}function gU(e){return e?e.display??e.reference??Oi(e):""}function ND(e,t){if(!e)return"";const n=[];if(e.line&&n.push(...e.line),e.city||e.state||e.postalCode){const r=[];e.city&&r.push(e.city),e.state&&r.push(e.state),e.postalCode&&r.push(e.postalCode),n.push(r.join(", "))}return e.use&&(t!=null&&t.use),n.join(", ").trim()}function Mc(e,t){if(!e)return"";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=id(e.text);if(r)return r}return n.join(" ").trim()}function Xp(e){return e instanceof Date&&!isNaN(e.getTime())}function vU(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return Xp(r)?r.toLocaleTimeString(t,n):""}function gr(e,t,n){if(!e)return"";const r=new Date(e);return Xp(r)?r.toLocaleString(t,n):""}function yU(e,t,n){return!e||!e.start&&!e.end?"":gr(e.start,t,n)+" - "+gr(e.end,t,n)}const xU={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},bU={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},SU={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function OD(e){if(!e)return"";const t=[];return wU(t,e.repeat),e.event&&t.push(e.event.map(n=>gr(n)).join(", ")),Ln(t.join(" ").trim())}function wU(e,t){if(!(t!=null&&t.periodUnit))return;const n=t.frequency??1,r=t.period??1,i=t.periodUnit;n===1&&r===1?e.push(xU[i]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+bU[i]):e.push("per "+r+" "+SU[i])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(Ln).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(o=>vU(o)).join(", "))}function rd(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},i=(e==null?void 0:e.high)&&{...e.high,comparator:void 0};return(r==null?void 0:r.value)===void 0&&(i==null?void 0:i.value)===void 0?"":(r==null?void 0:r.value)!==void 0&&(i==null?void 0:i.value)===void 0?`>= ${Ns(r)}`:(r==null?void 0:r.value)===void 0&&(i==null?void 0:i.value)!==void 0?`<= ${Ns(i)}`:((r==null?void 0:r.unit)===(i==null?void 0:i.unit)&&(r==null||delete r.unit),`${Ns(r)} - ${Ns(i)}`)}function Ns(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 jU(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function Ho(e){if(!e)return"";const t=id(e.text);return t||(e.coding?e.coding.map(n=>Td(n)).join(", "):"")}function Td(e,t){const n=id(e==null?void 0:e.display);return n?`${n}`:id(e==null?void 0:e.code)??""}function MD(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(Ns(e.valueQuantity));else if(e.valueCodeableConcept)t.push(Ho(e.valueCodeableConcept));else{const n=id(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>MD(n)).join(" / ")),t.join(" / ").trim()}function id(e){return typeof e=="string"?e:void 0}const ie={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 CU(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)(r==null?void 0:r.resourceType)==="StructureDefinition"&&r.kind==="resource"&&LD(r.type)}function LD(e){let t=la.types[e];return t||(t={searchParamsDetails:{}},la.types[e]=t),!t.searchParams&&e!=="Binary"&&(t.searchParams={_id:{base:[e],code:"_id",type:"token",expression:e+".id"},_lastUpdated:{base:[e],code:"_lastUpdated",type:"date",expression:e+".meta.lastUpdated"},_compartment:{base:[e],code:"_compartment",type:"reference",expression:e+".meta.compartment"},_profile:{base:[e],code:"_profile",type:"uri",expression:e+".meta.profile"},_security:{base:[e],code:"_security",type:"token",expression:e+".meta.security"},_source:{base:[e],code:"_source",type:"uri",expression:e+".meta.source"},_tag:{base:[e],code:"_tag",type:"token",expression:e+".meta.tag"}}),t}function EU(e){for(const t of e.base??[]){const n=LD(t);n.searchParams||(n.searchParams={}),n.searchParams[e.code]=e}}function vE(e){var n,r,i,o;const t=(r=(n=e.type)==null?void 0:n[0])==null?void 0:r.code;return t==="BackboneElement"||t==="Element"?TU((o=((i=e.base)==null?void 0:i.path)??e.path)==null?void 0:o.split(".")):t}function TU(e){return e.length===1?e[0]:e.map(Ln).join("")}function ob(e){var t;return(t=la.types[e])==null?void 0:t.searchParams}function RU(e,t){var n,r;return(r=(n=la.types[e])==null?void 0:n.searchParams)==null?void 0:r[t]}function Hs(e){const t=e.replaceAll("[x]","").split(".").pop();return ID(t)}function ID(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(DU).join(" ").replace("_"," ").replace(/\s+/g," ")}const _U=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function DU(e){const t=e.toUpperCase();return e===t?e:_U.has(t)?t:t.charAt(0)+e.slice(1)}function Ko(e,t,n){const r=Qp(e,n);if(r)return AU(r.elements,t)}function AU(e,t){const n=e[t]??e[t+"[x]"];if(n)return n;for(let r=0;r<t.length;r++){const i=t[r];if(i>="A"&&i<="Z"){const o=t.slice(0,r)+"[x]",c=e[o];if(c)return c}}}function ha(e,t){return!(!e||typeof e!="object"||!("resourceType"in e)||t&&e.resourceType!==t)}function no(e){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const la={types:{}};function xh(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 Ma=()=>[],Er={empty:(e,t)=>Xe(t.length===0||t.every(n=>Rn(n.value))),hasValue:(e,t)=>Xe(t.length!==0),exists:(e,t,n)=>Xe(n?t.filter(r=>ea(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!Rn(r.value))),all:(e,t,n)=>Xe(t.every(r=>ea(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return Xe(!1);return Xe(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return Xe(!0);return Xe(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return Xe(!1);return Xe(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return Xe(!0);return Xe(!1)},subsetOf:(e,t,n)=>{if(t.length===0)return Xe(!0);const r=n.eval(e,bs(e));return r.length===0?Xe(!1):Xe(t.every(i=>r.some(o=>o.value===i.value)))},supersetOf:(e,t,n)=>{const r=n.eval(e,bs(e));return r.length===0?Xe(!0):t.length===0?Xe(!1):Xe(r.every(i=>t.some(o=>o.value===i.value)))},count:(e,t)=>[{type:ie.integer,value:t.length}],distinct:(e,t)=>{const n=[];for(const r of t)n.some(i=>i.value===r.value)||n.push(r);return n},isDistinct:(e,t)=>Xe(t.length===Er.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>ea(n.eval(e,[r]))),select:(e,t,n)=>t.map(r=>n.eval({parent:e,variables:{$this:r}},[r])).flat(),repeat:Ma,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 i;const r=(i=n.eval(e,t)[0])==null?void 0:i.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 i;const r=(i=n.eval(e,t)[0])==null?void 0:i.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,bs(e)),i=[];for(const o of t)!i.some(c=>c.value===o.value)&&r.some(c=>c.value===o.value)&&i.push(o);return i},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,bs(e)),i=[];for(const o of t)r.some(c=>c.value===o.value)||i.push(o);return i},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,bs(e));return yD([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,bs(e));return[...t,...r]},htmlChecks:(e,t,n)=>[Gr(!0)],iif:(e,t,n,r,i)=>{const o=n.eval(e,t);if(o.length>1||o.length===1&&typeof o[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return ea(o)?r.eval(e,t):i?i.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zi(t,1);if(typeof n=="boolean")return[{type:ie.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return Xe(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return Xe(!0);if(["false","f","no","n","0","0.0"].includes(r))return Xe(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:Xe(Er.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zi(t,1);return typeof n=="number"?[{type:ie.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:ie.integer,value:parseInt(n,10)}]:typeof n=="boolean"?[{type:ie.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:Xe(Er.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zi(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:ie.date,value:xh(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:Xe(Er.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zi(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:ie.dateTime,value:xh(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:Xe(Er.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zi(t,1);return typeof n=="number"?[{type:ie.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:ie.decimal,value:parseFloat(n)}]:typeof n=="boolean"?[{type:ie.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:Xe(Er.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zi(t,1);return hi(n)?[{type:ie.Quantity,value:n}]:typeof n=="number"?[{type:ie.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:ie.Quantity,value:{value:parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:ie.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:Xe(Er.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zi(t,1);return n==null?[]:hi(n)?[{type:ie.string,value:`${n.value} '${n.unit}'`}]:[{type:ie.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:Xe(Er.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zi(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:ie.time,value:xh("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:Xe(Er.toTime(e,t).length===1),indexOf:(e,t,n)=>ci((r,i)=>r.indexOf(i),e,t,n),substring:(e,t,n,r)=>ci((i,o,c)=>{const u=o,f=c?u+c:i.length;return u<0||u>=i.length?void 0:i.substring(u,f)},e,t,n,r),startsWith:(e,t,n)=>ci((r,i)=>r.startsWith(i),e,t,n),endsWith:(e,t,n)=>ci((r,i)=>r.endsWith(i),e,t,n),contains:(e,t,n)=>ci((r,i)=>r.includes(i),e,t,n),upper:(e,t)=>ci(n=>n.toUpperCase(),e,t),lower:(e,t)=>ci(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>ci((i,o,c)=>i.replaceAll(o,c),e,t,n,r),matches:(e,t,n)=>ci((r,i)=>!!new RegExp(i).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>ci((i,o,c)=>i.replaceAll(new RegExp(o,"g"),c),e,t,n,r),length:(e,t)=>ci(n=>n.length,e,t),toChars:(e,t)=>ci(n=>n?n.split(""):void 0,e,t),encode:Ma,decode:Ma,escape:Ma,unescape:Ma,trim:Ma,split:Ma,join:(e,t,n)=>{var i;const r=((i=n==null?void 0:n.eval(e,bs(e))[0])==null?void 0:i.value)??"";if(typeof r!="string")throw new Error("Separator must be a string.");return[{type:ie.string,value:t.map(o=>{var c;return((c=o.value)==null?void 0:c.toString())??""}).join(r)}]},abs:(e,t)=>Yi(Math.abs,e,t),ceiling:(e,t)=>Yi(Math.ceil,e,t),exp:(e,t)=>Yi(Math.exp,e,t),floor:(e,t)=>Yi(Math.floor,e,t),ln:(e,t)=>Yi(Math.log,e,t),log:(e,t,n)=>Yi((r,i)=>Math.log(r)/Math.log(i),e,t,n),power:(e,t,n)=>Yi(Math.pow,e,t,n),round:(e,t)=>Yi(Math.round,e,t),sqrt:(e,t)=>Yi(Math.sqrt,e,t),truncate:(e,t)=>Yi(n=>n|0,e,t),children:Ma,descendants:Ma,trace:(e,t,n)=>t,now:()=>[{type:ie.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:ie.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:ie.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,i)=>{var h;const o=Er.toDateTime(e,n.eval(e,t));if(o.length===0)throw new Error("Invalid start date");const c=Er.toDateTime(e,r.eval(e,t));if(c.length===0)throw new Error("Invalid end date");const u=(h=i.eval(e,t)[0])==null?void 0:h.value;if(u!=="years"&&u!=="months"&&u!=="days")throw new Error("Invalid units");const f=TD(o[0].value,c[0].value);return[{type:ie.Quantity,value:{value:f[u],unit:u}}]},is:(e,t,n)=>{let r="";return n instanceof zh?r=n.name:n instanceof sb&&(r=n.left.name+"."+n.right.name),r?t.map(i=>({type:ie.boolean,value:bD(i,r)})):[]},not:(e,t)=>Er.toBoolean(e,t).map(n=>({type:ie.boolean,value:!n.value})),resolve:(e,t)=>t.map(n=>{const r=n.value;let i;if(typeof r=="string")i=r;else if(typeof r=="object"){const o=r;if(o.resource)return Gr(o.resource);o.reference?i=o.reference:o.type&&o.identifier&&(i=`${o.type}?identifier=${o.identifier.system}|${o.identifier.value}`)}if(i!=null&&i.includes("?")){const[o]=i.split("?");return{type:o,value:{resourceType:o}}}if(i!=null&&i.includes("/")){const[o,c]=i.split("/");return{type:o,value:{resourceType:o,id:c}}}return{type:ie.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:ie.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:ie.BackboneElement,value:{namespace:"System",name:"Integer"}}:ha(n)?{type:ie.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:ie.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 i=r.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(o=>{var c;return{type:ie.boolean,value:((c=o.value)==null?void 0:c.resourceType)===i}})},getResourceKey:(e,t)=>{const n=t[0].value;return n!=null&&n.id?[{type:ie.id,value:n.id}]:[]},getReferenceKey:(e,t,n)=>{const r=t[0].value;if(!(r!=null&&r.reference))return[];let i="";return n instanceof zh&&(i=n.name),i&&!r.reference.startsWith(i+"/")?[]:[{type:ie.id,value:Vs(r)}]},extension:(e,t,n)=>{var o;const r=n.eval(e,t)[0].value,i=(o=t==null?void 0:t[0])==null?void 0:o.value;if(i){const c=fa(i,r);if(c)return[{type:ie.Extension,value:c}]}return[]}};function ci(e,t,n,...r){if(n.length===0)return[];const[{value:i}]=Zi(n,1);if(typeof i!="string")throw new Error("String function cannot be called with non-string");const o=e(i,...r.map(c=>{var u;return(u=c==null?void 0:c.eval(t,n)[0])==null?void 0:u.value}));return o===void 0?[]:Array.isArray(o)?o.map(Gr):[Gr(o)]}function Yi(e,t,n,...r){if(n.length===0)return[];const[{value:i}]=Zi(n,1),o=hi(i),c=o?i.value:i;if(typeof c!="number")throw new Error("Math function cannot be called with non-number");const u=e(c,...r.map(m=>{var g;return(g=m.eval(t,n)[0])==null?void 0:g.value})),f=o?ie.Quantity:n[0].type,h=o?{...i,value:u}:u;return[{type:f,value:h}]}function Zi(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 bs(e){var n;let t=e;for(;(n=t.parent)!=null&&n.variables.$this;)t=t.parent;return[t.variables.$this]}class $D{constructor(t,n){this.original=t,this.child=n}eval(t,n){try{if(n.length>0){const r=[];for(const i of n)r.push(this.child.eval({parent:t,variables:{$this:i}},[i]));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 Zl{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class zh{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(i=>this.evalValue(i)).filter(i=>(i==null?void 0:i.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 ha(n,this.name)?t:xc(t,this.name)}toString(){return this.name}}class kU{eval(){return[]}toString(){return"{}"}}class PU extends uz{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 Uh extends Cd{constructor(t,n){super("as",t,n)}eval(t,n){return Er.ofType(t,this.left.eval(t,n),this.right)}}class Nr extends Cd{}class Ti extends Nr{constructor(t,n,r,i){super(t,n,r),this.impl=i}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const i=this.right.eval(t,n);if(i.length!==1)return[];const o=r[0].value,c=i[0].value,u=hi(o)?o.value:o,f=hi(c)?c.value:c,h=this.impl(u,f);return typeof h=="boolean"?Xe(h):hi(o)?[{type:ie.Quantity,value:{...o,value:h}}]:[Gr(h)]}}class NU extends Cd{constructor(t,n){super("&",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n),o=[...r,...i];return o.length>0&&o.every(c=>typeof c.value=="string")?[{type:ie.string,value:o.map(c=>c.value).join("")}]:o}}class OU extends Nr{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return Xe(r.some(o=>o.value===i[0].value))}}class MU extends Nr{constructor(t,n){super("in",t,n)}eval(t,n){const r=Ha(this.left.eval(t,n)),i=this.right.eval(t,n);return r?Xe(i.some(o=>Yp(r,o)[0].value)):[]}}class sb extends Cd{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 lb extends Cd{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return yD([...r,...i])}}class LU extends Nr{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return H8(r,i)}}class IU extends Nr{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return q8(r,i)}}class $U extends Nr{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return xD(r,i)}}class zU extends Nr{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return F8(xD(r,i))}}class cb extends Nr{constructor(t,n){super("is",t,n)}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const i=this.right.name;return Xe(bD(r[0],i))}}class UU extends Nr{constructor(t,n){super("and",t,n)}eval(t,n){const r=Ha(this.left.eval(t,n),"boolean"),i=Ha(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!0&&(i==null?void 0:i.value)===!0?Xe(!0):(r==null?void 0:r.value)===!1||(i==null?void 0:i.value)===!1?Xe(!1):[]}}class BU extends Nr{constructor(t,n){super("or",t,n)}eval(t,n){const r=Ha(this.left.eval(t,n),"boolean"),i=Ha(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!1&&(i==null?void 0:i.value)===!1?Xe(!1):r!=null&&r.value||i!=null&&i.value?Xe(!0):[]}}class VU extends Nr{constructor(t,n){super("xor",t,n)}eval(t,n){const r=Ha(this.left.eval(t,n),"boolean"),i=Ha(this.right.eval(t,n),"boolean");return!r||!i?[]:Xe(r.value!==i.value)}}class FU extends Nr{constructor(t,n){super("implies",t,n)}eval(t,n){const r=Ha(this.left.eval(t,n),"boolean"),i=Ha(this.right.eval(t,n),"boolean");return(i==null?void 0:i.value)===!0||(r==null?void 0:r.value)===!1?Xe(!0):!r||!i?[]:Xe(!1)}}class ub{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=Er[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 db{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 i=r[0].value;if(typeof i!="number")throw new Error("Invalid indexer expression: should return integer}");const o=this.left.eval(t,n);return i in o?[o[i]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const HU=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class qU{constructor(t,n,r,i){this.result=[],this.pos={index:0,line:1,column:0},this.markStack=[],this.str=t,this.keywords=n,this.operators=r,this.dateTimeLiterals=!!(i!=null&&i.dateTimeLiterals),this.symbolRegex=(i==null?void 0:i.symbolRegex)??/[$\w%]/}tokenize(){for(;this.pos.index<this.str.length;){const t=this.consumeToken();t&&this.result.push(t)}return this.result}prevToken(){return this.result.slice(-1)[0]}peekToken(){this.mark();const t=this.consumeToken();return this.reset(),t}consumeToken(){this.consumeWhitespace();const t=this.curr();if(!t)return;this.mark();const n=this.peek();return t==="/"&&n==="*"?this.consumeMultiLineComment():t==="/"&&n==="/"?this.consumeSingleLineComment():t==="'"||t==='"'||t==="`"?this.consumeString(t):t==="@"?this.consumeDateTime():/\d/.exec(t)?this.consumeNumber():/\w/.exec(t)?this.consumeSymbol():(t==="$"||t==="%")&&/\w/.exec(n)?this.consumeSymbol():(t==="$"||t==="%")&&(n==="'"||n==='"'||n==="`")?this.consumeQuotedSymbol(n):this.consumeOperator()}consumeWhitespace(){this.consumeWhile(()=>/\s/.exec(this.curr()))}consumeMultiLineComment(){const t=this.pos.index;return this.consumeWhile(()=>this.curr()!=="*"||this.peek()!=="/"),this.advance(),this.advance(),this.buildToken("Comment",this.str.substring(t,this.pos.index))}consumeSingleLineComment(){return this.buildToken("Comment",this.consumeWhile(()=>this.curr()!==`
77
+ `))}consumeString(t){this.advance();const r=this.consumeWhile(()=>this.prev()==="\\"||this.curr()!==t).replace(/\\u([0-9a-fA-F]{4})/g,(o,c)=>String.fromCodePoint(parseInt(c,16))),i=this.buildToken(t==="`"?"Symbol":"String",r);return this.advance(),i}consumeQuotedSymbol(t){this.mark();const n=this.pos.index;this.advance(),this.consumeString(t);const r=this.str.substring(n,this.pos.index);return this.buildToken("Symbol",r)}consumeDateTime(){this.advance();const t=this.pos.index;this.consumeWhile(()=>/[\d-]/.exec(this.curr()));let n=!1,r=!1;if(this.curr()==="T"&&(n=!0,this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="Z"?(r=!0,this.advance()):(this.curr()==="+"||this.curr()==="-")&&(r=!0,this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr())))),this.pos.index===t)throw new Error("Invalid DateTime literal");let i=this.str.substring(t,this.pos.index);return i.endsWith("T")?i=i.substring(0,i.length-1):!i.startsWith("T")&&n&&!r&&(i+="Z"),this.buildToken("DateTime",i)}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()===" "&&GU(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()===`
78
+ `?(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 GU(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&HU.includes(e.value)))}const WU=["true","false"],QU=["!=","!~","<=",">=","{}","->"];function YU(e){return new qU(e,WU,QU).tokenize()}const Xt={FunctionCall:0,Dot:1,Indexer:2,UnaryAdd:3,UnarySubtract:3,Multiply:4,Divide:4,Modulo:4,Add:5,Subtract:5,Ampersand:5,Is:6,As:6,Union:7,GreaterThan:8,GreaterThanOrEquals:8,LessThan:8,LessThanOrEquals:8,Equals:9,Equivalent:9,NotEquals:9,NotEquivalent:9,In:10,Contains:10,And:11,Xor:12,Or:12,Implies:13},XU={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}},KU={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new db(t,n)},precedence:Xt.Indexer},ZU={parse(e,t){if(!(t instanceof zh))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new ub(t.name,n)},precedence:Xt.FunctionCall};function JU(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 eB(){return new dz().registerPrefix("String",{parse:(e,t)=>new Zl({type:ie.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new Zl({type:ie.dateTime,value:xh(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new Zl({type:ie.Quantity,value:JU(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new Zl({type:t.value.includes(".")?ie.decimal:ie.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new Zl({type:ie.boolean,value:!0})}).registerPrefix("false",{parse:()=>new Zl({type:ie.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new zh(t.value)}).registerPrefix("{}",{parse:()=>new kU}).registerPrefix("(",XU).registerInfix("[",KU).registerInfix("(",ZU).prefix("+",Xt.UnaryAdd,(e,t)=>new PU("+",t,n=>n)).prefix("-",Xt.UnarySubtract,(e,t)=>new Ti("-",t,t,(n,r)=>-r)).infixLeft(".",Xt.Dot,(e,t,n)=>new sb(e,n)).infixLeft("/",Xt.Divide,(e,t,n)=>new Ti("/",e,n,(r,i)=>r/i)).infixLeft("*",Xt.Multiply,(e,t,n)=>new Ti("*",e,n,(r,i)=>r*i)).infixLeft("+",Xt.Add,(e,t,n)=>new Ti("+",e,n,(r,i)=>r+i)).infixLeft("-",Xt.Subtract,(e,t,n)=>new Ti("-",e,n,(r,i)=>r-i)).infixLeft("|",Xt.Union,(e,t,n)=>new lb(e,n)).infixLeft("=",Xt.Equals,(e,t,n)=>new LU(e,n)).infixLeft("!=",Xt.NotEquals,(e,t,n)=>new IU(e,n)).infixLeft("~",Xt.Equivalent,(e,t,n)=>new $U(e,n)).infixLeft("!~",Xt.NotEquivalent,(e,t,n)=>new zU(e,n)).infixLeft("<",Xt.LessThan,(e,t,n)=>new Ti("<",e,n,(r,i)=>r<i)).infixLeft("<=",Xt.LessThanOrEquals,(e,t,n)=>new Ti("<=",e,n,(r,i)=>r<=i)).infixLeft(">",Xt.GreaterThan,(e,t,n)=>new Ti(">",e,n,(r,i)=>r>i)).infixLeft(">=",Xt.GreaterThanOrEquals,(e,t,n)=>new Ti(">=",e,n,(r,i)=>r>=i)).infixLeft("&",Xt.Ampersand,(e,t,n)=>new NU(e,n)).infixLeft("and",Xt.And,(e,t,n)=>new UU(e,n)).infixLeft("as",Xt.As,(e,t,n)=>new Uh(e,n)).infixLeft("contains",Xt.Contains,(e,t,n)=>new OU(e,n)).infixLeft("div",Xt.Divide,(e,t,n)=>new Ti("div",e,n,(r,i)=>r/i|0)).infixLeft("in",Xt.In,(e,t,n)=>new MU(e,n)).infixLeft("is",Xt.Is,(e,t,n)=>new cb(e,n)).infixLeft("mod",Xt.Modulo,(e,t,n)=>new Ti("mod",e,n,(r,i)=>r%i)).infixLeft("or",Xt.Or,(e,t,n)=>new BU(e,n)).infixLeft("xor",Xt.Xor,(e,t,n)=>new VU(e,n)).infixLeft("implies",Xt.Implies,(e,t,n)=>new FU(e,n))}const tB=eB();function fb(e){return new $D(e,tB.construct(YU(e)).consumeAndParse())}function nB(e,t){const n=Array.isArray(t)?t:[t];for(let r=0;r<n.length;r++){const i=n[r];typeof i=="object"&&"type"in i&&"value"in i||(n[r]=Gr(n[r]))}return qo(e,n).map(r=>r.value)}function qo(e,t,n={},r=void 0){let i;if(typeof e=="string"){const o=r==null?void 0:r.get(e);i=o??fb(e),r&&!o&&r.set(e,i)}else i=e;return i.eval({variables:n},t).map(o=>{var c;return{type:o.type,value:(c=o.value)==null?void 0:c.valueOf()}})}function rB(e){const t=[];for(const n of e){const r=jD(n.value);r&&t.push(r)}return t}function iB(e){const t=[];for(const n of e){const r=Fs(n);r&&t.push(r)}return t}function aB(e){const t=[];for(const n of e){const{value:r}=n;r&&(aU(r)?t.push(r):no(r)?t.push(r.reference):ED(r)?t.push(Mt(r)):typeof r.identifier=="object"&&t.push(`identifier:${r.identifier.system}|${r.identifier.value}`))}return t}function oB(e,t={}){const n=[];for(const r of e)sB(t,n,r);return n}function sB(e,t,n){const{type:r,value:i}=n;switch(r){case ie.Identifier:lB(t,e,i);break;case ie.CodeableConcept:cB(t,e,i);break;case ie.Coding:zD(t,e,i);break;case ie.ContactPoint:uB(t,e,i);break;default:qs(t,e,void 0,i==null?void 0:i.toString())}}function lB(e,t,n){var r;(r=n==null?void 0:n.type)!=null&&r.text&&qs(e,t,t.textSearchSystem,n.type.text),qs(e,t,n==null?void 0:n.system,n==null?void 0:n.value)}function cB(e,t,n){if(n!=null&&n.text&&qs(e,t,t.textSearchSystem,n.text),n!=null&&n.coding)for(const r of n.coding)zD(e,t,r)}function zD(e,t,n){n&&(n.display&&qs(e,t,t.textSearchSystem,n.display),qs(e,t,n.system,n.code))}function uB(e,t,n){var r;n&&qs(e,t,n.system,(r=n.value)==null?void 0:r.toLocaleLowerCase())}function qs(e,t,n,r){(n||r)&&!e.some(i=>i.system===n&&i.value===r)&&e.push({system:n,value:r&&t.caseInsensitive?r.toLocaleLowerCase():r})}const Kp=20,ue={EQUALS:"eq",NOT_EQUALS:"ne",GREATER_THAN:"gt",LESS_THAN:"lt",GREATER_THAN_OR_EQUALS:"ge",LESS_THAN_OR_EQUALS:"le",STARTS_AFTER:"sa",ENDS_BEFORE:"eb",APPROXIMATELY:"ap",CONTAINS:"contains",STARTS_WITH:"sw",EXACT:"exact",TEXT:"text",NOT:"not",ABOVE:"above",BELOW:"below",IN:"in",NOT_IN:"not-in",OF_TYPE:"of-type",MISSING:"missing",PRESENT:"present",IDENTIFIER:"identifier",ITERATE:"iterate"},UD={contains:ue.CONTAINS,exact:ue.EXACT,above:ue.ABOVE,below:ue.BELOW,text:ue.TEXT,not:ue.NOT,in:ue.IN,"not-in":ue.NOT_IN,"of-type":ue.OF_TYPE,missing:ue.MISSING,identifier:ue.IDENTIFIER,iterate:ue.ITERATE},hb={eq:ue.EQUALS,ne:ue.NOT_EQUALS,lt:ue.LESS_THAN,le:ue.LESS_THAN_OR_EQUALS,gt:ue.GREATER_THAN,ge:ue.GREATER_THAN_OR_EQUALS,sa:ue.STARTS_AFTER,eb:ue.ENDS_BEFORE,ap:ue.APPROXIMATELY,sw:ue.STARTS_WITH};function BD(e,t){if(!e)throw new Error("Invalid search URL");let n="",r;if(typeof e=="string")if(e.includes("?")){const[c,u]=e.split("?");n=c,r=new URLSearchParams(u)}else n=e;else typeof e=="object"&&(n=e.pathname,r=e.searchParams);let i;n.includes("/")?i=n.split("/").filter(Boolean).pop():i=n;const o=[];return r&&o.push(...r.entries()),dB(i,o)}function dB(e,t){const n={resourceType:e};for(const[r,i]of t)fB(n,r,i);return n}function fB(e,t,n){var c,u;let r,i;const o=t.indexOf(":");if(o>=0?(r=t.substring(0,o),i=t.substring(o+1)):(r=t,i=""),r!=="_"){if(r==="_has"||t.includes(".")){e.filters=Mu(e.filters,{code:t,operator:ue.EQUALS,value:n});return}switch(r){case"_sort":hB(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 f=yE(n);i==="iterate"&&(f.modifier=ue.ITERATE),e.include=Mu(e.include,f);break}case"_revinclude":{const f=yE(n);i==="iterate"&&(f.modifier=ue.ITERATE),e.revInclude=Mu(e.revInclude,f);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 f=(u=(c=la.types[e.resourceType])==null?void 0:c.searchParams)==null?void 0:u[r];f?e.filters=Mu(e.filters,mB(f,i,n)):e.filters=Mu(e.filters,gB(r,i,n))}}}}function hB(e,t){for(const n of t.split(",")){let r,i=!1;n.startsWith("-")?(r=n.substring(1),i=!0):r=n,e.sortRules||(e.sortRules=[]),e.sortRules.push({code:r,descending:i})}}const pB=[ue.MISSING,ue.PRESENT];function mB(e,t,n){if(pB.includes(t))return{code:e.code,operator:t,value:n};switch(e.type){case"number":case"date":case"quantity":{const{operator:r,value:i}=vB(n);if(!xE(e,i))throw new ft(ra(`Invalid format for ${e.type} search parameter: ${i}`));return{code:e.code,operator:r,value:i}}case"reference":case"string":case"token":case"uri":if(!xE(e,n))throw new ft(ra(`Invalid format for ${e.type} search parameter: ${n}`));return{code:e.code,operator:yB(t),value:n};default:throw new Error("Unrecognized search parameter type: "+e.type)}}function gB(e,t,n){var i;let r=ue.EQUALS;if(t)r=t;else if(n.length>=2){const o=n.substring(0,2);o in hb&&(n.length===2||(i=n.at(2))!=null&&i.match(/\d/))&&(r=o,n=n.substring(o.length))}return{code:e,operator:r,value:n}}function vB(e){const t=e.substring(0,2),n=hb[t];return n?{operator:n,value:e.substring(2)}:{operator:ue.EQUALS,value:e}}function yB(e){return UD[e]??ue.EQUALS}function yE(e){const t=e.split(":");if(t.includes("*"))throw new ft(ra("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new ft(ra(`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 ft(ra(`Invalid include value '${e}'`))}function xE(e,t){switch(e.type){case"date":return td(t);default:return!0}}function Bo(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(xB(n))),e.sortRules&&e.sortRules.length>0&&t.push(bB(e.sortRules)),e.cursor!==void 0&&t.push("_cursor="+encodeURIComponent(e.cursor)),e.offset!==void 0&&e.offset!==0&&t.push("_offset="+e.offset),e.count!==void 0&&t.push("_count="+e.count),e.total!==void 0&&t.push("_total="+e.total),e.types&&e.types.length>0&&t.push("_type="+e.types.join(",")),e.include&&e.include.forEach(n=>t.push(bE("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(bE("_revinclude",n))),t.length===0?"":(nd(t),"?"+t.join("&"))}function xB(e){const t=e.operator in UD?":"+e.operator:"",n=e.operator!==ue.EQUALS&&e.operator in hb?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function bB(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function bE(e,t){return e+(t.modifier?":"+t.modifier:"")+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function Zp(e){const t=[];let n="",r=!1;for(const i of e)r?(n+=i,r=!1):i==="\\"?r=!0:i===","?(t.push(n),n=""):n+=i;return t.push(n),t}function SB(e,t){if(t.resourceType!==e.resourceType)return!1;if(t.filters){for(const n of t.filters)if(!wB(e,t,n))return!1}return!0}function wB(e,t,n){var o,c;const r=(c=(o=la.types[t.resourceType])==null?void 0:o.searchParams)==null?void 0:c[n.code];if(!r)return!1;const i=qo(r.expression,[Gr(e)]);if(n.operator===ue.MISSING||n.operator===ue.PRESENT)return jB(i,n);switch(r.type){case"reference":return CB(i,n);case"string":case"uri":return RB(i,n);case"token":return EB(i,n);case"date":return DB(i,n);default:return!1}}function jB(e,t){const n=e.length>0;return(t.operator===ue.MISSING&&t.value==="false"||t.operator===ue.PRESENT&&t.value==="true")===n}function CB(e,t){const n=Jp(t.operator);if(t.value===""&&e.length===0)return t.operator===ue.EQUALS;const r=aB(e);for(const i of Zp(t.value)){let o=r.includes(i);if(!o&&t.code==="_compartment"&&(o=r.some(c=>c==null?void 0:c.endsWith("/"+i))),o)return!n}return n}function EB(e,t){const n=oB(e),r=Zp(t.value),i=Jp(t.operator);for(const o of n)for(const c of r)if(TB(o,c))return!i;return i}function TB(e,t){var n,r,i,o;if(t.includes("|")){const[c,u]=t.split("|").map(f=>f.toLowerCase());return!c&&!u?!1:c?((r=e.system)==null?void 0:r.toLowerCase())===c&&(!u||((i=e.value)==null?void 0:i.toLowerCase())===u):!e.system&&((n=e.value)==null?void 0:n.toLowerCase())===u}return((o=e.value)==null?void 0:o.toLowerCase())===t.toLowerCase()}function RB(e,t){const n=iB(e),r=Zp(t.value),i=Jp(t.operator);for(const o of n)for(const c of r)if(_B(o,c))return!i;return i}function _B(e,t){return e.toLowerCase().includes(t.toLowerCase())}function DB(e,t){const n=rB(e),r=Zp(t.value),i=Jp(t.operator);for(const o of n)for(const c of r)if(AB(o,t.operator,c))return!i;return i}function AB(e,t,n){if(!e)return!1;const r=jD(n);if(!r)return!1;const i=e.start??"0000",o=e.end??"9999",c=r.start,u=r.end;switch(t){case ue.APPROXIMATELY:case ue.EQUALS:case ue.NOT_EQUALS:return i<u&&o>c;case ue.LESS_THAN:return i<c;case ue.GREATER_THAN:return o>u;case ue.LESS_THAN_OR_EQUALS:return i<=u;case ue.GREATER_THAN_OR_EQUALS:return o>=c;case ue.STARTS_AFTER:return i>u;case ue.ENDS_BEFORE:return o<c;default:return!1}}function Jp(e){return e===ue.NOT_EQUALS||e===ue.NOT}const kB={resourceType:"*"},PB=["DomainConfiguration","JsonWebKey","Login"],NB=["PasswordChangeRequest","UserSecurityRequest","Project","ProjectMembership","User"],Os={READ:"read",VREAD:"vread",UPDATE:"update",HISTORY:"history",SEARCH:"search"},OB=[Os.READ,Os.VREAD,Os.HISTORY,Os.SEARCH];function MB(e,t){return PB.includes(t)?!1:LB(e,Os.UPDATE,t)}function LB(e,t,n){var r;return!!((r=e.resource)!=null&&r.some(i=>FD(i,n,t)))}function VD(e,t,n){var r;return n?(r=n.resource)==null?void 0:r.find(i=>IB(e,t,i)):kB}function IB(e,t,n){var i,o;const r=e.resourceType;return FD(n,r,t)?r==="Binary"?!0:!(n.compartment&&!((o=(i=e.meta)==null?void 0:i.compartment)!=null&&o.some(c=>{var u;return c.reference===((u=n.compartment)==null?void 0:u.reference)}))||n.criteria&&!SB(e,BD(n.criteria))):!1}function FD(e,t,n){return e.resourceType!==t&&(e.resourceType!=="*"||NB.includes(t))?!1:e.interaction?e.interaction.includes(n):!e.readonly||OB.includes(n)}function $B(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 SE(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 zB(e){e=e.padEnd(e.length+(4-e.length%4)%4,"=");const t=e.replace(/-/g,"+").replace(/_/g,"/");return $B(t)}function wE(){const e=new Uint32Array(28);return crypto.getRandomValues(e),sU(e.buffer)}async function UB(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function HD(){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 qD(e){var i;const t={};e=Wr(e);for(const o of e.entry||[]){const c=o.resource;if(!c)continue;c.meta!==void 0&&(delete c.meta.author,delete c.meta.compartment,delete c.meta.lastUpdated,delete c.meta.project,delete c.meta.versionId,Object.keys(c.meta).length===0&&delete c.meta);const u=c==null?void 0:c.id;u&&(t[u]=HD(),o.fullUrl="urn:uuid:"+t[u],(i=o.resource)==null||delete i.id)}const n=e.entry,r=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:n==null?void 0:n.map(o=>{var c;return{fullUrl:o.fullUrl,request:{method:"POST",url:(c=o.resource)==null?void 0:c.resourceType},resource:o.resource}})},(o,c)=>BB(o,c,t),2);return VB(JSON.parse(r))}function BB(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 i=n[r];if(i)return"urn:uuid:"+i}}return t}function VB(e){const t=HB(e),{sorted:n,cycles:r}=FB(t),i={};for(const c of e.entry??[])c.fullUrl&&(i[c.fullUrl]=c);const o=n.map(c=>i[c]);for(const c of r)for(const u of c){const f=i[u],h={...f,request:{...f.request,method:"PUT"}};o.push(h)}return{...e,entry:o}}const Jl={NotVisited:"NotVisited",Visiting:"Visiting",Visited:"Visited"};function FB(e){const t=[],n={},r=[];for(const o of Object.keys(e))n[o]=Jl.NotVisited;function i(o,c){if(n[o]===Jl.Visited)return!0;if(n[o]===Jl.Visiting){const f=c.lastIndexOf(o);return f!==-1&&r.push(c.slice(f)),!0}n[o]=Jl.Visiting,c.push(o);let u=!1;for(const f of e[o])i(f,c)||(u=!0);return n[o]=Jl.Visited,c.pop(),t.unshift(o),!u}for(const o in e)n[o]===Jl.NotVisited&&i(o,[]);return{sorted:t,cycles:r}}function GD(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(no(r)){const i=r.reference;i.startsWith("urn:uuid:")&&t(i)}else GD(r,t)}}function HB(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&&GD(n.resource,i=>{t[i]&&t[i].push(r)})}return t}const fn={FHIR_JSON:"application/fhir+json",FORM_URL_ENCODED:"application/x-www-form-urlencoded",HL7_V2:"x-application/hl7-v2+er7",JSON:"application/json",JSON_PATCH:"application/json-patch+json",TEXT:"text/plain",PING:"x-application/ping",XML:"text/xml",CDA_XML:"application/cda+xml"};let qB=class{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 i=0;i<r.length;i++)if(r[i]===n){r.splice(i,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 em{constructor(){this.emitter=new qB}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 By={"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"},GB=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],pb=["DiagnosticReport-update"];function WB(e){return pb.includes(e)}function QB(e){if(pb.includes(e))throw new ft(yn(`'context.version' is required for '${e}'.`))}const YB={"Patient-open":{patient:{resourceType:"Patient"},encounter:{resourceType:"Encounter",optional:!0}},"Patient-close":{patient:{resourceType:"Patient"},encounter:{resourceType:"Encounter",optional:!0}},"ImagingStudy-open":{study:{resourceType:"ImagingStudy"},encounter:{resourceType:"Encounter",optional:!0},patient:{resourceType:"Patient",optional:!0}},"ImagingStudy-close":{study:{resourceType:"ImagingStudy"},encounter:{resourceType:"Encounter",optional:!0},patient:{resourceType:"Patient",optional:!0}},"Encounter-open":{encounter:{resourceType:"Encounter"},patient:{resourceType:"Patient"}},"Encounter-close":{encounter:{resourceType:"Encounter"},patient:{resourceType:"Patient"}},"DiagnosticReport-open":{report:{resourceType:"DiagnosticReport"},encounter:{resourceType:"Encounter",optional:!0},study:{resourceType:"ImagingStudy",optional:!0,manyAllowed:!0},patient:{resourceType:"Patient"}},"DiagnosticReport-close":{report:{resourceType:"DiagnosticReport"},encounter:{resourceType:"Encounter",optional:!0},study:{resourceType:"ImagingStudy",optional:!0,manyAllowed:!0},patient:{resourceType:"Patient"}},"DiagnosticReport-select":{report:{resourceType:"DiagnosticReport",reference:!0},patient:{resourceType:"Patient",optional:!0,reference:!0},select:{resourceType:"*",reference:!0,manyAllowed:!0}},"DiagnosticReport-update":{report:{resourceType:"DiagnosticReport",reference:!0},patient:{resourceType:"Patient",optional:!0,reference:!0},updates:{resourceType:"Bundle"}},syncerror:{operationoutcome:{resourceType:"OperationOutcome"}}};function XB(e){return GB.includes(e)}function WD(e){return!!e.endpoint}function jE(e){if(!mb(e))throw new ft(yn("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:n,topic:r,events:i}=e,o={"hub.channel.type":t,"hub.mode":n,"hub.topic":r,"hub.events":i.join(",")};return WD(e)&&(o.endpoint=e.endpoint),new URLSearchParams(o).toString()}function mb(e){if(typeof e!="object")return!1;const{channelType:t,mode:n,topic:r,events:i}=e;if(!(t&&n&&r&&i)||typeof r!="string"||typeof i!="object"||!Array.isArray(i)||i.length<1||t!=="websocket"||n!=="subscribe"&&n!=="unsubscribe")return!1;for(const o of i)if(!By[o])return!1;return!(WD(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function KB(e,t,n,r){if(typeof t!="object")throw new ft(yn(`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 ft(yn(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new ft(yn(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const i=r.resourceType;if(i!=="*"){if(!XB(t.resourceType))throw new ft(yn(`context[${n}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));if(i&&t.resourceType!==i)throw new ft(yn(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${i}.`))}}function ZB(e,t,n,r,i){if(i.set(t.key,(i.get(t.key)??0)+1),r.reference){if(!no(t.reference))throw new ft(yn(`context[${n}] is invalid. Expected key '${t.key}' to be a reference.`))}else KB(e,t.resource,n,r)}function JB(e,t){const n=new Map,r=YB[e];for(let i=0;i<t.length;i++){const o=t[i].key;if(!r[o])throw new ft(yn(`Key '${o}' not found for event '${e}'. Make sure to add only valid keys.`));ZB(e,t[i],i,r[o],n)}for(const[i,o]of Object.entries(r)){if(!(o.optional||n.has(i)))throw new ft(yn(`Missing required key '${i}' on context for '${e}' event.`));if(!o.manyAllowed&&(n.get(i)??0)>1)throw new ft(yn(`${n.get(i)} context entries with key '${i}' found for the '${e}' event when schema only allows for 1.`))}}function CE(e,t,n,r){if(!(e&&typeof e=="string"))throw new ft(yn("Must provide a topic."));if(!By[t])throw new ft(yn(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(By).join(", ")}`));if(typeof n!="object")throw new ft(yn("context must be a context object or array of context objects."));if(pb.includes(t)&&!r)throw new ft(yn(`The '${t}' event must contain a 'context.versionId'.`));const i=Array.isArray(n)?n:[n];return JB(t,i),{timestamp:new Date().toISOString(),id:HD(),event:{"hub.topic":e,"hub.event":t,context:i,...r?{"context.versionId":r}:{}}}}class eV extends em{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new ft(yn("Subscription request should contain an endpoint."));if(!mb(t))throw new ft(yn("Subscription request failed validation."));const n=new WebSocket(t.endpoint);n.addEventListener("open",()=>{this.dispatchEvent({type:"connect"}),n.addEventListener("message",r=>{const i=JSON.parse(r.data);if(i["hub.topic"])return;const o=i;o.event["hub.event"]!=="heartbeat"&&(this.dispatchEvent({type:"message",payload:o}),n.send(JSON.stringify({id:i==null?void 0:i.id,timestamp:new Date().toISOString()})))}),n.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=n}disconnect(){this.websocket.close()}}function tV(e){return JSON.parse(zB(e))}function nV(e){return e.split(".").length===3}function gb(e){const[t,n,r]=e.split(".");return tV(n)}function rV(e){try{return typeof gb(e).login_id=="string"}catch{return!1}}function iV(e){try{const n=gb(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class aV{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,fn.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}var QD;QD=Symbol.toStringTag;class Ri{constructor(t){this[QD]="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 oV{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new sV)}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?Oi(n):void 0)}}class sV{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]}}/*!
79
+ * Reconnecting WebSocket
80
+ * by Pedro Ladaria <pedro.ladaria@gmail.com>
81
+ * https://github.com/pladaria/reconnecting-websocket
82
+ * License MIT
83
+ *
84
+ * Copy of "partysocket" from Partykit team, a fork of the original "Reconnecting WebSocket"
85
+ * https://github.com/partykit/partykit/blob/main/packages/partysocket
86
+ */const lc={Event:typeof globalThis.Event<"u"?globalThis.Event:void 0,ErrorEvent:void 0,CloseEvent:void 0};let EE=!1;function lV(){if(typeof globalThis.Event>"u")throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");lc.Event=globalThis.Event,lc.ErrorEvent=class extends Event{constructor(t,n){super("error",n),this.message=t.message,this.error=t}},lc.CloseEvent=class extends Event{constructor(t=1e3,n="",r){super("close",r),this.wasClean=!0,this.code=t,this.reason=n}}}function cV(e,t){if(!e)throw new Error(t)}function ah(e){return new e.constructor(e.type,e)}const Ss={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0};let TE=!1;class Lo extends em{constructor(t,n,r={}){EE||(lV(),EE=!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=i=>{this._debug("open event");const{minUptime:o=Ss.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),o),cV(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(c=>{var u;return(u=this._ws)==null?void 0:u.send(c)}),this._messageQueue=[],this.onopen&&this.onopen(i),this.dispatchEvent(ah(i))},this._handleMessage=i=>{this._debug("message event"),this.onmessage&&this.onmessage(i),this.dispatchEvent(ah(i))},this._handleError=i=>{this._debug("error event",i.message),this._disconnect(void 0,i.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(i),this._debug("exec error listeners"),this.dispatchEvent(ah(i)),this._connect()},this._handleClose=i=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(i),this.dispatchEvent(ah(i))},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 Lo.CONNECTING}get OPEN(){return Lo.OPEN}get CLOSING(){return Lo.CLOSING}get CLOSED(){return Lo.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,i)=>(typeof i=="string"?r+=i.length:i instanceof Blob?r+=i.size:r+=i.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?Lo.CLOSED:Lo.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=Ss.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=Ss.reconnectionDelayGrowFactor,minReconnectionDelay:n=Ss.minReconnectionDelay,maxReconnectionDelay:r=Ss.maxReconnectionDelay}=this._options;let i=0;return this._retryCount>0&&(i=n*Math.pow(t,this._retryCount-1),i>r&&(i=r)),this._debug("next delay",i),i}_wait(){return new Promise(t=>{setTimeout(t,this._getNextDelay())})}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;const{maxRetries:t=Ss.maxRetries,connectionTimeout:n=Ss.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"&&!TE&&(console.error("‼️ No WebSocket implementation available. You should define options.WebSocket."),TE=!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 lc.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new lc.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new lc.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 uV=5e3;class Vy extends em{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 dV{constructor(t,n){this.connecting=!1,this.criteria=t,this.emitter=new Vy(t),this.refCount=1,this.subscriptionProps=n?{...n}:void 0}clearAttachedSubscription(){this.subscriptionId=void 0,this.token=void 0}}class fV{constructor(t,n,r){if(this.pingTimer=void 0,this.waitingForPong=!1,!(t instanceof XD))throw new ft(yn("First arg of constructor should be a `MedplumClient`"));let i;try{i=new URL(n).toString()}catch{throw new ft(yn("Not a valid URL"))}const o=r!=null&&r.ReconnectingWebSocket?new r.ReconnectingWebSocket(i,void 0,{debug:r==null?void 0:r.debug,debugLogger:r==null?void 0:r.debugLogger}):new Lo(i,void 0,{debug:r==null?void 0:r.debug,debugLogger:r==null?void 0:r.debugLogger});this.medplum=t,this.ws=o,this.masterSubEmitter=new Vy,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.pingIntervalMs=(r==null?void 0:r.pingIntervalMs)??uV,this.currentProfile=t.getProfile(),this.setupListeners()}setupListeners(){const t=this.ws;t.addEventListener("message",n=>{var r,i,o,c,u,f;try{const h=JSON.parse(n.data);if(h.type==="pong"){this.waitingForPong=!1;return}const m=h,g=(i=(r=m==null?void 0:m.entry)==null?void 0:r[0])==null?void 0:i.resource;if(g.type==="heartbeat"){(o=this.masterSubEmitter)==null||o.dispatchEvent({type:"heartbeat",payload:m});return}if(g.type==="handshake"){const b=Vs(g.subscription),S={type:"connect",payload:{subscriptionId:b}};(c=this.masterSubEmitter)==null||c.dispatchEvent(S);const j=this.criteriaEntriesBySubscriptionId.get(b);if(!j){console.warn("Received handshake for criteria the SubscriptionManager is not listening for yet");return}j.connecting=!1,j.emitter.dispatchEvent({...S});return}(u=this.masterSubEmitter)==null||u.dispatchEvent({type:"message",payload:m});const y=this.criteriaEntriesBySubscriptionId.get(Vs(g.subscription));if(!y){console.warn("Received notification for criteria the SubscriptionManager is not listening for");return}y.emitter.dispatchEvent({type:"message",payload:m})}catch(h){console.error(h);const m={type:"error",payload:h};(f=this.masterSubEmitter)==null||f.dispatchEvent(m);for(const g of this.getAllCriteriaEmitters())g.dispatchEvent({...m})}}),t.addEventListener("error",()=>{var r;const n={type:"error",payload:new ft(jz(new Error("WebSocket error")))};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const i of this.getAllCriteriaEmitters())i.dispatchEvent({...n})}),t.addEventListener("close",()=>{var r,i;const n={type:"close"};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const o of this.getAllCriteriaEmitters())o.dispatchEvent({...n});this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=void 0,this.waitingForPong=!1),this.wsClosed&&(this.criteriaEntries.clear(),this.criteriaEntriesBySubscriptionId.clear(),(i=this.masterSubEmitter)==null||i.removeAllListeners())}),t.addEventListener("open",()=>{var r;const n={type:"open"};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const i of this.getAllCriteriaEmitters())i.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 i;const r={type:"error",payload:n};(i=this.masterSubEmitter)==null||i.dispatchEvent(r),t.emitter.dispatchEvent({...r})}maybeEmitDisconnect(t){var r;const{subscriptionId:n}=t;if(n){const i={type:"disconnect",payload:{subscriptionId:n}};(r=this.masterSubEmitter)==null||r.dispatchEvent(i),t.emitter.dispatchEvent({...i})}else console.warn("Called disconnect for `CriteriaEntry` before `subscriptionId` was present.")}async getTokenForCriteria(t){var c,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 ${Mt(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`),i=(c=r==null?void 0:r.find(f=>f.name==="token"))==null?void 0:c.valueString,o=(u=r==null?void 0:r.find(f=>f.name==="websocket-url"))==null?void 0:u.valueUrl;if(!i)throw new ft(yn("Failed to get token"));if(!o)throw new ft(yn("Failed to get URL from $get-ws-binding-token"));return[n,i]}maybeGetCriteriaEntry(t,n){const r=this.criteriaEntries.get(t);if(r){if(!n)return r.bareCriteria;for(const i of r.criteriaWithProps)if(sa(n,i.subscriptionProps))return i}}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 i;this.criteriaEntries.has(n)?i=this.criteriaEntries.get(n):(i={criteriaWithProps:[]},this.criteriaEntries.set(n,i)),r?i.criteriaWithProps.push(t):i.bareCriteria=t}removeCriteriaEntry(t){var u;const{criteria:n,subscriptionProps:r,subscriptionId:i,token:o}=t;if(!this.criteriaEntries.has(n))return;const c=this.criteriaEntries.get(n);r?c.criteriaWithProps=c.criteriaWithProps.filter(f=>{const h=f.subscriptionProps;return!sa(r,h)}):c.bareCriteria=void 0,!c.bareCriteria&&c.criteriaWithProps.length===0&&(this.criteriaEntries.delete(n),(u=this.masterSubEmitter)==null||u._removeCriteria(n)),i&&this.criteriaEntriesBySubscriptionId.delete(i),o&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"unbind-from-token",payload:{token:o}}))}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(Ke(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 i=new dV(t,n);return this.addCriteriaEntry(i),this.subscribeToCriteria(i).catch(console.error),i.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 Vy(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const YD="4.3.7-da76410e3",hV=fn.FHIR_JSON+", */*; q=0.1",pV="https://api.medplum.com/",mV=1e3,gV=6e4,vV=0,yV=3e5,xV="Binary/",RE={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]},ec={ClientCredentials:"client_credentials",AuthorizationCode:"authorization_code",RefreshToken:"refresh_token",JwtBearer:"urn:ietf:params:oauth:grant-type:jwt-bearer",TokenExchange:"urn:ietf:params:oauth:grant-type:token-exchange"},bV={AccessToken:"urn:ietf:params:oauth:token-type:access_token"},SV={JwtBearer:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"};class XD extends em{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)??wV(),this.storage=(t==null?void 0:t.storage)??new oV,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=ab((t==null?void 0:t.baseUrl)??pV),this.fhirBaseUrl=Ki(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4"),this.authorizeUrl=Ki(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=Ki(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=Ki(this.baseUrl,(t==null?void 0:t.logoutUrl)??"oauth2/logout"),this.fhircastHubUrl=Ki(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.credentialsInHeader=(t==null?void 0:t.authCredentialsMethod)==="header",this.defaultHeaders=(t==null?void 0:t.defaultHeaders)??{},this.onUnauthenticated=t==null?void 0:t.onUnauthenticated,this.refreshGracePeriod=(t==null?void 0:t.refreshGracePeriod)??yV,this.cacheTime=(t==null?void 0:t.cacheTime)??(typeof window>"u"?vV:gV),this.cacheTime>0?this.requestCache=new sD((t==null?void 0:t.resourceCacheSize)??mV):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=Ki(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 i;t.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue&&!n.disableAutoBatch?i=new Promise((c,u)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:n,resolve:c,reject:u}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):i=this.request("GET",t,n);const o=new Ri(i);return this.setCacheEntry(t,o),o}post(t,n,r,i={}){return t=t.toString(),this.setRequestBody(i,n),r&&this.setRequestContentType(i,r),this.invalidateUrl(t),this.request("POST",t,i)}put(t,n,r,i={}){return t=t.toString(),this.setRequestBody(i,n),r&&this.setRequestContentType(i,r),this.invalidateUrl(t),this.request("PUT",t,i)}patch(t,n,r={}){return t=t.toString(),this.setRequestBody(r,n),this.setRequestContentType(r,fn.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:i}=await this.startPkce();return this.post("auth/newuser",{...t,clientId:t.clientId??this.clientId,codeChallengeMethod:r,codeChallenge:i},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,i,o=!0){let c=i;o&&(c=await this.ensureCodeChallenge(i)),window.location.assign(this.getExternalAuthRedirectUri(t,n,r,c,o))}async exchangeExternalAccessToken(t,n){if(n=n??this.clientId,!n)throw new Error("MedplumClient is missing clientId");return this.fetchTokens({grant_type:ec.TokenExchange,subject_token_type:bV.AccessToken,client_id:n,subject_token:t})}getExternalAuthRedirectUri(t,n,r,i,o=!0){const c=new URL(t);if(c.searchParams.set("response_type","code"),c.searchParams.set("client_id",n),c.searchParams.set("redirect_uri",r),c.searchParams.set("scope",i.scope??"openid profile email"),c.searchParams.set("state",JSON.stringify(i)),o){const{codeChallenge:u,codeChallengeMethod:f}=i;if(!f)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!u)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");c.searchParams.set("code_challenge_method",f),c.searchParams.set("code_challenge",u)}return c.toString()}fhirUrl(...t){return new URL(Ki(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=pU(n)),r}search(t,n,r){const i=this.fhirSearchUrl(t,n),o="search-"+i.toString(),c=this.getCacheEntry(o,r);if(c)return c.value;const u=this.getBundle(i,r);return this.setCacheEntry(o,u),u}searchOne(t,n,r){const i=this.fhirSearchUrl(t,n);i.searchParams.set("_count","1"),i.searchParams.sort();const o="searchOne-"+i.toString(),c=this.getCacheEntry(o,r);if(c)return c.value;const u=new Ri(this.search(t,i.searchParams,r).then(f=>{var h,m;return(m=(h=f.entry)==null?void 0:h[0])==null?void 0:m.resource}));return this.setCacheEntry(o,u),u}searchResources(t,n,r){const o="searchResources-"+this.fhirSearchUrl(t,n).toString(),c=this.getCacheEntry(o,r);if(c)return c.value;const u=new Ri(this.search(t,n,r).then(AE));return this.setCacheEntry(o,u),u}async*searchResourcePages(t,n,r){var o,c;let i=this.fhirSearchUrl(t,n);for(;i;){const u=new URL(i).searchParams;u.has("_count")||u.set("_count","1000");const f=await this.search(t,u,r),h=(o=f.link)==null?void 0:o.find(m=>m.relation==="next");if(!((c=f.entry)!=null&&c.length)&&!h)break;yield AE(f),i=h!=null&&h.url?new URL(h.url):void 0}}valueSetExpand(t,n){const r=this.fhirUrl("ValueSet","$expand");return r.search=new URLSearchParams(t).toString(),this.get(r.toString(),n)}getCached(t,n){var i,o;const r=(o=(i=this.requestCache)==null?void 0:i.get(this.fhirUrl(t,n).toString()))==null?void 0:o.value;return r!=null&&r.isOk()?r.read():void 0}getCachedReference(t){const n=t.reference;if(!n)return;if(n==="system")return RE;const[r,i]=n.split("/");if(!(!r||!i))return this.getCached(r,i)}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 Ri(Promise.reject(new Error("Missing reference")));if(r==="system")return new Ri(Promise.resolve(RE));const[i,o]=r.split("/");return!i||!o?new Ri(Promise.reject(new Error("Invalid reference"))):this.readResource(i,o,n)}requestSchema(t){if(pD(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const i=new Ri((async()=>{const o=`{
87
+ StructureDefinitionList(_filter: "name eq ${t}") {
88
+ resourceType,
89
+ name,
90
+ kind,
91
+ description,
92
+ type,
93
+ url,
94
+ snapshot {
95
+ element {
96
+ id,
97
+ path,
98
+ definition,
99
+ min,
100
+ max,
101
+ base {
102
+ path,
103
+ min,
104
+ max
105
+ },
106
+ contentReference,
107
+ type {
108
+ code,
109
+ profile,
110
+ targetProfile
111
+ },
112
+ binding {
113
+ strength,
114
+ valueSet
115
+ }
116
+ }
117
+ }
118
+ }
119
+ SearchParameterList(base: "${t}", _count: 100) {
120
+ base,
121
+ code,
122
+ type,
123
+ expression,
124
+ target
125
+ }
126
+ }`.replace(/\s+/g," "),c=await this.graphql(o);lE(c.data.StructureDefinitionList);for(const u of c.data.SearchParameterList)EU(u)})());return this.setCacheEntry(n,i),i}requestProfileSchema(t,n){if(!(n!=null&&n.expandProfile)&&eb(t))return Promise.resolve();const r=t+"-requestSchema"+(n!=null&&n.expandProfile?"-nested":""),i=this.getCacheEntry(r,void 0);if(i)return i.value;const o=new Ri((async()=>{if(n!=null&&n.expandProfile){const c=this.fhirUrl("StructureDefinition","$expand-profile");c.search=new URLSearchParams({url:t}).toString();const u=await this.post(c.toString(),{});lE(u)}else{const c=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});if(!c){console.warn(`No StructureDefinition found for ${t}!`);return}hD(c)}})());return this.setCacheEntry(r,o),o}readHistory(t,n,r){return this.get(this.fhirUrl(t,n,"_history"),r)}readVersion(t,n,r,i){return this.get(this.fhirUrl(t,n,"_history",r),i)}readPatientEverything(t,n){return this.getBundle(this.fhirUrl("Patient",t,"$everything"),n)}readPatientSummary(t,n){return this.getBundle(this.fhirUrl("Patient",t,"$summary"),n)}createResource(t,n){if(!t.resourceType)throw new Error("Missing resourceType");return this.invalidateSearches(t.resourceType),this.post(this.fhirUrl(t.resourceType),t,void 0,n)}async createResourceIfNoneExist(t,n,r){const i=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 o=await this.post(i,t,void 0,r);return this.cacheResource(o),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),o}async upsertResource(t,n,r){const i=this.fhirSearchUrl(t.resourceType,n);let o=await this.put(i,t,void 0,r);return o||(o=t),this.cacheResource(o),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),o}async createAttachment(t,n,r,i,o){let c=kE(t,n,r,i);if(c.contentType===fn.XML){const h=c.data;let m;h instanceof Blob?m=await new Promise((g,y)=>{const b=new FileReader;b.onload=()=>{if(!b.result){y(new Error("Failed to load file"));return}g(b.result)},b.readAsText(h,"utf-8")}):ArrayBuffer.isView(h)?m=new TextDecoder().decode(h):m=h,m.includes("<ClinicalDocument")&&m.includes("urn:hl7-org:v3")&&(c={...c,contentType:fn.CDA_XML})}const u=o??(typeof n=="object"?n:{}),f=await this.createBinary(c,u);return{contentType:c.contentType,url:f.url,title:c.filename}}createBinary(t,n,r,i,o){const c=kE(t,n,r,i),u=o??(typeof n=="object"?n:{}),{data:f,contentType:h,filename:m,securityContext:g,onProgress:y}=c,b=this.fhirUrl("Binary");return m&&b.searchParams.set("_filename",m),g!=null&&g.reference&&this.setRequestHeader(u,"X-Security-Context",g.reference),y?this.uploadwithProgress(b,f,h,y,u):this.post(b,f,h,u)}uploadwithProgress(t,n,r,i,o){return new Promise((c,u)=>{var g;const f=new XMLHttpRequest,h=()=>f.abort();(g=o==null?void 0:o.signal)==null||g.addEventListener("abort",h);const m=y=>{var b;(b=o==null?void 0:o.signal)==null||b.removeEventListener("abort",h),y instanceof Error?u(y):c(y)};if(f.responseType="json",f.onabort=()=>m(new DOMException("Request aborted","AbortError")),f.onerror=()=>m(new Error("Request error")),i&&(f.upload.onprogress=y=>i(y),f.upload.onload=y=>i(y)),f.onload=()=>{f.status>=200&&f.status<300?m(f.response):m(new ft(Kt(f.response||f.statusText)))},f.open("POST",t),f.withCredentials=!0,f.setRequestHeader("Authorization","Bearer "+this.accessToken),f.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),f.setRequestHeader("Content-Type",r),this.options.extendedMode!==!1&&f.setRequestHeader("X-Medplum","extended"),o!=null&&o.headers){const y=o.headers;for(const[b,S]of Object.entries(y))f.setRequestHeader(b,S)}f.send(n)})}async createPdf(t,n,r,i){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const o=EV(t,n,r,i),c=typeof n=="object"?n:{},{docDefinition:u,tableLayouts:f,fonts:h,...m}=o,g=await this.createPdfImpl(u,f,h),y={...m,data:g,contentType:"application/pdf"};return this.createBinary(y,c)}createComment(t,n,r){const i=this.getProfile();let o,c;return t.resourceType==="Encounter"&&(o=tn(t),c=t.subject),t.resourceType==="ServiceRequest"&&(o=t.encounter,c=t.subject),t.resourceType==="Patient"&&(c=tn(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[tn(t)],encounter:o,subject:c,sender:i?tn(i):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,i){const o=await this.patch(this.fhirUrl(t,n),r,i);return this.cacheResource(o),this.invalidateUrl(this.fhirUrl(t,n,"_history")),this.invalidateSearches(t),o}deleteResource(t,n,r){return this.deleteCacheEntry(this.fhirUrl(t,n).toString()),this.invalidateSearches(t),this.delete(this.fhirUrl(t,n),r)}validateResource(t,n){return this.post(this.fhirUrl(t.resourceType,"$validate"),t,void 0,n)}executeBot(t,n,r,i){let o;if(typeof t=="string"){const c=t;o=this.fhirUrl("Bot",c,"$execute")}else{const c=t;o=this.fhirUrl("Bot","$execute"),o.searchParams.set("identifier",c.system+"|"+c.value)}return this.post(o,n,r,i)}executeBatch(t,n){return this.post(this.fhirBaseUrl,t,void 0,n)}sendEmail(t,n){return this.post("email/v1/send",t,fn.JSON,n)}graphql(t,n,r,i){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},fn.JSON,i)}readResourceGraph(t,n,r,i){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,i)}pushToAgent(t,n,r,i,o,c){const{waitTimeout:u,...f}=c??{};return this.post(this.fhirUrl("Agent",Vs(t),"$push"),{destination:typeof n=="string"?n:Mt(n),body:r,contentType:i,waitForResponse:o,...u!==void 0?{waitTimeout:u}:void 0},fn.FHIR_JSON,f)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){var n,r;(!((n=this.sessionDetails)!=null&&n.profile)||Mt(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=iV(t),this.medplumServer=rV(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const n=this.getLogins().filter(r=>{var i,o;return((i=r.profile)==null?void 0:i.reference)!==((o=t.profile)==null?void 0:o.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 o,c;this.profilePromise=void 0;const i=((c=(o=this.sessionDetails)==null?void 0:o.profile)==null?void 0:c.id)!==r.profile.id;this.sessionDetails=r,i&&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(xV)&&(t=this.fhirUrl(r));let i=n.headers;return i||(i={},n.headers=i),i.Accept||(i.Accept="*/*"),this.addFetchOptionsDefaults(n),(await this.fetchWithRetry(t.toString(),n)).blob()}async createMedia(t,n){const{additionalFields:r,...i}=t,o=await this.createResource({resourceType:"Media",status:"preparation",content:{contentType:t.contentType},...r});i.securityContext||(i.securityContext=tn(o));const c=await this.createAttachment(i,n);return this.updateResource({...o,status:"completed",content:c})}async uploadMedia(t,n,r,i,o){return this.createMedia({data:t,contentType:n,filename:r,additionalFields:i},o)}async createDocumentReference(t,n){const{additionalFields:r,...i}=t,o=await this.createResource({resourceType:"DocumentReference",status:"current",content:[{attachment:{contentType:t.contentType}}],...r});i.securityContext||(i.securityContext=tn(o));const c=await this.createAttachment(i,n);return this.updateResource({...o,content:[{attachment:c}]})}async bulkExport(t="",n,r,i){const o=t&&`${t}/`,c=this.fhirUrl(`${o}$export`);return n&&c.searchParams.set("_type",n),r&&c.searchParams.set("_since",r),this.startAsyncRequest(c.toString(),i)}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 aV(this)),this.keyValueClient}getBundle(t,n){return new Ri((async()=>{const r=await this.get(t,n);if(r.entry)for(const i of r.entry)this.cacheResource(i.resource);return r})())}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(i=>i.code==="SUBSETTED"))&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new Ri(Promise.resolve(t)))}deleteCacheEntry(t){this.requestCache&&this.requestCache.delete(t)}async request(t,n,r={},i={}){await this.refreshIfExpired(),r.method=t,this.addFetchOptionsDefaults(r);const o=await this.fetchWithRetry(n,r);if(o.status===401)return this.handleUnauthenticated(t,n,r);if(o.status===204||o.status===304)return;const c=o.headers.get("content-type"),u=c==null?void 0:c.includes("json");if(o.status===404&&!u)throw new ft(Sz);const f=await this.parseBody(o,u);if(o.status===200&&r.followRedirectOnOk||o.status===201&&r.followRedirectOnCreated){const h=await DE(o,f);if(h)return this.request("GET",h,{...r,body:void 0})}if(o.status===202&&r.pollStatusOnAccepted){const m=await DE(o,f)??i.statusUrl;if(m)return this.pollStatus(m,r,i)}if(o.status>=400)throw new ft(Kt(f));return f}async parseBody(t,n){let r;if(t.headers.get("content-length")!=="0"){if(n)try{r=await t.json()}catch(i){throw console.error("Error parsing response",t.status,i),i}else r=await t.text();return r}}async fetchWithRetry(t,n){t.startsWith("http")||(t=Ki(this.baseUrl,t));const r=(n==null?void 0:n.maxRetries)??2;for(let i=0;i<=r;i++)try{this.options.verbose&&this.logRequest(t,n);const o=await this.fetch(t,n);if(this.options.verbose&&this.logResponse(o),this.setCurrentRateLimit(o),i>=r||!TV(o))return o;const c=this.getRetryDelay(i),u=n.maxRetryTime??2e3;if(c>u)return o;await gE(c)}catch(o){if(o.message==="Failed to fetch"&&i===0&&this.dispatchEvent({type:"offline"}),o.name==="AbortError"||i===r)throw o}throw new Error("Unreachable")}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const i of nd(Object.keys(r)))console.log(`> ${i}: ${r[i]}`)}}logResponse(t){console.log(`< ${t.status} ${t.statusText}`),t.headers&&t.headers.forEach((n,r)=>console.log(`< ${r}: ${n}`))}setCurrentRateLimit(t){var r;const n=(r=t.headers)==null?void 0:r.get("ratelimit");n&&(this.currentRateLimits=n)}rateLimitStatus(){if(!this.currentRateLimits)return[];const t=this.currentRateLimits;return t.split(/\s*;\s*/g).map(n=>{const r=n.split(/\s*,\s*/g);if(r.length!==3)throw new Error("Could not parse RateLimit header: "+t);const i=r[0].substring(1,r[0].length-1),o=r.find(h=>h.startsWith("r=")),c=o?parseInt(o.substring(2),10):NaN,u=r.find(h=>h.startsWith("t=")),f=u?parseInt(u.substring(2),10):NaN;if(!i||Number.isNaN(c)||Number.isNaN(f))throw new Error("Could not parse RateLimit header: "+t);return{name:i,remainingUnits:c,secondsUntilReset:f}})}getRetryDelay(t){const n=this.rateLimitStatus();let r=500*Math.pow(1.5,t);for(const i of n)i.remainingUnits||(r=Math.max(r,i.secondsUntilReset*1e3));return r}async pollStatus(t,n,r){const i={...n,method:"GET",body:void 0,redirect:"follow"};if(r.pollCount===void 0)n.headers&&typeof n.headers=="object"&&"Prefer"in n.headers&&(i.headers={...n.headers},delete i.headers.Prefer),r.statusUrl=t,r.pollCount=1;else{const o=n.pollStatusPeriod??1e3;await gE(o),r.pollCount++}return this.request("GET",t,i,r)}async executeAutoBatch(){var i,o;if(this.autoBatchQueue===void 0)return;const t=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,t.length===1){const c=t[0];try{c.resolve(await this.request(c.method,Ki(this.fhirBaseUrl,c.url),c.options))}catch(u){c.reject(new ft(Kt(u)))}return}const n={resourceType:"Bundle",type:"batch",entry:t.map(c=>({request:{method:c.method,url:c.url},resource:c.options.body?JSON.parse(c.options.body):void 0}))},r=await this.post(this.fhirBaseUrl,n);for(let c=0;c<t.length;c++){const u=t[c],f=(i=r.entry)==null?void 0:i[c];(o=f==null?void 0:f.response)!=null&&o.outcome&&!cD(f.response.outcome)?u.reject(new ft(f.response.outcome)):u.resolve(f==null?void 0:f.resource)}}addFetchOptionsDefaults(t){Object.entries(this.defaultHeaders).forEach(([n,r])=>{this.setRequestHeader(t,n,r)}),this.setRequestHeader(t,"Accept",hV,!0),this.options.extendedMode!==!1&&this.setRequestHeader(t,"X-Medplum","extended"),t.body&&this.setRequestHeader(t,"Content-Type",fn.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,i=!1){t.headers||(t.headers={});const o=t.headers;i&&o[n]||(o[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 ft(ed)))}async startPkce(){const t=wE();sessionStorage.setItem("pkceState",t);const n=wE().slice(0,128);sessionStorage.setItem("codeVerifier",n);try{const r=await UB(n);return{codeChallengeMethod:"S256",codeChallenge:lU(r).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}}catch(r){return console.warn("Failed to hash code verifier. Falling back to 'plain' code challenge method",r),{codeChallengeMethod:"plain",codeChallenge:n}}}async requestAuthorization(t){const n=await this.ensureCodeChallenge(t??{}),r=new URL(this.authorizeUrl);r.searchParams.set("response_type","code"),r.searchParams.set("state",sessionStorage.getItem("pkceState")),r.searchParams.set("client_id",n.clientId??this.clientId),r.searchParams.set("redirect_uri",n.redirectUri??_E()),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={grant_type:ec.AuthorizationCode,code:t,client_id:(n==null?void 0:n.clientId)??this.clientId??"",redirect_uri:(n==null?void 0:n.redirectUri)??_E()};if(typeof sessionStorage<"u"){const i=sessionStorage.getItem("codeVerifier");i&&(r.code_verifier=i)}return this.fetchTokens(r)}refreshIfExpired(t){return!this.refreshPromise&&this.accessTokenExpires!==void 0&&!this.isAuthenticated(t)&&this.refresh(),this.refreshPromise??Promise.resolve()}refresh(){if(this.refreshPromise)return this.refreshPromise;if(this.refreshToken)return this.refreshPromise=this.fetchTokens({grant_type:ec.RefreshToken,client_id:this.clientId??"",refresh_token:this.refreshToken}),this.refreshPromise;if(this.clientId&&this.clientSecret)return this.refreshPromise=this.startClientLogin(this.clientId,this.clientSecret),this.refreshPromise}async startClientLogin(t,n){return this.clientId=t,this.clientSecret=n,this.fetchTokens({grant_type:ec.ClientCredentials,client_id:t,client_secret:n})}async startJwtBearerLogin(t,n,r){return this.clientId=t,this.fetchTokens({grant_type:ec.JwtBearer,client_id:t,assertion:n,scope:r})}async startJwtAssertionLogin(t){return this.fetchTokens({grant_type:ec.ClientCredentials,client_assertion_type:SV.JwtBearer,client_assertion:t})}setBasicAuth(t,n){this.clientId=t,this.clientSecret=n,this.basicAuth=SE(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new ft(yn("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new ft(yn("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},o=(await this.post(this.fhircastHubUrl,jE(r),fn.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!o)throw new Error("Invalid response!");return r.endpoint=o,r}async fhircastUnsubscribe(t){if(!mb(t))throw new ft(yn("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new ft(yn("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post(this.fhircastHubUrl,jE(t),fn.FORM_URL_ENCODED)}fhircastConnect(t){return new eV(t)}async fhircastPublish(t,n,r,i){return WB(n)?this.post(this.fhircastHubUrl,CE(t,n,r,i),fn.JSON):(QB(n),this.post(this.fhircastHubUrl,CE(t,n,r),fn.JSON))}async fhircastGetContext(t){return this.get(`${this.fhircastHubUrl}/${t}`,{cache:"no-cache"})}async invite(t,n){return this.post("admin/projects/"+t+"/invite",n)}async fetchTokens(t){const n=new URLSearchParams(t),r={...this.defaultHeaders,"Content-Type":fn.FORM_URL_ENCODED};this.basicAuth&&(r.Authorization=`Basic ${this.basicAuth}`),this.credentialsInHeader&&(n.delete("client_id"),n.delete("client_secret"),!this.basicAuth&&t.client_id&&t.client_secret&&(r.Authorization=`Basic ${SE(t.client_id+":"+t.client_secret)}`));const i={method:"POST",headers:r,body:n.toString(),credentials:"include"};let o;try{o=await this.fetchWithRetry(this.tokenUrl,i)}catch(u){throw this.refreshPromise=void 0,u}if(!o.ok){this.clearActiveLogin();try{const u=await o.json();throw new ft(ra(u.error_description))}catch(u){throw new ft(ra("Failed to fetch tokens"),u)}}const c=await o.json();return await this.verifyTokens(c),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(nV(n)){const r=gb(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new ft(wz);if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new ft(oE)}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new ft(oE)}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 fV(this,hU(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 wV(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function _E(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}async function DE(e,t){var i,o;const n=e.headers.get("content-location");if(n)return n;const r=e.headers.get("location");if(r)return r;if(Wp(t)&&((o=(i=t.issue)==null?void 0:i[0])!=null&&o.diagnostics))return t.issue[0].diagnostics}function AE(e){var n;const t=((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];return Object.assign(t,{bundle:e})}function jV(e){return sr(e)&&"data"in e&&"contentType"in e}function kE(e,t,n,r){return jV(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function CV(e){return sr(e)&&"docDefinition"in e}function EV(e,t,n,r){return CV(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function TV(e){return e.status===429||e.status>=500}function bc({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:i,accessPolicyResource:o}){if(t===(e==null?void 0:e.path))return;i??(i=(e==null?void 0:e.debugMode)??!1),o??(o=e==null?void 0:e.accessPolicyResource);let c=RV(t,n,e,!!i);const u=Uy(t,".",2)[1];c=_V(c,o,u),c=DV(c,o,u);const f=Object.create(null);for(const[m,g]of Object.entries(c))f[t+"."+m]=g;let h;if(e&&!e.isDefaultContext)h=e.getExtendedProps;else{const m=Object.create(null);h=g=>{const y=Uy(g,".",2)[1];if(y){if(!m[y]){const b=Bh(y,o==null?void 0:o.hiddenFields);m[y]={hidden:b,readonly:b||Bh(y,o==null?void 0:o.readonlyFields)}}return m[y]}}}return{path:t,elements:c,elementsByPath:f,profileUrl:r??(e==null?void 0:e.profileUrl),debugMode:i,getExtendedProps:h,accessPolicyResource:o}}function RV(e,t,n,r){const i=Object.create(null);if(n)for(const[c,u]of Object.entries(n.elementsByPath)){const f=Ps(e,c);f!==void 0&&(i[f]=u)}let o=!1;if(t)for(const[c,u]of Object.entries(t))c in i||(i[c]=u,o=!0);return r&&console.assert(o,"Unnecessary ElementsContext; not using any newly provided elements"),i}function _V(e,t,n){var i;if(!((i=t==null?void 0:t.hiddenFields)!=null&&i.length))return e;const r=n?n+".":"";return Object.fromEntries(Object.entries(e).filter(([o])=>!Bh(r+o,t.hiddenFields)))}function DV(e,t,n){var o;if(!((o=t==null?void 0:t.readonlyFields)!=null&&o.length))return e;const r=Object.create(null),i=n?n+".":"";for(const[c,u]of Object.entries(e))Bh(i+c,t.readonlyFields)?r[c]={...u,readonly:!0}:r[c]=u;return r}function Bh(e,t){if(!(t!=null&&t.length))return!1;const n=e.split(".");for(let r=1;r<=n.length;r++){const i=n.slice(0,r).join(".");if(t.includes(i))return!0}return!1}function KD(e){return e.type!==void 0&&e.type.length>0}function AV(e,t,n,r){var o;const i=z8(e,t.path,{profileUrl:r});if(i){const c=((o=n.typeSchema)==null?void 0:o.elements)??n.elements;return i.some(u=>V8(u,t,n,c))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function ZD(e,t,n,r){var i,o;if(e)for(const c of t){const u={value:e,type:((i=c.typeSchema)==null?void 0:i.type)??((o=c.type)==null?void 0:o[0].code)};if(n.every(f=>{var h;return AV(u,f,c,((h=c.typeSchema)==null?void 0:h.url)??r)}))return c.name}}class kV{constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const i=bc({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(i===void 0)throw new Error("Could not create root elements context");this.elementsContextStack=[i],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 i=Object.fromEntries(Object.entries(this.elementsContext.elements).filter(([o])=>o.startsWith(n)));this.crawlElementsImpl(i,r),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlSlice(t,n,r){const i=this.prepareSlices(r.slices,r);if(!Tn(i.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(i.slices[0],n.path,i),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=PV(t);for(const i of r)this.crawlElementNode(i,n)}crawlElementNode(t,n){var i,o;const r=n+"."+t.key;this.visitor.onEnterElement&&this.visitor.onEnterElement(r,t.element,this.elementsContext);for(const c of t.children)this.crawlElementNode(c,n);Tn((o=(i=t.element)==null?void 0:i.slicing)==null?void 0:o.slices)&&this.crawlSlicingImpl(t.element.slicing,r),this.visitor.onExitElement&&this.visitor.onExitElement(r,t.element,this.elementsContext)}prepareSlices(t,n){var o,c;const r=[];for(const u of t){if(!KD(u))continue;const f=(c=(o=u.type.find(h=>Tn(h.profile)))==null?void 0:o.profile)==null?void 0:c[0];if(Tn(f)){const h=Oc(f);h&&(u.typeSchema=h)}r.push(u)}return{...n,slices:r}}crawlSlicingImpl(t,n){const r=this.prepareSlices(t.slices,t);for(const i of r.slices)(this.sliceAllowList===void 0||this.sliceAllowList.includes(i))&&this.crawlSliceImpl(i,n,r)}crawlSliceImpl(t,n,r){const i=t.typeSchema;i&&this.visitor.onEnterSchema&&this.visitor.onEnterSchema(i),this.visitor.onEnterSlice&&this.visitor.onEnterSlice(n,t,r);let o;const c=(i==null?void 0:i.elements)??t.elements;Tn(c)&&(o=bc({path:n,parentContext:this.elementsContext,elements:c})),o&&this.elementsContextStack.push(o),this.crawlElementsImpl(c,n),o&&this.elementsContextStack.pop(),this.visitor.onExitSlice&&this.visitor.onExitSlice(n,t,r),i&&this.visitor.onExitSchema&&this.visitor.onExitSchema(i)}}function PV(e){const t=[];function n(o,c){return c.startsWith(o+".")}function r(o,c){for(const u of o.children)if(n(u.key,c.key)){r(u,c);return}o.children.push(c)}const i=Object.entries(e);i.sort((o,c)=>o[0].localeCompare(c[0]));for(const[o,c]of i){const u={key:o,element:c,children:[]};let f=!1;for(const h of t)if(n(h.key,o)){r(h,u),f=!0;break}f||t.push(u)}return t}const Kv="__sliceName";function NV(e,t){const n=new OV(e,e.resourceType,"resource");return new kV(t,n).crawlResource(),n.getDefaultValue()}function PE(e,t,n){for(const[r,i]of Object.entries(t)){if(n===void 0||n===r){Vh(e,r,i,t);continue}const o=Ps(n,r);o!==void 0&&Vh(e,o,i,t)}return e}class OV{constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=Wr(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 i=this.value.values,o=this.value.path,c=Ps(o,t);if(c===void 0)throw new Error(`Expected ${t} to be prefixed by ${o}`);const u=[];for(const f of i){if(f===void 0)continue;const h=Ps(r.path,o),m=Array.isArray(f)?f:[f];for(const g of m){MV(g,c,n,r.elements,h),Vh(g,c,n,r.elements);const y=Hy(g,c,r.elements,h);y!==void 0&&u.push(y)}}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 o=Ps(this.value.path,t);if(o===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);const c=Ps(r.path,this.value.path);for(const u of this.value.values){const f=Hy(u,o,r.elements,c);if(Array.isArray(f))for(let h=f.length-1;h>=0;h--){const m=f[h];Tn(m)||f.splice(h,1)}Rn(f)&&Fy(u,void 0,o,n)}}onEnterSlice(t,n,r){const i=this.value.values,o=[];for(const c of i)if(c!==void 0){const u=Array.isArray(c)?c:[c],f=this.getMatchingSliceValues(u,n,r);o.push(f)}this.valueStack.push({type:"slice",path:t,values:o})}getMatchingSliceValues(t,n,r){const i=[];for(const o of t)(o[Kv]??ZD(o,[n],r.discriminator,this.schema.url))===n.name&&i.push(o);for(let o=i.length;o<n.min;o++)if(ib(n.type[0].code)){const c=Object.create(null);i.push(c),t.push(c)}return i}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 i=n[r];Kv in i&&delete i[Kv]}}getDefaultValue(){return this.rootValue}}function MV(e,t,n,r,i){const o=Hy(e,t,r,i);n.min>0&&o===void 0&&ib(n.type[0].code)&&(n.isArray?Fy(e,[Object.create(null)],t,n):Fy(e,Object.create(null),t,n))}function Fy(e,t,n,r){if(n.includes("."))throw new Error("key cannot be nested");let i=n;if(n.includes("[x]")){const o=r.type[0].code;i=n.replace("[x]",Ln(o))}t===void 0?delete e[i]:e[i]=t}function Hy(e,t,n,r){const i=t.split(".");let o=e,c;for(let u=0;u<i.length;u++){let f=i[u];if(f.includes("[x]")){const h=(r?r+".":"")+i.slice(0,u+1).join("."),g=n[h].type[0].code;f=f.replace("[x]",Ln(g))}if(u===i.length-1){Array.isArray(o)?c=o.map(h=>h[f]):c=o[f];continue}if(Array.isArray(o))o=o.map(h=>h[f]);else if(sr(o)){if(o[f]===void 0)return;o=o[f]}else return}return c}function Vh(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(u=>Vh(u,t,n,r));e==null&&(e=Object.create(null));const i=e,o=t.split(".");let c=i;for(let u=0;u<o.length;u++){let f=o[u];if(f.includes("[x]")){const m=r[o.slice(0,u+1).join(".")].type[0].code;f=f.replace("[x]",Ln(m))}if(u===o.length-1){const h=Array.isArray(c)?c:[c];for(const m of h)n.fixed?m[f]??(m[f]=n.fixed.value):n.pattern&&(m[f]=JD(m[f],n.pattern.value))}else{if(!(f in c)){const h=o.slice(0,u+1).join(".");c[f]=r[h].isArray?[Object.create(null)]:Object.create(null)}c=c[f]}}return i}function JD(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return((e==null?void 0:e.length)??0)>0?e:Wr(t);if(sr(t)&&(sr(e)&&!Array.isArray(e)||e===void 0)){const n=Wr(e)??Object.create(null);for(const r of Object.keys(t))n[r]=JD(n[r],t[r]);return n}return e}const ir={BOOLEAN:"BOOLEAN",NUMBER:"NUMBER",QUANTITY:"QUANTITY",TEXT:"TEXT",REFERENCE:"REFERENCE",CANONICAL:"CANONICAL",DATE:"DATE",DATETIME:"DATETIME"};function tm(e,t){var r,i;let n=(i=(r=la.types[e])==null?void 0:r.searchParamsDetails)==null?void 0:i[t.code];return n||(n=IV(e,t)),n}function LV(e,t,n){let r=la.types[e];r||(r={},la.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function IV(e,t){const n=t.code,r=BV(e,t.expression),i={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const c of r){const u=bh(c),f=dU(()=>u.join("."));u.length===1&&u[0]instanceof Nr?i.propertyTypes.add("boolean"):t.code.endsWith(":identifier")?i.propertyTypes.add("Identifier"):f().endsWith("extension.value.code")||f().endsWith("extension.value.coding.code")?(i.array=!0,i.propertyTypes.clear(),i.propertyTypes.add("code")):eA(i,u,e,1),f().endsWith("extension.valueDateTime")&&(i.array=!1,i.propertyTypes.clear(),i.propertyTypes.add("dateTime"))}const o={type:UV(t,i.propertyTypes),elementDefinitions:i.elementDefinitions.map(c=>{var u;return{...c,type:(u=c.type)==null?void 0:u.filter(f=>i.propertyTypes.has(f.code))}}).filter(c=>c.type&&c.type.length>0),parsedExpression:VV(e,t.expression),array:i.array};return LV(e,n,o),o}function eA(e,t,n,r){const i=t[r];if(i instanceof Uh){e.propertyTypes.add(i.right.toString());return}if(i instanceof ub){$V(e,i);return}const o=i.toString(),c=Ko(n,o);if(!c)throw new Error(`Element definition not found for ${n} ${o}`);let u=!1,f=r+1;f<t.length&&t[f]instanceof db&&(u=!0,f++);const h=t[f];if(c.isArray&&!u&&(e.array=!0),f===t.length-1&&h instanceof Uh){e.elementDefinitions.push(c),e.propertyTypes.add(h.right.toString());return}if(f>=t.length){e.elementDefinitions.push(c);for(const m of c.type)e.propertyTypes.add(m.code);return}for(const m of c.type){let g=m.code;zV(g)&&(g=c.type[0].code),eA(e,t,g,f)}}function $V(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 cb){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function zV(e){return e==="Element"||e==="BackboneElement"}function UV(e,t){switch(e.type){case"date":return t.size===1&&t.has(ie.date)?ir.DATE:ir.DATETIME;case"number":return ir.NUMBER;case"quantity":return ir.QUANTITY;case"reference":return t.has(ie.canonical)?ir.CANONICAL:ir.REFERENCE;case"token":return t.size===1&&t.has(ie.boolean)?ir.BOOLEAN:ir.TEXT;default:return ir.TEXT}}function BV(e,t){const n=[],r=fb(t);return Fh(e,r.child,n),n}function VV(e,t){const n=[],r=fb(t);if(Fh(e,r.child,n),n.length===0)return r;let i=n[0];for(let o=1;o<n.length;o++)i=new lb(i,n[o]);return new $D("<original-not-available>",i)}function Fh(e,t,n){t instanceof lb?(Fh(e,t.left,n),Fh(e,t.right,n)):t.toString().includes(e+".")&&n.push(t)}function bh(e){if(e instanceof Uh||e instanceof db)return[bh(e.left),e].flat();if(e instanceof Nr)return[e];if(e instanceof sb)return[bh(e.left),bh(e.right)].flat();if(e instanceof ub){if(e.name==="where"&&!(e.args[0]instanceof cb))return[];if(e.name==="last")return[]}return[e]}const FV="https://meta.medplum.com/releases",Zv=new Map;function HV(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 qV(e,t,n){let r=Zv.get("latest");if(!r){const i="latest",o=new URL(`${FV}/${i}.json`);o.searchParams.set("a",e),o.searchParams.set("c",YD);const c=await fetch(o.toString());if(c.status!==200){let f;try{f=(await c.json()).message}catch(h){console.error(`Failed to parse message from body: ${Ke(h)}`)}throw new Error(`Received status code ${c.status} while fetching manifest for version 'latest'. Message: ${f}`)}const u=await c.json();HV(u),r=u,Zv.set("latest",r),Zv.set(r.tag_name.slice(1),r)}return r}async function GV(e){const t=await qV(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 tA=v.createContext(void 0);function nm(){return v.useContext(tA)}function Ae(){return nm().medplum}function rm(){return nm().navigate}function im(){return nm().profile}const NE=["change","storageInitialized","storageInitFailed","profileRefreshing","profileRefreshed"];function WV(e){const t=e.medplum,n=e.navigate??QV,[r,i]=v.useState({profile:t.getProfile(),loading:t.isLoading()});v.useEffect(()=>{function c(){i(u=>({...u,profile:t.getProfile(),loading:t.isLoading()}))}for(const u of NE)t.addEventListener(u,c);return()=>{for(const u of NE)t.removeEventListener(u,c)}},[t]);const o=v.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return s.jsx(tA.Provider,{value:o,children:e.children})}function QV(e){window.location.assign(e)}const OE=new Map,nA=e=>v.useMemo(()=>{if(!e)return;const t=e.split("?")[0];if(!t)return e;let n;try{n=new URLSearchParams(new URL(e).search)}catch{return e}if(!n.has("Key-Pair-Id")||!n.has("Signature"))return e;const r=n.get("Expires");if(!r||r.length>13)return e;const i=OE.get(t);if(i){const c=new URLSearchParams(new URL(i).search).get("Expires");if(c&&parseInt(c,10)*1e3-5e3>Date.now())return i}return OE.set(t,e),e},[e]);function Wt(e,t){const n=Ae(),[r,i]=v.useState(()=>ME(n,e)),o=v.useCallback(c=>{sa(c,r)||i(c)},[r]);return v.useEffect(()=>{let c=!0;const u=ME(n,e);return!u&&no(e)?n.readReference(e).then(f=>{c&&o(f)}).catch(f=>{c&&(o(void 0),t&&t(Kt(f)))}):o(u),()=>c=!1},[n,e,o,t]),r}function ME(e,t){if(t){if(ha(t))return t;if(no(t))return e.getCachedReference(t)}}const jt={group:"group",display:"display",boolean:"boolean",decimal:"decimal",integer:"integer",date:"date",dateTime:"dateTime",time:"time",string:"string",text:"text",url:"url",choice:"choice",openChoice:"open-choice",attachment:"attachment",reference:"reference",quantity:"quantity"},vb=`${$i}/fhir/StructureDefinition/questionnaire-itemControl`,YV=`${$i}/fhir/StructureDefinition/questionnaire-referenceFilter`,qy=`${$i}/fhir/StructureDefinition/questionnaire-referenceResource`,XV=`${$i}/fhir/StructureDefinition/questionnaire-validationError`,KV=`${$i}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression`,ZV=`${$i}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression`,JV=`${$i}/fhir/StructureDefinition/questionnaire-signatureRequired`,Sh=`${$i}/fhir/StructureDefinition/questionnaireresponse-signature`;function eF(e){return e.type==="choice"||e.type==="open-choice"}function tF(e,t){const n=nF(e,t);return n!==void 0?n:rF(e,t)}function nF(e,t){var r;const n=fa(e,KV);if(t&&n){const i=(r=n.valueExpression)==null?void 0:r.expression;if(i){const o=Gr(t),c=qo(i,[o],{"%resource":o});return ea(c)}}}function rF(e,t){if(!e.enableWhen)return!0;const n=e.enableBehavior??"any";for(const r of e.enableWhen){const i=aA(t==null?void 0:t.item,r.question);if(r.operator==="exists"&&!r.answerBoolean&&!(i!=null&&i.length)){if(n==="any")return!0;continue}const{anyMatch:o,allMatch:c}=cF(r,i,n);if(n==="any"&&o)return!0;if(n==="all"&&!c)return!1}return n!=="any"}function rA(e,t,n=t.item){for(const r of e){const i=n==null?void 0:n.find(o=>o.linkId===r.linkId);i&&(iF(t,r,i),r.item&&i.item&&rA(r.item,t,i.item))}}function iF(e,t,n){try{const r=sF(t,e);if(!r)return;const i=oF(t,r);if(!i)return;n.answer=[i]}catch(r){n.extension=[{url:XV,valueString:`Expression evaluation failed: ${Ke(r)}`}]}}const aF={[jt.boolean]:[ie.boolean],[jt.date]:[ie.date],[jt.dateTime]:[ie.dateTime],[jt.time]:[ie.time],[jt.url]:[ie.string,ie.uri,ie.url],[jt.attachment]:[ie.Attachment],[jt.reference]:[ie.Reference],[jt.quantity]:[ie.Quantity],[jt.decimal]:[ie.decimal,ie.integer],[jt.integer]:[ie.decimal,ie.integer]};function oF(e,t){if(!e.type)return;if(e.type===jt.choice||e.type===jt.openChoice)return{[`value${Ln(t.type)}`]:t.value};if(e.type===jt.string||e.type===jt.text)return typeof t.value=="string"?{valueString:t.value}:void 0;const n=aF[e.type];if(n!=null&&n.includes(t.type))return{[`value${Ln(e.type)}`]:t.value}}function sF(e,t){var r;if(!t)return;const n=fa(e,ZV);if(n){const i=(r=n.valueExpression)==null?void 0:r.expression;if(i){const o=Gr(t),c=qo(i,[o],{"%resource":o});return c.length!==0?c[0]:void 0}}}function iA(e,t,n){var i;const r=[];for(const o of e){const c=(i=n.answerOption)==null?void 0:i.find(u=>Fs(ca(u))===o);if(c){const u=ca(c);u&&r.push({[t]:u.value})}}return r}function aA(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=aA(n.item,t);if(r)return r}}}function lF(e,t,n){if(n==="exists")return!!e===t.value;if(e){const r=n==="="||n==="!="?n==null?void 0:n.replace("=","~"):n,[{value:i}]=qo(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return i}else return!1}function cF(e,t,n){const r=t||[],i=fF(e);let o=!1,c=!0;for(const u of r){const f=hF(u),{operator:h}=e;if(lF(f,i,h)?o=!0:c=!1,n==="any"&&o)break}return{anyMatch:o,allMatch:c}}function oA(e){var n,r;const t=fa(e,qy);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(i=>i.code)}}function Jv(e,t){var i;const n=Wr(e);let r=fa(n,qy);return!t||t.length===0?(r&&(n.extension=(i=n.extension)==null?void 0:i.filter(o=>o!==r)),n):(r||(n.extension??(n.extension=[]),r={url:qy},n.extension.push(r)),t.length===1?(r.valueCode=t[0],delete r.valueCodeableConcept):(r.valueCodeableConcept={coding:t.map(o=>({code:o}))},delete r.valueCode),n)}function uF(e,t,n){const r=fa(e,YV);if(!(r!=null&&r.valueString))return;let i=r.valueString;t!=null&&t.reference&&(i=i.replaceAll("$subj",t.reference)),n!=null&&n.reference&&(i=i.replaceAll("$encounter",n.reference));const o={},c=i.split("&");for(const u of c){const[f,h]=Uy(u,"=",2);o[f]=h}return o}function LE(e,t){return{resourceType:"QuestionnaireResponse",questionnaire:e.url??Mt(e),item:yb(e.item,t==null?void 0:t.item),status:"in-progress"}}function yb(e,t){if(!e)return;const n=[];for(const r of e){if(r.type===jt.display)continue;const i=t==null?void 0:t.filter(o=>o.linkId===r.linkId);if(i&&(i==null?void 0:i.length)>0)for(const o of i)o.id=o.id??lA(),o.text=o.text??r.text,o.item=yb(r.item,o.item),o.answer=cA(r,o),n.push(o);else n.push(sA(r))}return n}function sA(e){return{id:lA(),linkId:e.linkId,text:e.text,item:yb(e.item,void 0),answer:cA(e)}}let dF=1;function lA(){return"id-"+dF++}function cA(e,t){if(!(e.type===jt.display||e.type===jt.group)){if(t!=null&&t.answer&&t.answer.length>0)return t.answer;if(e.initial&&e.initial.length>0)return e.initial.map(n=>({...n}));if(e.answerOption)return e.answerOption.filter(n=>n.initialSelected).map(n=>({...n,initialSelected:void 0}))}}function xb(e){return Ed({value:e},"value")}function ca(e){return Ed({value:e},"value")}function fF(e){return Ed({value:e},"answer")}function hF(e){return Ed({value:e},"value")}function pF(e){const t=Wt(e.questionnaire),n=Wt(e.defaultValue),[,r]=v.useReducer(S=>S+1,0),i=v.useRef({activePage:0});if(!i.current.questionnaire&&t&&(i.current.questionnaire=t,i.current.pages=e.disablePagination?void 0:mF(t)),t&&e.defaultValue&&n&&!i.current.questionnaireResponse&&(i.current.questionnaireResponse=LE(t,n),b()),t&&!e.defaultValue&&!i.current.questionnaireResponse&&(i.current.questionnaireResponse=LE(t),b()),!i.current.questionnaire||!i.current.questionnaireResponse)return{loading:!0};function o(S,j){var T,_;let C=i.current.questionnaireResponse;for(const E of S)C=(T=C==null?void 0:C.item)==null?void 0:T.find(R=>R.linkId===E.linkId);return j&&(C=(_=C==null?void 0:C.item)==null?void 0:_.find(E=>E.linkId===j.linkId)),C}function c(){i.current.activePage=(i.current.activePage??0)+1,r()}function u(){i.current.activePage=(i.current.activePage??0)-1,r()}function f(S,j){const C=o(S);C&&(C.item??(C.item=[]),C.item.push(sA(j)),b())}function h(S,j){const C=o(S,j);C&&(C.answer??(C.answer=[]),C.answer.push({}),b())}function m(S,j,C){const T=o(S,j);T&&(T.answer=C,b())}function g(S){var C;const j=i.current.questionnaireResponse;j&&(S?(j.extension=j.extension??[],j.extension=j.extension.filter(T=>T.url!==Sh),j.extension.push({url:Sh,valueSignature:S})):j.extension=(C=j.extension)==null?void 0:C.filter(T=>T.url!==Sh),b())}function y(){const S=i.current.questionnaire;if(S!=null&&S.item){const j=i.current.questionnaireResponse;rA(S.item,j)}}function b(){var j;const S=i.current.questionnaireResponse;S&&(y(),r(),(j=e.onChange)==null||j.call(e,S))}return{loading:!1,pagination:!!i.current.pages,questionnaire:i.current.questionnaire,questionnaireResponse:i.current.questionnaireResponse,subject:e.subject,encounter:e.encounter,activePage:i.current.activePage,pages:i.current.pages,items:gF(i.current.questionnaire,i.current.pages,i.current.activePage),responseItems:vF(i.current.questionnaireResponse,i.current.pages,i.current.activePage),onNextPage:c,onPrevPage:u,onAddGroup:f,onAddAnswer:h,onChangeAnswer:m,onChangeSignature:g}}function mF(e){var n,r,i,o;if(!(e!=null&&e.item))return;const t=fa((n=e==null?void 0:e.item)==null?void 0:n[0],vb);if(((o=(i=(r=t==null?void 0:t.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:i[0])==null?void 0:o.code)==="page")return e.item.map((c,u)=>({linkId:c.linkId,title:c.text??`Page ${u+1}`,group:c}))}function gF(e,t,n=0){var r;return t&&((r=e==null?void 0:e.item)!=null&&r[n])?[e.item[n]]:e.item??[]}function vF(e,t,n=0){var r;return t&&((r=e==null?void 0:e.item)!=null&&r[n])?[e.item[n]]:e.item??[]}function yF(e,t,n={leading:!1}){const[r,i]=v.useState(e),o=v.useRef(!1),c=v.useRef(void 0),u=v.useRef(!1),f=v.useCallback(()=>window.clearTimeout(c.current),[]);return v.useEffect(()=>{o.current&&(!u.current&&n.leading?(u.current=!0,i(e)):(f(),c.current=setTimeout(()=>{u.current=!1,i(e)},t)))},[e,n.leading,t,f]),v.useEffect(()=>(o.current=!0,f),[f]),[r,f]}const xF=250;function bF(e,t,n){return uA("searchOne",e,t)}function Sc(e,t,n){return uA("searchResources",e,t)}function uA(e,t,n,r){const i=Ae(),[o,c]=v.useState(),[u,f]=v.useState(!0),[h,m]=v.useState(),[g,y]=v.useState(),b=i.fhirSearchUrl(t,n).toString(),[S]=yF(b,xF,{leading:!0});return v.useEffect(()=>{S!==o&&(c(S),i[e](t,n).then(j=>{f(!1),m(j),y(bz)}).catch(j=>{f(!1),m(void 0),y(Kt(j))}))},[i,e,t,n,o,S]),[h,u,g]}function SF(e){const t=e.value;return t?s.jsx(s.Fragment,{children:ND(t)}):null}const dA=["meta","implicitRules","contained","extension","modifierExtension"],fA=["language","text"],ln=v.createContext({path:"",profileUrl:void 0,elements:Object.create(null),elementsByPath:Object.create(null),getExtendedProps:()=>({readonly:!1,hidden:!1}),accessPolicyResource:void 0,debugMode:!1,isDefaultContext:!0});ln.displayName="ElementsContext";const bb=["extension","modifierExtension"],wF=["id",...dA].filter(e=>!bb.includes(e));function jF(e){return Object.entries(e).filter(([n,r])=>{var i;return!Tn(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||bb.includes(n)&&!Tn((i=r.slicing)==null?void 0:i.slices)||wF.includes(n)?!1:!(fA.includes(n)&&r.path.split(".").length===2||n.includes("."))})}function IE(e,t){return e.line&&e.line.length>t?e.line[t]:""}function $E(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:r}}function CF(e){const[t,n]=v.useState(e.defaultValue||{}),r=v.useRef(t);r.current=t;const{getExtendedProps:i}=v.useContext(ln),[o,c,u,f,h,m,g]=v.useMemo(()=>["use","type","line1","line2","city","state","postalCode"].map(R=>i(e.path+"."+R)),[i,e.path]);function y(R){n(R),e.onChange&&e.onChange(R)}function b(R){y({...r.current,use:R})}function S(R){y({...r.current,type:R})}function j(R){y($E(r.current||{},0,R))}function C(R){y($E(r.current||{},1,R))}function T(R){y({...r.current,city:R})}function _(R){y({...r.current,state:R})}function E(R){y({...r.current,postalCode:R})}return s.jsxs(je,{gap:"xs",wrap:"nowrap",grow:!0,children:[s.jsx(sn,{disabled:e.disabled||(o==null?void 0:o.readonly),"data-testid":"address-use",defaultValue:t.use,onChange:R=>b(R.currentTarget.value),data:["","home","work","temp","old","billing"]}),s.jsx(sn,{disabled:e.disabled||(c==null?void 0:c.readonly),"data-testid":"address-type",defaultValue:t.type,onChange:R=>S(R.currentTarget.value),data:["","postal","physical","both"]}),s.jsx($e,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"Line 1",defaultValue:IE(t,0),onChange:R=>j(R.currentTarget.value)}),s.jsx($e,{disabled:e.disabled||(f==null?void 0:f.readonly),placeholder:"Line 2",defaultValue:IE(t,1),onChange:R=>C(R.currentTarget.value)}),s.jsx($e,{disabled:e.disabled||(h==null?void 0:h.readonly),placeholder:"City",defaultValue:t.city,onChange:R=>T(R.currentTarget.value)}),s.jsx($e,{disabled:e.disabled||(m==null?void 0:m.readonly),placeholder:"State",defaultValue:t.state,onChange:R=>_(R.currentTarget.value)}),s.jsx($e,{disabled:e.disabled||(g==null?void 0:g.readonly),placeholder:"Postal Code",defaultValue:t.postalCode,onChange:R=>E(R.currentTarget.value)})]})}function EF(e){const t=im(),[n,r]=v.useState(e.defaultValue||{});function i(o){const c=o?{text:o,authorReference:t&&tn(t),time:new Date().toISOString()}:{};r(c),e.onChange&&e.onChange(c)}return s.jsx($e,{disabled:e.disabled,name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:o=>i(o.currentTarget.value)})}/**
127
+ * @license @tabler/icons-react v3.34.1 - MIT
128
+ *
129
+ * This source code is licensed under the MIT license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */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"}};/**
132
+ * @license @tabler/icons-react v3.34.1 - MIT
133
+ *
134
+ * This source code is licensed under the MIT license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const Be=(e,t,n,r)=>{const i=v.forwardRef(({color:o="currentColor",size:c=24,stroke:u=2,title:f,className:h,children:m,...g},y)=>v.createElement("svg",{ref:y,...TF[e],width:c,height:c,className:["tabler-icon",`tabler-icon-${t}`,h].join(" "),...e==="filled"?{fill:o}:{strokeWidth:u,stroke:o},...g},[f&&v.createElement("title",{key:"svg-title"},f),...r.map(([b,S])=>v.createElement(b,S)),...Array.isArray(m)?m:[m]]));return i.displayName=`${n}`,i};/**
137
+ * @license @tabler/icons-react v3.34.1 - MIT
138
+ *
139
+ * This source code is licensed under the MIT license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const RF=[["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"}]],_F=Be("outline","adjustments-horizontal","AdjustmentsHorizontal",RF);/**
142
+ * @license @tabler/icons-react v3.34.1 - MIT
143
+ *
144
+ * This source code is licensed under the MIT license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const DF=[["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"}]],al=Be("outline","alert-circle","AlertCircle",DF);/**
147
+ * @license @tabler/icons-react v3.34.1 - 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 AF=[["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"}]],kF=Be("outline","arrow-down","ArrowDown",AF);/**
152
+ * @license @tabler/icons-react v3.34.1 - MIT
153
+ *
154
+ * This source code is licensed under the MIT license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const PF=[["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"}]],NF=Be("outline","arrow-up","ArrowUp",PF);/**
157
+ * @license @tabler/icons-react v3.34.1 - MIT
158
+ *
159
+ * This source code is licensed under the MIT license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const OF=[["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"}]],MF=Be("outline","bleach-off","BleachOff",OF);/**
162
+ * @license @tabler/icons-react v3.34.1 - MIT
163
+ *
164
+ * This source code is licensed under the MIT license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const LF=[["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"}]],IF=Be("outline","bleach","Bleach",LF);/**
167
+ * @license @tabler/icons-react v3.34.1 - MIT
168
+ *
169
+ * This source code is licensed under the MIT license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const $F=[["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"}]],zF=Be("outline","box-multiple","BoxMultiple",$F);/**
172
+ * @license @tabler/icons-react v3.34.1 - MIT
173
+ *
174
+ * This source code is licensed under the MIT license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const UF=[["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"}]],BF=Be("outline","brackets-contain","BracketsContain",UF);/**
177
+ * @license @tabler/icons-react v3.34.1 - MIT
178
+ *
179
+ * This source code is licensed under the MIT license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const VF=[["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"}]],FF=Be("outline","brand-asana","BrandAsana",VF);/**
182
+ * @license @tabler/icons-react v3.34.1 - MIT
183
+ *
184
+ * This source code is licensed under the MIT license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ */const HF=[["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"}]],qF=Be("outline","bucket-off","BucketOff",HF);/**
187
+ * @license @tabler/icons-react v3.34.1 - MIT
188
+ *
189
+ * This source code is licensed under the MIT license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */const GF=[["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"}]],WF=Be("outline","bucket","Bucket",GF);/**
192
+ * @license @tabler/icons-react v3.34.1 - MIT
193
+ *
194
+ * This source code is licensed under the MIT license.
195
+ * See the LICENSE file in the root directory of this source tree.
196
+ */const QF=[["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"}]],YF=Be("outline","building","Building",QF);/**
197
+ * @license @tabler/icons-react v3.34.1 - MIT
198
+ *
199
+ * This source code is licensed under the MIT license.
200
+ * See the LICENSE file in the root directory of this source tree.
201
+ */const XF=[["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"}]],No=Be("outline","calendar","Calendar",XF);/**
202
+ * @license @tabler/icons-react v3.34.1 - MIT
203
+ *
204
+ * This source code is licensed under the MIT license.
205
+ * See the LICENSE file in the root directory of this source tree.
206
+ */const KF=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],ro=Be("outline","check","Check",KF);/**
207
+ * @license @tabler/icons-react v3.34.1 - MIT
208
+ *
209
+ * This source code is licensed under the MIT license.
210
+ * See the LICENSE file in the root directory of this source tree.
211
+ */const ZF=[["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"}]],JF=Be("outline","checkbox","Checkbox",ZF);/**
212
+ * @license @tabler/icons-react v3.34.1 - MIT
213
+ *
214
+ * This source code is licensed under the MIT license.
215
+ * See the LICENSE file in the root directory of this source tree.
216
+ */const eH=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],Sb=Be("outline","chevron-down","ChevronDown",eH);/**
217
+ * @license @tabler/icons-react v3.34.1 - MIT
218
+ *
219
+ * This source code is licensed under the MIT license.
220
+ * See the LICENSE file in the root directory of this source tree.
221
+ */const tH=[["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"}]],nH=Be("outline","circle-check","CircleCheck",tH);/**
222
+ * @license @tabler/icons-react v3.34.1 - MIT
223
+ *
224
+ * This source code is licensed under the MIT license.
225
+ * See the LICENSE file in the root directory of this source tree.
226
+ */const rH=[["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"}]],Hh=Be("outline","circle-minus","CircleMinus",rH);/**
227
+ * @license @tabler/icons-react v3.34.1 - MIT
228
+ *
229
+ * This source code is licensed under the MIT license.
230
+ * See the LICENSE file in the root directory of this source tree.
231
+ */const iH=[["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"}]],qh=Be("outline","circle-plus","CirclePlus",iH);/**
232
+ * @license @tabler/icons-react v3.34.1 - MIT
233
+ *
234
+ * This source code is licensed under the MIT license.
235
+ * See the LICENSE file in the root directory of this source tree.
236
+ */const aH=[["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"}]],wb=Be("outline","cloud-upload","CloudUpload",aH);/**
237
+ * @license @tabler/icons-react v3.34.1 - MIT
238
+ *
239
+ * This source code is licensed under the MIT license.
240
+ * See the LICENSE file in the root directory of this source tree.
241
+ */const oH=[["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"}]],sH=Be("outline","columns","Columns",oH);/**
242
+ * @license @tabler/icons-react v3.34.1 - MIT
243
+ *
244
+ * This source code is licensed under the MIT license.
245
+ * See the LICENSE file in the root directory of this source tree.
246
+ */const lH=[["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"}]],hA=Be("outline","copy","Copy",lH);/**
247
+ * @license @tabler/icons-react v3.34.1 - MIT
248
+ *
249
+ * This source code is licensed under the MIT license.
250
+ * See the LICENSE file in the root directory of this source tree.
251
+ */const cH=[["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"}]],uH=Be("outline","currency-dollar","CurrencyDollar",cH);/**
252
+ * @license @tabler/icons-react v3.34.1 - MIT
253
+ *
254
+ * This source code is licensed under the MIT license.
255
+ * See the LICENSE file in the root directory of this source tree.
256
+ */const dH=[["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"}]],fH=Be("outline","device-floppy","DeviceFloppy",dH);/**
257
+ * @license @tabler/icons-react v3.34.1 - MIT
258
+ *
259
+ * This source code is licensed under the MIT license.
260
+ * See the LICENSE file in the root directory of this source tree.
261
+ */const hH=[["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"}]],pH=Be("outline","dots","Dots",hH);/**
262
+ * @license @tabler/icons-react v3.34.1 - MIT
263
+ *
264
+ * This source code is licensed under the MIT license.
265
+ * See the LICENSE file in the root directory of this source tree.
266
+ */const mH=[["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"}]],pA=Be("outline","edit","Edit",mH);/**
267
+ * @license @tabler/icons-react v3.34.1 - MIT
268
+ *
269
+ * This source code is licensed under the MIT license.
270
+ * See the LICENSE file in the root directory of this source tree.
271
+ */const gH=[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}],["path",{d:"M5 19l14 -14",key:"svg-2"}]],Rd=Be("outline","equal-not","EqualNot",gH);/**
272
+ * @license @tabler/icons-react v3.34.1 - MIT
273
+ *
274
+ * This source code is licensed under the MIT license.
275
+ * See the LICENSE file in the root directory of this source tree.
276
+ */const vH=[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]],_d=Be("outline","equal","Equal",vH);/**
277
+ * @license @tabler/icons-react v3.34.1 - MIT
278
+ *
279
+ * This source code is licensed under the MIT license.
280
+ * See the LICENSE file in the root directory of this source tree.
281
+ */const yH=[["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"}]],zE=Be("outline","file-alert","FileAlert",yH);/**
282
+ * @license @tabler/icons-react v3.34.1 - MIT
283
+ *
284
+ * This source code is licensed under the MIT license.
285
+ * See the LICENSE file in the root directory of this source tree.
286
+ */const xH=[["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"}]],bH=Be("outline","file-plus","FilePlus",xH);/**
287
+ * @license @tabler/icons-react v3.34.1 - MIT
288
+ *
289
+ * This source code is licensed under the MIT license.
290
+ * See the LICENSE file in the root directory of this source tree.
291
+ */const SH=[["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"}]],wH=Be("outline","filter","Filter",SH);/**
292
+ * @license @tabler/icons-react v3.34.1 - MIT
293
+ *
294
+ * This source code is licensed under the MIT license.
295
+ * See the LICENSE file in the root directory of this source tree.
296
+ */const jH=[["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"}]],CH=Be("outline","forms","Forms",jH);/**
297
+ * @license @tabler/icons-react v3.34.1 - MIT
298
+ *
299
+ * This source code is licensed under the MIT license.
300
+ * See the LICENSE file in the root directory of this source tree.
301
+ */const EH=[["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"}]],TH=Be("outline","id","Id",EH);/**
302
+ * @license @tabler/icons-react v3.34.1 - MIT
303
+ *
304
+ * This source code is licensed under the MIT license.
305
+ * See the LICENSE file in the root directory of this source tree.
306
+ */const RH=[["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"}]],UE=Be("outline","list-details","ListDetails",RH);/**
307
+ * @license @tabler/icons-react v3.34.1 - MIT
308
+ *
309
+ * This source code is licensed under the MIT license.
310
+ * See the LICENSE file in the root directory of this source tree.
311
+ */const _H=[["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"}]],DH=Be("outline","lock-access","LockAccess",_H);/**
312
+ * @license @tabler/icons-react v3.34.1 - MIT
313
+ *
314
+ * This source code is licensed under the MIT license.
315
+ * See the LICENSE file in the root directory of this source tree.
316
+ */const AH=[["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"}]],kH=Be("outline","lock","Lock",AH);/**
317
+ * @license @tabler/icons-react v3.34.1 - MIT
318
+ *
319
+ * This source code is licensed under the MIT license.
320
+ * See the LICENSE file in the root directory of this source tree.
321
+ */const PH=[["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"}]],NH=Be("outline","logout","Logout",PH);/**
322
+ * @license @tabler/icons-react v3.34.1 - MIT
323
+ *
324
+ * This source code is licensed under the MIT license.
325
+ * See the LICENSE file in the root directory of this source tree.
326
+ */const OH=[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]],mA=Be("outline","math-greater","MathGreater",OH);/**
327
+ * @license @tabler/icons-react v3.34.1 - MIT
328
+ *
329
+ * This source code is licensed under the MIT license.
330
+ * See the LICENSE file in the root directory of this source tree.
331
+ */const MH=[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]],gA=Be("outline","math-lower","MathLower",MH);/**
332
+ * @license @tabler/icons-react v3.34.1 - MIT
333
+ *
334
+ * This source code is licensed under the MIT license.
335
+ * See the LICENSE file in the root directory of this source tree.
336
+ */const LH=[["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"}]],IH=Be("outline","message","Message",LH);/**
337
+ * @license @tabler/icons-react v3.34.1 - MIT
338
+ *
339
+ * This source code is licensed under the MIT license.
340
+ * See the LICENSE file in the root directory of this source tree.
341
+ */const $H=[["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"}]],zH=Be("outline","microscope","Microscope",$H);/**
342
+ * @license @tabler/icons-react v3.34.1 - MIT
343
+ *
344
+ * This source code is licensed under the MIT license.
345
+ * See the LICENSE file in the root directory of this source tree.
346
+ */const UH=[["path",{d:"M5 12l14 0",key:"svg-0"}]],BH=Be("outline","minus","Minus",UH);/**
347
+ * @license @tabler/icons-react v3.34.1 - MIT
348
+ *
349
+ * This source code is licensed under the MIT license.
350
+ * See the LICENSE file in the root directory of this source tree.
351
+ */const VH=[["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"}]],FH=Be("outline","packages","Packages",VH);/**
352
+ * @license @tabler/icons-react v3.34.1 - MIT
353
+ *
354
+ * This source code is licensed under the MIT license.
355
+ * See the LICENSE file in the root directory of this source tree.
356
+ */const HH=[["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"}]],qH=Be("outline","pin","Pin",HH);/**
357
+ * @license @tabler/icons-react v3.34.1 - MIT
358
+ *
359
+ * This source code is licensed under the MIT license.
360
+ * See the LICENSE file in the root directory of this source tree.
361
+ */const GH=[["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"}]],WH=Be("outline","pinned-off","PinnedOff",GH);/**
362
+ * @license @tabler/icons-react v3.34.1 - MIT
363
+ *
364
+ * This source code is licensed under the MIT license.
365
+ * See the LICENSE file in the root directory of this source tree.
366
+ */const QH=[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]],YH=Be("outline","player-play","PlayerPlay",QH);/**
367
+ * @license @tabler/icons-react v3.34.1 - MIT
368
+ *
369
+ * This source code is licensed under the MIT license.
370
+ * See the LICENSE file in the root directory of this source tree.
371
+ */const XH=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],vA=Be("outline","plus","Plus",XH);/**
372
+ * @license @tabler/icons-react v3.34.1 - MIT
373
+ *
374
+ * This source code is licensed under the MIT license.
375
+ * See the LICENSE file in the root directory of this source tree.
376
+ */const KH=[["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"}]],ZH=Be("outline","receipt","Receipt",KH);/**
377
+ * @license @tabler/icons-react v3.34.1 - MIT
378
+ *
379
+ * This source code is licensed under the MIT license.
380
+ * See the LICENSE file in the root directory of this source tree.
381
+ */const JH=[["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"}]],yA=Be("outline","refresh","Refresh",JH);/**
382
+ * @license @tabler/icons-react v3.34.1 - MIT
383
+ *
384
+ * This source code is licensed under the MIT license.
385
+ * See the LICENSE file in the root directory of this source tree.
386
+ */const eq=[["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"}]],tq=Be("outline","repeat","Repeat",eq);/**
387
+ * @license @tabler/icons-react v3.34.1 - MIT
388
+ *
389
+ * This source code is licensed under the MIT license.
390
+ * See the LICENSE file in the root directory of this source tree.
391
+ */const nq=[["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"}]],rq=Be("outline","report-medical","ReportMedical",nq);/**
392
+ * @license @tabler/icons-react v3.34.1 - MIT
393
+ *
394
+ * This source code is licensed under the MIT license.
395
+ * See the LICENSE file in the root directory of this source tree.
396
+ */const iq=[["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"}]],aq=Be("outline","router","Router",iq);/**
397
+ * @license @tabler/icons-react v3.34.1 - MIT
398
+ *
399
+ * This source code is licensed under the MIT license.
400
+ * See the LICENSE file in the root directory of this source tree.
401
+ */const oq=[["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"}]],sq=Be("outline","search","Search",oq);/**
402
+ * @license @tabler/icons-react v3.34.1 - MIT
403
+ *
404
+ * This source code is licensed under the MIT license.
405
+ * See the LICENSE file in the root directory of this source tree.
406
+ */const lq=[["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"}]],Gy=Be("outline","settings","Settings",lq);/**
407
+ * @license @tabler/icons-react v3.34.1 - MIT
408
+ *
409
+ * This source code is licensed under the MIT license.
410
+ * See the LICENSE file in the root directory of this source tree.
411
+ */const cq=[["path",{d:"M4 6l7 0",key:"svg-0"}],["path",{d:"M4 12l7 0",key:"svg-1"}],["path",{d:"M4 18l9 0",key:"svg-2"}],["path",{d:"M15 9l3 -3l3 3",key:"svg-3"}],["path",{d:"M18 6l0 12",key:"svg-4"}]],jb=Be("outline","sort-ascending","SortAscending",cq);/**
412
+ * @license @tabler/icons-react v3.34.1 - MIT
413
+ *
414
+ * This source code is licensed under the MIT license.
415
+ * See the LICENSE file in the root directory of this source tree.
416
+ */const uq=[["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"}]],Cb=Be("outline","sort-descending","SortDescending",uq);/**
417
+ * @license @tabler/icons-react v3.34.1 - MIT
418
+ *
419
+ * This source code is licensed under the MIT license.
420
+ * See the LICENSE file in the root directory of this source tree.
421
+ */const dq=[["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"}]],fq=Be("outline","square","Square",dq);/**
422
+ * @license @tabler/icons-react v3.34.1 - MIT
423
+ *
424
+ * This source code is licensed under the MIT license.
425
+ * See the LICENSE file in the root directory of this source tree.
426
+ */const hq=[["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"}]],pq=Be("outline","star","Star",hq);/**
427
+ * @license @tabler/icons-react v3.34.1 - MIT
428
+ *
429
+ * This source code is licensed under the MIT license.
430
+ * See the LICENSE file in the root directory of this source tree.
431
+ */const mq=[["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"}]],gq=Be("outline","switch-horizontal","SwitchHorizontal",mq);/**
432
+ * @license @tabler/icons-react v3.34.1 - MIT
433
+ *
434
+ * This source code is licensed under the MIT license.
435
+ * See the LICENSE file in the root directory of this source tree.
436
+ */const vq=[["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"}]],yq=Be("outline","table-export","TableExport",vq);/**
437
+ * @license @tabler/icons-react v3.34.1 - MIT
438
+ *
439
+ * This source code is licensed under the MIT license.
440
+ * See the LICENSE file in the root directory of this source tree.
441
+ */const xq=[["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"}]],bq=Be("outline","text-recognition","TextRecognition",xq);/**
442
+ * @license @tabler/icons-react v3.34.1 - MIT
443
+ *
444
+ * This source code is licensed under the MIT license.
445
+ * See the LICENSE file in the root directory of this source tree.
446
+ */const Sq=[["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"}]],am=Be("outline","trash","Trash",Sq);/**
447
+ * @license @tabler/icons-react v3.34.1 - MIT
448
+ *
449
+ * This source code is licensed under the MIT license.
450
+ * See the LICENSE file in the root directory of this source tree.
451
+ */const wq=[["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"}]],BE=Be("outline","upload","Upload",wq);/**
452
+ * @license @tabler/icons-react v3.34.1 - MIT
453
+ *
454
+ * This source code is licensed under the MIT license.
455
+ * See the LICENSE file in the root directory of this source tree.
456
+ */const jq=[["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"}]],Cq=Be("outline","webhook","Webhook",jq);/**
457
+ * @license @tabler/icons-react v3.34.1 - MIT
458
+ *
459
+ * This source code is licensed under the MIT license.
460
+ * See the LICENSE file in the root directory of this source tree.
461
+ */const Eq=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],Gs=Be("outline","x","X",Eq);/**
462
+ * @license @tabler/icons-react v3.34.1 - MIT
463
+ *
464
+ * This source code is licensed under the MIT license.
465
+ * See the LICENSE file in the root directory of this source tree.
466
+ */const Tq=[["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"}]],Rq=Be("filled","circle-filled","CircleFilled",Tq);class xA extends v.Component{constructor(t){super(t),this.state={lastLocation:window.location.toString()}}static getDerivedStateFromError(t){return{error:t,lastLocation:window.location.toString()}}componentDidUpdate(t,n){window.location.toString()!==this.state.lastLocation&&this.setState({lastLocation:window.location.toString(),error:void 0})}shouldComponentUpdate(t,n){return!!(this.props.children!==t.children||n.error&&!this.state.error||this.state.lastLocation!==window.location.toString())}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.error?s.jsx(Za,{icon:s.jsx(al,{size:16}),title:"Something went wrong",color:"red",children:Ke(this.state.error)}):this.props.children}}function gi(){return s.jsx(er,{style:{width:"100%",height:"100vh"},children:s.jsx(Ar,{})})}const _q="_main_6f7o5_1",Dq={main:_q};function hn(e){e.preventDefault(),e.stopPropagation()}function bA(e){return e.button===1||e.ctrlKey||e.metaKey}function SA(e){if(VE(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&VE(t[0]))return!0}return!1}function VE(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}async function qu(e,t){return new Promise((n,r)=>{var o;const i=new MessageChannel;i.port1.onmessage=({data:c})=>{i.port1.close(),c.error?r(c.error):n(c.result)},(o=e.contentWindow)==null||o.postMessage(t,new URL(e.src).origin,[i.port2])})}function wA(e,t){const n=new Blob([e],{type:fn.JSON}),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r;const o=t??new Date().toISOString().replace(/\D/g,"");i.download=`${o}.json`,document.body.appendChild(i),i.click(),URL.revokeObjectURL(r)}function gt(e){const t=rm(),{to:n,suffix:r,label:i,onClick:o,children:c,...u}=e;let f=Aq(n);return r&&(f+="/"+r),s.jsx(Pt,{href:f,"aria-label":i,onAuxClick:h=>{h.stopPropagation()},onClick:h=>{h.stopPropagation(),o?(h.preventDefault(),o(h)):n&&(bA(h)||(h.preventDefault(),t(f)))},...u,children:c})}function Aq(e){if(e){if(typeof e=="string")return kq(e);if(ha(e))return Pq(e);if(no(e))return Nq(e)}return"#"}function kq(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function Pq(e){return`/${e.resourceType}/${e.id}`}function Nq(e){return`/${e.reference}`}function Oq(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 Zo(e){const t=Wt(e.value),n=t?qa(t):e.alt??"",r=Oq(n),i=(t&&K8(t))??e.src,o=nA(i??void 0),c=e.radius??"xl",u={...e,value:void 0,link:void 0};return e.link?s.jsx(gt,{to:t,children:s.jsx(zs,{src:o,alt:n,radius:c,...u,children:r})}):s.jsx(zs,{src:o,alt:n,radius:c,...u,children:r})}const Mq="_logoButton_189g3_1",Lq="_user_189g3_11",Iq="_userName_189g3_21",$q="_userActive_189g3_31",oh={logoButton:Mq,user:Lq,userName:Iq,userActive:$q};function Eb(e){const t=e.value;return t?s.jsx(s.Fragment,{children:Mc(t,e.options)}):null}function zq(e){var f,h,m;const t=nm(),{medplum:n,profile:r,navigate:i}=t,o=n.getLogins(),{colorScheme:c,setColorScheme:u}=EO();return s.jsxs(s.Fragment,{children:[s.jsxs(qe,{align:"center",p:"xl",children:[s.jsx(Zo,{size:"xl",radius:100,value:t.profile}),s.jsx(Eb,{value:(h=(f=t.profile)==null?void 0:f.name)==null?void 0:h[0]}),s.jsx(_e,{c:"dimmed",size:"xs",children:(m=n.getActiveLogin())==null?void 0:m.project.display})]}),o.length>1&&s.jsx(Ce.Divider,{}),o.map(g=>g.profile.reference!==Mt(t.profile)&&s.jsx(Ce.Item,{onClick:()=>{n.setActiveLogin(g).then(()=>window.location.reload()).catch(console.log)},children:s.jsxs(je,{children:[s.jsx(zs,{radius:"xl"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(_e,{size:"sm",fw:500,children:g.profile.display}),s.jsx(_e,{c:"dimmed",size:"xs",children:g.project.display})]})]})},g.profile.reference)),s.jsx(Ce.Divider,{}),s.jsx(je,{justify:"center",children:s.jsx(qp,{size:"xs",value:c,onChange:g=>u(g),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(gq,{size:14,stroke:1.5}),onClick:()=>i("/signin"),children:"Add another account"}),s.jsx(Ce.Item,{leftSection:s.jsx(Gy,{size:14,stroke:1.5}),onClick:()=>i(`/${Mt(r)}`),children:"Account settings"}),s.jsx(Ce.Item,{leftSection:s.jsx(NH,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),i("/signin")},children:"Sign out"}),s.jsx(_e,{size:"xs",c:"dimmed",ta:"center",children:e.version})]})}const FE={selectedItems:"selected-items",options:"options"};function Tb(e){const t=gd({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:i,error:o,defaultValue:c,toOption:u,loadOptions:f,itemComponent:h,pillComponent:m,emptyComponent:g,onChange:y,onCreate:b,creatable:S,clearable:j,required:C,placeholder:T,leftSection:_,maxValues:E,optionsDropdownMaxHeight:R=320,minInputLength:D=0,...k}=e,M=k.disabled,L=Uq(c),[z,F]=v.useState(""),[Y,W]=v.useState(),[J,G]=v.useState(),[X,P]=v.useState(),[I,$]=v.useState(L.map(u)),[H,O]=v.useState([]),U=h??Bq,K=m??Vq,ee=g??Fq,Se=v.useRef(z);Se.current=z;const be=v.useRef(void 0),xe=v.useRef(void 0),Ge=v.useRef(Y);Ge.current=Y;const Me=v.useRef(J);Me.current=J;const nt=v.useRef(X);nt.current=X;const ke=v.useRef(H);ke.current=H;const yt=v.useCallback(()=>{var me;if(W(void 0),Se.current===xe.current&&f===be.current||(((me=Se.current)==null?void 0:me.length)??0)<D)return;xe.current=Se.current,be.current=f;const Re=new AbortController;G(Re),f(Se.current??"",Re.signal).then(ge=>{Re.signal.aborted||(O(ge.map(u)),nt.current?(ge.length>0&&y(ge.slice(0,1)),P(!1)):ge.length>0&&t.openDropdown())}).catch(ge=>{Re.signal.aborted||ge.message.includes("aborted")||Oe({color:"red",message:Ke(ge)})}).finally(()=>{Re.signal.aborted||G(void 0)})},[t,f,y,u,D]),It=v.useCallback(Re=>{(H&&H.length>0||S)&&t.openDropdown(),t.updateSelectedOptionIndex(),F(Re.currentTarget.value),Me.current&&(Me.current.abort(),G(void 0)),Ge.current!==void 0&&window.clearTimeout(Ge.current);const me=window.setTimeout(()=>yt(),100);W(me)},[t,H,S,yt]),$t=v.useCallback(Re=>{const me=I.some(we=>we.value===Re),ge=me?I.filter(we=>we.value!==Re):[...I];let Ne=H==null?void 0:H.find(we=>we.value===Re);if(!Ne&&S!==!1&&b){const we=b(Re);Ne=u(we)}if(Ne){if(E===0){y([Ne.resource]),I.length>0&&$([]);return}me||ge.push(Ne)}if(E!==void 0)for(;ge.length>E;)ge.shift();y(ge.map(we=>we.resource)),$(ge)},[S,H,I,E,y,b,u]),vt=v.useMemo(()=>{if(!M)return Re=>{M||(E===1&&(F(""),O([]),t.closeDropdown()),xe.current=void 0,Re==="$create"?(F(""),$t(z)):$t(Re))}},[$t,t,M,E,z]),At=v.useCallback(Re=>{const me=I.filter(ge=>ge.value!==Re.value);y(me.map(ge=>ge.resource)),$(me)},[I,y]),nn=v.useCallback(Re=>{Re.key==="Enter"?(Y||J)&&P(!0):Re.key==="Backspace"&&z.length===0&&(hn(Re),At(I[I.length-1]))},[J,At,z.length,I,Y]);v.useEffect(()=>()=>{Me.current&&Me.current.abort()},[]);const Te=!M&&j&&I.length>0&&s.jsx(ct.ClearButton,{title:"Clear all",size:"sm",onClear:()=>{F(""),$([]),y([]),t.closeDropdown()}}),De=S&&z.trim().length>0,Qe=H.length>0||De;return s.jsxs(ct,{store:t,onOptionSubmit:vt,withinPortal:!0,shadow:"xl",...k,children:[s.jsx(ct.DropdownTarget,{children:s.jsx(vc,{label:r,description:i,error:o,className:e.className,leftSection:_,rightSection:J?s.jsx(Ar,{size:16}):Te,required:C,disabled:M,children:s.jsxs(Us.Group,{"data-testid":FE.selectedItems,children:[I.map(Re=>s.jsx(K,{item:Re,disabled:M,onRemove:()=>At(Re)},Re.value)),!M&&(E===void 0||E===0||I.length<E)&&s.jsx(ct.EventsTarget,{children:s.jsx(vc.Field,{role:"searchbox",name:n,value:z,placeholder:T,onFocus:It,onBlur:()=>{t.closeDropdown(),F("")},onKeyDown:nn,onChange:It})})]})})}),s.jsx(ct.Dropdown,{hidden:!Qe,"data-testid":FE.options,children:s.jsx(ct.Options,{children:s.jsxs(yp,{type:"scroll",mah:R,children:[H.map(Re=>{const me=I.some(ge=>ge.value===Re.value);return s.jsx(ct.Option,{value:Re.value,active:me,children:s.jsx(U,{...Re,active:me})},Re.value)}),De&&s.jsxs(ct.Option,{value:"$create",children:["+ Create ",z]}),!S&&z.trim().length>0&&H.length===0&&s.jsx(ee,{search:z})]})})})]})}function Uq(e){return e?Array.isArray(e)?e:[e]:[]}function Bq(e){return s.jsxs(je,{gap:"xs",children:[e.active&&s.jsx(ro,{size:12}),s.jsx("span",{children:e.label})]})}function Vq({item:e,disabled:t,onRemove:n}){return s.jsx(Us,{withRemoveButton:!t,onRemove:n,children:e.label})}function Fq(){return s.jsx(ct.Empty,{children:"Nothing found"})}const Hq="_searchInput_dick8_1",qq={searchInput:Hq};function Gq(e){return{value:e.id,label:qa(e),resource:e}}function Wq(e){const t=rm(),n=Ae(),r=v.useCallback(async(o,c)=>{const u=Yq(o),f={signal:c},h=await n.graphql(u,void 0,void 0,f);return Xq(h,o)},[n]),i=v.useCallback(o=>{o.length>0&&t(`/${Mt(o[0])}`)},[t]);return s.jsx(Tb,{size:"sm",radius:"md",className:qq.searchInput,leftSection:s.jsx(sq,{size:16}),placeholder:"Search",itemComponent:Qq,toOption:Gq,onChange:i,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const Qq=v.forwardRef(({resource:e,active:t,...n},r)=>{var o;let i;return e.resourceType==="Patient"?i=e.birthDate:e.resourceType==="ServiceRequest"&&(i=(o=e.subject)==null?void 0:o.display),s.jsx("div",{ref:r,...n,children:s.jsxs(je,{wrap:"nowrap",children:[s.jsx(Zo,{value:e}),s.jsxs("div",{children:[s.jsx(_e,{children:qa(e)}),s.jsx(_e,{size:"xs",c:"dimmed",children:i})]})]})})});function Yq(e){const t=JSON.stringify(e);return RD(e)?`{
467
+ Patients1: PatientList(_id: ${t}, _count: 1) {
468
+ resourceType
469
+ id
470
+ identifier {
471
+ system
472
+ value
473
+ }
474
+ name {
475
+ given
476
+ family
477
+ }
478
+ birthDate
479
+ }
480
+ ServiceRequestList(_id: ${t}, _count: 1) {
481
+ resourceType
482
+ id
483
+ identifier {
484
+ system
485
+ value
486
+ }
487
+ subject {
488
+ display
489
+ }
490
+ }
491
+ }`.replace(/\s+/g," "):`{
492
+ Patients1: PatientList(name: ${t}, _count: 5) {
493
+ resourceType
494
+ id
495
+ identifier {
496
+ system
497
+ value
498
+ }
499
+ name {
500
+ given
501
+ family
502
+ }
503
+ birthDate
504
+ }
505
+ Patients2: PatientList(identifier: ${t}, _count: 5) {
506
+ resourceType
507
+ id
508
+ identifier {
509
+ system
510
+ value
511
+ }
512
+ name {
513
+ given
514
+ family
515
+ }
516
+ birthDate
517
+ }
518
+ ServiceRequestList(identifier: ${t}, _count: 5) {
519
+ resourceType
520
+ id
521
+ identifier {
522
+ system
523
+ value
524
+ }
525
+ subject {
526
+ display
527
+ }
528
+ }
529
+ }`.replace(/\s+/g," ")}function Xq(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),Zq(Kq(n),t).slice(0,5)}function Kq(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 Zq(e,t){return e.sort((n,r)=>HE(r,t)-HE(n,t))}function HE(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,qE(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,qE(Mc(r),t));return n}function qE(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function Jq(e){var i;const t=im(),[n,r]=v.useState(!1);return s.jsx(Dr.Header,{p:8,style:{zIndex:101},children:s.jsxs(je,{justify:"space-between",children:[s.jsxs(je,{gap:"xs",children:[s.jsx(tr,{className:oh.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&s.jsx(Wq,{pathname:e.pathname,searchParams:e.searchParams})]}),s.jsxs(je,{gap:"lg",pr:"sm",children:[e.notifications,s.jsxs(Ce,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:n,onClose:()=>r(!1),children:[s.jsx(Ce.Target,{children:s.jsx(tr,{className:zt(oh.user,{[oh.userActive]:n}),onClick:()=>r(o=>!o),children:s.jsxs(je,{gap:7,children:[s.jsx(Zo,{value:t,radius:"xl",size:24}),s.jsx(_e,{size:"sm",className:oh.userName,children:Mc((i=t==null?void 0:t.name)==null?void 0:i[0])}),s.jsx(Sb,{size:12,stroke:1.5})]})})}),s.jsx(Ce.Dropdown,{children:s.jsx(zq,{version:e.version})})]})]})]})})}const Rb=v.createContext({submitting:!1});Rb.displayName="FormContext";function eG(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?tG(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&nG(t,n);return t}function tG(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function nG(e,t){e[t.name]=t.value}function mt(e){const[t,n]=v.useState(!1);return s.jsx(Rb.Provider,{value:{submitting:t},children:s.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:r=>{r.preventDefault();const i=eG(r.target);if(e.onSubmit){n(!0);const o=e.onSubmit(i);o!=null&&o.then?o.catch(console.error).finally(()=>{n(!1)}):n(!1)}},children:e.children})})}function xr(e){const{children:t,...n}=e,{submitting:r}=v.useContext(Rb);return s.jsx(Pe,{type:"submit",loading:r,...n,children:t})}function rG(e){const t=Ae(),n=t.getUserConfiguration();function r(i){var m,g;const{menuname:o,bookmarkname:c}=i,u=`${e.pathname}?${e.searchParams.toString()}`,f=Wr(n),h=(m=f.menu)==null?void 0:m.find(({title:y})=>y===o);(g=h==null?void 0:h.link)==null||g.push({name:c,target:u}),t.updateResource(f).then(y=>{n.menu=y.menu,t.dispatchEvent({type:"change"}),Oe({color:"green",message:"Success"}),e.onOk()}).catch(y=>{Oe({color:"red",message:Ke(y)})})}return s.jsx(Vn,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:s.jsx(mt,{onSubmit:r,children:s.jsxs(qe,{children:[s.jsx(iG,{config:n}),s.jsx($e,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),s.jsx(je,{justify:"flex-end",children:s.jsx(xr,{mt:"sm",children:"OK"})})]})})})}function iG(e){function t(r){var i;return(i=r==null?void 0:r.menu)==null?void 0:i.map(o=>o.title)}const n=t(e.config);return s.jsx(sn,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function jA(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function aG(e){return typeof e.display=="string"?e.display:jA(e)}function oG(e){return{value:jA(e),label:aG(e),resource:e}}function sG(e){return{code:e,display:e}}function om(e){const t=Ae(),{binding:n,creatable:r,clearable:i,expandParams:o,withHelpText:c,...u}=e,f=v.useCallback(async(h,m)=>{var S;if(!n)return[];const y=((S=(await t.valueSetExpand({...o,url:n,filter:h,count:10},{signal:m})).expansion)==null?void 0:S.contains)??[],b=[];for(const j of y)j.code&&!b.some(C=>C.code===j.code)&&b.push(j);return b},[t,o,n]);return s.jsx(Tb,{...u,creatable:r??!0,clearable:i??!0,toOption:oG,loadOptions:f,onCreate:sG,itemComponent:c?lG:void 0})}const lG=v.forwardRef(({label:e,resource:t,active:n,...r},i)=>s.jsx("div",{ref:i,...r,children:s.jsxs(je,{wrap:"nowrap",gap:"xs",children:[n&&s.jsx(ro,{size:12}),s.jsxs("div",{children:[s.jsx(_e,{children:e}),s.jsx(_e,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})]})}));function CA(e){const{defaultValue:t,onChange:n,withHelpText:r,...i}=e,[o,c]=v.useState(t);function u(f){const h=f[0],m=uG(h);c(m),n&&n(m)}return s.jsx(om,{defaultValue:cG(o),onChange:u,withHelpText:r??!0,...i})}function cG(e){return e?{code:e}:void 0}function uG(e){return e==null?void 0:e.code}function _b(e){const[t,n]=v.useState(e.defaultValue),r=e.onChange,i=v.useCallback(o=>{n(o),r&&r(o)},[r]);return s.jsx(CA,{disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":e.testId,defaultValue:t,onChange:i,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 dG="_menuTitle_9g6l5_1",fG="_link_9g6l5_9",hG="_linkActive_9g6l5_38",Wy={menuTitle:dG,link:fG,linkActive:hG};function pG(e){var u;const t=rm(),n=vG(e.pathname,e.searchParams,e.menus),[r,i]=v.useState(!1);function o(f,h){f.stopPropagation(),f.preventDefault(),t(h),window.innerWidth<768&&e.closeNavbar()}function c(f){f&&t(`/${f}`)}return s.jsxs(s.Fragment,{children:[s.jsx(Dr.Navbar,{children:s.jsxs(Yr,{p:"xs",children:[!e.resourceTypeSearchDisabled&&s.jsx(Dr.Section,{mb:"sm",children:s.jsx(_b,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:f=>c(f)},window.location.pathname)}),s.jsxs(Dr.Section,{grow:!0,children:[(u=e.menus)==null?void 0:u.map(f=>{var h;return s.jsxs(v.Fragment,{children:[s.jsx(_e,{className:Wy.menuTitle,children:f.title}),(h=f.links)==null?void 0:h.map(m=>s.jsxs(mG,{to:m.href,active:m.href===(n==null?void 0:n.href),onClick:g=>o(g,m.href),children:[s.jsx(gG,{icon:m.icon}),s.jsx("span",{children:m.label})]},m.href))]},`menu-${f.title}`)}),e.displayAddBookmark&&s.jsx(Pe,{variant:"subtle",size:"xs",mt:"xl",leftSection:s.jsx(vA,{size:"0.75rem"}),onClick:()=>i(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&s.jsx(rG,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>i(!1),onCancel:()=>i(!1)})]})}function mG(e){return s.jsx(gt,{onClick:e.onClick,to:e.to,className:zt(Wy.link,{[Wy.linkActive]:e.active}),children:e.children})}function gG(e){return e.icon?e.icon:s.jsx(Gp,{w:30})}function vG(e,t,n){if(!e||!t||!n)return;let r,i=0;for(const o of n)if(o.links)for(const c of o.links){const u=yG(e,t,c.href);u>i&&(i=u,r=c)}return r}function yG(e,t,n){const r=new URL(n,"https://example.com");if(e!==r.pathname)return 0;const i=["_count","_offset"];for(const[c,u]of r.searchParams.entries())if(!i.includes(c)&&t.get(c)!==u)return 0;let o=1;for(const[c,u]of t.entries())i.includes(c)||r.searchParams.get(c)===u&&o++;return o}function xG(e){const[t,n]=v.useState(localStorage.navbarOpen==="true"),r=Ae(),i=im();v.useEffect(()=>{function f(){Oe({id:"offline",color:"red",message:"No connection to server",autoClose:!1})}return r.addEventListener("offline",f),()=>r.removeEventListener("offline",f)},[r]);function o(f){localStorage.navbarOpen=f.toString(),n(f)}function c(){o(!1)}function u(){o(!t)}return r.isLoading()?s.jsx(gi,{}):s.jsxs(Dr,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!i||!t,mobile:!i||!t}},padding:0,children:[i&&s.jsx(Jq,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:u,notifications:e.notifications}),i&&t?s.jsx(pG,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:c,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,s.jsx(Dr.Main,{className:Dq.main,children:s.jsx(xA,{children:s.jsx(v.Suspense,{fallback:s.jsx(gi,{}),children:e.children})})})]})}const bG="https://ccda.medplum.com",SG="https://ccda-validator.medplum.com/";function wG(e){const{url:t}=e,[n,r]=v.useState(!1),i=v.useRef(null),[o,c]=v.useState(),[u,f]=v.useState(!1);v.useEffect(()=>{t&&n&&i.current&&(qu(i.current,{command:"loadCcdaXml",value:t}).catch(console.error),r(!1))},[t,n]);const h=async()=>{if(t)try{f(!0);const b=await(await fetch(t)).text(),S=new FormData;S.append("ccdaFile",new Blob([b],{type:"text/xml"}),"ccda.xml");const j=`${SG}referenceccdaservice/?validationObjective=C-CDA_IG_Plus_Vocab&referenceFileName=No%20scenario%20File&curesUpdate=true&severityLevel=WARNING`,C=await fetch(j,{method:"POST",body:S,credentials:"omit",redirect:"manual"});if(!C.ok)throw new Error(`Validation failed: ${C.status} ${C.statusText}`);const T=await C.json();c(T)}catch(y){c(void 0),console.error("CCDA validation error:",y)}finally{f(!1)}},m=()=>{if(!o)return;const y=JSON.stringify(o,null,2);wA(y,"ccda-validation-results")},g=()=>o?o.resultsMetaData.resultMetaData.filter(y=>y==null?void 0:y.type.includes("Error")).reduce((y,b)=>y+(b.count||0),0):0;return t?s.jsxs("div",{"data-testid":"ccda-iframe",style:{maxWidth:e.maxWidth},children:[s.jsx("div",{style:{minHeight:400},children:s.jsx("iframe",{title:"C-CDA Viewer",width:"100%",height:"400",ref:i,src:bG,allowFullScreen:!0,frameBorder:0,seamless:!0,onLoad:()=>r(!0)})}),s.jsxs("div",{style:{marginTop:"10px",marginBottom:"10px",display:"flex",alignItems:"center"},children:[s.jsx(Pe,{type:"button",onClick:h,disabled:u,children:u?"Validating...":"Validate"}),o&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{marginLeft:"15px"},children:[s.jsx("strong",{children:"Validation Results:"})," ",g()," errors found"]}),s.jsx(Pe,{type:"button",onClick:m,color:"green",style:{marginLeft:"auto"},children:"Download Full Results"})]})]})]}):null}function Dd(e){const{contentType:t,url:n,title:r}=e.value??{},i=nA(n);return i?s.jsxs("div",{"data-testid":"attachment-display",children:[(t==null?void 0:t.startsWith("image/"))&&s.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:i,alt:r}),(t==null?void 0:t.startsWith("video/"))&&s.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:s.jsx("source",{type:t,src:i})}),((t==null?void 0:t.startsWith("text/"))||t==="application/json"||t==="application/pdf")&&s.jsx("div",{"data-testid":"attachment-iframe",style:{maxWidth:e.maxWidth,minHeight:400},children:s.jsx("iframe",{title:"Attachment",width:"100%",height:"400",src:i+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),t===fn.CDA_XML&&s.jsx(wG,{url:i}),s.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:s.jsx(Pt,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:jG(r),children:r||"Download"})})]}):null}function jG(e){return e!=null&&e.includes(".")?e:void 0}const CG="_root_17n8t_1",EG="_compact_17n8t_25",GE={root:CG,compact:EG};function Db(e){const{children:t,compact:n}=e;return s.jsx("dl",{className:zt(GE.root,{[GE.compact]:n}),children:t})}function Ua(e){return s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:e.term}),s.jsx("dd",{children:e.children})]})}function TG(e){var r;const t=(r=e.values)==null?void 0:r.map((i,o)=>s.jsx("div",{children:s.jsx(Dd,{value:i,maxWidth:e.maxWidth})},"attatchment-"+o));let n;if(e.includeDescriptionListEntry){if(e.property===void 0)throw new Error("props.property is required when includeDescriptionListEntry is true");if(!Tn(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const i=e.path.split(".").pop();n=s.jsx(Ua,{term:Hs(i),children:t})}else n=s.jsx(s.Fragment,{children:t});return n}function Ab(e){const t=Ae(),n=v.useRef(null);function r(c){var u;hn(c),(u=n.current)==null||u.click()}function i(c){hn(c);const u=c.target.files;u&&Array.from(u).forEach(o)}function o(c){!c||!c.name||(e.onUploadStart&&e.onUploadStart(),t.createAttachment({data:c,contentType:c.type||"application/octet-stream",filename:c.name,securityContext:e.securityContext,onProgress:e.onUploadProgress}).then(f=>e.onUpload(f)).catch(f=>{e.onUploadError&&e.onUploadError(Kt(f))}))}return s.jsxs(s.Fragment,{children:[s.jsx("input",{disabled:e.disabled,type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:n,onChange:c=>i(c)}),e.children({onClick:r,disabled:e.disabled})]})}function RG(e){const[t,n]=v.useState(e.defaultValue??[]),r=v.useRef(t);r.current=t;function i(o){n(o),e.onChange&&e.onChange(o)}return s.jsxs("table",{style:{width:"100%"},children:[s.jsxs("colgroup",{children:[s.jsx("col",{width:"97%"}),s.jsx("col",{width:"3%"})]}),s.jsxs("tbody",{children:[t.map((o,c)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(Dd,{value:o,maxWidth:200})}),s.jsx("td",{children:s.jsx(An,{disabled:e.disabled,title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:u=>{hn(u);const f=t.slice();f.splice(c,1),i(f)},children:s.jsx(Hh,{})})})]},`${c}-${t.length}`)),s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{children:s.jsx(Ab,{disabled:e.disabled,onUpload:o=>{i([...r.current,o])},children:o=>s.jsx(An,{...o,title:"Add",variant:"subtle",size:"sm",color:o.disabled?"gray":"green",children:s.jsx(wb,{})})})})]})]})]})}function EA(e){const[t,n]=v.useState(e.defaultValue);function r(i){n(i),e.onChange&&e.onChange(i)}return t?s.jsxs(s.Fragment,{children:[s.jsx(Dd,{value:t,maxWidth:200}),s.jsx(Pe,{disabled:e.disabled,onClick:i=>{hn(i),r(void 0)},children:"Remove"})]}):s.jsx(Ab,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:i=>s.jsx(Pe,{...i,children:"Upload..."})})}const _G="_root_1vii2_1",DG={root:_G};function Lc(e){const{children:t,...n}=e;return s.jsx(v0,{className:DG.root,...n,children:t})}const AG="_paper_1igaj_1",kG="_fill_1igaj_20",WE={paper:AG,fill:kG};function sm(e){const{width:t,fill:n,className:r,children:i,...o}=e,c=t?{maxWidth:t}:void 0;return s.jsx(lr,{className:zt(WE.paper,n&&WE.fill,r),style:c,shadow:"sm",radius:"sm",withBorder:!0,...o,children:i})}function st(e){const{children:t,...n}=e;return s.jsx(Lc,{children:s.jsx(sm,{...n,children:t})})}function zi(e){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 491 491",style:{width:e.size,height:e.size},children:[s.jsx("title",{children:"Medplum Logo"}),s.jsx("path",{fill:e.fill??"#ad7136",d:"M282 67c6-16 16-29 29-40L289 0c-22 17-37 41-43 68l17 23 19-24z"}),s.jsx("path",{fill:e.fill??"#946af9",d:"M311 63c-17 0-33 4-48 11-16-7-32-11-49-11-87 0-158 96-158 214s71 214 158 214c17 0 33-4 49-11 15 7 31 11 48 11 87 0 158-96 158-214S398 63 311 63z"}),s.jsx("path",{fill:e.fill??"#7857c5",d:"M231 489l-17 2c-87 0-158-96-158-214S127 63 214 63l17 1c-39 12-70 102-70 213s31 201 70 212z"}),s.jsx("path",{fill:e.fill??"#40bc26",d:"M207 220a176 176 0 01-177 43A176 176 0 01251 43l1 5c17 59 2 125-45 172z"}),s.jsx("path",{fill:e.fill??"#33961e",d:"M252 48A421 421 0 0057 270l-27-7A176 176 0 01251 43l1 5z"})]})}function Nt(e,t){var n,r,i;return(i=(r=(n=e==null?void 0:e.issue)==null?void 0:n.filter(o=>{var c;return TA((c=o.expression)==null?void 0:c[0],t)}))==null?void 0:r.map(o=>{var c;return(c=o.details)==null?void 0:c.text}))==null?void 0:i.join(`
530
+ `)}function Ad(e,t){var n;return(n=e==null?void 0:e.issue)==null?void 0:n.filter(r=>{var i;return TA((i=r.expression)==null?void 0:i[0],t)})}const sh=/\[\d+\]/;function TA(e,t){const n=typeof e=="string"&&sh.test(e),r=typeof t=="string"&&sh.test(t);if(n!==r&&(e=e==null?void 0:e.replace(sh,""),t=t==null?void 0:t.replace(sh,"")),e===t)return!0;if(!e||!t)return!1;const i=e.indexOf(".");if(i>=0&&e.substring(i+1)===t)return!0;const o=t.indexOf(".");return o>=0&&t.substring(o+1)===e}function RA(e){const t=Ae(),[n,r]=v.useState();return s.jsxs(mt,{onSubmit:async i=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:i.projectName}))}catch(o){r(Kt(o))}},children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx(zi,{size:32}),s.jsx(Ie,{children:"Create project"})]}),s.jsxs(qe,{gap:"xl",children:[s.jsx($e,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:Nt(n,"projectName")}),s.jsxs(_e,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Pt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Pt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),s.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(xr,{children:"Create project"})})]})}function _A(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 DA(e){const t=Ae(),{googleClientId:n,handleGoogleCredential:r}=e,i=v.useRef(null),[o,c]=v.useState(typeof google<"u"),[u,f]=v.useState(!1),[h,m]=v.useState(!1);return v.useEffect(()=>{if(typeof google>"u"){_A("https://accounts.google.com/gsi/client",()=>c(!0));return}u||(google.accounts.id.initialize({client_id:n,callback:r}),f(!0)),i.current&&!h&&(google.accounts.id.renderButton(i.current,{}),m(!0))},[t,n,u,o,i,h,r]),n?s.jsx("div",{ref:i}):null}function AA(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 Xr(e){var n;const t=((n=e.outcome)==null?void 0:n.issue)||e.issues;return!t||t.length===0?null:s.jsx(Za,{icon:s.jsx(al,{size:16}),color:"red",children:t.map(r=>{var i;return s.jsx("div",{"data-testid":"text-field-error",children:dD(r)},(i=r.details)==null?void 0:i.text)})})}function kA(e){typeof grecaptcha>"u"&&_A("https://www.google.com/recaptcha/api.js?render="+e)}function PA(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function PG(e){const t=AA(e.googleClientId),n=e.recaptchaSiteKey,r=Ae(),[i,o]=v.useState(),c=Ad(i,void 0);return v.useEffect(()=>{n&&kA(n)},[n]),s.jsxs(mt,{onSubmit:async u=>{o(void 0);try{let f="";n&&(f=await PA(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:f}))}catch(f){o(Kt(f))}},children:[s.jsx(er,{style:{flexDirection:"column"},children:e.children}),s.jsx(Xr,{issues:c}),t&&s.jsxs(s.Fragment,{children:[s.jsx(je,{justify:"center",p:"xl",style:{height:70},children:s.jsx(DA,{googleClientId:t,handleGoogleCredential:async u=>{try{e.handleAuthResponse(await r.startGoogleLogin({googleClientId:u.clientId,googleCredential:u.credential,projectId:e.projectId,createUser:!0}))}catch(f){o(Kt(f))}}})}),s.jsx(Cn,{label:"or",labelPosition:"center",my:"lg"})]}),s.jsxs(qe,{gap:"xl",children:[s.jsx($e,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:Nt(i,"firstName")}),s.jsx($e,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:Nt(i,"lastName")}),s.jsx($e,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:Nt(i,"email")}),s.jsx(ki,{name:"password",label:"Password",autoComplete:"off",required:!0,error:Nt(i,"password")}),s.jsxs(_e,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Pt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Pt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),s.jsxs(_e,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",s.jsx(Pt,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Pt,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),s.jsxs(je,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(Un,{name:"remember",label:"Remember me",size:"xs"}),s.jsx(xr,{children:"Create account"})]})]})}function NG(e){const{type:t,projectId:n,clientId:r,googleClientId:i,recaptchaSiteKey:o,onSuccess:c}=e,u=Ae(),[f,h]=v.useState(),[m,g]=v.useState();v.useEffect(()=>{t==="patient"&&f&&u.startNewPatient({login:f,projectId:n}).then(b=>u.processCode(b.code)).then(()=>c()).catch(b=>g(Kt(b)))},[u,t,n,f,c]);function y(b){b.code?u.processCode(b.code).then(()=>c()).catch(console.log):b.login&&h(b.login)}return s.jsxs(st,{width:450,children:[m&&s.jsx("pre",{children:JSON.stringify(m,null,2)}),!f&&s.jsx(PG,{projectId:n,clientId:r,googleClientId:i,recaptchaSiteKey:o,handleAuthResponse:y,children:e.children}),f&&t==="project"&&s.jsx(RA,{login:f,handleAuthResponse:y})]})}function OG(e){const[t,n]=v.useState();return t?s.jsx(LG,{email:t,...e}):s.jsx(MG,{setEmail:n,...e})}function MG(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:i,disableEmailAuth:o,...c}=e,u=Ae(),f=!e.disableGoogleAuth&&AA(e.googleClientId),[h,m]=v.useState(),g=Ad(h,void 0),y=v.useCallback(async j=>{if(!j.authorizeUrl)return!1;const C=JSON.stringify({...await u.ensureCodeChallenge(c),domain:j.domain}),T=new URL(j.authorizeUrl);return T.searchParams.set("state",C),window.location.assign(T.toString()),!0},[u,c]),b=v.useCallback(async j=>{const C=await u.post("auth/method",{email:j.email});await y(C)||t(j.email)},[u,y,t]),S=v.useCallback(async j=>{try{const C=await u.startGoogleLogin({...c,googleCredential:j.credential});await y(C)||r(C)}catch(C){m(Kt(C))}},[u,c,y,r]);return s.jsxs(mt,{onSubmit:b,children:[s.jsx(er,{style:{flexDirection:"column"},children:i}),s.jsx(Xr,{issues:g}),f&&s.jsxs(s.Fragment,{children:[s.jsx(je,{justify:"center",p:"xl",style:{height:70},children:s.jsx(DA,{googleClientId:f,handleGoogleCredential:S})}),!o&&s.jsx(Cn,{label:"or",labelPosition:"center",my:"lg"})]}),!o&&s.jsx($e,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:Nt(h,"email")}),s.jsxs(je,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[s.jsx("div",{children:n&&s.jsx(Pt,{component:"button",type:"button",c:"dimmed",onClick:n,size:"xs","data-dashlane-ignore":"true","data-lp-ignore":"true","data-no-autofill":"true","data-form-type":"navigation",children:"Register"})}),!o&&s.jsx(xr,{children:"Next"})]})]})}function LG(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...i}=e,o=Ae(),[c,u]=v.useState(),f=Ad(c,void 0),h=v.useCallback(m=>{o.startLogin({...i,password:m.password,remember:m.remember==="on"}).then(n).catch(g=>u(Kt(g)))},[o,i,n]);return s.jsxs(mt,{onSubmit:h,children:[s.jsx(er,{style:{flexDirection:"column"},children:r}),s.jsx(Xr,{issues:f}),s.jsx(qe,{gap:"xl",children:s.jsx(ki,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:Nt(c,"password")})}),s.jsxs(je,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&s.jsx(Pt,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),s.jsx(Un,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),s.jsx(xr,{children:"Sign in"})]})]})}function IG(e){const t=Ae(),n=gd(),[r,i]=v.useState(""),[o,c]=v.useState();function u(g){var y;return!!((y=g==null?void 0:g.toLowerCase())!=null&&y.includes(r.toLowerCase()))}function f(g){var y,b;return u((y=g.profile)==null?void 0:y.display)||u((b=g.project)==null?void 0:b.display)}function h(g){t.post("auth/profile",{login:e.login,profile:g}).then(e.handleAuthResponse).catch(y=>c(Kt(y)))}const m=e.memberships.filter(f).slice(0,10).map(g=>s.jsx(ct.Option,{value:g.id,children:s.jsx($G,{...g})},g.id));return s.jsxs(qe,{children:[s.jsxs(Fo,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[s.jsx(zi,{size:32}),s.jsx(Ie,{order:3,children:"Choose profile"})]}),s.jsx(Xr,{outcome:o}),s.jsxs(ct,{store:n,onOptionSubmit:h,children:[s.jsx(ct.EventsTarget,{children:s.jsx($e,{placeholder:"Search",value:r,onChange:g=>{i(g.currentTarget.value),n.updateSelectedOptionIndex()}})}),s.jsx("div",{children:s.jsx(ct.Options,{children:m.length>0?m:s.jsx(ct.Empty,{children:"Nothing found..."})})})]})]})}function $G(e){var t,n;return s.jsxs(je,{children:[s.jsx(zs,{radius:"xl"}),s.jsxs("div",{children:[s.jsx(_e,{fz:"sm",fw:500,children:(t=e.profile)==null?void 0:t.display}),s.jsx(_e,{fz:"xs",opacity:.6,children:(n=e.project)==null?void 0:n.display})]})]})}const zG=/^patient\/Condition\.(?:\*|c?r?u?d?s?)$/,UG="?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis",BG="?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item",VG="?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern",FG=/^patient\/Observation\.(?:\*|c?r?u?d?s?)$/,HG="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-observation-category|clinical-test",qG="?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory",GG="?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history",WG="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh",QG="?category=http://terminology.hl7.org/CodeSystem/observation-category|survey",YG="?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs";function XG(e){const t=Ae();return s.jsx(mt,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:s.jsxs(qe,{children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx(zi,{size:32}),s.jsx(Ie,{children:"Choose scope"})]}),s.jsx(qe,{children:(e.scope??"openid").split(" ").map(n=>{let r;return zG.test(n)?r=[n+UG,n+BG,n+VG]:FG.test(n)&&(r=[n+HG,n+qG,n+GG,n+WG,n+QG,n+YG]),s.jsxs(s.Fragment,{children:[s.jsx(Un,{id:n,name:n,label:n,defaultChecked:!0},n),r==null?void 0:r.map(i=>s.jsx(Un,{id:i,name:i,label:i},i))]},n+"_group")})}),s.jsx(je,{justify:"flex-end",mt:"xl",children:s.jsx(xr,{children:"Set scope"})})]})})}function NA(e){const[t,n]=v.useState();return s.jsx(mt,{onSubmit:r=>{n(void 0),e.onSubmit(r).catch(i=>n(Ke(i)))},children:s.jsxs(qe,{children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx(zi,{size:32}),s.jsx(Ie,{children:"Enter MFA code"})]}),t&&s.jsx(Za,{icon:s.jsx(al,{size:16}),title:"Error",color:"red",children:t}),s.jsx(qe,{children:s.jsx($e,{name:"token",label:"MFA code",required:!0,autoFocus:!0})}),s.jsx(je,{justify:"flex-end",mt:"xl",children:s.jsx(xr,{children:"Submit code"})})]})})}function OA(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:i,onRegister:o,onCode:c,...u}=e,f=Ae(),[h,m]=v.useState(),g=v.useRef(!1),[y,b]=v.useState(!1),[S,j]=v.useState(),C=v.useCallback(E=>{c?c(E):f.processCode(E).then(()=>{r&&r()}).catch(R=>Oe({color:"red",message:Ke(R)}))},[f,c,r]),T=v.useCallback(E=>{b(!!E.mfaRequired),E.login&&m(E.login),E.memberships&&j(E.memberships),E.code&&(n?j(void 0):C(E.code))},[n,C]),_=v.useCallback(E=>{C(E.code)},[C]);return v.useEffect(()=>{t&&!g.current&&!h&&(g.current=!0,f.get("auth/login/"+t).then(T).catch(E=>Oe({color:"red",message:Ke(E)})))},[f,t,g,h,T]),s.jsx(st,{width:450,px:"sm",py:"md",children:h?y?s.jsx(NA,{onSubmit:async E=>{const R=await f.post("auth/mfa/verify",{login:h,token:E.token});T(R)}}):S?s.jsx(IG,{login:h,memberships:S,handleAuthResponse:T}):e.projectId==="new"?s.jsx(RA,{login:h,handleAuthResponse:T}):e.chooseScopes?s.jsx(XG,{login:h,scope:e.scope,handleAuthResponse:_}):s.jsx("div",{children:"Success"}):s.jsx(OG,{onForgotPassword:i,onRegister:o,handleAuthResponse:T,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...u,children:e.children})})}function ia(e){return s.jsx(s.Fragment,{children:Ho(e.value)})}function KG(e){return s.jsx(s.Fragment,{children:Td(e.value)})}function MA(e){const t=e.value;if(!t)return null;const n=[];return t.value&&n.push(t.value),(t.use||t.system)&&(n.push(" ["),t.use&&n.push(t.use),t.use&&t.system&&n.push(" "),t.system&&n.push(t.system),n.push("]")),s.jsx(s.Fragment,{children:n.join("").trim()})}function ZG(e){var n;const t=e.value;return t?s.jsxs(s.Fragment,{children:[t.name,t.name&&": ",(n=t.telecom)==null?void 0:n.map(r=>s.jsx(MA,{value:r},`telecom-${t.name}-${r.value}`))]}):null}function lm(e,t,n){const r=xc(e,t,{profileUrl:n});return r?Array.isArray(r)?[r.map(i=>i.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function JG(e,t,n){const r=vD(e,t,n);return r?Array.isArray(r)?[r.map(i=>i.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function eW(e){const{elementDefinitionType:t}=e,n=Ae(),r=v.useContext(ln),[i,o]=v.useState(mD("Extension")),c=v.useMemo(()=>{if(Tn(t==null?void 0:t.profile))return t.profile[0]},[t]),[u,f]=v.useState(c!==void 0);if(v.useEffect(()=>{c&&(f(!0),n.requestProfileSchema(c).then(()=>{const g=Oc(c);f(!1),g&&o(g)}).catch(g=>{f(!1),console.warn(g)}))},[n,c]),c&&(u||!eb(c)))return s.jsx("div",{children:"Loading..."});const h=i.elements["value[x]"];if((h==null?void 0:h.max)!==0){const[g,y]=lm({type:"Extension",value:e.value},"value[x]",c??r.profileUrl);return s.jsx(Mi,{propertyType:y,value:g})}return s.jsx(Gh,{path:e.path,value:{type:i.type,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:c})}function tW(e){var t,n;return s.jsxs("div",{children:[(t=e.value)==null?void 0:t.system,": ",(n=e.value)==null?void 0:n.value]})}function nW(e){return s.jsx(s.Fragment,{children:jU(e.value)})}function ad(e){return s.jsx(s.Fragment,{children:Ns(e.value)})}function kb(e){return s.jsx(s.Fragment,{children:rd(e.value)})}function rW(e){const t=e.value;return t?s.jsxs(s.Fragment,{children:[s.jsx(ad,{value:t.numerator})," / ",s.jsx(ad,{value:t.denominator})]}):null}function Qy(e){if(!e.value)return null;const t=e.value.display||e.value.reference||Oi(e.value);return e.link!==!1&&e.value.reference?s.jsx(gt,{to:e.value,children:t}):s.jsx(s.Fragment,{children:t})}function LA(e,t,n,r){if(!Tn(n==null?void 0:n.slices))return[e];const i=new Array(t.length+1);for(let o=0;o<i.length;o++)i[o]=[];for(const o of e){const c=ZD(o,t,n.discriminator,r);let u=c?t.findIndex(f=>f.name===c):-1;u===-1&&(u=t.length),i[u].push(o)}return i}async function IA({medplum:e,property:t}){return new Promise((n,r)=>{var u,f;if(!t.slicing){n([]);return}const i=[],o=[],c=[];for(const h of t.slicing.slices){if(!KD(h)){console.debug("Unsupported slice definition",h);continue}let m;Tn(h.elements)||(m=(f=(u=h.type[0])==null?void 0:u.profile)==null?void 0:f[0]),i.push(h),o.push(m),m&&c.push(e.requestProfileSchema(m))}Promise.all(c).then(()=>{for(let h=0;h<i.length;h++){const m=i[h],g=o[h];if(g){const y=Oc(g);m.typeSchema=y}}n(i)}).catch(r)})}function cm(e,t,n){return t!==void 0?s.jsx(e,{value:t,children:n}):n}function iW(e){var c,u;const{slice:t,property:n}=e,r=((c=t.typeSchema)==null?void 0:c.elements)??t.elements,i=v.useContext(ln),o=v.useMemo(()=>{var f;if(Tn(r))return bc({parentContext:i,elements:r,path:e.path,profileUrl:(f=t.typeSchema)==null?void 0:f.url})},[i,e.path,(u=t.typeSchema)==null?void 0:u.url,r]);return cm(ln.Provider,o,s.jsx(s.Fragment,{children:e.value.map((f,h)=>s.jsx("div",{children:s.jsx(Mi,{property:n,path:e.path,arrayElement:!0,elementDefinitionType:t.type[0],propertyType:t.type[0].code,value:f,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${h}-${e.value.length}`))}))}const QE=50;function aW(e){var C;const{property:t,propertyType:n}=e,r=Ae(),i=v.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[o,c]=v.useState(!0),[u,f]=v.useState([]),[h,m]=v.useState(()=>[i]),[g,y]=v.useState(0),b=v.useContext(ln);if(v.useEffect(()=>{IA({medplum:r,property:t}).then(T=>{y(i.length),f(T);const _=i.slice(0,QE),E=LA(_,T,t.slicing,b.profileUrl);m(E),c(!1)}).catch(T=>{console.error(T),c(!1)})},[r,t,b.profileUrl,m,i]),o)return s.jsx("div",{children:"Loading..."});let S;if(((C=t.type[0])==null?void 0:C.code)!=="Extension"){const T=h[u.length],_=T.map((E,R)=>s.jsx("div",{children:s.jsx(Mi,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:E,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${R}-${T.length}`));if(e.includeDescriptionListEntry){if(!Tn(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const E=e.path.split(".").pop();S=s.jsx(Ua,{term:Hs(E),children:_})}else S=s.jsx(s.Fragment,{children:_})}return s.jsxs(s.Fragment,{children:[u.map((T,_)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let E=s.jsx(iW,{path:e.path,slice:T,property:t,value:h[_],ignoreMissingValues:e.ignoreMissingValues,link:e.link},T.name);return e.includeDescriptionListEntry&&(E=s.jsx(Ua,{term:Hs(T.name),children:E},T.name)),E}),S,g>QE&&s.jsx(je,{justify:"right",children:s.jsxs(_e,{children:["... ",g," total values"]})})]})}function Mi(e){var o;const{property:t,propertyType:n,value:r}=e;if((o=t==null?void 0:t.path)==null?void 0:o.endsWith(".id"))return s.jsxs(ce,{component:"div",style:{display:"flex",gap:3,alignItems:"center"},children:[r,!Rn(r)&&s.jsx(v_,{value:r,timeout:2e3,children:({copied:c,copy:u})=>s.jsx(nl,{label:c?"Copied":"Copy",withArrow:!0,position:"right",children:s.jsx(An,{variant:"subtle",color:c?"teal":"gray",onClick:u,children:c?s.jsx(ro,{size:"1rem"}):s.jsx(hA,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===ie.Attachment?s.jsx(TG,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):s.jsx(aW,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case ie.boolean:return s.jsx(s.Fragment,{children:r===void 0?"":(!!r).toString()});case ie.SystemString:case ie.string:return s.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case ie.code:case ie.date:case ie.decimal:case ie.id:case ie.integer:case ie.positiveInt:case ie.unsignedInt:case ie.uri:case ie.url:return s.jsx(s.Fragment,{children:r});case ie.canonical:return s.jsx(Qy,{value:{reference:r},link:e.link});case ie.dateTime:case ie.instant:return s.jsx(s.Fragment,{children:gr(r)});case ie.markdown:return s.jsx("pre",{children:r});case ie.Address:return s.jsx(SF,{value:r});case ie.Annotation:return s.jsx(s.Fragment,{children:r==null?void 0:r.text});case ie.Attachment:return s.jsx(Dd,{value:r,maxWidth:e.maxWidth});case ie.CodeableConcept:return s.jsx(ia,{value:r});case ie.Coding:return s.jsx(KG,{value:r});case ie.ContactDetail:return s.jsx(ZG,{value:r});case ie.ContactPoint:return s.jsx(MA,{value:r});case ie.HumanName:return s.jsx(Eb,{value:r});case ie.Identifier:return s.jsx(tW,{value:r});case ie.Money:return s.jsx(nW,{value:r});case ie.Period:return s.jsx(s.Fragment,{children:yU(r)});case ie.Quantity:case ie.Duration:return s.jsx(ad,{value:r});case ie.Range:return s.jsx(kb,{value:r});case ie.Ratio:return s.jsx(rW,{value:r});case ie.Reference:return s.jsx(Qy,{value:r,link:e.link});case ie.Timing:return s.jsx(s.Fragment,{children:OD(r)});case ie.Dosage:case ie.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(Gh,{path:e.path,value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});case ie.Extension:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(eW,{path:e.path,value:r,compact:!0,ignoreMissingValues:e.ignoreMissingValues,elementDefinitionType:e.elementDefinitionType});default:if(!t)throw Error(`Displaying property of type ${e.propertyType} requires element schema`);if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(Gh,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}const $A=["extension","modifierExtension"],oW=dA.filter(e=>!$A.includes(e));function Gh(e){const t=e.value,{value:n,type:r}=t,i=v.useContext(ln),o=e.profileUrl??(i==null?void 0:i.profileUrl),c=v.useMemo(()=>Qp(r,o),[o,r]),u=v.useMemo(()=>{if(c)return bc({parentContext:i,elements:c.elements,path:e.path,profileUrl:c.url,accessPolicyResource:e.accessPolicyResource})},[c,i,e.path,e.accessPolicyResource]);if(Rn(n))return null;if(!c)return s.jsxs("div",{children:[r," not implemented"]});if(typeof n=="object"&&"name"in n&&Object.keys(n).length===1&&typeof n.name=="string")return s.jsx("div",{children:n.name});const f=u??i;return cm(ln.Provider,u,s.jsx(Db,{compact:e.compact,children:Object.entries(f.elements).map(([h,m])=>{var j;if($A.includes(h)&&Rn((j=m.slicing)==null?void 0:j.slices))return null;if(oW.includes(h))return null;if(fA.includes(h)&&m.path.split(".").length===2||h.includes("."))return null;const[g,y]=lm(t,h,f.profileUrl);if((e.ignoreMissingValues||m.max===0)&&Rn(g)||e.path.endsWith(".extension")&&(h==="url"||h==="id"))return null;const b=m.max>1||m.isArray,S=s.jsx(Mi,{property:m,propertyType:y,path:e.path+"."+h,value:g,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:b,link:e.link},h);return b?S:s.jsx(Ua,{term:Hs(h),children:S},h)})}))}const sW="_dimmed_11me5_1",lW="_preserveBreaks_11me5_5",Yy={dimmed:sW,preserveBreaks:lW},zA="Read Only";function UA(e,t){return e?s.jsx(nl.Floating,{label:e,children:t}):t}function BA(e){const{debugMode:t}=v.useContext(ln);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,UA(e!=null&&e.readonly?zA:void 0,s.jsxs(je,{wrap:"nowrap","data-testid":e.testId,children:[s.jsx("div",{children:e.children}),s.jsx("div",{children:s.jsx(pn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e!=null&&e.readonly?Yy.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function Lt(e){const{debugMode:t}=v.useContext(ln);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,UA(e!=null&&e.readonly?zA:void 0,s.jsx(pn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:zt({[Yy.dimmed]:e==null?void 0:e.readonly},Yy.preserveBreaks)},description:e.description,withAsterisk:e.withAsterisk,error:Nt(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function cW(e,t,n,r,i){const o=r.type;if(o.length>1)for(const c of o){const u=t.replace("[x]",Ln(c.code));u in e&&delete e[u]}return Rn(i)?e[n]=void 0:e[n]=i,e}function uW(e){return!!e&&!Rn(e.url)&&!Rn(e.name)}function dW(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:i,path:o,valuePath:c,...u}=e,[f,h]=v.useState(t);function m(g){const y=hW(g);h(y),n&&n(y)}return s.jsx(om,{defaultValue:f&&fW(f),onChange:m,withHelpText:r??!0,...u})}function fW(e){var t;return(t=e.coding)==null?void 0:t.map(n=>({system:n.system,code:n.code,display:n.display}))}function hW(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function pW(e){var h,m;const{defaultValue:t,onChange:n,withHelpText:r,response:i,...o}=e,[c,u]=v.useState(((m=(h=i==null?void 0:i.answer)==null?void 0:h[0])==null?void 0:m.valueCoding)??t);function f(g){const y=g[0],b=y&&gW(y);u(b),n&&n(b)}return s.jsx(om,{defaultValue:c?mW(c):void 0,maxValues:1,onChange:f,withHelpText:r??!0,...o})}function mW(e){return{system:e.system,code:e.code,display:e.display}}function gW(e){return{system:e.system,code:e.code,display:e.display}}function VA(e){const{path:t,outcome:n}=e,{elementsByPath:r,getExtendedProps:i}=v.useContext(ln),[o,c]=v.useState(e.defaultValue),u=v.useRef(o);u.current=o;const[f,h,m]=v.useMemo(()=>["system","use","value"].map(E=>r[t+"."+E]),[r,t]),[g,y,b]=v.useMemo(()=>["system","use","value"].map(E=>i(t+"."+E)),[i,t]);function S(E){E&&Object.keys(E).length===0&&(E=void 0),c(E),e.onChange&&e.onChange(E)}function j(E){const R={...u.current,system:E};E||delete R.system,S(R)}function C(E){const R={...u.current,use:E};E||delete R.use,S(R)}function T(E){const R={...u.current,value:E};E||delete R.value,S(R)}const _=e.valuePath??t;return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(sn,{disabled:e.disabled||(g==null?void 0:g.readonly),"data-testid":"system",defaultValue:o==null?void 0:o.system,required:((f==null?void 0:f.min)??0)>0,onChange:E=>j(E.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:Nt(n,_+".system")}),s.jsx(sn,{disabled:e.disabled||(y==null?void 0:y.readonly),"data-testid":"use",defaultValue:o==null?void 0:o.use,required:((h==null?void 0:h.min)??0)>0,onChange:E=>C(E.currentTarget.value),data:["","home","work","temp","old","mobile"],error:Nt(n,_+".use")}),s.jsx($e,{disabled:e.disabled||(b==null?void 0:b.readonly),placeholder:"Value",defaultValue:o==null?void 0:o.value,required:((m==null?void 0:m.min)??0)>0,onChange:E=>T(E.currentTarget.value),error:Nt(n,_+".value")})]})}function vW(e){var m;const[t,n]=v.useState(e.defaultValue),r=v.useRef(t);r.current=t;const{getExtendedProps:i}=v.useContext(ln),[o,c]=v.useMemo(()=>["name","telecom"].map(g=>i(e.path+"."+g)),[i,e.path]);function u(g){n(g),e.onChange&&e.onChange(g)}function f(g){const y={...r.current,name:g};g||delete y.name,u(y)}function h(g){const y={...r.current,telecom:g&&[g]};g||delete y.telecom,u(y)}return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx($e,{disabled:e.disabled||(o==null?void 0:o.readonly),"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t==null?void 0:t.name,onChange:g=>f(g.currentTarget.value)}),s.jsx(VA,{disabled:e.disabled||(c==null?void 0:c.readonly),name:e.name+"-telecom",path:e.path+".telecom",defaultValue:(m=t==null?void 0:t.telecom)==null?void 0:m[0],onChange:h,outcome:e.outcome})]})}function yW(e){if(!e)return"";const t=new Date(e);return Xp(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function Pb(e){if(!e)return"";const t=new Date(e);return Xp(t)?t.toISOString():""}function aa(e){return s.jsx($e,{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:xW(),step:1,defaultValue:yW(e.defaultValue),autoFocus:e.autoFocus,error:Nt(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(Pb(n))}}})}function xW(){return"datetime-local"}function bW(e){const{propertyType:t}=e,n=Ae(),r=v.useMemo(()=>{if(Tn(t.profile))return t.profile[0]},[t]),[i,o]=v.useState(r!==void 0);return v.useEffect(()=>{r&&(o(!0),n.requestProfileSchema(r).then(()=>o(!1)).catch(c=>{o(!1),console.warn(c)}))},[n,r]),r&&(i||!eb(r))?s.jsx("div",{children:"Loading..."}):s.jsx(Lb,{profileUrl:r,path:e.path,typeName:"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function SW(e){var _,E,R;const{outcome:t,path:n}=e,[r,i]=v.useState(e.defaultValue),{getExtendedProps:o}=v.useContext(ln),[c,u,f,h,m]=v.useMemo(()=>["use","prefix","given","family","suffix"].map(D=>o(e.path+"."+D)),[o,e.path]);function g(D){i(D),e.onChange&&e.onChange(D)}function y(D){g({...r,use:D||void 0})}function b(D){g({...r,prefix:D?D.split(" "):void 0})}function S(D){g({...r,given:D?D.split(" "):void 0})}function j(D){g({...r,family:D||void 0})}function C(D){g({...r,suffix:D?D.split(" "):void 0})}const T=e.valuePath??n;return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(sn,{disabled:e.disabled||(c==null?void 0:c.readonly),defaultValue:r==null?void 0:r.use,name:e.name+"-use","data-testid":"use",onChange:D=>y(D.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:Nt(t,T+".use")}),s.jsx($e,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(_=r==null?void 0:r.prefix)==null?void 0:_.join(" "),onChange:D=>b(D.currentTarget.value),error:Nt(t,T+".prefix")}),s.jsx($e,{disabled:e.disabled||(f==null?void 0:f.readonly),placeholder:"Given",name:e.name+"-given",defaultValue:(E=r==null?void 0:r.given)==null?void 0:E.join(" "),onChange:D=>S(D.currentTarget.value),error:Nt(t,T+".given")}),s.jsx($e,{disabled:e.disabled||(h==null?void 0:h.readonly),name:e.name+"-family",placeholder:"Family",defaultValue:r==null?void 0:r.family,onChange:D=>j(D.currentTarget.value),error:Nt(t,T+".family")}),s.jsx($e,{disabled:e.disabled||(m==null?void 0:m.readonly),placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(R=r==null?void 0:r.suffix)==null?void 0:R.join(" "),onChange:D=>C(D.currentTarget.value),error:Nt(t,T+".suffix")})]})}function wW(e){const[t,n]=v.useState(e.defaultValue),{elementsByPath:r,getExtendedProps:i}=v.useContext(ln),[o,c]=v.useMemo(()=>["system","value"].map(g=>r[e.path+"."+g]),[r,e.path]),[u,f]=v.useMemo(()=>["system","value"].map(g=>i(e.path+"."+g)),[i,e.path]);function h(g){n(g),e.onChange&&e.onChange(g)}const m=e.valuePath??e.path;return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx($e,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"System",required:((o==null?void 0:o.min)??0)>0,defaultValue:t==null?void 0:t.system,onChange:g=>h({...t,system:g.currentTarget.value}),error:Nt(e.outcome,m+".system")}),s.jsx($e,{disabled:e.disabled||(f==null?void 0:f.readonly),placeholder:"Value",required:((c==null?void 0:c.min)??0)>0,defaultValue:t==null?void 0:t.value,onChange:g=>h({...t,value:g.currentTarget.value}),error:Nt(e.outcome,m+".value")})]})}const jW=["USD","EUR","CAD","GBP","AUD"];function CW(e){var g;const{onChange:t}=e,[n,r]=v.useState(e.defaultValue),{getExtendedProps:i}=v.useContext(ln),[o,c]=v.useMemo(()=>["currency","value"].map(y=>i(e.path+"."+y)),[i,e.path]),u=v.useCallback(y=>{r(y),t&&t(y)},[t]),f=v.useCallback(y=>{u({...n,currency:y.currentTarget.value})},[n,u]),h=v.useCallback(y=>{u({...n,value:y.currentTarget.valueAsNumber})},[n,u]),m=s.jsx(sn,{disabled:e.disabled||(o==null?void 0:o.readonly),defaultValue:n==null?void 0:n.currency,data:jW,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:f});return s.jsx($e,{disabled:e.disabled||(c==null?void 0:c.readonly),type:"number",name:e.name,label:e.label,placeholder:e.placeholder??"Value",defaultValue:((g=n==null?void 0:n.value)==null?void 0:g.toString())??"USD",leftSection:s.jsx(uH,{size:14}),rightSection:m,rightSectionWidth:92,onChange:h})}function EW(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(ln),[i,o]=v.useMemo(()=>["start","end"].map(u=>r(e.path+"."+u)),[r,e.path]);function c(u){n(u),e.onChange&&e.onChange(u)}return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(aa,{disabled:e.disabled||(i==null?void 0:i.readonly),name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:u=>c({...t,start:u})}),s.jsx(aa,{disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:u=>c({...t,end:u})})]})}function Ws(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(ln),[i,o,c]=v.useMemo(()=>["comparator","value","unit"].map(f=>r(e.path+"."+f)),[r,e.path]);function u(f){n(f),e.onChange&&e.onChange(f)}return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(sn,{disabled:e.disabled||(i==null?void 0:i.readonly),style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t==null?void 0:t.comparator,data:["","<","<=",">=",">"],onChange:f=>u({...t,comparator:f.currentTarget.value})}),s.jsx($e,{disabled:e.disabled||(o==null?void 0:o.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:f=>{e.disableWheel&&f.currentTarget.blur()},onChange:f=>{u({...t,value:TW(f.currentTarget.value)})}}),s.jsx($e,{disabled:e.disabled||(c==null?void 0:c.readonly),placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:f=>u({...t,unit:f.currentTarget.value})})]})}function TW(e){if(e)return parseFloat(e)}function Nb(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(ln),[i,o]=v.useMemo(()=>["low","high"].map(u=>r(e.path+"."+u)),[r,e.path]);function c(u){n(u),e.onChange&&e.onChange(u)}return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Ws,{path:e.path+".low",disabled:e.disabled||(i==null?void 0:i.readonly),name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:u=>c({...t,low:u})}),s.jsx(Ws,{path:e.path+".high",disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:u=>c({...t,high:u})})]})}function RW(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(ln),[i,o]=v.useMemo(()=>["numerator","denominator"].map(u=>r(e.path+"."+u)),[r,e.path]);function c(u){n(u),e.onChange&&e.onChange(u)}return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Ws,{path:e.path+".numerator",disabled:e.disabled||(i==null?void 0:i.readonly),name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:u=>c({...t,numerator:u})}),s.jsx(Ws,{path:e.path+".denominator",disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:u=>c({...t,denominator:u})})]})}const _W={Device:"device-name",Observation:"code",Subscription:"criteria",User:"email:contains"},DW=["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 AW(e){return{value:Mt(e)??"",label:qa(e),resource:e}}function ol(e){const t=Ae(),{resourceType:n,searchCriteria:r}=e,[i,o]=v.useState(),c=Wt(e.defaultValue,o),u=e.itemComponent??kW,f=e.onChange,h=v.useCallback(async(g,y)=>{const b=PW(n),S=new URLSearchParams({[b]:g??"",_count:"10",...r});return await t.searchResources(n,S,{signal:y})},[t,n,r]),m=v.useCallback(g=>{f&&f(g[0])},[f]);return Tn(e.defaultValue)&&!i&&!c?null:s.jsx(Tb,{disabled:e.disabled,name:e.name,label:e.label,error:e.error,required:e.required,itemComponent:u,defaultValue:c,placeholder:e.placeholder,maxValues:1,toOption:AW,loadOptions:h,onChange:m,clearable:!0})}const kW=v.forwardRef(({label:e,resource:t,active:n,...r},i)=>s.jsx("div",{ref:i,...r,children:s.jsxs(je,{wrap:"nowrap",children:[s.jsx(Zo,{value:t}),s.jsxs("div",{children:[s.jsx(_e,{children:e}),s.jsx(_e,{size:"xs",c:"dimmed",children:t.birthDate||t.id})]})]})}));function PW(e){return _W[e]??(DW.includes(e)?"name":"_id")}function kd(e){const{onChange:t}=e,n=Ae(),[r,i]=v.useState(e.defaultValue),[o,c]=v.useState(()=>NW(e.targetTypes)),[u,f]=v.useState(()=>OW(e.defaultValue,o)),h=v.useRef(new sD),m=v.useMemo(()=>(u==null?void 0:u.type)==="profile"?{...e.searchCriteria,_profile:u.value}:e.searchCriteria,[e.searchCriteria,u]);v.useEffect(()=>{let b=!1;const S=o==null?void 0:o.map(j=>{if(!LW(j))return Promise.resolve(j);b=!0;const C=j.value,T=h.current.get(C);if(T)return T;const _=MW(n,j.value).then(R=>{const D={...j};return R?Tn(R.type)?(D.resourceType=R.type,D.name=R.name,D.title=R.title):(console.error(`StructureDefinition.type missing for ${j.value}`),D.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${j.value}`),D.error="StructureDefinition not found"),D}).catch(R=>(console.error(R),{...j,error:R})),E=new Ri(_);return h.current.set(C,E),E});!S||!b||Promise.all(S).then(j=>{if(c(j),!u)return;const C=j.findIndex(T=>T.value===u.value||T.resourceType===u.resourceType);if(C===-1){console.debug(`defaultValue had unexpected resourceType: ${u.resourceType}`);return}f(j[C])}).catch(console.error)},[n,u,o]);const g=v.useCallback(b=>{const S=b?tn(b):void 0;i(S),t&&t(S)},[t]),y=v.useMemo(()=>o?o.map(b=>({value:b.value,label:b.type==="profile"?b.title??b.name??b.resourceType??b.value:b.value})):[],[o]);return s.jsxs(s.Fragment,{children:[e.name&&s.jsx("input",{type:"hidden",name:e.name,value:(r==null?void 0:r.reference)??""}),s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[o&&o.length>1&&s.jsx(sn,{name:e.name+"-resourceType",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:b=>{const S=b.currentTarget.value,j=o.find(C=>C.value===S);f(j)},data:y}),!o&&s.jsx(_b,{disabled:e.disabled,autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:u==null?void 0:u.resourceType,onChange:b=>{f(b?{type:"resourceType",value:b,resourceType:b}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),s.jsx(ol,{resourceType:u==null?void 0:u.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:m,onChange:g,disabled:e.disabled})]})]})}function NW(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 OW(e,t){var r;const n=(r=e==null?void 0:e.reference)==null?void 0:r.split("/")[0];if(n){const i=t==null?void 0:t.find(o=>o.resourceType===n);return i||{type:"resourceType",value:n,resourceType:n}}if(t&&t.length>0)return t[0]}async function MW(e,t){const n=Oc(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
531
+ StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
532
+ type,
533
+ name,
534
+ title,
535
+ }
536
+ }`.replace(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function LW(e){return e.type==="profile"&&!(e!=null&&e.error)&&Rn(e.resourceType)}function IW(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}const $W="_indented_ldk1d_1",FA={indented:$W};function Ob({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?s.jsx(Pe,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:s.jsx(qh,{size:"1.25rem"}),onClick:t,children:r}):s.jsx(An,{title:r,color:"green.6","data-testid":n,onClick:t,children:s.jsx(qh,{size:"1.25rem"})})}function HA({propertyDisplayName:e,onClick:t,testId:n}){return s.jsx(An,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:s.jsx(Hh,{size:"1.25rem"})})}function zW(e){var b,S;const{slice:t,property:n}=e,[r,i]=v.useState(e.defaultValue),o=((b=t.typeSchema)==null?void 0:b.elements)??t.elements,c=v.useContext(ln),u=v.useMemo(()=>{var j;if(Tn(o))return bc({parentContext:c,elements:o,path:e.path,profileUrl:(j=t.typeSchema)==null?void 0:j.url})},[c,e.path,(S=t.typeSchema)==null?void 0:S.url,o]);function f(j){i(j),e.onChange&&e.onChange(j)}const h=t.min>0,m=Rn(t.elements),g=ID(t.name),y=e.property.readonly&&r.length===0;return cm(ln.Provider,u,s.jsx(Lt,{title:g,description:t.definition,withAsterisk:h,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:y?s.jsx(_e,{c:"dimmed",children:"(empty)"}):s.jsxs(qe,{className:m?FA.indented:void 0,children:[r.map((j,C)=>s.jsxs(je,{wrap:"nowrap",children:[s.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${C}`,children:s.jsx(Mb,{elementDefinitionType:t.type[0],name:t.name,defaultValue:j,onChange:T=>{const _=[...r];_[C]=T,f(_)},outcome:e.outcome,min:t.min,max:t.max,binding:t.binding,path:e.path,valuePath:void 0,readOnly:e.property.readonly})}),!e.property.readonly&&r.length>t.min&&s.jsx(HA,{propertyDisplayName:g,testId:e.testId&&`${e.testId}-remove-${C}`,onClick:T=>{hn(T);const _=[...r];_.splice(C,1),f(_)}})]},`${C}-${r.length}`)),!e.property.readonly&&r.length<t.max&&s.jsx(je,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(Ob,{propertyDisplayName:g,onClick:j=>{hn(j);const C=[...r,void 0];f(C)},testId:e.testId&&`${e.testId}-add`})})]})}))}function UW(e){var _;const{property:t}=e,n=Ae(),[r,i]=v.useState(!0),[o,c]=v.useState([]),[u]=v.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[f,h]=v.useState(()=>[u]),m=v.useContext(ln),g=(_=t.type[0])==null?void 0:_.code;v.useEffect(()=>{IA({medplum:n,property:t}).then(E=>{c(E);const R=LA(u,E,t.slicing,m.profileUrl);BW(R,E),h(R),i(!1)}).catch(E=>{console.error(E),i(!1)})},[n,t,u,m.profileUrl,h]);function y(E,R){const D=[...f];if(D[R]=E,h(D),e.onChange){const k=D.flat().filter(M=>M!==void 0);e.onChange(k)}}if(r)return s.jsx("div",{children:"Loading..."});const b=o.length,S=f[b],j=!(e.hideNonSliceValues??(g==="Extension"&&o.length>0)),C=Hs(t.path),T=e.property.readonly&&o.length===0&&u.length===0;return s.jsxs(qe,{className:e.indent?FA.indented:void 0,children:[T&&s.jsx(_e,{c:"dimmed",children:"(empty)"}),o.map((E,R)=>s.jsx(zW,{slice:E,path:e.path,valuePath:e.valuePath,property:t,defaultValue:f[R],onChange:D=>{y(D,R)},testId:`slice-${E.name}`},E.name)),j&&S.map((E,R)=>s.jsxs(je,{wrap:"nowrap",style:{flexGrow:1},children:[s.jsx("div",{style:{flexGrow:1},children:s.jsx(Pd,{arrayElement:!0,property:e.property,name:e.name+"."+R,path:e.path,valuePath:IW(e.path,e.valuePath,R),defaultValue:E,onChange:D=>{const k=[...S];k[R]=D,y(k,b)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&s.jsx(HA,{propertyDisplayName:C,testId:`nonsliced-remove-${R}`,onClick:D=>{hn(D);const k=[...S];k.splice(R,1),y(k,b)}})]},`${R}-${S.length}`)),!e.property.readonly&&j&&f.flat().length<t.max&&s.jsx(je,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(Ob,{propertyDisplayName:C,onClick:E=>{hn(E);const R=[...S];R.push(void 0),y(R,b)},testId:"nonsliced-add"})})]})}function BW(e,t){for(let n=0;n<t.length;n++){const r=t[n],i=e[n];for(;i.length<r.min;)i.push(void 0)}}function VW(e){const[t,n]=v.useState(!1),r=gR(),i=v.useRef(null),o={...e.styles};return t||(o.input||(o.input={}),o.input.WebkitTextSecurity="disc"),s.jsxs(Fo,{gap:"xs",children:[s.jsx(tl,{...e,styles:{...o,root:{...o.root??{},flexGrow:1}},ref:i,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),s.jsx(An,{title:"Copy secret",onClick:()=>{var c;r.copy((c=i.current)==null?void 0:c.value),Oe({color:"green",message:"Copied"})},children:s.jsx(hA,{})})]})}const FW=["sun","mon","tue","wed","thu","fri","sat"];function HW(e){const[t,n]=v.useState(e.defaultValue),[r,i]=v.useState(!e.disabled&&(e.defaultModalOpen??!1)),o=v.useRef(t);return o.current=t,s.jsxs(s.Fragment,{children:[s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx("span",{children:OD(o.current)||"No repeat"}),s.jsx(Pe,{disabled:e.disabled,onClick:()=>i(!0),children:"Edit"})]}),!e.disabled&&s.jsx(qW,{path:e.path,visible:r,defaultValue:o.current,onOk:c=>{e.onChange&&e.onChange(c),n(c),i(!1)},onCancel:()=>i(!1)})]})}const YE={repeat:{period:1,periodUnit:"d"}};function qW(e){const[t,n]=v.useState(e.defaultValue||YE),{getExtendedProps:r}=v.useContext(ln),[i,o,c,u,f]=v.useMemo(()=>["event","repeat","repeat.period","repeat.periodUnit","repeat.dayOfWeek"].map(j=>r(e.path+"."+j)),[r,e.path]),h=v.useRef(t);h.current=t;function m(j){n({...h.current,event:[j]})}function g(j){n({...h.current,repeat:j})}function y(j){var C;g({...(C=h.current)==null?void 0:C.repeat,period:j})}function b(j){var C;g({...(C=h.current)==null?void 0:C.repeat,periodUnit:j})}function S(j){var C;g({...(C=h.current)==null?void 0:C.repeat,dayOfWeek:j})}return s.jsx(Vn,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:s.jsxs(qe,{children:[s.jsx(Lt,{title:"Starts on",htmlFor:"timing-dialog-start",children:s.jsx(aa,{disabled:i==null?void 0:i.readonly,name:"timing-dialog-start",onChange:j=>m(j)})}),s.jsx(Sd,{disabled:o==null?void 0:o.readonly,label:"Repeat",checked:!!t.repeat,onChange:j=>g(j.currentTarget.checked?YE.repeat:void 0)}),t.repeat&&s.jsxs(s.Fragment,{children:[s.jsx(Lt,{title:"Repeat every",htmlFor:"timing-dialog-period",children:s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx($e,{disabled:c==null?void 0:c.readonly,type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:j=>y(parseInt(j.currentTarget.value,10)||1)}),s.jsx(sn,{disabled:u==null?void 0:u.readonly,id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:j=>b(j.currentTarget.value),data:[{label:"second",value:"s"},{label:"minute",value:"min"},{label:"hour",value:"h"},{label:"day",value:"d"},{label:"week",value:"wk"},{label:"month",value:"mo"},{label:"year",value:"a"}]})]})}),t.repeat.periodUnit==="wk"&&s.jsx(Lt,{title:"Repeat on",children:s.jsx(Ku.Group,{multiple:!0,onChange:S,children:s.jsx(je,{justify:"space-between",mt:"md",gap:"xs",children:FW.map(j=>s.jsx(Ku,{value:j,size:"xs",radius:"xl",disabled:f==null?void 0:f.readonly,children:j.charAt(0).toUpperCase()},j))})})})]}),s.jsx(je,{justify:"flex-end",children:s.jsx(Pe,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function Pd(e){var u;const{property:t,name:n,onChange:r,defaultValue:i}=e,o=e.defaultPropertyType&&e.defaultPropertyType!=="undefined"?e.defaultPropertyType:t.type[0].code,c=t.type;if((t.isArray||t.max>1)&&!e.arrayElement){if(o===ie.Attachment)return s.jsx(RG,{name:n,defaultValue:i,onChange:r,disabled:t.readonly});const f=((u=c[0])==null?void 0:u.code)!==ie.Extension;return s.jsx(UW,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:i,indent:f,onChange:r,outcome:e.outcome})}else return c.length>1?s.jsx(GW,{elementDefinitionTypes:c,...e}):s.jsx(Mb,{name:n,defaultValue:i,onChange:f=>{if(e.onChange){const h=e.name.replace("[x]",Ln(c[0].code));e.onChange(f,h)}},outcome:e.outcome,elementDefinitionType:c[0],min:t.min,max:t.min,binding:t.binding,path:e.path,valuePath:e.valuePath,readOnly:t.readonly})}function GW(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(o=>o.code===e.defaultPropertyType)),n||(n=t[0]);const[r,i]=v.useState(n);return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(sn,{disabled:e.property.readonly,style:{width:"200px"},defaultValue:r.code,"data-testid":e.name&&e.name+"-selector",onChange:o=>{i(t.find(c=>c.code===o.currentTarget.value))},data:t.map(o=>({value:o.code,label:o.code}))}),s.jsx(Mb,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:o=>{e.onChange&&e.onChange(o,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 Mb(e){const{name:t,onChange:n,outcome:r,binding:i,path:o,valuePath:c,readOnly:u}=e,f=e.min!==void 0&&e.min>0,h=e.elementDefinitionType.code,m=v.useContext(ln),g=v.useMemo(()=>{if(!ib(h)||!Rn(e.defaultValue))return e.defaultValue;const S=Object.create(null);if(m.path===e.path)PE(S,m.elements);else{const j=Ps(m.path,e.path);if(j===void 0)return e.defaultValue;PE(S,m.elements,j)}return Tn(S)?S:e.defaultValue},[h,m.path,m.elements,e.path,e.defaultValue]);if(!h)return s.jsx("div",{children:"Property type not specified "});function y(){return{name:t,defaultValue:g,onChange:n,outcome:r,path:o,valuePath:c,disabled:u}}function b(){const S=Nt(e.outcome,c??o);return{id:t,name:t,"data-testid":t,defaultValue:g,required:f,error:S,disabled:u}}switch(h){case ie.SystemString:case ie.canonical:case ie.string:case ie.time:case ie.uri:case ie.url:return e.path==="Project.secret.value[x]"?s.jsx(VW,{...b(),onChange:S=>{e.onChange&&e.onChange(S.currentTarget.value)}}):s.jsx($e,{...b(),onChange:S=>{n&&n(S.currentTarget.value)}});case ie.date:return s.jsx($e,{...b(),type:"date",onChange:S=>{n&&n(S.currentTarget.value)}});case ie.dateTime:case ie.instant:return s.jsx(aa,{...b(),onChange:n,outcome:r});case ie.decimal:case ie.integer:case ie.positiveInt:case ie.unsignedInt:return s.jsx($e,{...b(),type:"number",step:h===ie.decimal?"any":"1",onChange:S=>{if(n){const j=S.currentTarget.valueAsNumber;n(Number.isNaN(j)?void 0:j)}}});case ie.code:return s.jsx(CA,{...b(),error:void 0,onChange:n,binding:i==null?void 0:i.valueSet,creatable:!0,maxValues:1});case ie.boolean:return s.jsx(Un,{...b(),defaultChecked:!!g,onChange:S=>{n&&n(S.currentTarget.checked)}});case ie.base64Binary:case ie.markdown:return s.jsx(tl,{...b(),spellCheck:h!==ie.base64Binary,onChange:S=>{n&&n(S.currentTarget.value)}});case ie.Address:return s.jsx(CF,{...y()});case ie.Annotation:return s.jsx(EF,{...y()});case ie.Attachment:return s.jsx(EA,{...y()});case ie.CodeableConcept:return s.jsx(dW,{binding:i==null?void 0:i.valueSet,...y()});case ie.Coding:return s.jsx(pW,{binding:i==null?void 0:i.valueSet,...y()});case ie.ContactDetail:return s.jsx(vW,{...y()});case ie.ContactPoint:return s.jsx(VA,{...y()});case ie.Extension:return s.jsx(bW,{...y(),propertyType:e.elementDefinitionType});case ie.HumanName:return s.jsx(SW,{...y()});case ie.Identifier:return s.jsx(wW,{...y()});case ie.Money:return s.jsx(CW,{...y()});case ie.Period:return s.jsx(EW,{...y()});case ie.Duration:case ie.Quantity:return s.jsx(Ws,{...y()});case ie.Range:return s.jsx(Nb,{...y()});case ie.Ratio:return s.jsx(RW,{...y()});case ie.Reference:return s.jsx(kd,{...y(),targetTypes:QW(e.elementDefinitionType)});case ie.Timing:return s.jsx(HW,{...y()});case ie.Dosage:case ie.UsageContext:default:return s.jsx(Lb,{...y(),typeName:h})}}const WW=[`${$i}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function QW(e){var t;return(t=e==null?void 0:e.targetProfile)==null?void 0:t.map(n=>{const r=WW.find(i=>n.startsWith(i));return r?n.slice(r.length):n})}function YW(e){const[t,n]=v.useState(e.defaultValue??{}),r=v.useContext(ln),i=v.useMemo(()=>jF(r.elements),[r.elements]);function o(u){n(u),e.onChange&&e.onChange(u)}const c={type:e.type,value:t};return s.jsx(qe,{style:{flexGrow:1},"data-testid":e.testId,children:i.map(([u,f])=>{const[h,m]=JG(c,u,f),g=f.min!==void 0&&f.min>0,y=e.valuePath?e.valuePath+"."+u:void 0,b=s.jsx(Pd,{property:f,name:u,path:e.path+"."+u,valuePath:y,defaultValue:h,defaultPropertyType:m,onChange:(S,j)=>{o(cW({...t},u,j??u,f,S))},outcome:e.outcome},u);return e.type==="Extension"||bb.includes(u)?b:f.type.length===1&&f.type[0].code==="boolean"?s.jsx(BA,{title:Hs(u),description:f.description,htmlFor:u,fhirPath:f.path,withAsterisk:g,readonly:f.readonly,children:b},u):s.jsx(Lt,{title:Hs(u),description:f.description,withAsterisk:g,htmlFor:u,outcome:e.outcome,fhirPath:f.path,errorExpression:y,readonly:f.readonly,children:b},u)})})}function Lb(e){const[t]=v.useState(()=>e.defaultValue??{}),n=v.useContext(ln),r=e.profileUrl??(n==null?void 0:n.profileUrl),i=v.useMemo(()=>Qp(e.typeName,r),[e.typeName,r]),o=(i==null?void 0:i.type)??e.typeName,c=v.useMemo(()=>{if(i)return bc({parentContext:n,elements:i.elements,path:e.path,profileUrl:i.url,accessPolicyResource:e.accessPolicyResource})},[i,n,e.path,e.accessPolicyResource]);return i?cm(ln.Provider,c,s.jsx(YW,{path:e.path,valuePath:e.valuePath,type:o,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):s.jsxs("div",{children:[o," not implemented"]})}const XW="_noteCite_10swh_5",KW="_noteRoot_10swh_10",XE={noteCite:XW,noteRoot:KW};function qA({value:e}){return e?s.jsx(qe,{justify:"flex-start",gap:"xs",children:e.map(t=>{var n;return t.text&&s.jsx(h0,{classNames:{cite:XE.noteCite,root:XE.noteRoot},cite:((n=t.authorReference)==null?void 0:n.display)||t.authorString,icon:null,children:t.text},`note-${t.text}`)})}):null}function Ic(e){const{value:t,link:n,...r}=e,[i,o]=v.useState(),c=Wt(t,o);let u;if(i&&!cD(i))u=`[${Ke(i)}]`;else if(c)u=qa(c);else return null;return n?s.jsx(gt,{to:t,...r,children:u}):s.jsx(_e,{component:"span",...r,children:u})}function cc(e){return s.jsxs(je,{gap:"xs",children:[s.jsx(Zo,{size:24,radius:12,value:e.value,link:e.link}),s.jsx(Ic,{value:e.value,link:e.link})]})}const ZW={draft:"blue",active:"blue","on-hold":"yellow",revoked:"red",completed:"green","entered-in-error":"red",unknown:"gray",retired:"gray",registered:"blue",preliminary:"blue",final:"green",amended:"yellow",corrected:"yellow",cancelled:"red",requested:"blue",received:"blue",accepted:"blue",rejected:"red",ready:"blue","in-progress":"blue",failed:"red",proposed:"blue",pending:"blue",booked:"blue",arrived:"blue",fulfilled:"green",noshow:"red","checked-in":"blue",waitlist:"gray",routine:"gray",urgent:"red",asap:"red",stat:"red","not-done":"red",connected:"green",disconnected:"red",finished:"green",planned:"gray"};function um(e){const{status:t,...n}=e;return s.jsx(Tp,{color:e.color||ZW[t],...n,children:t.replace(/-/g," ")})}const JW="_table_pe9td_1",eQ="_criticalRow_pe9td_12",GA={table:JW,criticalRow:eQ};Ib.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1,hideSubject:!1};function Ib(e){var c;const t=Ae(),n=Wt(e.value),[r,i]=v.useState();if(v.useEffect(()=>{n!=null&&n.specimen&&Promise.allSettled(n.specimen.map(u=>t.readReference(u))).then(u=>u.filter(f=>f.status==="fulfilled").map(f=>f.value)).then(i).catch(console.error)},[t,n]),!n)return null;const o=(r==null?void 0:r.flatMap(u=>u.note||[]))||[];if(n.presentedForm&&n.presentedForm.length>0){const u=n.presentedForm[0];(c=u.contentType)!=null&&c.startsWith("text/plain")&&u.data&&o.push({text:window.atob(u.data)})}return s.jsxs(qe,{children:[s.jsx(Ie,{children:"Diagnostic Report"}),s.jsx(tQ,{value:n,hideSubject:e.hideSubject}),r&&!e.hideSpecimenInfo&&nQ(r),n.result&&s.jsx(rQ,{hideObservationNotes:e.hideObservationNotes,value:n.result}),o.length>0&&s.jsx(qA,{value:o})]})}function tQ({value:e,hideSubject:t=!1}){var n,r;return s.jsxs(je,{mt:"md",gap:30,children:[e.subject&&!t&&s.jsxs("div",{children:[s.jsx(_e,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),s.jsx(cc,{value:e.subject,link:!0})]}),(n=e.resultsInterpreter)==null?void 0:n.map(i=>s.jsxs("div",{children:[s.jsx(_e,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),s.jsx(cc,{value:i,link:!0})]},i.reference)),(r=e.performer)==null?void 0:r.map(i=>s.jsxs("div",{children:[s.jsx(_e,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),s.jsx(cc,{value:i,link:!0})]},i.reference)),e.issued&&s.jsxs("div",{children:[s.jsx(_e,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),s.jsx(_e,{children:gr(e.issued)})]}),e.status&&s.jsxs("div",{children:[s.jsx(_e,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),s.jsx(um,{status:e.status})]})]})}function nQ(e){return s.jsxs(qe,{gap:"xs",children:[s.jsx(Ie,{order:2,size:"h6",children:"Specimens"}),s.jsx(mr,{type:"ordered",children:e==null?void 0:e.map(t=>{var n;return s.jsx(mr.Item,{ml:"sm",children:s.jsxs(je,{gap:20,children:[s.jsxs(je,{gap:5,children:[s.jsx(_e,{fw:500,children:"Collected:"})," ",gr((n=t.collection)==null?void 0:n.collectedDateTime)]}),s.jsxs(je,{gap:5,children:[s.jsx(_e,{fw:500,children:"Received:"})," ",gr(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function rQ(e){return s.jsxs("table",{className:GA.table,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Test"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Reference Range"}),s.jsx("th",{children:"Interpretation"}),s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Performer"}),s.jsx("th",{children:"Status"})]})}),s.jsx("tbody",{children:s.jsx(WA,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function WA(e){var t;return s.jsx(s.Fragment,{children:(t=e.value)==null?void 0:t.map(n=>s.jsx(iQ,{value:n,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${no(n)?n.reference:n.id}`))})}function iQ(e){var i,o;const t=Wt(e.value);if(!t||(i=e.ancestorIds)!=null&&i.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=sQ(t);return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:zt({[GA.criticalRow]:r}),children:[s.jsx("td",{rowSpan:n?2:1,children:s.jsx(gt,{to:t,children:s.jsx(ia,{value:t.code})})}),s.jsx("td",{children:s.jsx(aQ,{value:t})}),s.jsx("td",{children:s.jsx(oQ,{value:t.referenceRange})}),s.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&s.jsx(ia,{value:t.interpretation[0]})}),s.jsx("td",{children:t.category&&t.category.length>0&&s.jsx(s.Fragment,{children:t.category.map(c=>s.jsx("div",{children:s.jsx(ia,{value:c})},`category-${Ho(c)}`))})}),s.jsx("td",{children:(o=t.performer)==null?void 0:o.map(c=>s.jsx(Qy,{value:c},c.reference))}),s.jsx("td",{children:t.status&&s.jsx(um,{status:t.status})})]}),t.hasMember&&s.jsx(WA,{value:t.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,t.id]:[t.id],hideObservationNotes:e.hideObservationNotes}),n&&s.jsx("tr",{children:s.jsx("td",{colSpan:6,children:s.jsx(qA,{value:t.note})})})]})}function aQ(e){const t=e.value;return s.jsx(s.Fragment,{children:MD(t)})}function oQ(e){const t=e.value&&e.value.length>0&&e.value[0];return t?t.text?s.jsx(s.Fragment,{children:t.text}):s.jsx(kb,{value:t}):null}function sQ(e){var n,r,i,o;const t=(o=(i=(r=(n=e.interpretation)==null?void 0:n[0])==null?void 0:r.coding)==null?void 0:i[0])==null?void 0:o.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}var ey={},La={},KE;function QA(){if(KE)return La;KE=1,Object.defineProperty(La,"__esModule",{value:!0}),La.Pointer=La.escapeToken=La.unescapeToken=void 0;function e(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}La.unescapeToken=e;function t(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}La.escapeToken=t;var n=function(){function r(i){i===void 0&&(i=[""]),this.tokens=i}return r.fromJSON=function(i){var o=i.split("/").map(e);if(o[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(i));return new r(o)},r.prototype.toString=function(){return this.tokens.map(t).join("/")},r.prototype.evaluate=function(i){for(var o=null,c="",u=i,f=1,h=this.tokens.length;f<h;f++)o=u,c=this.tokens[f],!(c=="__proto__"||c=="constructor"||c=="prototype")&&(u=(o||{})[c]);return{parent:o,key:c,value:u}},r.prototype.get=function(i){return this.evaluate(i).value},r.prototype.set=function(i,o){var c=this.evaluate(i);c.parent&&(c.parent[c.key]=o)},r.prototype.push=function(i){this.tokens.push(i)},r.prototype.add=function(i){var o=this.tokens.concat(String(i));return new r(o)},r}();return La.Pointer=n,La}var gn={},ty={},ZE;function YA(){return ZE||(ZE=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.clone=e.objectType=e.hasOwnProperty=void 0,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(i){return i===void 0?"undefined":i===null?"null":Array.isArray(i)?"array":typeof i}e.objectType=t;function n(i){return i!=null&&typeof i=="object"}function r(i){if(!n(i))return i;if(i.constructor==Array){for(var o=i.length,c=new Array(o),u=0;u<o;u++)c[u]=r(i[u]);return c}if(i.constructor==Date){var f=new Date(+i);return f}var h={};for(var m in i)e.hasOwnProperty.call(i,m)&&(h[m]=r(i[m]));return h}e.clone=r}(ty)),ty}var hr={},JE;function XA(){if(JE)return hr;JE=1,Object.defineProperty(hr,"__esModule",{value:!0}),hr.diffAny=hr.diffObjects=hr.diffArrays=hr.intersection=hr.subtract=hr.isDestructive=void 0;var e=YA();function t(m){var g=m.op;return g==="remove"||g==="replace"||g==="copy"||g==="move"}hr.isDestructive=t;function n(m,g){var y={};for(var b in m)e.hasOwnProperty.call(m,b)&&m[b]!==void 0&&(y[b]=1);for(var S in g)e.hasOwnProperty.call(g,S)&&g[S]!==void 0&&delete y[S];return Object.keys(y)}hr.subtract=n;function r(m){for(var g=m.length,y={},b=0;b<g;b++){var S=m[b];for(var j in S)e.hasOwnProperty.call(S,j)&&S[j]!==void 0&&(y[j]=(y[j]||0)+1)}for(var j in y)y[j]<g&&delete y[j];return Object.keys(y)}hr.intersection=r;function i(m){return m.op==="add"}function o(m){return m.op==="remove"}function c(m,g){return{operations:m.operations.concat(g),cost:m.cost+1}}function u(m,g,y,b){b===void 0&&(b=h);var S={"0,0":{operations:[],cost:0}};function j(R,D){var k="".concat(R,",").concat(D),M=S[k];if(M===void 0){if(R>0&&D>0&&!b(m[R-1],g[D-1],y.add(String(R-1))).length)M=j(R-1,D-1);else{var L=[];if(R>0){var z=j(R-1,D),F={op:"remove",index:R-1};L.push(c(z,F))}if(D>0){var Y=j(R,D-1),W={op:"add",index:R-1,value:g[D-1]};L.push(c(Y,W))}if(R>0&&D>0){var J=j(R-1,D-1),G={op:"replace",index:R-1,original:m[R-1],value:g[D-1]};L.push(c(J,G))}var X=L.sort(function(P,I){return P.cost-I.cost})[0];M=X}S[k]=M}return M}var C=isNaN(m.length)||m.length<=0?0:m.length,T=isNaN(g.length)||g.length<=0?0:g.length,_=j(C,T).operations,E=_.reduce(function(R,D){var k=R[0],M=R[1];if(i(D)){var L=D.index+1+M,z=L<C+M?String(L):"-",F={op:D.op,path:y.add(z).toString(),value:D.value};return[k.concat(F),M+1]}else if(o(D)){var F={op:D.op,path:y.add(String(D.index+M)).toString()};return[k.concat(F),M-1]}else{var Y=y.add(String(D.index+M)),W=b(D.original,D.value,Y);return[k.concat.apply(k,W),M]}},[[],0])[0];return E}hr.diffArrays=u;function f(m,g,y,b){b===void 0&&(b=h);var S=[];return n(m,g).forEach(function(j){S.push({op:"remove",path:y.add(j).toString()})}),n(g,m).forEach(function(j){S.push({op:"add",path:y.add(j).toString(),value:g[j]})}),r([m,g]).forEach(function(j){S.push.apply(S,b(m[j],g[j],y.add(j)))}),S}hr.diffObjects=f;function h(m,g,y,b){if(b===void 0&&(b=h),m===g)return[];var S=(0,e.objectType)(m),j=(0,e.objectType)(g);return S=="array"&&j=="array"?u(m,g,y,b):S=="object"&&j=="object"?f(m,g,y,b):[{op:"replace",path:y.toString(),value:g}]}return hr.diffAny=h,hr}var eT;function lQ(){if(eT)return gn;eT=1;var e=gn&&gn.__extends||function(){var C=function(T,_){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,R){E.__proto__=R}||function(E,R){for(var D in R)Object.prototype.hasOwnProperty.call(R,D)&&(E[D]=R[D])},C(T,_)};return function(T,_){if(typeof _!="function"&&_!==null)throw new TypeError("Class extends value "+String(_)+" is not a constructor or null");C(T,_);function E(){this.constructor=T}T.prototype=_===null?Object.create(_):(E.prototype=_.prototype,new E)}}();Object.defineProperty(gn,"__esModule",{value:!0}),gn.apply=gn.InvalidOperationError=gn.test=gn.copy=gn.move=gn.replace=gn.remove=gn.add=gn.TestError=gn.MissingError=void 0;var t=QA(),n=YA(),r=XA(),i=function(C){e(T,C);function T(_){var E=C.call(this,"Value required at path: ".concat(_))||this;return E.path=_,E.name="MissingError",E}return T}(Error);gn.MissingError=i;var o=function(C){e(T,C);function T(_,E){var R=C.call(this,"Test failed: ".concat(_," != ").concat(E))||this;return R.actual=_,R.expected=E,R.name="TestError",R}return T}(Error);gn.TestError=o;function c(C,T,_){if(Array.isArray(C))if(T=="-")C.push(_);else{var E=parseInt(T,10);C.splice(E,0,_)}else C[T]=_}function u(C,T){if(Array.isArray(C)){var _=parseInt(T,10);C.splice(_,1)}else delete C[T]}function f(C,T){var _=t.Pointer.fromJSON(T.path).evaluate(C);return _.parent===void 0?new i(T.path):(c(_.parent,_.key,(0,n.clone)(T.value)),null)}gn.add=f;function h(C,T){var _=t.Pointer.fromJSON(T.path).evaluate(C);return _.value===void 0?new i(T.path):(u(_.parent,_.key),null)}gn.remove=h;function m(C,T){var _=t.Pointer.fromJSON(T.path).evaluate(C);if(_.parent===null)return new i(T.path);if(Array.isArray(_.parent)){if(parseInt(_.key,10)>=_.parent.length)return new i(T.path)}else if(_.value===void 0)return new i(T.path);return _.parent[_.key]=(0,n.clone)(T.value),null}gn.replace=m;function g(C,T){var _=t.Pointer.fromJSON(T.from).evaluate(C);if(_.value===void 0)return new i(T.from);var E=t.Pointer.fromJSON(T.path).evaluate(C);return E.parent===void 0?new i(T.path):(u(_.parent,_.key),c(E.parent,E.key,_.value),null)}gn.move=g;function y(C,T){var _=t.Pointer.fromJSON(T.from).evaluate(C);if(_.value===void 0)return new i(T.from);var E=t.Pointer.fromJSON(T.path).evaluate(C);return E.parent===void 0?new i(T.path):(c(E.parent,E.key,(0,n.clone)(_.value)),null)}gn.copy=y;function b(C,T){var _=t.Pointer.fromJSON(T.path).evaluate(C);return(0,r.diffAny)(_.value,T.value,new t.Pointer).length?new o(_.value,T.value):null}gn.test=b;var S=function(C){e(T,C);function T(_){var E=C.call(this,"Invalid operation: ".concat(_.op))||this;return E.operation=_,E.name="InvalidOperationError",E}return T}(Error);gn.InvalidOperationError=S;function j(C,T){switch(T.op){case"add":return f(C,T);case"remove":return h(C,T);case"replace":return m(C,T);case"move":return g(C,T);case"copy":return y(C,T);case"test":return b(C,T)}return new S(T)}return gn.apply=j,gn}var tT;function cQ(){return tT||(tT=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=QA();Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=lQ(),r=XA();function i(h,m){return m.map(function(g){return(0,n.apply)(h,g)})}e.applyPatch=i;function o(h){function m(g,y,b){var S=h(g,y,b);return Array.isArray(S)?S:(0,r.diffAny)(g,y,b,m)}return m}function c(h,m,g){var y=new t.Pointer;return(g?o(g):r.diffAny)(h,m,y)}e.createPatch=c;function u(h,m){var g=t.Pointer.fromJSON(m).evaluate(h);if(g!==void 0)return{op:"test",path:m,value:g.value}}function f(h,m){var g=new Array;return m.filter(r.isDestructive).forEach(function(y){var b=u(h,y.path);if(b&&g.push(b),"from"in y){var S=u(h,y.from);S&&g.push(S)}}),g}e.createTests=f}(ey)),ey}var KA=cQ();const uQ="_removed_el5zk_1",dQ="_added_el5zk_6",nT={removed:uQ,added:dQ};function fQ(e){var m;const{name:t,path:n,property:r,originalValue:i,revisedValue:o}=e,c=!!((m=r==null?void 0:r.type)!=null&&m.find(g=>g.code==="Attachment")),[u,f]=v.useState(c),h=()=>f(g=>!g);return s.jsx(s.Fragment,{children:c&&!u||!c?s.jsx(s.Fragment,{children:s.jsxs(ye.Tr,{children:[s.jsx(ye.Td,{children:t}),s.jsx(ye.Td,{className:nT.removed,children:i&&s.jsx(Mi,{path:n,property:r,propertyType:i.type,value:i.value,ignoreMissingValues:!0})}),s.jsx(ye.Td,{className:nT.added,children:o&&s.jsx(Mi,{path:n,property:r,propertyType:o.type,value:o.value,ignoreMissingValues:!0})})]})}):s.jsxs(ye.Tr,{children:[s.jsx(ye.Td,{children:t}),s.jsx(ye.Td,{colSpan:2,style:{textAlign:"right"},children:s.jsx(Pe,{onClick:h,variant:"light",children:"Expand"})})]})})}const hQ="_root_15xvr_1",pQ={root:hQ};function mQ(e){const t=Ae(),{original:n,revised:r}=e,[i,o]=v.useState(!1);v.useEffect(()=>{t.requestSchema(e.original.resourceType).then(()=>o(!0)).catch(console.log)},[t,e.original.resourceType]);const c=v.useMemo(()=>{if(!i)return null;const u=[Gr(n)],f=[Gr(r)],h=[],m=gQ(KA.createPatch(n,r));for(const g of m){const y=g.path,b=vQ(y),S=yQ(n.resourceType,b),j=g.op==="add"?void 0:qo(b,u),C=g.op==="remove"?void 0:qo(b,f);h.push({key:`op-${g.op}-${g.path}`,name:`${Ln(g.op)} ${b}`,path:(S==null?void 0:S.path)??n.resourceType+"."+b,property:S,originalValue:rT(S,j),revisedValue:rT(S,C)})}return h},[i,n,r]);return c?s.jsxs(ye,{className:pQ.root,children:[s.jsx(ye.Thead,{children:s.jsxs(ye.Tr,{children:[s.jsx(ye.Th,{}),s.jsx(ye.Th,{children:"Before"}),s.jsx(ye.Th,{children:"After"})]})}),s.jsx(ye.Tbody,{children:c.map(u=>{const{key:f,...h}=u;return s.jsx(fQ,{...h},f)})})]}):null}function gQ(e){const t=[];for(const n of e){const{op:r,path:i}=n;if(i.startsWith("/meta/author")||i.startsWith("/meta/compartment")||i.startsWith("/meta/lastUpdated")||i.startsWith("/meta/versionId"))continue;const o=e.filter(u=>u.op===r&&u.path===i).length,c={op:r,path:i};o>1&&(r==="add"||r==="remove")&&/\/[0-9-]+$/.test(i)&&(c.op="replace",c.path=i.replace(/\/[^/]+$/,"")),t.some(u=>u.op===c.op&&u.path===c.path)||t.push(c)}return t}function vQ(e){const t=e.split("/").filter(Boolean);let n="";for(let r=0;r<t.length;r++){const i=t[r];i==="-"?n+=".last()":/^\d+$/.test(i)?n+=`[${i}]`:(r>0&&(n+="."),n+=i)}return n.endsWith(".url")&&(n=n.replace(/\.url$/,"")),n}function yQ(e,t){var r;const n=tm(e,{code:e+"."+t,expression:e+"."+t});return(r=n==null?void 0:n.elementDefinitions)==null?void 0:r[0]}function rT(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:xQ(t,!!(e!=null&&e.isArray))}}function xQ(e,t){const n=uU(e).flatMap(r=>r.value);return t?n:n[0]}function $b(e){const{profileUrl:t}=e,n=Ae(),r=n.getAccessPolicy(),i=Wt(e.value),[o,c]=v.useState(!1);v.useEffect(()=>{if(i)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{Oc(t)?c(!0):console.error(`Schema not found for ${t}`)}).catch(f=>{console.error("Error in requestProfileSchema",f)});else{const f=i.resourceType;n.requestSchema(f).then(()=>{c(!0)}).catch(console.error)}},[n,t,i]);const u=v.useMemo(()=>i&&VD(i,Os.READ,r),[r,i]);return!o||!i?null:s.jsx(Gh,{path:i.resourceType,value:{type:i.resourceType,value:e.forceUseInput?e.value:i},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:u})}const bQ="_item_5q6yx_1",SQ="_itemPadding_5q6yx_5",iT={item:bQ,itemPadding:SQ};function wQ(e){return s.jsx(Lc,{children:e.children})}function Qs(e){var f,h;const{resource:t,profile:n,padding:r,popupMenuItems:i,...o}=e,c=n??((f=t.meta)==null?void 0:f.author),u=e.dateTime??((h=t.meta)==null?void 0:h.lastUpdated);return s.jsxs(sm,{"data-testid":"timeline-item",fill:!0,...o,children:[s.jsxs(je,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[s.jsx(Zo,{value:c,link:!0,size:"md"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(_e,{size:"sm",children:s.jsx(Ic,{c:"dark",fw:500,value:c,link:!0})}),s.jsxs(_e,{size:"xs",children:[s.jsx(gt,{c:"dimmed",to:e.resource,children:gr(u)}),s.jsx(_e,{component:"span",c:"dimmed",mx:8,children:"·"}),s.jsx(gt,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),i&&s.jsxs(Ce,{position:"bottom-end",shadow:"md",width:200,children:[s.jsx(Ce.Target,{children:s.jsx(An,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${Mt(e.resource)}`,children:s.jsx(pH,{})})}),i]})]}),s.jsx(xA,{children:s.jsx("div",{className:zt(iT.item,{[iT.itemPadding]:r}),children:e.children})})]})}function ZA(e,t){e.sort((n,r)=>{const i=aT(n,t),o=aT(r,t);return i>o?1:i<o?-1:oT(n,t)-oT(r,t)})}function aT(e,t){if(!JA(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function oT(e,t){var r;if(!JA(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 JA(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const jQ="_pinnedComment_u08s5_1",CQ={pinnedComment:jQ};function dm(e){const t=Ae(),n=t.getProfile(),r=v.useRef(null),i=Wt(e.value),[o,c]=v.useState(),[u,f]=v.useState([]),h=e.loadTimelineResources,m=v.useRef(u);m.current=u;const g=v.useCallback(R=>{ZA(R,i),R.reverse(),f(R)},[i]),y=v.useCallback(R=>{const D=[];for(const k of R){if(k.status!=="fulfilled")continue;const M=k.value;if(M.type==="history"&&c(M),M.entry)for(const L of M.entry)D.push(L.resource)}g(D)},[g]),b=v.useCallback(R=>g([...m.current,R]),[g]),S=v.useCallback(()=>{var k;let R,D;"resourceType"in e.value?(R=e.value.resourceType,D=e.value.id):[R,D]=(k=e.value.reference)==null?void 0:k.split("/"),h(t,R,D).then(y).catch(console.error)},[t,e.value,h,y]);v.useEffect(()=>S(),[S]);function j(R){!i||!e.createCommunication||t.createResource(e.createCommunication(i,n,R)).then(D=>b(D)).catch(console.error)}function C(R){!i||!e.createMedia||t.createResource(e.createMedia(i,n,R)).then(D=>b(D)).then(()=>As({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:s.jsx(ro,{size:16}),autoClose:2e3})).catch(D=>As({id:"upload-notification",color:"red",title:"Upload error",message:Ke(D),icon:s.jsx(zE,{size:16}),autoClose:2e3}))}function T(){Oe({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function _(R){As({id:"upload-notification",loading:!0,title:"Uploading...",message:kQ(R),autoClose:!1,withCloseButton:!1})}function E(R){As({id:"upload-notification",color:"red",title:"Upload error",message:Ke(R),icon:s.jsx(zE,{size:16}),autoClose:2e3})}return i?s.jsxs(wQ,{children:[e.createCommunication&&s.jsx(sm,{children:s.jsx(mt,{testid:"timeline-form",onSubmit:R=>{j(R.text);const D=r.current;D&&(D.value="",D.focus())},children:s.jsxs(je,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[s.jsx(Zo,{value:n}),s.jsx($e,{name:"text",ref:r,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),s.jsx(An,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:s.jsx(IH,{size:16})}),s.jsx(Ab,{securityContext:tn(i),onUpload:C,onUploadStart:T,onUploadProgress:_,onUploadError:E,children:R=>s.jsx(An,{...R,radius:"xl",color:"blue",variant:"filled",children:s.jsx(wb,{size:16})})})]})})}),u.map(R=>{var M;if(!R)return null;const D=`${R.resourceType}/${R.id}/${(M=R.meta)==null?void 0:M.versionId}`,k=e.getMenu?e.getMenu({primaryResource:i,currentResource:R,reloadTimeline:S}):void 0;if(R.resourceType===i.resourceType&&R.id===i.id)return s.jsx(EQ,{history:o,resource:R,popupMenuItems:k},D);switch(R.resourceType){case"AuditEvent":return s.jsx(DQ,{resource:R,popupMenuItems:k},D);case"Communication":return s.jsx(RQ,{resource:R,popupMenuItems:k},D);case"DiagnosticReport":return s.jsx(AQ,{resource:R,popupMenuItems:k},D);case"Media":return s.jsx(_Q,{resource:R,popupMenuItems:k},D);default:return s.jsx(Qs,{resource:R,padding:!0,children:s.jsx($b,{value:R,ignoreMissingValues:!0})},D)}})]}):s.jsx(er,{style:{width:"100%",height:"100%"},children:s.jsx(Ar,{})})}function EQ(e){const{history:t,resource:n,...r}=e,i=TQ(t,n);return i?s.jsx(Qs,{resource:n,padding:!0,...r,children:s.jsx(mQ,{original:i,revised:e.resource})}):s.jsxs(Qs,{resource:n,padding:!0,...r,children:[s.jsx("h3",{children:"Created"}),s.jsx($b,{value:n,ignoreMissingValues:!0,forceUseInput:!0})]})}function TQ(e,t){const n=e.entry??[],r=n.findIndex(i=>{var o,c,u;return((c=(o=i.resource)==null?void 0:o.meta)==null?void 0:c.versionId)===((u=t.meta)==null?void 0:u.versionId)});if(!(r>=n.length-1))return n[r+1].resource}function RQ(e){var r,i;const n=!e.resource.priority||e.resource.priority==="routine"?void 0:CQ.pinnedComment;return s.jsx(Qs,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:e.popupMenuItems,children:s.jsx("p",{children:(i=(r=e.resource.payload)==null?void 0:r[0])==null?void 0:i.contentString})})}function _Q(e){var r;const t=(r=e.resource.content)==null?void 0:r.contentType,n=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return s.jsx(Qs,{resource:e.resource,padding:!!n,popupMenuItems:e.popupMenuItems,children:s.jsx(Dd,{value:e.resource.content})})}function DQ(e){return s.jsx(Qs,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:s.jsx(Yr,{children:s.jsx("pre",{children:e.resource.outcomeDesc})})})}function AQ(e){return s.jsx(Qs,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:s.jsx(Ib,{value:e.resource})})}function kQ(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${ny(e.loaded)} / ${ny(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${ny(e.loaded)}`}function ny(e){if(e===0)return"0.00 B";const t=Math.floor(Math.log(e)/Math.log(1024));return(e/Math.pow(1024,t)).toFixed(2)+" "+" KMGTP".charAt(t)+"B"}function PQ(e){const{resource:t,...n}=e;return s.jsx(dm,{value:t,loadTimelineResources:async(r,i,o)=>{const c=`${i}/${o}`;return Promise.allSettled([r.readHistory(i,o),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:100})])},...n})}function NQ(e){const{encounter:t,...n}=e;return s.jsx(dm,{value:t,loadTimelineResources:async(r,i,o)=>Promise.allSettled([r.readHistory("Encounter",o),r.search("Communication","encounter=Encounter/"+o),r.search("Media","encounter=Encounter/"+o)]),createCommunication:(r,i,o)=>({resourceType:"Communication",status:"completed",encounter:tn(r),subject:r.subject,sender:tn(i),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(r,i,o)=>({resourceType:"Media",status:"completed",encounter:tn(r),subject:r.subject,operator:tn(i),issued:new Date().toISOString(),content:o}),...n})}function OQ(e){let t;try{t=nB(e.path,e.resource)}catch(n){return console.warn("FhirPathDisplay:",n),null}if(t.length>1)throw new Error(`Component "path" for "FhirPathDisplay" must resolve to a single element. Received ${t.length} elements [${JSON.stringify(t,null,2)}]`);return s.jsx(Mi,{value:t[0]||"",propertyType:e.propertyType})}function MQ(e){return s.jsxs(Vn,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[s.jsxs(ce,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&s.jsx(sT,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&s.jsx(sT,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),s.jsx(_e,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function sT(e){return s.jsx(Pe,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const LQ={string:[ue.EQUALS,ue.NOT,ue.CONTAINS,ue.EXACT],fulltext:[ue.EQUALS,ue.NOT,ue.CONTAINS,ue.EXACT],token:[ue.EQUALS,ue.NOT],reference:[ue.EQUALS,ue.NOT],numeric:[ue.EQUALS,ue.NOT_EQUALS,ue.GREATER_THAN,ue.LESS_THAN,ue.GREATER_THAN_OR_EQUALS,ue.LESS_THAN_OR_EQUALS],quantity:[ue.EQUALS,ue.NOT_EQUALS,ue.GREATER_THAN,ue.LESS_THAN,ue.GREATER_THAN_OR_EQUALS,ue.LESS_THAN_OR_EQUALS],date:[ue.EQUALS,ue.NOT_EQUALS,ue.GREATER_THAN,ue.LESS_THAN,ue.GREATER_THAN_OR_EQUALS,ue.LESS_THAN_OR_EQUALS,ue.STARTS_AFTER,ue.ENDS_BEFORE,ue.APPROXIMATELY],datetime:[ue.EQUALS,ue.NOT_EQUALS,ue.GREATER_THAN,ue.LESS_THAN,ue.GREATER_THAN_OR_EQUALS,ue.LESS_THAN_OR_EQUALS,ue.STARTS_AFTER,ue.ENDS_BEFORE,ue.APPROXIMATELY],uri:[ue.EQUALS,ue.NOT,ue.ABOVE,ue.BELOW]},IQ={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 zb(e,t){return{...e,filters:t,offset:0,name:void 0}}function ek(e,t){return zb(e,(e.filters??[]).filter(n=>n.code!==t))}function fm(e,t,n,r,i){const o=[];return e.filters&&o.push(...e.filters),o.push({code:t,operator:n,value:r??""}),zb(e,o)}function $Q(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function zQ(e,t){return Ub(e,t,-1)}function UQ(e,t){return Ub(e,t,0)}function BQ(e,t){return Ub(e,t,1)}function Ub(e,t,n){const r=new Date;r.setDate(r.getDate()+n),r.setHours(0,0,0,0);const i=new Date(r.getTime());return i.setDate(i.getDate()+1),i.setTime(i.getTime()-1),hm(e,t,r,i)}function VQ(e,t){const n=new Date,r=new Date(n.getTime()+1440*60*1e3);return hm(e,t,n,r)}function FQ(e,t){return Bb(e,t,-1)}function HQ(e,t){return Bb(e,t,0)}function qQ(e,t){return Bb(e,t,1)}function Bb(e,t,n){const r=new Date;r.setMonth(r.getMonth()+n),r.setDate(1),r.setHours(0,0,0,0);const i=new Date(r.getTime());return i.setMonth(i.getMonth()+1),i.setDate(1),i.setHours(0,0,0,0),i.setTime(i.getTime()-1),hm(e,t,r,i)}function GQ(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),hm(e,t,n,new Date)}function hm(e,t,n,r){return e=ek(e,t),e=lT(e,t,ue.GREATER_THAN_OR_EQUALS,n),e=lT(e,t,ue.LESS_THAN_OR_EQUALS,r),e}function lT(e,t,n,r){return fm(e,t,n,r.toISOString())}function cT(e,t,n=!0){return fm(e,t,ue.MISSING,n.toString())}function WQ(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function QQ(e,t){const n=e.count??Kp,r=(t-1)*n;return WQ(e,r)}function YQ(e,t,n){return t===XQ(e)&&n!==void 0&&n===KQ(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function XQ(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function KQ(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function ZQ(e){return LQ[e.type]}function tk(e){return IQ[e]??""}function Ys(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 JQ(e,t){var r,i;const n=t.name;return n==="id"?s.jsx(gt,{to:`/${e.resourceType}/${e.id}`,children:e.id}):n==="meta.versionId"?(r=e.meta)==null?void 0:r.versionId:n==="_lastUpdated"?gr((i=e.meta)==null?void 0:i.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?eY(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?tY(e,t.searchParams[0]):null}function eY(e,t){var o,c,u;const n=((u=(c=(o=t.path)==null?void 0:o.split("."))==null?void 0:c.pop())==null?void 0:u.replaceAll("[x]",""))??"",[r,i]=lm({type:e.resourceType,value:e},n);return r?s.jsx(Mi,{path:t.path,property:t,propertyType:i,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function tY(e,t){const n=qo(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:s.jsx(s.Fragment,{children:n.map((r,i)=>s.jsx(Mi,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${i}-${n.length}`))})}function nY(e){const t=v.useRef(!1),[n,r]=v.useState({search:JSON.parse(Oi(e.search))}),[i,o]=v.useState(!1);v.useEffect(()=>{r({search:e.search})},[e.search]);const c=v.useMemo(()=>{if(!e.visible)return[];const f=e.search.resourceType,h=mD(f),m=ob(f);return nd(rY(h,m)).map(g=>({value:g,label:Ys(g)}))},[e.visible,e.search.resourceType]);function u(f){r({search:{...n.search,fields:f}})}return s.jsx(Vn,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=i},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:s.jsx("div",{"data-testid":"overlay-child"})},children:s.jsxs(qe,{children:[s.jsx(Lp,{style:{width:550},placeholder:"Select fields to display",data:c,value:n.search.fields??[],onChange:u,onDropdownOpen:()=>o(!0),onDropdownClose:()=>o(!1),maxDropdownHeight:"250px",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),s.jsx(je,{justify:"flex-end",children:s.jsx(Pe,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function rY(e,t){const n=[],r=new Set,i=new Set;for(const o of Object.keys(e.elements))n.push(o),r.add(o.toLowerCase()),i.add(Ys(o));if(t)for(const o of Object.keys(t)){const c=Ys(o);!r.has(o)&&!i.has(c)&&(n.push(o),r.add(o),i.add(c))}return n}function nk(e){const t=tm(e.resourceType,e.searchParam),n=e.name??"filter-value";switch(t.type){case ir.REFERENCE:return s.jsx(kd,{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 ir.BOOLEAN:return s.jsx(Un,{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 ir.DATE:return s.jsx($e,{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 ir.DATETIME:return s.jsx(aa,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case ir.NUMBER:return s.jsx($e,{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 ir.QUANTITY:return s.jsx(Ws,{name:n,path:"",defaultValue:iY(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return s.jsx($e,{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 iY(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function aY(e){const[t,n]=v.useState(Wr(e.search)),r=v.useRef(t);r.current=t,v.useEffect(()=>{n(Wr(e.search))},[e.search]);function i(f){n(fm(r.current,f.code,f.operator,f.value))}const o=e.search.resourceType,c=ob(o)??{},u=t.filters||[];return s.jsx(Vn,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:s.jsxs(mt,{onSubmit:()=>e.onOk(r.current),children:[s.jsxs("div",{children:[s.jsxs("table",{children:[s.jsxs("colgroup",{children:[s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:380}}),s.jsx("col",{style:{width:40}})]}),s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Field"}),s.jsx("th",{children:"Operation"}),s.jsx("th",{children:"Value"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:u.map((f,h)=>s.jsx(oY,{id:`filter-${h}-row`,resourceType:o,searchParams:c,value:f,onChange:m=>{const g=[...u];g[h]=m,n(zb(r.current,g))},onDelete:()=>n($Q(r.current,h))},`filter-${h}-row`))})]}),s.jsx(Ob,{propertyDisplayName:"Filter",onClick:()=>i({})})]}),s.jsx(je,{justify:"flex-end",mt:"xl",children:s.jsx(xr,{children:"OK"})})]})})}function oY(e){const t=e.value,n=v.useRef(t);n.current=t;function r(f){n.current.code=f,n.current.operator=ue.EQUALS,n.current.value="",e.onChange(n.current)}function i(f){n.current.operator=f,n.current.value="",e.onChange(n.current)}function o(f){n.current.value=f,e.onChange(n.current)}const c=e.searchParams[t.code],u=c&&ZQ(c);return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(sn,{"data-testid":`${e.id}-filter-field`,defaultValue:e.value.code,onChange:f=>r(f.currentTarget.value),data:["",...Object.keys(e.searchParams).map(f=>({value:f,label:Ys(f)}))]})}),s.jsx("td",{children:u&&s.jsx(sn,{"data-testid":`${e.id}-filter-operation`,defaultValue:t.operator,onChange:f=>i(f.currentTarget.value),data:["",...u.map(f=>({value:f,label:tk(f)}))]},`${e.id}-filter-value-${e.value.code}`)}),s.jsx("td",{children:c&&t.operator&&s.jsx(nk,{name:`${e.id}-filter-value`,resourceType:e.resourceType,searchParam:c,defaultValue:t.value,onChange:o},`${e.id}-filter-value-${e.value.code}-${e.value.operator}`)}),s.jsx("td",{children:e.onDelete&&s.jsx(An,{variant:"outline",color:"red",radius:"xl","aria-label":"Delete filter",onClick:e.onDelete,children:s.jsx(Gs,{style:{width:"70%",height:"70%"},stroke:1.5})})})]})}function sY(e){const[t,n]=v.useState(e.defaultValue??"");if(!e.searchParam||!e.filter)return null;function r(){e.onOk({...e.filter,value:t})}return s.jsx(Vn,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:s.jsx(mt,{onSubmit:r,children:s.jsxs(or,{children:[s.jsx(or.Col,{span:10,children:s.jsx(nk,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),s.jsx(or.Col,{span:2,children:s.jsx(Pe,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function lY(e){var i;const{resourceType:t,filter:n}=e,r=(i=la.types[t].searchParams)==null?void 0:i[n.code];if(r){if(r.type==="reference"&&(n.operator===ue.EQUALS||n.operator===ue.NOT_EQUALS))return s.jsx(Ic,{value:{reference:n.value}});const o=tm(t,r);if(n.code==="_lastUpdated"||o.type===ir.DATETIME)return s.jsx(s.Fragment,{children:gr(n.value)})}return s.jsx(s.Fragment,{children:n.value})}function cY(e){if(!e.searchParams)return null;function t(o,c){i(YQ(e.search,o.code,c))}function n(o){i(ek(e.search,o.code))}function r(o,c){e.onPrompt(o,{code:o.code,operator:c,value:""})}function i(o){e.onChange(o)}return e.searchParams.length===1?s.jsx(uY,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:i,onClear:n}):s.jsx(Ce.Dropdown,{children:e.searchParams.map(o=>s.jsx(Ce.Item,{children:Ys(o.code)},o.code))})}function uY(e){switch(e.searchParam.type){case"date":return s.jsx(dY,{...e});case"number":case"quantity":return s.jsx(fY,{...e});case"reference":return s.jsx(hY,{...e});case"string":return s.jsx(pY,{...e});case"token":case"uri":return s.jsx(mY,{...e});default:return s.jsxs(s.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function dY(e){const{searchParam:t}=e,n=t.code;return s.jsxs(Ce.Dropdown,{children:[s.jsx(Ce.Item,{leftSection:s.jsx(jb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),s.jsx(Ce.Item,{leftSection:s.jsx(Cb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(_d,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),s.jsx(Ce.Item,{leftSection:s.jsx(Rd,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT_EQUALS),children:"Does not equal..."}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(gA,{size:14}),onClick:()=>e.onPrompt(t,ue.ENDS_BEFORE),children:"Before..."}),s.jsx(Ce.Item,{leftSection:s.jsx(mA,{size:14}),onClick:()=>e.onPrompt(t,ue.STARTS_AFTER),children:"After..."}),s.jsx(Ce.Item,{leftSection:s.jsx(BF,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Between..."}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(No,{size:14}),onClick:()=>e.onChange(BQ(e.search,n)),children:"Tomorrow"}),s.jsx(Ce.Item,{leftSection:s.jsx(No,{size:14}),onClick:()=>e.onChange(UQ(e.search,n)),children:"Today"}),s.jsx(Ce.Item,{leftSection:s.jsx(No,{size:14}),onClick:()=>e.onChange(zQ(e.search,n)),children:"Yesterday"}),s.jsx(Ce.Item,{leftSection:s.jsx(No,{size:14}),onClick:()=>e.onChange(VQ(e.search,n)),children:"Next 24 Hours"}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(No,{size:14}),onClick:()=>e.onChange(qQ(e.search,n)),children:"Next Month"}),s.jsx(Ce.Item,{leftSection:s.jsx(No,{size:14}),onClick:()=>e.onChange(HQ(e.search,n)),children:"This Month"}),s.jsx(Ce.Item,{leftSection:s.jsx(No,{size:14}),onClick:()=>e.onChange(FQ(e.search,n)),children:"Last Month"}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(No,{size:14}),onClick:()=>e.onChange(GQ(e.search,n)),children:"Year to date"}),s.jsx(Nd,{...e})]})}function fY(e){const{searchParam:t}=e;return s.jsxs(Ce.Dropdown,{children:[s.jsx(Ce.Item,{leftSection:s.jsx(jb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),s.jsx(Ce.Item,{leftSection:s.jsx(Cb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(_d,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),s.jsx(Ce.Item,{leftSection:s.jsx(Rd,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT_EQUALS),children:"Does not equal..."}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(mA,{size:14}),onClick:()=>e.onPrompt(t,ue.GREATER_THAN),children:"Greater than..."}),s.jsx(Ce.Item,{leftSection:s.jsx(Gy,{size:14}),onClick:()=>e.onPrompt(t,ue.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),s.jsx(Ce.Item,{leftSection:s.jsx(gA,{size:14}),onClick:()=>e.onPrompt(t,ue.LESS_THAN),children:"Less than..."}),s.jsx(Ce.Item,{leftSection:s.jsx(Gy,{size:14}),onClick:()=>e.onPrompt(t,ue.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),s.jsx(Nd,{...e})]})}function hY(e){const{searchParam:t}=e;return s.jsxs(Ce.Dropdown,{children:[s.jsx(Ce.Item,{leftSection:s.jsx(_d,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),s.jsx(Ce.Item,{leftSection:s.jsx(Rd,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT),children:"Does not equal..."}),s.jsx(Nd,{...e})]})}function pY(e){const{searchParam:t}=e;return s.jsxs(Ce.Dropdown,{children:[s.jsx(Ce.Item,{leftSection:s.jsx(jb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),s.jsx(Ce.Item,{leftSection:s.jsx(Cb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(_d,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),s.jsx(Ce.Item,{leftSection:s.jsx(Rd,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT),children:"Does not equal..."}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(WF,{size:14}),onClick:()=>e.onPrompt(t,ue.CONTAINS),children:"Contains..."}),s.jsx(Ce.Item,{leftSection:s.jsx(qF,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Does not contain..."}),s.jsx(Nd,{...e})]})}function mY(e){const{searchParam:t}=e;return s.jsxs(Ce.Dropdown,{children:[s.jsx(Ce.Item,{leftSection:s.jsx(_d,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),s.jsx(Ce.Item,{leftSection:s.jsx(Rd,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT),children:"Does not equal..."}),s.jsx(Nd,{...e})]})}function Nd(e){const{searchParam:t}=e,n=t.code;return s.jsxs(s.Fragment,{children:[s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(IF,{size:14}),onClick:()=>e.onChange(cT(e.search,n)),children:"Missing"}),s.jsx(Ce.Item,{leftSection:s.jsx(MF,{size:14}),onClick:()=>e.onChange(cT(e.search,n,!1)),children:"Not missing"}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(Gs,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}const gY="_root_vlout_1",vY="_table_vlout_8",yY="_tr_vlout_12",xY="_control_vlout_22",bY="_icon_vlout_31",Lu={root:gY,table:vY,tr:yY,control:xY,icon:bY};function SY(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(wY(t,r));return n}function wY(e,t){var i;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=Ko(e,t),r=RU(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const o=ob(e);let c;if(o){const u=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);c=Object.values(o).filter(f=>!!f.expression&&u.test(f==null?void 0:f.expression)),c.length===0&&(c=void 0)}return{name:t,elementDefinition:n,searchParams:c}}if(r){const o=tm(e,r);return{name:t,elementDefinition:(i=o.elementDefinitions)==null?void 0:i[0],searchParams:[r]}}return{name:t}}class jY extends Event{constructor(t){super("change"),this.definition=t}}class CY extends Event{constructor(t){super("load"),this.response=t}}class Wh extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function $c(e){var G,X;const t=Ae(),[n,r]=v.useState(),{search:i,onLoad:o}=e,[c,u]=v.useState(i);sa(i,c)||u(i);const[f,h]=v.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),m=v.useRef(f);m.current=f;const g=c.total??"accurate",y=v.useCallback(P=>{r(void 0),t.requestSchema(c.resourceType).then(()=>t.search(c.resourceType,Bo({...c,total:g,fields:void 0}),P)).then(I=>{h({...m.current,searchResponse:I}),o&&o(new CY(I))}).catch(I=>{h({...m.current,searchResponse:void 0}),r(Kt(I))})},[t,c,g,o]),b=v.useCallback(()=>{h({...m.current,searchResponse:void 0}),y({cache:"reload"})},[y]);v.useEffect(()=>{y()},[y]);function S(P,I){P.stopPropagation();const H=P.target.checked,O={...m.current.selected};H?O[I]=!0:delete O[I],h({...m.current,selected:O})}function j(P){P.stopPropagation();const $=P.target.checked,H={},O=m.current.searchResponse;$&&(O!=null&&O.entry)&&O.entry.forEach(U=>{var K;(K=U.resource)!=null&&K.id&&(H[U.resource.id]=!0)}),h({...m.current,selected:H})}function C(){var I,$;const P=m.current;if(!((I=P.searchResponse)!=null&&I.entry)||P.searchResponse.entry.length===0)return!1;for(const H of P.searchResponse.entry)if(($=H.resource)!=null&&$.id&&!P.selected[H.resource.id])return!1;return!0}function T(P){e.onChange&&e.onChange(new jY(P))}function _(P,I){if(SA(P.target)||P.button===2)return;hn(P);const $=bA(P);!$&&e.onClick&&e.onClick(new Wh(I,P)),$&&e.onAuxClick&&e.onAuxClick(new Wh(I,P))}function E(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(n)return s.jsx(Xr,{outcome:n});if(!pD(c.resourceType))return s.jsx(er,{style:{width:"100%",height:"100%"},children:s.jsx(Ar,{})});const R=e.checkboxesEnabled,D=SY(c),k=c.resourceType,M=f.searchResponse,L=M==null?void 0:M.entry,z=L==null?void 0:L.map(P=>P.resource),F="subtle",Y="gray",W=16,J=window.innerWidth<768;return s.jsxs("div",{className:Lu.root,"data-testid":"search-control",children:[!e.hideToolbar&&s.jsxs(je,{justify:"space-between",mb:"xl",children:[s.jsxs(je,{gap:2,children:[s.jsx(Pe,{size:"compact-md",variant:F,color:Y,leftSection:s.jsx(sH,{size:W}),onClick:()=>h({...m.current,fieldEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Fields"}),s.jsx(Pe,{size:"compact-md",variant:F,color:Y,leftSection:s.jsx(wH,{size:W}),onClick:()=>h({...m.current,filterEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Filters"}),e.onNew&&s.jsx(Pe,{size:"compact-md",variant:F,color:Y,leftSection:s.jsx(bH,{size:W}),onClick:e.onNew,children:"New..."}),!J&&E()&&s.jsx(Pe,{size:"compact-md",variant:F,color:Y,leftSection:s.jsx(yq,{size:W}),onClick:e.onExport?e.onExport:()=>h({...m.current,exportDialogVisible:!0,dialogOpenTime:Date.now()}),children:"Export..."}),!J&&e.onDelete&&s.jsx(Pe,{size:"compact-md",variant:F,color:Y,leftSection:s.jsx(am,{size:W}),onClick:()=>e.onDelete(Object.keys(f.selected)),children:"Delete..."}),!J&&e.onBulk&&s.jsx(Pe,{size:"compact-md",variant:F,color:Y,leftSection:s.jsx(zF,{size:W}),onClick:()=>e.onBulk(Object.keys(f.selected)),children:"Bulk..."})]}),s.jsxs(je,{gap:2,children:[M&&s.jsxs(_e,{size:"xs",c:"dimmed","data-testid":"count-display",children:[rk(c,M).toLocaleString(),"-",DY(c,M).toLocaleString(),M.total!==void 0&&` of ${c.total==="estimate"?"~":""}${(G=M.total)==null?void 0:G.toLocaleString()}`]}),s.jsx(An,{variant:F,color:Y,title:"Refresh",onClick:b,children:s.jsx(yA,{size:W})})]})]}),s.jsxs(ye,{className:Lu.table,children:[s.jsxs(ye.Thead,{children:[s.jsxs(ye.Tr,{children:[R&&s.jsx(ye.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:P=>j(P)})}),D.map(P=>s.jsx(ye.Th,{children:s.jsxs(Ce,{shadow:"md",width:240,position:"bottom-end",children:[s.jsx(Ce.Target,{children:s.jsx(tr,{className:Lu.control,p:2,children:s.jsxs(je,{justify:"space-between",wrap:"nowrap",children:[s.jsx(_e,{fw:500,children:Ys(P.name)}),s.jsx(er,{className:Lu.icon,children:s.jsx(_F,{size:14,stroke:1.5})})]})})}),s.jsx(cY,{search:c,searchParams:P.searchParams,onPrompt:(I,$)=>{h({...m.current,filterDialogVisible:!0,filterDialogSearchParam:I,filterDialogFilter:$,dialogOpenTime:Date.now()})},onChange:I=>{T(I)}})]})},P.name))]}),!e.hideFilters&&s.jsxs(ye.Tr,{children:[R&&s.jsx(ye.Th,{}),D.map(P=>s.jsx(ye.Th,{children:P.searchParams&&s.jsx(TY,{resourceType:k,searchParams:P.searchParams,filters:c.filters})},P.name))]})]}),s.jsx(ye.Tbody,{children:z==null?void 0:z.map(P=>P&&s.jsxs(ye.Tr,{className:Lu.tr,"data-testid":"search-control-row",onClick:I=>_(I,P),onAuxClick:I=>_(I,P),children:[R&&s.jsx(ye.Td,{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${P.id}`,checked:!!f.selected[P.id],onChange:I=>S(I,P.id)})}),D.map(I=>s.jsx(ye.Td,{children:JQ(P,I)},I.name))]},P.id))})]}),!(z!=null&&z.length)&&s.jsx(Lc,{children:s.jsx(er,{style:{height:150},children:s.jsx(_e,{size:"xl",c:"dimmed",children:"No results"})})}),M&&s.jsx(er,{m:"md",p:"md",children:s.jsx(Ii,{value:RY(c),total:_Y(c,M),onChange:P=>T(QQ(c,P)),getControlProps:P=>{switch(P){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),s.jsx(nY,{search:c,visible:m.current.fieldEditorVisible,onOk:P=>{T(P),h({...m.current,fieldEditorVisible:!1})},onCancel:()=>{h({...m.current,fieldEditorVisible:!1})}},`search-field-editor-${f.dialogOpenTime}`),s.jsx(aY,{search:c,visible:m.current.filterEditorVisible,onOk:P=>{T(P),h({...m.current,filterEditorVisible:!1})},onCancel:()=>{h({...m.current,filterEditorVisible:!1})}},`search-filter-editor-${f.dialogOpenTime}`),s.jsx(MQ,{visible:m.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{h({...m.current,exportDialogVisible:!1})}},`search-export-dialog-${f.dialogOpenTime}`),s.jsx(sY,{visible:m.current.filterDialogVisible,title:(X=f.filterDialogSearchParam)!=null&&X.code?Ys(f.filterDialogSearchParam.code):"",resourceType:k,searchParam:f.filterDialogSearchParam,filter:f.filterDialogFilter,defaultValue:"",onOk:P=>{T(fm(c,P.code,P.operator,P.value)),h({...m.current,filterDialogVisible:!1})},onCancel:()=>{h({...m.current,filterDialogVisible:!1})}},`search-filter-dialog-${f.dialogOpenTime}`)]})}const EY=$c;function TY(e){const t=(e.filters??[]).filter(n=>e.searchParams.find(r=>r.code===n.code));return t.length===0?s.jsx("span",{children:"no filters"}):s.jsx(s.Fragment,{children:t.map(n=>s.jsxs("div",{children:[tk(n.operator)," ",s.jsx(lY,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function RY(e){return Math.floor((e.offset??0)/(e.count??Kp))+1}function _Y(e,t){const n=e.count??Kp,r=ik(e,t);return Math.ceil(r/n)}function rk(e,t){return Math.min(ik(e,t),(e.offset??0)+1)}function DY(e,t){var n;return Math.max(rk(e,t)+(((n=t.entry)==null?void 0:n.length)??0)-1,0)}function ik(e,t){var r,i;let n=t.total;return n===void 0&&(n=(e.offset??0)+(((r=t.entry)==null?void 0:r.length)??0)+((i=t.link)!=null&&i.some(o=>o.relation==="next")?1:0)),n}function AY(e){const t=Ae(),[n,r]=v.useState(!1),[i,o]=v.useState(),{query:c,fields:u}=e,[f,h]=v.useState(),[m,g]=v.useState({}),y=v.useRef(f);y.current=f;const b=v.useRef({});b.current=m,v.useEffect(()=>{o(void 0),t.graphql(c).then(h).catch(E=>o(Kt(E)))},[t,c]);function S(E,R){E.stopPropagation();const k=E.target.checked,M={...b.current};k?M[R]=!0:delete M[R],g(M)}function j(E){var L;E.stopPropagation();const D=E.target.checked,k={},M=(L=y.current)==null?void 0:L.data.ResourceList;D&&M&&M.forEach(z=>{z.id&&(k[z.id]=!0)}),g(k)}function C(){var R;const E=(R=y.current)==null?void 0:R.data.ResourceList;if(!E||E.length===0)return!1;for(const D of E)if(D.id&&!b.current[D.id])return!1;return!0}function T(E,R){SA(E.target)||(hn(E),E.button!==1&&e.onClick&&e.onClick(new Wh(R,E)),E.button===1&&e.onAuxClick&&e.onAuxClick(new Wh(R,E)))}if(v.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return s.jsx(Ar,{});const _=e.checkboxesEnabled;return s.jsxs("div",{onContextMenu:E=>hn(E),"data-testid":"search-control",children:[s.jsxs(ye,{children:[s.jsx(ye.Thead,{children:s.jsxs(ye.Tr,{children:[_&&s.jsx(ye.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:E=>j(E)})}),u.map(E=>s.jsx(ye.Th,{children:E.name},E.name))]})}),s.jsx(ye.Tbody,{children:f==null?void 0:f.data.ResourceList.map(E=>E&&s.jsxs(ye.Tr,{"data-testid":"search-control-row",onClick:R=>T(R,E),onAuxClick:R=>T(R,E),children:[_&&s.jsx(ye.Td,{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${E.id}`,checked:!!m[E.id],onChange:R=>S(R,E.id)})}),u.map(R=>s.jsx(ye.Td,{children:s.jsx(OQ,{propertyType:R.propertyType,path:R.fhirPath,resource:E})},R.name))]},E.id))})]}),(f==null?void 0:f.data.ResourceList.length)===0&&s.jsx("div",{"data-testid":"empty-search",children:"No results"}),i&&s.jsx("div",{"data-testid":"search-error",children:s.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(i,void 0,2)})}),e.onBulk&&s.jsx(Pe,{onClick:()=>e.onBulk(Object.keys(b.current)),children:"Bulk..."})]})}const kY=v.memo(AY),PY="_root_1fbwr_1",NY="_entry_1fbwr_8",OY="_key_1fbwr_13",MY="_value_1fbwr_20",pm={root:PY,entry:NY,key:OY,value:MY};function pt(e){return s.jsx(Yr,{children:s.jsx("div",{className:pm.root,children:e.children})})}pt.Entry=function(t){return s.jsx("div",{className:pm.entry,children:t.children})};pt.Key=function(t){return s.jsx("div",{className:pm.key,children:t.children})};pt.Value=function(t){return s.jsx("div",{className:pm.value,children:t.children})};function LY(e){const{group:t}=e;return s.jsx(lr,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:s.jsxs(je,{children:[t.measureScore&&s.jsx(zY,{group:t}),!t.measureScore&&s.jsx($Y,{group:t})]})})}function IY(e){const{measure:t}=e;return s.jsxs(s.Fragment,{children:[s.jsx(_e,{fz:"md",fw:500,mb:8,children:t.title}),s.jsx(_e,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function $Y(e){const{group:t}=e,n=t.population,r=n==null?void 0:n.find(f=>Ho(f.code)==="numerator"),i=n==null?void 0:n.find(f=>Ho(f.code)==="denominator"),o=r==null?void 0:r.count,c=i==null?void 0:i.count;if(c===0)return s.jsxs(ce,{children:[s.jsx(Ie,{order:3,children:"Not Applicable"}),s.jsx(_e,{children:`Denominator: ${c}`})]});if(o===void 0||c===void 0)return s.jsxs(ce,{children:[s.jsx(Ie,{order:3,children:"Insufficient Data"}),s.jsx(_e,{children:`Numerator: ${o}`}),s.jsx(_e,{children:`Denominator: ${c}`})]});const u=o/c*100;return s.jsx(Hp,{size:120,thickness:12,roundCaps:!0,sections:[{value:u,color:ak(u)}],label:s.jsx(Fo,{justify:"center",children:s.jsxs(_e,{fw:700,fz:18,children:[o," / ",c]})})})}function zY(e){var r,i,o;const{group:t}=e,n=((r=t.measureScore)==null?void 0:r.unit)??((i=t.measureScore)==null?void 0:i.code);return s.jsx(s.Fragment,{children:n==="%"?s.jsx(Hp,{size:120,thickness:12,roundCaps:!0,sections:[{value:UY(t),color:ak(((o=t==null?void 0:t.measureScore)==null?void 0:o.value)??0)}],label:s.jsx(Fo,{justify:"center",children:s.jsx(_e,{fw:700,fz:18,children:s.jsx(ad,{value:t.measureScore})})})}):s.jsx(Fo,{h:120,align:"center",children:s.jsx(Ie,{order:3,children:s.jsx(ad,{value:t.measureScore})})})})}function UY(e){var r,i;const t=(r=e.measureScore)==null?void 0:r.value,n=(i=e.measureScore)==null?void 0:i.unit;return t?t<=1&&n==="%"?t*100:t:0}function ak(e){return e<=33?"red":e<=67?"yellow":"green"}function BY(e){var r;const t=Wt(e.measureReport),[n]=bF("Measure",{url:t==null?void 0:t.measure});return t?s.jsxs(ce,{children:[n&&s.jsx(IY,{measure:n}),s.jsx(U0,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:(r=t.group)==null?void 0:r.map((i,o)=>s.jsx(LY,{group:i},i.id??o))})]}):null}const ry="patient-export",iy="Patient Export",VY={everything:{operation:"$everything",extension:"json",contentType:fn.FHIR_JSON},summary:{operation:"$summary",extension:"json",contentType:fn.FHIR_JSON},ccda:{operation:"$ccda-export",extension:"xml",contentType:fn.CDA_XML},ccdaReferral:{operation:"$ccda-export",type:"referral",extension:"xml",contentType:fn.CDA_XML}};function FY(e){const t=Ae(),{patient:n}=e,r=v.useCallback(async i=>{const o=Vs(n),c=i.format,{operation:u,type:f,contentType:h,extension:m}=VY[c],g=t.fhirUrl("Patient",o,u),y={};f&&(y.type=f),i.author&&(y.author={reference:i.author}),i.authoredOn&&(y.authoredOn=Pb(i.authoredOn)),i.startDate&&(y.start=i.startDate),i.endDate&&(y.end=i.endDate),fi.show({id:ry,title:iy,loading:!0,message:"Exporting...",autoClose:!1,withCloseButton:!1});try{const b=await t.post(g,y,void 0,{cache:"no-cache",headers:{Accept:h}}),S=`Patient-export-${o}-${new Date().toISOString().replaceAll(":","-")}.${m}`;HY(b,S,h),fi.update({id:ry,title:iy,color:"green",message:"Done",icon:s.jsx(ro,{size:"1rem"}),loading:!1,autoClose:!0,withCloseButton:!0})}catch(b){fi.update({id:ry,title:iy,color:"red",message:Ke(b),icon:s.jsx(Gs,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}},[t,n]);return s.jsx(mt,{onSubmit:r,children:s.jsxs(qe,{children:[s.jsx(Lt,{title:"Export Format",description:"Required",withAsterisk:!0,children:s.jsx(qp,{name:"format",data:[{label:"FHIR Everything",value:"everything"},{label:"Patient Summary",value:"summary"},{label:"C-CDA",value:"ccda"},{label:"C-CDA Referral",value:"ccdaReferral"}],fullWidth:!0})}),s.jsx(Lt,{title:"Author",description:"Optional author for composition. Default value is current user.",children:s.jsx(kd,{name:"author",placeholder:"Author",targetTypes:["Organization","Practitioner","PractitionerRole"]})}),s.jsx(Lt,{title:"Authored On",description:"Optional date for composition authored on. Default value is current date.",children:s.jsx(aa,{name:"authoredOn",placeholder:"Authored on"})}),s.jsx(Lt,{title:"Start Date",description:"The start date of care. If no start date is provided, all records prior to the end date are in scope.",children:s.jsx(aa,{name:"startDate",placeholder:"Start date"})}),s.jsx(Lt,{title:"End Date",description:"The end date of care. If no end date is provided, all records subsequent to the start date are in scope.",children:s.jsx(aa,{name:"endDate",placeholder:"End date"})}),s.jsx(je,{justify:"right",children:s.jsx(xr,{children:"Request Export"})})]})})}function HY(e,t,n){const r=typeof e=="string"?e:JSON.stringify(e,null,2),i=new Blob([r],{type:n}),o=window.URL.createObjectURL(i),c=document.createElement("a");document.body.appendChild(c),c.style.display="none",c.href=o,c.download=t,c.click(),window.URL.revokeObjectURL(o)}function qY(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function ok(e){var n,r;const t=Wt(e.patient);return t?s.jsxs(pt,{children:[s.jsx(Zo,{value:t,size:"lg",color:qY(t)}),s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Name"}),s.jsx(pt.Value,{children:s.jsx(gt,{to:t,fw:500,children:t.name?s.jsx(Eb,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&s.jsxs(s.Fragment,{children:[s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"DoB"}),s.jsx(pt.Value,{children:t.birthDate})]}),s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Age"}),s.jsx(pt.Value,{children:Z8(t.birthDate)})]})]}),t.gender&&s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Gender"}),s.jsx(pt.Value,{children:t.gender})]}),t.address&&s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"State"}),s.jsx(pt.Value,{children:(n=t.address[0])==null?void 0:n.state})]}),(r=t.identifier)==null?void 0:r.map(i=>s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:i==null?void 0:i.system}),s.jsx(pt.Value,{children:i==null?void 0:i.value})]},`${i==null?void 0:i.system}-${i==null?void 0:i.value}`))]}):null}function GY(e){const{patient:t,...n}=e,r=v.useCallback((i,o,c)=>{const u=`${o}/${c}`,f=100;return Promise.allSettled([i.readHistory("Patient",c),i.search("Communication",{subject:u,_count:f}),i.search("Device",{patient:u,_count:f}),i.search("DeviceRequest",{patient:u,_count:f}),i.search("DiagnosticReport",{subject:u,_count:f}),i.search("Media",{subject:u,_count:f}),i.search("ServiceRequest",{subject:u,_count:f}),i.search("Task",{subject:u,_count:f})])},[]);return s.jsx(dm,{value:t,loadTimelineResources:r,createCommunication:(i,o,c)=>({resourceType:"Communication",status:"completed",subject:tn(i),sender:tn(o),sent:new Date().toISOString(),payload:[{contentString:c}]}),createMedia:(i,o,c)=>({resourceType:"Media",status:"completed",subject:tn(i),operator:tn(o),issued:new Date().toISOString(),content:c}),...n})}const WY="_section_pqpwm_1",QY="_hovering_pqpwm_7",Xy={section:WY,hovering:QY};function YY(e){const t=Ae(),n=Wt(e.value),[r,i]=v.useState(!1),[o,c]=v.useState(),[u,f]=v.useState(),[h,m]=v.useState();function g(){f(void 0)}function y(){c(void 0)}const b=v.useRef(h);if(b.current=h,v.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>i(!0)).catch(console.log)},[t]),v.useEffect(()=>(m(eX(n??{resourceType:"PlanDefinition",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",y),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",y)}),[n]),!r||!h)return null;function S(j,C){m({...b.current,[j]:C})}return s.jsx("div",{children:s.jsxs(mt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(h),children:[s.jsx($e,{label:"Plan Title",py:"md",defaultValue:h.title,onChange:j=>S("title",j.currentTarget.value)}),s.jsx(XY,{actions:h.action||[],selectedKey:o,setSelectedKey:c,hoverKey:u,setHoverKey:f,onChange:j=>S("action",j)}),s.jsx(xr,{children:"Save"})]})})}function XY(e){const t=v.useRef(e.actions);t.current=e.actions;function n(o){e.onChange(t.current.map(c=>c.id===o.id?o:c))}function r(o){e.onChange([...t.current,o]),e.setSelectedKey(o.id)}function i(o){e.onChange(t.current.filter(c=>c!==o))}return s.jsxs(qe,{gap:"md",className:Xy.section,children:[e.actions.map(o=>s.jsx(KY,{action:o,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>i(o)},o.id)),s.jsx("div",{children:s.jsx(Pe,{variant:"outline",onClick:o=>{hn(o),r({id:sk()})},children:"Add action"})})]})}function KY(e){const{action:t}=e,n=JY(t);function r(o){o.stopPropagation(),e.setSelectedKey(e.action.id)}function i(o){hn(o),e.setHoverKey(e.action.id)}return s.jsx("div",{onClick:r,onMouseOver:i,onFocus:i,children:s.jsx(ZY,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,hoverKey:e.hoverKey,onRemove:e.onRemove})})}function ZY(e){const{action:t}=e,[n,r]=v.useState(e.actionType),i=e.selectedKey===e.action.id,o=e.hoverKey===e.action.id;function c(f,h){e.onChange({...t,[f]:h})}const u=zt(Xy.section,{[Xy.hovering]:o&&!i});return s.jsxs(lr,{"data-testid":t.id,className:u,p:0,radius:"sm",withBorder:!0,children:[s.jsxs(Fo,{w:"100%",p:"xs",bg:"gray.0",gap:"md",align:"center",justify:"space-between",children:[s.jsx($e,{w:"100%",name:`actionTitle-${t.id}`,defaultValue:t.title,placeholder:"Title",onChange:f=>c("title",f.currentTarget.value)}),s.jsx(Yo,{"data-testid":"close-button",onClick:e.onRemove})]}),i&&s.jsxs(qe,{gap:"xl",p:"md",children:[s.jsx(ce,{children:s.jsx($e,{label:"Task Description",placeholder:"Enter task description",name:`actionDescription-${t.id}`,defaultValue:t.description,onChange:f=>c("description",f.currentTarget.value)})}),s.jsx(ce,{children:s.jsx(sn,{label:"Type of Action",value:n,onChange:f=>{const h=f.currentTarget.value==="standard"?void 0:f.currentTarget.value;r(h),e.onChange({...e.action,definitionCanonical:h==="standard"?void 0:e.action.definitionCanonical})},data:[{value:"standard",label:"Standard task"},{value:"questionnaire",label:"Task with Questionnaire"},{value:"activitydefinition",label:"Task with Activity Definition"}]})}),n==="questionnaire"&&s.jsxs(qe,{gap:0,children:[s.jsxs(je,{gap:0,mb:"xs",children:[s.jsx(_e,{fw:600,children:"Select questionnaire"}),s.jsx(_e,{c:"red",children:"*"})]}),s.jsxs(_e,{size:"sm",c:"dimmed",mb:"sm",children:["Questionnaire to be shown in the task in Encounter view. You can create new one from"," ",s.jsx(Pt,{href:"/Questionnaire",target:"_blank",c:"blue",children:"questionnaires list"})]}),s.jsx(uT,{resourceType:"Questionnaire",action:t,onChange:e.onChange})]}),n==="activitydefinition"&&s.jsxs(qe,{gap:0,children:[s.jsxs(je,{gap:0,mb:"xs",children:[s.jsx(_e,{fw:600,children:"Select activity definition"}),s.jsx(_e,{c:"red",children:"*"})]}),s.jsxs(_e,{size:"sm",c:"dimmed",mb:"sm",children:["ActivityDefinition.kind resource to be shown in the task in Encounter view. You can create new one from"," ",s.jsx(Pt,{href:"/ActivityDefinition",target:"_blank",c:"blue",children:"activity definitions list"})]}),s.jsx(uT,{resourceType:"ActivityDefinition",action:t,onChange:e.onChange})]})]})]})}function uT(e){const{id:t,definitionCanonical:n}=e.action,r=n!=null&&n.startsWith(e.resourceType+"/")?{reference:n}:void 0;return s.jsx(ol,{name:t,resourceType:e.resourceType,defaultValue:r,onChange:i=>{i?e.onChange({...e.action,definitionCanonical:Mt(i)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function JY(e){var t,n;return(t=e.definitionCanonical)!=null&&t.startsWith("Questionnaire")?"questionnaire":(n=e.definitionCanonical)!=null&&n.startsWith("ActivityDefinition")?"activitydefinition":"standard"}let ay=1;function sk(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(ay=Math.max(ay,t+1))}return e}return"id-"+ay++}function eX(e){return{...e,action:lk(e.action)}}function lk(e){if(e)return e.map(t=>({...t,id:sk(t.id),action:lk(t.action)}))}const Is=30,Qh=50;function Yh(e){const t=e.formState,n=e.item,r=e.responseItem;function i(g){t&&e.context&&t.onChangeAnswer(e.context,e.item,g)}const o=n.type;if(!o)return null;const c=n.linkId;if(!c)return null;let u;n.initial&&n.initial.length>0?u=n.initial[0]:n.answerOption&&n.answerOption.length>0&&(u=n.answerOption.find(g=>g.initialSelected));const f=Fb(r,e.index)??xb(u),h=fa(r,`${$i}/fhir/StructureDefinition/questionnaire-validationError`);let m=null;switch(o){case jt.display:m=s.jsx("p",{children:e.item.text},e.item.linkId);break;case jt.boolean:m=s.jsx(BA,{title:e.item.text,htmlFor:e.item.linkId,children:s.jsx(Un,{id:e.item.linkId,name:e.item.linkId,required:e.required??n.required,defaultChecked:f==null?void 0:f.value,onChange:g=>i([{valueBoolean:g.currentTarget.checked}])})},e.item.linkId);break;case jt.decimal:m=s.jsx($e,{type:"number",step:"any",id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>i([{valueDecimal:g.currentTarget.value===""?void 0:g.currentTarget.valueAsNumber}])});break;case jt.integer:m=s.jsx($e,{type:"number",step:1,id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>i([{valueInteger:g.currentTarget.value===""?void 0:g.currentTarget.valueAsNumber}])});break;case jt.date:m=s.jsx($e,{type:"date",id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>i([{valueDate:g.currentTarget.value}])});break;case jt.dateTime:m=s.jsx(aa,{name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>i([{valueDateTime:g}])});break;case jt.time:m=s.jsx($e,{type:"time",id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>i([{valueTime:g.currentTarget.value}])});break;case jt.string:case jt.url:m=s.jsx($e,{id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>{const y=g.currentTarget.value;i([{valueString:y===""?void 0:y}])}});break;case jt.text:m=s.jsx(tl,{id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>{const y=g.currentTarget.value;i([{valueString:y===""?void 0:y}])}});break;case jt.attachment:m=s.jsx(je,{py:4,children:s.jsx(EA,{path:"",name:c,defaultValue:f==null?void 0:f.value,onChange:g=>i([{valueAttachment:g}])})});break;case jt.reference:m=s.jsx(kd,{name:c,required:e.required??n.required,targetTypes:oA(n),searchCriteria:uF(n,t==null?void 0:t.subject,t==null?void 0:t.encounter),defaultValue:f==null?void 0:f.value,onChange:g=>i([{valueReference:g}])});break;case jt.quantity:m=s.jsx(Ws,{path:"",name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>i([{valueQuantity:g}]),disableWheel:!0});break;case jt.choice:case jt.openChoice:sX(n)?m=s.jsx(iX,{name:c,item:n,required:e.required??n.required,initial:u,response:r,onChangeAnswer:g=>i(g)}):oX(n)||n.answerValueSet&&!lX(n)?m=s.jsx(tX,{name:c,item:n,required:e.required??n.required,initial:u,response:r,onChangeAnswer:g=>i(g)}):m=s.jsx(rX,{name:c,item:n,required:e.required??n.required,initial:u,response:r,onChangeAnswer:g=>i(g)});break;default:return null}return s.jsxs(s.Fragment,{children:[m,(h==null?void 0:h.valueString)&&s.jsx(_e,{c:"red",size:"lg",mt:4,children:h.valueString})]})}function tX(e){var g;const{name:t,item:n,required:r,initial:i,onChangeAnswer:o,response:c}=e;if(!((g=n.answerOption)!=null&&g.length)&&!n.answerValueSet)return s.jsx(Vb,{});const u=xb(i),f=Fb(c)??u,h=dk(c),m=n.repeats||cX(n);if(n.answerValueSet)return s.jsx(om,{name:t,placeholder:"Select items",binding:n.answerValueSet,maxValues:m?void 0:1,required:r,onChange:y=>{m?y.length===0?o([{}]):o(y.map(b=>({valueCoding:b}))):o([{valueCoding:y[0]}])},defaultValue:f==null?void 0:f.value});if(m){const{propertyName:y,data:b}=uX(n);return s.jsx(Lp,{data:b,placeholder:"Select items",searchable:!0,defaultValue:h||[Fs(u)],required:r,onChange:S=>{if(S.length===0)o([{}]);else{const j=iA(S,y,n);o(j)}}})}else{const y=[""];if(n.answerOption)for(const b of n.answerOption){const S=ca(b);y.push(Fs(S))}return s.jsx(sn,{id:t,name:t,required:r,onChange:b=>{const S=b.currentTarget.selectedIndex;if(S===0){o([{}]);return}const j=n.answerOption[S-1],C=ca(j),T="value"+Ln(C.type);o([{[T]:C.value}])},defaultValue:Td(f==null?void 0:f.value)||(f==null?void 0:f.value),data:y})}}function nX(e,t){return e?t.valueSetExpand({url:e,count:Is+1}).then(n=>{var r;return((r=n.expansion)==null?void 0:r.contains)??[]}):Promise.resolve([])}function ck(e){const t=Ae(),[n,r]=v.useState([]),[i,o]=v.useState(!1);return v.useEffect(()=>{async function c(){if(e){o(!0);try{const u=await nX(e,t);r(u)}catch(u){console.error("Error loading value set:",u)}finally{o(!1)}}}c().catch(console.error)},[e,t]),[n,i]}function uk(e,t){return e.map((n,r)=>{const i=`${t}-valueset-${r}`,o={type:"Coding",value:{system:n.system,code:n.code,display:n.display}};return[i,o]})}function rX(e){const{name:t,item:n,required:r,initial:i,onChangeAnswer:o,response:c}=e,u=Ko("QuestionnaireItemAnswerOption","value[x]"),f=xb(i),[h,m]=ck(n.answerValueSet),g=[];let y;if(n.answerValueSet)g.push(...uk(h,t));else if(n.answerOption){const C=n.answerOption.slice(0,Qh).map((T,_)=>{const E=`${t}-option-${_}`,R=ca(T);return R!=null&&R.value?(f&&Oi(R)===Oi(f)&&(y=E),[E,R]):null}).filter(T=>T!==null);g.push(...C)}const b=Fb(c),S=aX(g,b);if(m)return s.jsx(_e,{children:"Loading options..."});if(g.length===0)return s.jsx(Vb,{});const j=g.slice(0,Is);return s.jsxs(s.Fragment,{children:[s.jsx(Bs.Group,{name:t,value:S??y,required:r,onChange:C=>{const T=g.find(_=>_[0]===C);if(T){const _=T[1],E="value"+Ln(_.type);o([{[E]:_.value}])}},children:j.map(([C,T])=>s.jsx(Bs,{id:C,value:C,py:4,required:r,label:s.jsx(Mi,{property:u,propertyType:T.type,value:T.value})},C))}),(n.answerValueSet&&g.length>Is||n.answerOption&&g.length>Qh)&&s.jsxs(_e,{size:"sm",c:"dimmed",mt:"xs",children:["Showing first ",Is," options"]})]})}function iX(e){var S;const{name:t,item:n,onChangeAnswer:r,response:i}=e,o=Ko("QuestionnaireItemAnswerOption","value[x]"),[c,u]=ck(n.answerValueSet),f=n.answerValueSet?(((S=i==null?void 0:i.answer)==null?void 0:S.map(j=>j.valueCoding))||[]).filter(j=>j!==void 0):dk(i),[h,m]=v.useState(f),g=[];if(n.answerValueSet)g.push(...uk(c,t));else if(n.answerOption){const j=n.answerOption.slice(0,Qh).map((C,T)=>{const _=`${t}-option-${T}`,E=ca(C);return E!=null&&E.value?[_,E]:null}).filter(C=>C!==null);g.push(...j)}if(u)return s.jsx(_e,{children:"Loading options..."});if(g.length===0)return s.jsx(Vb,{});const y=g.slice(0,Is),b=(j,C)=>{if(n.answerValueSet){const T=h;let _;C?_=[...T,j.value]:_=T.filter(E=>!sa(E,j.value)),m(_),_.length===0?r([{}]):r(_.map(E=>({valueCoding:E})))}else{const T=h,_=Fs(j);let E;if(C?E=[...T,_]:E=T.filter(R=>R!==_),m(E),E.length===0)r([{}]);else{const R=iA(E,"value"+Ln(j.type),n);r(R)}}};return s.jsxs(je,{style:{flexDirection:"column",alignItems:"flex-start"},children:[y.map(([j,C])=>{const T=Fs(C),_=n.answerValueSet?h.some(E=>sa(E,C.value)):h.includes(T);return s.jsx(Un,{id:j,label:s.jsx(Mi,{property:o,propertyType:C.type,value:C.value}),checked:_,onChange:E=>b(C,E.currentTarget.checked)},j)}),(n.answerValueSet&&g.length>Is||n.answerOption&&g.length>Qh)&&s.jsxs(_e,{size:"sm",c:"dimmed",children:["Showing first ",Is," options"]})]})}function Vb(){return s.jsx($e,{disabled:!0,placeholder:"No Answers Defined"})}function Fb(e,t=0){var n;return ca(((n=e==null?void 0:e.answer)==null?void 0:n[t])??{})}function dk(e){const t=e==null?void 0:e.answer;return t?t.map(r=>ca(r)).map(r=>Td(r==null?void 0:r.value)||(r==null?void 0:r.value)).filter(Boolean):[]}function aX(e,t){var n;return(n=e.find(r=>sa(r[1].value,t==null?void 0:t.value)))==null?void 0:n[0]}function mm(e,t){var n;return!!((n=e.extension)!=null&&n.some(r=>{var i,o,c;return r.url===vb&&((c=(o=(i=r.valueCodeableConcept)==null?void 0:i.coding)==null?void 0:o[0])==null?void 0:c.code)===t}))}function oX(e){return mm(e,"drop-down")}function sX(e){return mm(e,"check-box")}function lX(e){return mm(e,"radio-button")}function cX(e){return mm(e,"multi-select")}function uX(e){var o;if(((o=e.answerOption)==null?void 0:o.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=ca(t),r="value"+Ln(n.type),i=(e.answerOption??[]).map(c=>{const u=ca(c),f=Fs(u);return{value:f,label:f}});return{propertyName:r,data:i}}const dX="_section_my8o4_1",fX="_hovering_my8o4_10",hX="_editing_my8o4_14",pX="_questionBody_my8o4_20",mX="_topActions_my8o4_24",gX="_bottomActions_my8o4_33",vX="_movementActions_my8o4_44",yX="_movementIcons_my8o4_56",xX="_columnAlignment_my8o4_60",bX="_linkIdInput_my8o4_65",SX="_typeSelect_my8o4_70",wX="_preserveBreaks_my8o4_74",Fr={section:dX,hovering:fX,editing:hX,questionBody:pX,topActions:mX,bottomActions:gX,movementActions:vX,movementIcons:yX,columnAlignment:xX,linkIdInput:bX,typeSelect:SX,preserveBreaks:wX};function jX(e){const t=Ae(),n=Wt(e.questionnaire),[r,i]=v.useState(!1),[o,c]=v.useState(),[u,f]=v.useState(),[h,m]=v.useState();function g(){m(void 0)}function y(){f(void 0)}v.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>i(!0)).catch(console.log)},[t]),v.useEffect(()=>(c(RX(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",y),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",y)}),[n]);const b=(S,j)=>{c(S),e.autoSave&&!j&&e.onSubmit&&e.onSubmit(S)};return!r||!o?null:s.jsx("div",{children:s.jsxs(mt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(o),children:[s.jsx(fk,{item:o,selectedKey:u,setSelectedKey:f,hoverKey:h,setHoverKey:m,onChange:b}),s.jsx(xr,{children:"Save"})]})})}function fk(e){var E;const t=e.item,n=e.item,r=ha(e.item),i=r||n.type===jt.group,o=n.linkId??"[untitled]",c=e.selectedKey===e.item.id,u=e.hoverKey===e.item.id,f=v.useRef(e.item);f.current=e.item;function h(R){hn(R),e.setSelectedKey(e.item.id)}function m(R){hn(R),e.setHoverKey(e.item.id)}function g(R){var k;const D=f.current;e.onChange({...D,item:(k=D.item)==null?void 0:k.map(M=>M.id===R.id?R:M)})}function y(R,D){e.onChange({...e.item,item:[...e.item.item??[],R]},D)}function b(R){var D;e.onChange({...e.item,item:(D=e.item.item)==null?void 0:D.filter(k=>k!==R)})}function S(R,D){e.onChange({...f.current,[R]:D})}function j(R){e.onChange({...e.item,...R})}function C(R){var D;e.onChange({...e.item,item:(D=e.item.item)==null?void 0:D.map(k=>k===R?{...k,repeats:!k.repeats}:k)})}function T(R,D){const k=AX(e.item.item,R,D);e.onChange({...e.item,item:k})}const _=zt(Fr.section,{[Fr.editing]:c,[Fr.hovering]:u&&!c});return s.jsxs("div",{"data-testid":n.linkId,className:_,onClick:h,onMouseOver:m,onFocus:m,children:[s.jsx("div",{className:Fr.questionBody,children:c?s.jsxs(s.Fragment,{children:[r&&s.jsx($e,{size:"xl",defaultValue:t.title,onBlur:R=>S("title",R.currentTarget.value)}),!r&&s.jsx(tl,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:R=>S("text",R.currentTarget.value)}),n.type==="reference"&&s.jsx(TX,{item:n,onChange:j}),eF(n)&&s.jsx(CX,{item:n,onChange:R=>j(R)})]}):s.jsxs(s.Fragment,{children:[t.title&&s.jsx(Ie,{children:t.title}),n.text&&s.jsx("div",{className:Fr.preserveBreaks,children:n.text}),!i&&s.jsx(Yh,{item:n,index:0,required:!1,responseItem:{linkId:n.linkId}})]})}),(E=n.item)==null?void 0:E.map((R,D)=>s.jsx("div",{children:s.jsx(fk,{item:R,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:D===0,isLast:D===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:g,onRemove:()=>b(R),onRepeatable:C,onMoveUp:()=>T(D,-1),onMoveDown:()=>T(D,1)})},R.id)),!i&&s.jsx("div",{className:Fr.topActions,children:c?s.jsxs(s.Fragment,{children:[s.jsx($e,{size:"xs",className:Fr.linkIdInput,defaultValue:n.linkId,onBlur:R=>S("linkId",R.currentTarget.value)}),!i&&s.jsx(sn,{size:"xs",className:Fr.typeSelect,defaultValue:n.type,onChange:R=>S("type",R.currentTarget.value),data:[{value:"display",label:"Display"},{value:"boolean",label:"Boolean"},{value:"decimal",label:"Decimal"},{value:"integer",label:"Integer"},{value:"date",label:"Date"},{value:"dateTime",label:"Date/Time"},{value:"time",label:"Time"},{value:"string",label:"String"},{value:"text",label:"Text"},{value:"url",label:"URL"},{value:"choice",label:"Choice"},{value:"open-choice",label:"Open Choice"},{value:"attachment",label:"Attachment"},{value:"reference",label:"Reference"},{value:"quantity",label:"Quantity"}]})]}):s.jsx("div",{children:o})}),!r&&s.jsx(ce,{className:Fr.movementActions,children:s.jsxs(ce,{className:Fr.columnAlignment,children:[!e.isFirst&&s.jsx(Pt,{href:"#",onClick:R=>{R.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:s.jsx(NF,{"data-testid":"up-button",size:15,className:Fr.movementIcons})}),!e.isLast&&s.jsx(Pt,{href:"#",onClick:R=>{R.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:s.jsx(kF,{"data-testid":"down-button",size:15,className:Fr.movementIcons})})]})}),s.jsxs("div",{className:Fr.bottomActions,children:[i&&s.jsxs(s.Fragment,{children:[s.jsx(Pt,{href:"#",onClick:R=>{R.preventDefault(),y({id:Xs(),linkId:Jy("q"),type:"string",text:"Question"})},children:"Add item"}),s.jsx(Pt,{href:"#",onClick:R=>{R.preventDefault(),y({id:Xs(),linkId:Jy("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&s.jsx(Pt,{href:"#",onClick:R=>{R.preventDefault(),y(DX(),!0)},children:"Add Page"}),c&&!r&&s.jsxs(s.Fragment,{children:[s.jsx(Pt,{href:"#",onClick:R=>{R.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),s.jsx(Pt,{href:"#",onClick:R=>{R.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function CX(e){const t=Ko("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return s.jsxs("div",{children:[e.item.answerValueSet!==void 0?s.jsx($e,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):s.jsx(EX,{options:n,property:t,item:e.item,onChange:e.onChange}),s.jsxs(ce,{display:"flex",children:[s.jsx(Pt,{href:"#",onClick:r=>{hn(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:Xs()}]})},children:"Add choice"}),s.jsx(Gp,{w:"lg"}),s.jsx(Pt,{href:"#",onClick:r=>{hn(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function EX(e){return s.jsx("div",{children:e.options.map(t=>{const[n,r]=lm({type:"QuestionnaireItemAnswerOption",value:t},"value");return s.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"},children:[s.jsx("div",{children:s.jsx(Pd,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(i,o)=>{const c=[...e.options],u=c.findIndex(f=>f.id===t.id);c[u]={id:t.id,[o]:i},e.onChange({...e.item,answerOption:c})},outcome:void 0},t.id)}),s.jsx("div",{children:s.jsx(Pt,{href:"#",onClick:i=>{hn(i),e.onChange({...e.item,answerOption:e.options.filter(o=>o.id!==t.id)})},children:"Remove"})})]},t.id)})})}function TX(e){const t=oA(e.item)??[];return s.jsxs(s.Fragment,{children:[t.map((n,r)=>s.jsxs(je,{children:[s.jsx(_b,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:i=>{e.onChange(Jv(e.item,t.map(o=>o===n?i:o)))}}),s.jsx(Pt,{href:"#",onClick:i=>{hn(i),e.onChange(Jv(e.item,t.filter(o=>o!==n)))},children:"Remove"})]},`${n}-${r}`)),s.jsx(Pt,{href:"#",onClick:n=>{hn(n),e.onChange(Jv(e.item,[...t,""]))},children:"Add Resource Type"})]})}let Ky=1,Zy=1;function Jy(e){return e+Ky++}function Xs(){return"id-"+Zy++}function RX(e){return{...e,id:e.id||Xs(),item:hk(e.item)}}function hk(e){if(e)return e.forEach(t=>{var n,r;(n=t.id)!=null&&n.match(/^id-\d+$/)&&(Zy=Math.max(Zy,parseInt(t.id.substring(3),10)+1)),(r=t.linkId)!=null&&r.match(/^q\d+$/)&&(Ky=Math.max(Ky,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||Xs(),item:hk(t.item),answerOption:_X(t.answerOption)}))}function _X(e){if(e)return e.map(t=>({...t,id:t.id||Xs()}))}function DX(){return{id:Xs(),linkId:Jy("s"),type:"group",text:"New Page",extension:[{url:vb,valueCodeableConcept:{coding:[{system:"http://hl7.org/fhir/questionnaire-item-control",code:"page"}]}}]}}function AX(e,t,n){const r=e??[],i=t+n;if(i<0||i>=r.length)return r;const o=[...r];return[o[t],o[i]]=[o[i],o[t]],o}/*!
537
+ * Signature Pad v5.0.10 | https://github.com/szimek/signature_pad
538
+ * (c) 2025 Szymon Nowak | Released under the MIT license
539
+ */class Xh{constructor(t,n,r,i){if(isNaN(t)||isNaN(n))throw new Error(`Point is invalid: (${t}, ${n})`);this.x=+t,this.y=+n,this.pressure=r||0,this.time=i||Date.now()}distanceTo(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))}equals(t){return this.x===t.x&&this.y===t.y&&this.pressure===t.pressure&&this.time===t.time}velocityFrom(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0}}class Hb{static fromPoints(t,n){const r=this.calculateControlPoints(t[0],t[1],t[2]).c2,i=this.calculateControlPoints(t[1],t[2],t[3]).c1;return new Hb(t[1],r,i,t[2],n.start,n.end)}static calculateControlPoints(t,n,r){const i=t.x-n.x,o=t.y-n.y,c=n.x-r.x,u=n.y-r.y,f={x:(t.x+n.x)/2,y:(t.y+n.y)/2},h={x:(n.x+r.x)/2,y:(n.y+r.y)/2},m=Math.sqrt(i*i+o*o),g=Math.sqrt(c*c+u*u),y=f.x-h.x,b=f.y-h.y,S=m+g==0?0:g/(m+g),j={x:h.x+y*S,y:h.y+b*S},C=n.x-j.x,T=n.y-j.y;return{c1:new Xh(f.x+C,f.y+T),c2:new Xh(h.x+C,h.y+T)}}constructor(t,n,r,i,o,c){this.startPoint=t,this.control2=n,this.control1=r,this.endPoint=i,this.startWidth=o,this.endWidth=c}length(){let n=0,r,i;for(let o=0;o<=10;o+=1){const c=o/10,u=this.point(c,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),f=this.point(c,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(o>0){const h=u-r,m=f-i;n+=Math.sqrt(h*h+m*m)}r=u,i=f}return n}point(t,n,r,i,o){return n*(1-t)*(1-t)*(1-t)+3*r*(1-t)*(1-t)*t+3*i*(1-t)*t*t+o*t*t*t}}class kX{constructor(){try{this._et=new EventTarget}catch{this._et=document}}addEventListener(t,n,r){this._et.addEventListener(t,n,r)}dispatchEvent(t){return this._et.dispatchEvent(t)}removeEventListener(t,n,r){this._et.removeEventListener(t,n,r)}}function PX(e,t=250){let n=0,r=null,i,o,c;const u=()=>{n=Date.now(),r=null,i=e.apply(o,c),r||(o=null,c=[])};return function(...h){const m=Date.now(),g=t-(m-n);return o=this,c=h,g<=0||g>t?(r&&(clearTimeout(r),r=null),n=m,i=e.apply(o,c),r||(o=null,c=[])):r||(r=window.setTimeout(u,g)),i}}class Kh extends kX{constructor(t,n={}){var r,i,o;super(),this.canvas=t,this._drawingStroke=!1,this._isEmpty=!0,this._lastPoints=[],this._data=[],this._lastVelocity=0,this._lastWidth=0,this.velocityFilterWeight=n.velocityFilterWeight||.7,this.minWidth=n.minWidth||.5,this.maxWidth=n.maxWidth||2.5,this.throttle=(r=n.throttle)!==null&&r!==void 0?r:16,this.minDistance=(i=n.minDistance)!==null&&i!==void 0?i:5,this.dotSize=n.dotSize||0,this.penColor=n.penColor||"black",this.backgroundColor=n.backgroundColor||"rgba(0,0,0,0)",this.compositeOperation=n.compositeOperation||"source-over",this.canvasContextOptions=(o=n.canvasContextOptions)!==null&&o!==void 0?o:{},this._strokeMoveUpdate=this.throttle?PX(Kh.prototype._strokeUpdate,this.throttle):Kh.prototype._strokeUpdate,this._handleMouseDown=this._handleMouseDown.bind(this),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this._handleTouchStart=this._handleTouchStart.bind(this),this._handleTouchMove=this._handleTouchMove.bind(this),this._handleTouchEnd=this._handleTouchEnd.bind(this),this._handlePointerDown=this._handlePointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._ctx=t.getContext("2d",this.canvasContextOptions),this.clear(),this.on()}clear(){const{_ctx:t,canvas:n}=this;t.fillStyle=this.backgroundColor,t.clearRect(0,0,n.width,n.height),t.fillRect(0,0,n.width,n.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0,this._strokePointerId=void 0}fromDataURL(t,n={}){return new Promise((r,i)=>{const o=new Image,c=n.ratio||window.devicePixelRatio||1,u=n.width||this.canvas.width/c,f=n.height||this.canvas.height/c,h=n.xOffset||0,m=n.yOffset||0;this._reset(this._getPointGroupOptions()),o.onload=()=>{this._ctx.drawImage(o,h,m,u,f),r()},o.onerror=g=>{i(g)},o.crossOrigin="anonymous",o.src=t,this._isEmpty=!1})}toDataURL(t="image/png",n){switch(t){case"image/svg+xml":return typeof n!="object"&&(n=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(n))}`;default:return typeof n!="number"&&(n=void 0),this.canvas.toDataURL(t,n)}}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none";const t=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!t?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("pointerdown",this._handlePointerDown),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this._removeMoveUpEventListeners()}_getListenerFunctions(){var t;const n=window.document===this.canvas.ownerDocument?window:(t=this.canvas.ownerDocument.defaultView)!==null&&t!==void 0?t:this.canvas.ownerDocument;return{addEventListener:n.addEventListener.bind(n),removeEventListener:n.removeEventListener.bind(n)}}_removeMoveUpEventListeners(){const{removeEventListener:t}=this._getListenerFunctions();t("pointermove",this._handlePointerMove),t("pointerup",this._handlePointerUp),t("mousemove",this._handleMouseMove),t("mouseup",this._handleMouseUp),t("touchmove",this._handleTouchMove),t("touchend",this._handleTouchEnd)}isEmpty(){return this._isEmpty}fromData(t,{clear:n=!0}={}){n&&this.clear(),this._fromData(t,this._drawCurve.bind(this),this._drawDot.bind(this)),this._data=this._data.concat(t)}toData(){return this._data}_isLeftButtonPressed(t,n){return n?t.buttons===1:(t.buttons&1)===1}_pointerEventToSignatureEvent(t){return{event:t,type:t.type,x:t.clientX,y:t.clientY,pressure:"pressure"in t?t.pressure:0}}_touchEventToSignatureEvent(t){const n=t.changedTouches[0];return{event:t,type:t.type,x:n.clientX,y:n.clientY,pressure:n.force}}_handleMouseDown(t){!this._isLeftButtonPressed(t,!0)||this._drawingStroke||this._strokeBegin(this._pointerEventToSignatureEvent(t))}_handleMouseMove(t){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}_handleMouseUp(t){this._isLeftButtonPressed(t)||this._strokeEnd(this._pointerEventToSignatureEvent(t))}_handleTouchStart(t){t.targetTouches.length!==1||this._drawingStroke||(t.cancelable&&t.preventDefault(),this._strokeBegin(this._touchEventToSignatureEvent(t)))}_handleTouchMove(t){if(t.targetTouches.length===1){if(t.cancelable&&t.preventDefault(),!this._drawingStroke){this._strokeEnd(this._touchEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._touchEventToSignatureEvent(t))}}_handleTouchEnd(t){t.targetTouches.length===0&&(t.cancelable&&t.preventDefault(),this._strokeEnd(this._touchEventToSignatureEvent(t)))}_getPointerId(t){return t.persistentDeviceId||t.pointerId}_allowPointerId(t,n=!1){return typeof this._strokePointerId>"u"?n:this._getPointerId(t)===this._strokePointerId}_handlePointerDown(t){this._drawingStroke||!this._isLeftButtonPressed(t)||!this._allowPointerId(t,!0)||(this._strokePointerId=this._getPointerId(t),t.preventDefault(),this._strokeBegin(this._pointerEventToSignatureEvent(t)))}_handlePointerMove(t){if(this._allowPointerId(t)){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}t.preventDefault(),this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}}_handlePointerUp(t){this._isLeftButtonPressed(t)||!this._allowPointerId(t)||(t.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(t)))}_getPointGroupOptions(t){return{penColor:t&&"penColor"in t?t.penColor:this.penColor,dotSize:t&&"dotSize"in t?t.dotSize:this.dotSize,minWidth:t&&"minWidth"in t?t.minWidth:this.minWidth,maxWidth:t&&"maxWidth"in t?t.maxWidth:this.maxWidth,velocityFilterWeight:t&&"velocityFilterWeight"in t?t.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:t&&"compositeOperation"in t?t.compositeOperation:this.compositeOperation}}_strokeBegin(t){if(!this.dispatchEvent(new CustomEvent("beginStroke",{detail:t,cancelable:!0})))return;const{addEventListener:r}=this._getListenerFunctions();switch(t.event.type){case"mousedown":r("mousemove",this._handleMouseMove,{passive:!1}),r("mouseup",this._handleMouseUp,{passive:!1});break;case"touchstart":r("touchmove",this._handleTouchMove,{passive:!1}),r("touchend",this._handleTouchEnd,{passive:!1});break;case"pointerdown":r("pointermove",this._handlePointerMove,{passive:!1}),r("pointerup",this._handlePointerUp,{passive:!1});break}this._drawingStroke=!0;const i=this._getPointGroupOptions(),o=Object.assign(Object.assign({},i),{points:[]});this._data.push(o),this._reset(i),this._strokeUpdate(t)}_strokeUpdate(t){if(!this._drawingStroke)return;if(this._data.length===0){this._strokeBegin(t);return}this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:t}));const n=this._createPoint(t.x,t.y,t.pressure),r=this._data[this._data.length-1],i=r.points,o=i.length>0&&i[i.length-1],c=o?n.distanceTo(o)<=this.minDistance:!1,u=this._getPointGroupOptions(r);if(!o||!(o&&c)){const f=this._addPoint(n,u);o?f&&this._drawCurve(f,u):this._drawDot(n,u),i.push({time:n.time,x:n.x,y:n.y,pressure:n.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:t}))}_strokeEnd(t,n=!0){this._removeMoveUpEventListeners(),this._drawingStroke&&(n&&this._strokeUpdate(t),this._drawingStroke=!1,this._strokePointerId=void 0,this.dispatchEvent(new CustomEvent("endStroke",{detail:t})))}_handlePointerEvents(){this._drawingStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerDown,{passive:!1})}_handleMouseEvents(){this._drawingStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown,{passive:!1})}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart,{passive:!1})}_reset(t){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(t.minWidth+t.maxWidth)/2,this._ctx.fillStyle=t.penColor,this._ctx.globalCompositeOperation=t.compositeOperation}_createPoint(t,n,r){const i=this.canvas.getBoundingClientRect();return new Xh(t-i.left,n-i.top,r,new Date().getTime())}_addPoint(t,n){const{_lastPoints:r}=this;if(r.push(t),r.length>2){r.length===3&&r.unshift(r[0]);const i=this._calculateCurveWidths(r[1],r[2],n),o=Hb.fromPoints(r,i);return r.shift(),o}return null}_calculateCurveWidths(t,n,r){const i=r.velocityFilterWeight*n.velocityFrom(t)+(1-r.velocityFilterWeight)*this._lastVelocity,o=this._strokeWidth(i,r),c={end:o,start:this._lastWidth};return this._lastVelocity=i,this._lastWidth=o,c}_strokeWidth(t,n){return Math.max(n.maxWidth/(t+1),n.minWidth)}_drawCurveSegment(t,n,r){const i=this._ctx;i.moveTo(t,n),i.arc(t,n,r,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(t,n){const r=this._ctx,i=t.endWidth-t.startWidth,o=Math.ceil(t.length())*2;r.beginPath(),r.fillStyle=n.penColor;for(let c=0;c<o;c+=1){const u=c/o,f=u*u,h=f*u,m=1-u,g=m*m,y=g*m;let b=y*t.startPoint.x;b+=3*g*u*t.control1.x,b+=3*m*f*t.control2.x,b+=h*t.endPoint.x;let S=y*t.startPoint.y;S+=3*g*u*t.control1.y,S+=3*m*f*t.control2.y,S+=h*t.endPoint.y;const j=Math.min(t.startWidth+h*i,n.maxWidth);this._drawCurveSegment(b,S,j)}r.closePath(),r.fill()}_drawDot(t,n){const r=this._ctx,i=n.dotSize>0?n.dotSize:(n.minWidth+n.maxWidth)/2;r.beginPath(),this._drawCurveSegment(t.x,t.y,i),r.closePath(),r.fillStyle=n.penColor,r.fill()}_fromData(t,n,r){for(const i of t){const{points:o}=i,c=this._getPointGroupOptions(i);if(o.length>1)for(let u=0;u<o.length;u+=1){const f=o[u],h=new Xh(f.x,f.y,f.pressure,f.time);u===0&&this._reset(c);const m=this._addPoint(h,c);m&&n(m,c)}else this._reset(c),r(o[0],c)}}toSVG({includeBackgroundColor:t=!1}={}){const n=this._data,r=Math.max(window.devicePixelRatio||1,1),i=0,o=0,c=this.canvas.width/r,u=this.canvas.height/r,f=document.createElementNS("http://www.w3.org/2000/svg","svg");if(f.setAttribute("xmlns","http://www.w3.org/2000/svg"),f.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),f.setAttribute("viewBox",`${i} ${o} ${c} ${u}`),f.setAttribute("width",c.toString()),f.setAttribute("height",u.toString()),t&&this.backgroundColor){const h=document.createElement("rect");h.setAttribute("width","100%"),h.setAttribute("height","100%"),h.setAttribute("fill",this.backgroundColor),f.appendChild(h)}return this._fromData(n,(h,{penColor:m})=>{const g=document.createElement("path");if(!isNaN(h.control1.x)&&!isNaN(h.control1.y)&&!isNaN(h.control2.x)&&!isNaN(h.control2.y)){const y=`M ${h.startPoint.x.toFixed(3)},${h.startPoint.y.toFixed(3)} C ${h.control1.x.toFixed(3)},${h.control1.y.toFixed(3)} ${h.control2.x.toFixed(3)},${h.control2.y.toFixed(3)} ${h.endPoint.x.toFixed(3)},${h.endPoint.y.toFixed(3)}`;g.setAttribute("d",y),g.setAttribute("stroke-width",(h.endWidth*2.25).toFixed(3)),g.setAttribute("stroke",m),g.setAttribute("fill","none"),g.setAttribute("stroke-linecap","round"),f.appendChild(g)}},(h,{penColor:m,dotSize:g,minWidth:y,maxWidth:b})=>{const S=document.createElement("circle"),j=g>0?g:(y+b)/2;S.setAttribute("r",j.toString()),S.setAttribute("cx",h.x.toString()),S.setAttribute("cy",h.y.toString()),S.setAttribute("fill",m),f.appendChild(S)}),f.outerHTML}}function NX(e){const t=Ae(),{width:n=500,height:r=200,defaultValue:i,who:o,onChange:c,...u}=e,f=v.useRef(null),h=v.useRef(null),m=v.useRef(c);m.current=c,v.useEffect(()=>{function y(){var b,S;(S=m.current)==null||S.call(m,{type:[{system:$i+"/fhir/signature-type",code:"ProofOfOrigin",display:"Proof of Origin"}],when:new Date().toISOString(),who:o??tn(t.getProfile()),data:(b=h.current)==null?void 0:b.toDataURL()})}if(f.current){const b=new Kh(f.current);i!=null&&i.data&&b.fromDataURL(i.data).catch(console.error),b.addEventListener("endStroke",y),h.current=b}return()=>{h.current&&h.current.removeEventListener("beginStroke",y)}},[t,i,o]);const g=()=>{var y;h.current&&h.current.clear(),(y=m.current)==null||y.call(m,void 0)};return s.jsxs(lr,{withBorder:!0,p:0,w:n,h:r,pos:"relative",...u,children:[s.jsx("canvas",{ref:f,width:n,height:r,"aria-label":"Signature input area"}),s.jsx(Pe,{onClick:g,"aria-label":"Clear signature",pos:"absolute",top:0,right:0,size:"xs",leftSection:s.jsx(am,{size:16}),variant:"subtle",color:"gray",children:"Clear"})]})}function pk(e){const t=[...e.context,e.responseItem];return s.jsxs("div",{children:[e.item.text&&s.jsx(Ie,{order:3,mb:"md",children:e.item.text}),s.jsx(ex,{formState:e.formState,context:t,items:e.item.item??[],responseItems:e.responseItem.item??[]})]},e.item.linkId)}function OX(e){return s.jsxs(s.Fragment,{children:[e.responseItems.map(t=>s.jsx(pk,{formState:e.formState,context:e.context,item:e.item,responseItem:t},`group-${t.id}`)),s.jsx(Pt,{onClick:()=>e.formState.onAddGroup(e.context,e.item),children:`Add Group: ${e.item.text}`})]})}function MX(e){const{formState:t,context:n,item:r,responseItem:i}=e,o=r.type!==jt.choice&&r.type!==jt.openChoice,c=i.answer&&i.answer.length>0?i.answer:[{}];return s.jsxs(Lt,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[s.jsx(qe,{gap:"xs",children:c==null?void 0:c.map((u,f)=>s.jsx(Yh,{formState:t,context:n,item:r,responseItem:i,index:f},`${r.linkId}-${f}`))}),o&&s.jsx(Pt,{onClick:()=>t.onAddAnswer(n,r),children:"Add Item"})]},e.item.linkId)}function ex(e){const{formState:t,context:n,items:r,responseItems:i}=e;return s.jsx(qe,{children:r.map((o,c)=>{if(!tF(o,t.questionnaireResponse))return null;if(o.type===jt.display)return s.jsx("p",{children:o.text},`display-${o.id}-${c}`);const u=i.filter(f=>f.linkId===o.linkId);return o.type===jt.group&&o.repeats?s.jsx(OX,{formState:t,context:n,item:o,responseItems:u},`repeating-group-${o.id}-${c}`):o.type===jt.group?s.jsx(pk,{formState:t,context:n,item:o,responseItem:u[0]},`group-${o.id}-${c}`):o.type===jt.boolean?s.jsx(Yh,{formState:t,context:n,item:o,responseItem:u[0],index:0},`boolean-item-${o.id}-${c}`):o.repeats?s.jsx(MX,{formState:t,context:n,item:o,responseItem:u[0]},`repeating-item-${o.id}-${c}`):s.jsx(Lt,{htmlFor:o.linkId,title:o.text,withAsterisk:o.required,children:s.jsx(Yh,{formState:t,context:n,item:o,responseItem:u[0],index:0})},`repeating-item-${o.id}-${c}`)})})}function LX(e){const{formState:t,submitButtonText:n,excludeButtons:r,children:i}=e,o=t.pages,c=t.activePage,u=c>0,f=c<o.length-1,h=c===o.length-1;return s.jsxs(s.Fragment,{children:[s.jsx(yc,{active:c,allowNextStepsSelect:!1,p:6,children:o.map((m,g)=>s.jsx(yc.Step,{label:m.title,children:g===c&&i},m.linkId))}),!r&&s.jsxs(je,{justify:"flex-end",mt:"xl",gap:"xs",children:[u&&s.jsx(Pe,{onClick:t.onPrevPage,children:"Back"}),f&&s.jsx(Pe,{onClick:m=>{m.currentTarget.closest("form").reportValidity()&&t.onNextPage()},children:"Next"}),h&&s.jsx(xr,{children:n??"Submit"})]})]})}function mk(e){const t=Ae(),[n,r]=v.useState(!1),i=v.useRef(e);i.current=e;const o=v.useCallback(g=>{var y,b;r(!1),(b=(y=i.current).onChange)==null||b.call(y,g)},[]),c=pF({questionnaire:e.questionnaire,defaultValue:e.questionnaireResponse,subject:e.subject,encounter:e.encounter,source:e.source,disablePagination:e.disablePagination,onChange:o}),u=v.useRef(c);u.current=c;const f=v.useMemo(()=>c.loading?!1:!!fa(c.questionnaire,JV),[c]),h=v.useMemo(()=>{var g;return c.loading?!1:!!((g=c.questionnaireResponse.extension)!=null&&g.find(y=>y.url===Sh))},[c]),m=v.useCallback(()=>{const g=u.current;if(g.loading)return;const y=i.current.onSubmit;if(!y)return;if(f&&!h){r(!0);return}const b=g.questionnaire,S=g.questionnaireResponse,j=i.current.subject;let C=i.current.source;if(!C){const T=t.getProfile();T&&(C=tn(T))}y({...S,questionnaire:b.url??Mt(b),subject:j,source:C,authored:new Date().toISOString(),status:"completed"})},[t,f,h]);return c.loading?null:s.jsxs(mt,{testid:"questionnaire-form",onSubmit:m,children:[c.questionnaire.title&&s.jsx(Ie,{children:c.questionnaire.title}),c.pagination?s.jsx(LX,{formState:c,submitButtonText:e.submitButtonText,excludeButtons:e.excludeButtons,children:s.jsx(ex,{formState:c,context:[],items:c.items,responseItems:c.responseItems})}):s.jsxs(s.Fragment,{children:[s.jsx(ex,{formState:c,context:[],items:c.items,responseItems:c.responseItems}),f&&s.jsxs(qe,{mt:"md",gap:0,children:[s.jsx(_e,{size:"sm",fw:500,children:"Signature"}),s.jsx(NX,{onChange:c.onChangeSignature}),!h&&n&&s.jsx(_e,{c:"red",size:"sm",children:"Signature is required."})]}),!e.excludeButtons&&s.jsx(je,{justify:"flex-end",mt:"xl",gap:"xs",children:s.jsx(xr,{children:e.submitButtonText??"Submit"})})]})]})}const IX="_section_4m5it_1",$X={section:IX},zX=["gender","age","gestationalAge","context","appliesTo","category"],UX={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function BX(e){e=Object.assign(UX,e);const t=e.definition,[n,r]=v.useState([]),[i,o]=v.useState(1),[c,u]=v.useState(1);return v.useEffect(()=>{const S=HX(t,u);r(qX(S.qualifiedInterval||[],o))},[t]),s.jsxs(mt,{testid:"reference-range-editor",onSubmit:f,children:[s.jsx(qe,{children:n.map(S=>{var j;return s.jsx(VX,{unit:WX((j=t.quantitativeDetails)==null?void 0:j.unit),onChange:g,onAdd:y,onRemove:b,onRemoveGroup:m,intervalGroup:S},`group-${S.id}`)})}),s.jsx(An,{title:"Add Group",variant:"subtle",size:"sm",onClick:S=>{hn(S),h({id:`group-id-${i}`,filters:{},intervals:[]}),o(j=>j+1)},children:s.jsx(qh,{})}),s.jsx(je,{justify:"flex-end",children:s.jsx(xr,{children:"Save"})})]});function f(){const S=n.flatMap(j=>j.intervals).filter(j=>!QX(j));e.onSubmit({...t,qualifiedInterval:S})}function h(S){r(j=>[...j,S])}function m(S){r(j=>j.filter(C=>C.id!==S.id))}function g(S,j){r(C=>{C=[...C];const T=C.find(E=>E.id===S),_=T==null?void 0:T.intervals.findIndex(E=>E.id===j.id);return _!==void 0&&(T!=null&&T.intervals[_])&&(T.intervals[_]=j),C})}function y(S,j){j.id===void 0&&(j.id=`id-${c}`,u(C=>C+1)),r(C=>{C=[...C];const T=C.findIndex(_=>_.id===S);if(T!==-1){const _={...C[T]};j={...j,..._.filters},_.intervals=[..._.intervals,j],C[T]=_}return C})}function b(S,j){r(C=>{C=[...C];const T=C.find(_=>_.id===S);return T&&(T.intervals=T.intervals.filter(_=>_.id!==j.id)),C})}}function VX(e){const{intervalGroup:t,unit:n}=e;return s.jsx(Lc,{"data-testid":t.id,className:$X.section,children:s.jsxs(qe,{gap:"lg",children:[s.jsx(je,{justify:"flex-end",children:s.jsx(An,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{hn(r),e.onRemoveGroup(t)},children:s.jsx(Hh,{})},`remove-group-button-${t.id}`)}),s.jsx(FX,{intervalGroup:t,onChange:e.onChange}),s.jsx(Cn,{}),t.intervals.map(r=>s.jsxs(qe,{gap:"xs",children:[s.jsxs(je,{children:[s.jsx($e,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:i=>{hn(i),e.onChange(t.id,{...r,condition:i.currentTarget.value.trim()})}},`condition-${r.id}`),s.jsx(An,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:i=>{hn(i),e.onRemove(t.id,r)},children:s.jsx(Hh,{})},`remove-interval-${r.id}`)]}),s.jsx(Nb,{path:"",onChange:i=>{e.onChange(t.id,{...r,range:i})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),s.jsx(An,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{hn(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:s.jsx(qh,{})})]})})}function FX(e){var r,i;const{intervalGroup:t,onChange:n}=e;t.filters.age||(t.filters.age={});for(const o of["low","high"])(r=t.filters.age[o])!=null&&r.unit||(t.filters.age[o]={...t.filters.age[o],unit:"years",system:"http://unitsofmeasure.org"});return s.jsxs(qe,{style:{maxWidth:"50%"},children:[s.jsx(je,{children:s.jsx(sn,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:o=>{for(const c of t.intervals){let u=o.currentTarget.value;u===""&&(u=void 0),n(t.id,{...c,gender:u})}}})}),s.jsxs(je,{gap:"xs",children:[s.jsx(_e,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),s.jsx("div",{id:`div-age-${t.id}`,children:s.jsx(Nb,{path:"",name:`age-${t.id}`,defaultValue:t.filters.age,onChange:o=>{for(const c of t.intervals)n(t.id,{...c,age:o})}},`age-${t.id}`)})]}),s.jsx(sn,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:((i=t.filters.context)==null?void 0:i.text)||"",onChange:o=>{for(const c of t.intervals){let u=o.currentTarget.value;u===""?(u=void 0,n(t.id,{...c,context:void 0})):n(t.id,{...c,context:{text:u,coding:[{code:u,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),s.jsx(sn,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:o=>{for(const c of t.intervals){const u=o.currentTarget.value;u===""?n(t.id,{...c,category:void 0}):n(t.id,{...c,category:u})}}})]})}function HX(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(i=>{var c;const o=parseInt(((c=i.id)==null?void 0:c.substring(3))||"",10);return isNaN(o)?Number.NEGATIVE_INFINITY:o}))+1;return Number.isFinite(r)||(r=1),e={...e,qualifiedInterval:n.map(i=>({...i,id:i.id||`id-${r++}`}))},t(r),e}function qX(e,t){let n=1;const r={};for(const i of e){const o=GX(i);o in r||(r[o]={id:`group-id-${n++}`,filters:Object.fromEntries(zX.map(c=>[c,i[c]])),intervals:[]}),r[o].intervals.push(i)}return t(n),Object.values(r)}function GX(e){var n,r;return[`gender=${e.gender}`,`age=${rd(e.age)}`,`gestationalAge=${rd(e.gestationalAge)}`,`context=${(n=e.context)==null?void 0:n.text}`,`appliesTo=${(r=e.appliesTo)==null?void 0:r.map(i=>i.text).join("+")}`,`category=${e.category}`].join(":")}function WX(e){return e&&(cU(e,"http://unitsofmeasure.org")||e.text)}function QX(e){var t,n,r,i;return((n=(t=e.range)==null?void 0:t.low)==null?void 0:n.value)===void 0&&((i=(r=e.range)==null?void 0:r.high)==null?void 0:i.value)===void 0}function YX(e){var h;const t=Ae(),n=Wt(e.value),[r,i]=v.useState(!1),[o,c]=v.useState();if(v.useEffect(()=>{n&&!r&&(t.executeBatch(u(n)).then(c).catch(console.log),i(!0))},[t,n,r]),!n||!o)return null;return s.jsx(or,{children:(h=n.action)==null?void 0:h.map((m,g)=>{var j,C,T,_,E,R;const y=m.resource&&f(m.resource),b=(C=(j=y==null?void 0:y.input)==null?void 0:j[0])==null?void 0:C.valueReference,S=(_=(T=y==null?void 0:y.output)==null?void 0:T[0])==null?void 0:_.valueReference;return s.jsxs(v.Fragment,{children:[s.jsx(or.Col,{span:1,p:"md",children:(y==null?void 0:y.status)==="completed"?s.jsx(JF,{}):s.jsx(fq,{color:"gray"})}),s.jsxs(or.Col,{span:9,p:"xs",children:[s.jsx(_e,{fw:500,children:m.title}),m.description&&s.jsx("div",{children:m.description}),s.jsxs("div",{children:["Last edited by ",s.jsx(Ic,{value:(E=y==null?void 0:y.meta)==null?void 0:E.author})," on ",gr((R=y==null?void 0:y.meta)==null?void 0:R.lastUpdated)]}),s.jsxs("div",{children:["Status: ",s.jsx(um,{status:(y==null?void 0:y.status)||"unknown"})]})]}),s.jsxs(or.Col,{span:2,p:"md",children:[b&&!S&&s.jsx(Pe,{onClick:()=>e.onStart(y,b),children:"Start"}),b&&S&&s.jsx(Pe,{onClick:()=>e.onEdit(y,b,S),children:"Edit"})]})]},`action-${g}`)})});function u(m){var y;const g=[];if(m.action)for(const b of m.action)(y=b.resource)!=null&&y.reference&&g.push({request:{method:"GET",url:b.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:g}}function f(m){for(const g of(o==null?void 0:o.entry)??[])if(g.resource&&m.reference===Mt(g.resource))return g.resource}}function gk(e,t){const n=XX(e,t);return KX(n,e,t)}function XX(e,t){const n=e.length,r=t.length,i=n+r+1,o=1+2*i,c=o/2|0,u=new Array(o);u[c+1]={i:0,j:-1,prev:void 0,snake:!0};for(let f=0;f<i;f++){for(let h=-f;h<=f;h+=2){const m=c+h,g=m+1,y=m-1,b=u[g],S=u[y];let j,C=0;h===-f||h!==f&&S.i<b.i?(C=b.i,j=b):(C=S.i+1,j=S),u[y]=void 0;let T=C-h,_={i:C,j:T,prev:ZX(j),snake:!1};for(;C<n&&T<r&&e[C]===t[T];)C++,T++;if(C>_.i&&(_={i:C,j:T,prev:_,snake:!0}),u[m]=_,C>=n&&T>=r)return u[m]}u[c+f-1]=void 0}}function KX(e,t,n){const r=[];let i=e;for(i.snake&&(i=i.prev);i!=null&&i.prev&&i.prev.j>=0;){const o=i.i,c=i.j;i=i.prev;const u=i.i,f=i.j,h={position:u,lines:t.slice(u,o)},m={position:f,lines:n.slice(f,c)};let g;h.lines.length===0&&m.lines.length>0?g="insert":h.lines.length>0&&m.lines.length===0?g="delete":g="change",r.push({original:h,revised:m,type:g}),i.snake&&(i=i.prev)}return r}function ZX(e){return e&&!e.snake&&e.prev?e.prev:e}function JX(e){const t=(e.entry??[]).filter(r=>!!r.resource).map(r=>{var i;return{meta:(i=r.resource)==null?void 0:i.meta,lines:Oi(r.resource,!0).match(/[^\r\n]+/g)}}).sort((r,i)=>r.meta.lastUpdated.localeCompare(i.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 eK(n,t),tK(n),n}function eK(e,t){for(let n=1;n<t.length;n++){const r=gk(t[n-1].lines,t[n].lines);for(const i of r){const o=i.original.position,c=i.original.lines,u=i.revised.lines;if((i.type==="delete"||i.type==="change")&&e.splice(o,c.length),i.type==="insert"||i.type==="change")for(let f=0;f<i.revised.lines.length;f++)e.splice(o+f,0,{id:t[n].meta.versionId,meta:t[n].meta,value:u[f],span:1})}}}function tK(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 nK="_container_1oj0p_1",rK="_root_1oj0p_5",iK="_startRow_1oj0p_20",aK="_normalRow_1oj0p_24",oK="_author_1oj0p_28",sK="_dateTime_1oj0p_32",lK="_lineNumber_1oj0p_37",cK="_line_1oj0p_37",uK="_pre_1oj0p_52",Ia={container:nK,root:rK,startRow:iK,normalRow:aK,author:oK,dateTime:sK,lineNumber:lK,line:cK,pre:uK};function dK(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function fK(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return tc(n,"year");const r=Math.floor(t/2592e3);if(r>0)return tc(r,"month");const i=Math.floor(t/86400);if(i>0)return tc(i,"day");const o=Math.floor(t/3600);if(o>0)return tc(o,"hour");const c=Math.floor(t/60);return c>0?tc(c,"minute"):tc(t,"second")}function tc(e,t){return`${e} ${e===1?t:t+"s"} ago`}function hK(e){var c,u;const t=Ae(),[n,r]=v.useState(e.history);if(v.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),!n)return s.jsx("div",{children:"Loading..."});const i=(u=(c=n.entry)==null?void 0:c[0])==null?void 0:u.resource;if(!i)return null;const o=JX(n);return s.jsx("div",{className:Ia.container,children:s.jsx("table",{className:Ia.root,children:s.jsx("tbody",{children:o.map((f,h)=>s.jsxs("tr",{className:f.span>0?Ia.startRow:Ia.normalRow,children:[f.span>0&&s.jsxs(s.Fragment,{children:[s.jsx("td",{className:Ia.author,rowSpan:f.span,children:s.jsx(cc,{value:f.meta.author,link:!0})}),s.jsx("td",{className:Ia.dateTime,rowSpan:f.span,children:s.jsx(gt,{to:dK(i,f.meta.versionId),children:fK(f.meta.lastUpdated)})})]}),s.jsx("td",{className:Ia.lineNumber,children:h+1}),s.jsx("td",{className:Ia.line,children:s.jsx("pre",{className:Ia.pre,children:f.value})})]},"row-"+h))})})})}const pK="_removed_el5zk_1",mK="_added_el5zk_6",dT={removed:pK,added:mK};function gK(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=Oi(t,!0).match(/[^\r\n]+/g),i=Oi(n,!0).match(/[^\r\n]+/g),o=gk(r,i);return s.jsx("pre",{style:{color:"gray"},children:o.map((c,u)=>s.jsx(vK,{delta:c},"delta"+u))})}function vK(e){return s.jsxs(s.Fragment,{children:["...",s.jsx("br",{}),e.delta.original.lines.length>0&&s.jsx("div",{className:dT.removed,children:e.delta.original.lines.join(`
540
+ `)}),e.delta.revised.lines.length>0&&s.jsx("div",{className:dT.added,children:e.delta.revised.lines.join(`
541
+ `)}),"...",s.jsx("br",{})]})}const yK="_splitButton_1i0gi_1",xK="_menuControl_1i0gi_6",fT={splitButton:yK,menuControl:xK};function Zh(e){const{outcome:t}=e,n=Ae(),r=Wt(e.defaultValue),i=r==null?void 0:r.resourceType,[o,c]=v.useState(!1),[u,f]=v.useState(),h=n.getAccessPolicy(),m=bn();v.useEffect(()=>{if(r)if(e.profileUrl){const b=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const S=Oc(b);if(S){c(!0);const j=NV(r,S);f(j)}else console.error(`Schema not found for ${b}`)}).catch(S=>{console.error("Error in requestProfileSchema",S)})}else n.requestSchema(i).then(()=>{f(r),c(!0)}).catch(console.log)},[n,r,i,e.profileUrl]);const g=v.useMemo(()=>r&&VD(r,Os.READ,h),[h,r]),y=v.useMemo(()=>n.isSuperAdmin()||!h||!Tn(u==null?void 0:u.resourceType)?!0:MB(h,u==null?void 0:u.resourceType),[n,h,u==null?void 0:u.resourceType]);return!o||!u?s.jsx("div",{children:"Loading..."}):y?s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:b=>{b.preventDefault(),e.onSubmit&&e.onSubmit(u)},children:[s.jsxs(qe,{mb:"xl",children:[s.jsx(Lt,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:s.jsx($e,{name:"resourceType",defaultValue:u.resourceType,disabled:!0})}),s.jsx(Lt,{title:"ID",htmlFor:"id",outcome:t,children:s.jsx($e,{name:"id",defaultValue:u.id,disabled:!0})})]}),s.jsx(Lb,{path:u.resourceType,valuePath:u.resourceType,typeName:i,defaultValue:u,outcome:t,onChange:f,profileUrl:e.profileUrl,accessPolicyResource:g}),s.jsxs(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",gap:0,children:[s.jsx(Pe,{type:"submit",className:zt((e.onPatch||e.onDelete)&&fT.splitButton),children:r!=null&&r.id?"Update":"Create"}),(e.onPatch||e.onDelete)&&s.jsxs(Ce,{transitionProps:{transition:"pop"},position:"bottom-end",withinPortal:!0,children:[s.jsx(Ce.Target,{children:s.jsx(An,{variant:"filled",color:m.primaryColor,size:36,className:fT.menuControl,"aria-label":"More actions",children:s.jsx(Sb,{size:14,stroke:1.5})})}),s.jsxs(Ce.Dropdown,{children:[e.onPatch&&s.jsx(Ce.Item,{leftSection:s.jsx(pA,{size:14,stroke:1.5}),onClick:()=>{e.onPatch(u)},children:"Patch"}),e.onDelete&&s.jsx(Ce.Item,{color:"red",leftSection:s.jsx(am,{size:14,stroke:1.5,color:"red"}),onClick:()=>{e.onDelete(u)},children:"Delete"})]})]})]})]}):s.jsxs(Za,{color:"red",title:"Permission denied",icon:s.jsx(al,{}),children:["Your access level prevents you from editing and creating ",u.resourceType," resources."]})}function bK(e){var i;const t=Ae(),[n,r]=v.useState(e.history);return v.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),n?s.jsxs(ye,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx(ye.Thead,{children:s.jsxs(ye.Tr,{children:[s.jsx(ye.Th,{children:"Author"}),s.jsx(ye.Th,{children:"Date"}),s.jsx(ye.Th,{children:"Version"})]})}),s.jsx(ye.Tbody,{children:(i=n.entry)==null?void 0:i.map((o,c)=>s.jsx(SK,{entry:o},"entry-"+c))})]}):s.jsx("div",{children:"Loading..."})}function SK(e){var r,i,o;const{response:t,resource:n}=e.entry;return n?s.jsxs(ye.Tr,{children:[s.jsx(ye.Td,{children:s.jsx(cc,{value:(r=n.meta)==null?void 0:r.author,link:!0})}),s.jsx(ye.Td,{children:gr((i=n.meta)==null?void 0:i.lastUpdated)}),s.jsx(ye.Td,{children:s.jsx(gt,{to:wK(n),children:(o=n.meta)==null?void 0:o.versionId})})]}):s.jsx(ye.Tr,{children:s.jsx(ye.Td,{colSpan:3,children:Ke(t==null?void 0:t.outcome)})})}function wK(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function jK(e){const{serviceRequest:t,...n}=e;return s.jsx(dm,{value:t,loadTimelineResources:async(r,i,o)=>{const c=`${i}/${o}`,u=100;return Promise.allSettled([r.readHistory("ServiceRequest",o),r.search("Communication",{"based-on":c,_count:u}),r.search("DiagnosticReport",{"based-on":c,_count:u}),r.search("Media",{"based-on":c,_count:u}),r.search("DocumentReference",{related:c,_count:u}),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:u})])},createCommunication:(r,i,o)=>({resourceType:"Communication",status:"completed",basedOn:[tn(r)],subject:r.subject,sender:tn(i),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(r,i,o)=>({resourceType:"Media",status:"completed",basedOn:[tn(r)],subject:r.subject,operator:tn(i),issued:new Date().toISOString(),content:o}),...n})}function CK(e){const t=Ae(),{client:n,patient:r,encounter:i,children:o,...c}=e;function u(){t.createResource({resourceType:"SmartAppLaunch",patient:r,encounter:i}).then(f=>{const h=new URL(n.launchUri);h.searchParams.set("iss",ab(t.fhirUrl().toString())),h.searchParams.set("launch",f.id),window.location.assign(h.toString())}).catch(f=>Oe({color:"red",message:Ke(f),autoClose:!1}))}return s.jsx(Pt,{onClick:()=>u(),...c,children:o})}var oy={exports:{}},Iu={},sy={exports:{}},ly={};/**
542
+ * @license React
543
+ * scheduler.production.js
544
+ *
545
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
546
+ *
547
+ * This source code is licensed under the MIT license found in the
548
+ * LICENSE file in the root directory of this source tree.
549
+ */var hT;function EK(){return hT||(hT=1,function(e){function t(P,I){var $=P.length;P.push(I);e:for(;0<$;){var H=$-1>>>1,O=P[H];if(0<i(O,I))P[H]=I,P[$]=O,$=H;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var I=P[0],$=P.pop();if($!==I){P[0]=$;e:for(var H=0,O=P.length,U=O>>>1;H<U;){var K=2*(H+1)-1,ee=P[K],Se=K+1,be=P[Se];if(0>i(ee,$))Se<O&&0>i(be,ee)?(P[H]=be,P[Se]=$,H=Se):(P[H]=ee,P[K]=$,H=K);else if(Se<O&&0>i(be,$))P[H]=be,P[Se]=$,H=Se;else break e}}return I}function i(P,I){var $=P.sortIndex-I.sortIndex;return $!==0?$:P.id-I.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var f=[],h=[],m=1,g=null,y=3,b=!1,S=!1,j=!1,C=!1,T=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function R(P){for(var I=n(h);I!==null;){if(I.callback===null)r(h);else if(I.startTime<=P)r(h),I.sortIndex=I.expirationTime,t(f,I);else break;I=n(h)}}function D(P){if(j=!1,R(P),!S)if(n(f)!==null)S=!0,k||(k=!0,W());else{var I=n(h);I!==null&&X(D,I.startTime-P)}}var k=!1,M=-1,L=5,z=-1;function F(){return C?!0:!(e.unstable_now()-z<L)}function Y(){if(C=!1,k){var P=e.unstable_now();z=P;var I=!0;try{e:{S=!1,j&&(j=!1,_(M),M=-1),b=!0;var $=y;try{t:{for(R(P),g=n(f);g!==null&&!(g.expirationTime>P&&F());){var H=g.callback;if(typeof H=="function"){g.callback=null,y=g.priorityLevel;var O=H(g.expirationTime<=P);if(P=e.unstable_now(),typeof O=="function"){g.callback=O,R(P),I=!0;break t}g===n(f)&&r(f),R(P)}else r(f);g=n(f)}if(g!==null)I=!0;else{var U=n(h);U!==null&&X(D,U.startTime-P),I=!1}}break e}finally{g=null,y=$,b=!1}I=void 0}}finally{I?W():k=!1}}}var W;if(typeof E=="function")W=function(){E(Y)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,G=J.port2;J.port1.onmessage=Y,W=function(){G.postMessage(null)}}else W=function(){T(Y,0)};function X(P,I){M=T(function(){P(e.unstable_now())},I)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(P){switch(y){case 1:case 2:case 3:var I=3;break;default:I=y}var $=y;y=I;try{return P()}finally{y=$}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(P,I){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var $=y;y=P;try{return I()}finally{y=$}},e.unstable_scheduleCallback=function(P,I,$){var H=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?H+$:H):$=H,P){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=$+O,P={id:m++,callback:I,priorityLevel:P,startTime:$,expirationTime:O,sortIndex:-1},$>H?(P.sortIndex=$,t(h,P),n(f)===null&&P===n(h)&&(j?(_(M),M=-1):j=!0,X(D,$-H))):(P.sortIndex=O,t(f,P),S||b||(S=!0,k||(k=!0,W()))),P},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(P){var I=y;return function(){var $=y;y=I;try{return P.apply(this,arguments)}finally{y=$}}}}(ly)),ly}var pT;function TK(){return pT||(pT=1,sy.exports=EK()),sy.exports}/**
550
+ * @license React
551
+ * react-dom-client.production.js
552
+ *
553
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
554
+ *
555
+ * This source code is licensed under the MIT license found in the
556
+ * LICENSE file in the root directory of this source tree.
557
+ */var mT;function RK(){if(mT)return Iu;mT=1;var e=TK(),t=hx(),n=LR();function r(a){var l="https://react.dev/errors/"+a;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+a+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function o(a){var l=a,d=a;if(a.alternate)for(;l.return;)l=l.return;else{a=l;do l=a,(l.flags&4098)!==0&&(d=l.return),a=l.return;while(a)}return l.tag===3?d:null}function c(a){if(a.tag===13){var l=a.memoizedState;if(l===null&&(a=a.alternate,a!==null&&(l=a.memoizedState)),l!==null)return l.dehydrated}return null}function u(a){if(o(a)!==a)throw Error(r(188))}function f(a){var l=a.alternate;if(!l){if(l=o(a),l===null)throw Error(r(188));return l!==a?null:a}for(var d=a,p=l;;){var x=d.return;if(x===null)break;var w=x.alternate;if(w===null){if(p=x.return,p!==null){d=p;continue}break}if(x.child===w.child){for(w=x.child;w;){if(w===d)return u(x),a;if(w===p)return u(x),l;w=w.sibling}throw Error(r(188))}if(d.return!==p.return)d=x,p=w;else{for(var A=!1,N=x.child;N;){if(N===d){A=!0,d=x,p=w;break}if(N===p){A=!0,p=x,d=w;break}N=N.sibling}if(!A){for(N=w.child;N;){if(N===d){A=!0,d=w,p=x;break}if(N===p){A=!0,p=w,d=x;break}N=N.sibling}if(!A)throw Error(r(189))}}if(d.alternate!==p)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?a:l}function h(a){var l=a.tag;if(l===5||l===26||l===27||l===6)return a;for(a=a.child;a!==null;){if(l=h(a),l!==null)return l;a=a.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),_=Symbol.for("react.consumer"),E=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function W(a){return a===null||typeof a!="object"?null:(a=Y&&a[Y]||a["@@iterator"],typeof a=="function"?a:null)}var J=Symbol.for("react.client.reference");function G(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===J?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case S:return"Fragment";case C:return"Profiler";case j:return"StrictMode";case D:return"Suspense";case k:return"SuspenseList";case z:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case b:return"Portal";case E:return(a.displayName||"Context")+".Provider";case _:return(a._context.displayName||"Context")+".Consumer";case R:var l=a.render;return a=a.displayName,a||(a=l.displayName||l.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case M:return l=a.displayName||null,l!==null?l:G(a.type)||"Memo";case L:l=a._payload,a=a._init;try{return G(a(l))}catch{}}return null}var X=Array.isArray,P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},H=[],O=-1;function U(a){return{current:a}}function K(a){0>O||(a.current=H[O],H[O]=null,O--)}function ee(a,l){O++,H[O]=a.current,a.current=l}var Se=U(null),be=U(null),xe=U(null),Ge=U(null);function Me(a,l){switch(ee(xe,l),ee(be,a),ee(Se,null),l.nodeType){case 9:case 11:a=(a=l.documentElement)&&(a=a.namespaceURI)?hj(a):0;break;default:if(a=l.tagName,l=l.namespaceURI)l=hj(l),a=pj(l,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}K(Se),ee(Se,a)}function nt(){K(Se),K(be),K(xe)}function ke(a){a.memoizedState!==null&&ee(Ge,a);var l=Se.current,d=pj(l,a.type);l!==d&&(ee(be,a),ee(Se,d))}function yt(a){be.current===a&&(K(Se),K(be)),Ge.current===a&&(K(Ge),Tu._currentValue=$)}var It=Object.prototype.hasOwnProperty,$t=e.unstable_scheduleCallback,vt=e.unstable_cancelCallback,At=e.unstable_shouldYield,nn=e.unstable_requestPaint,Te=e.unstable_now,De=e.unstable_getCurrentPriorityLevel,Qe=e.unstable_ImmediatePriority,Re=e.unstable_UserBlockingPriority,me=e.unstable_NormalPriority,ge=e.unstable_LowPriority,Ne=e.unstable_IdlePriority,we=e.log,ze=e.unstable_setDisableYieldValue,xt=null,ht=null;function qt(a){if(typeof we=="function"&&ze(a),ht&&typeof ht.setStrictMode=="function")try{ht.setStrictMode(xt,a)}catch{}}var kt=Math.clz32?Math.clz32:Bi,cn=Math.log,Ct=Math.LN2;function Bi(a){return a>>>=0,a===0?32:31-(cn(a)/Ct|0)|0}var Si=256,ma=4194304;function Fn(a){var l=a&42;if(l!==0)return l;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function wi(a,l,d){var p=a.pendingLanes;if(p===0)return 0;var x=0,w=a.suspendedLanes,A=a.pingedLanes;a=a.warmLanes;var N=p&134217727;return N!==0?(p=N&~w,p!==0?x=Fn(p):(A&=N,A!==0?x=Fn(A):d||(d=N&~a,d!==0&&(x=Fn(d))))):(N=p&~w,N!==0?x=Fn(N):A!==0?x=Fn(A):d||(d=p&~a,d!==0&&(x=Fn(d)))),x===0?0:l!==0&&l!==x&&(l&w)===0&&(w=x&-x,d=l&-l,w>=d||w===32&&(d&4194048)!==0)?l:x}function Kr(a,l){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&l)===0}function ul(a,l){switch(a){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ga(){var a=Si;return Si<<=1,(Si&4194048)===0&&(Si=256),a}function ao(){var a=ma;return ma<<=1,(ma&62914560)===0&&(ma=4194304),a}function Vi(a){for(var l=[],d=0;31>d;d++)l.push(a);return l}function br(a,l){a.pendingLanes|=l,l!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Gn(a,l,d,p,x,w){var A=a.pendingLanes;a.pendingLanes=d,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=d,a.entangledLanes&=d,a.errorRecoveryDisabledLanes&=d,a.shellSuspendCounter=0;var N=a.entanglements,B=a.expirationTimes,ne=a.hiddenUpdates;for(d=A&~d;0<d;){var de=31-kt(d),pe=1<<de;N[de]=0,B[de]=-1;var re=ne[de];if(re!==null)for(ne[de]=null,de=0;de<re.length;de++){var oe=re[de];oe!==null&&(oe.lane&=-536870913)}d&=~pe}p!==0&&va(a,p,0),w!==0&&x===0&&a.tag!==0&&(a.suspendedLanes|=w&~(A&~l))}function va(a,l,d){a.pendingLanes|=l,a.suspendedLanes&=~l;var p=31-kt(l);a.entangledLanes|=l,a.entanglements[p]=a.entanglements[p]|1073741824|d&4194090}function oo(a,l){var d=a.entangledLanes|=l;for(a=a.entanglements;d;){var p=31-kt(d),x=1<<p;x&l|a[p]&l&&(a[p]|=l),d&=~x}}function ts(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function ns(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function V(){var a=I.p;return a!==0?a:(a=window.event,a===void 0?32:Nj(a.type))}function Z(a,l){var d=I.p;try{return I.p=a,l()}finally{I.p=d}}var ae=Math.random().toString(36).slice(2),he="__reactFiber$"+ae,Ee="__reactProps$"+ae,Ue="__reactContainer$"+ae,We="__reactEvents$"+ae,Fe="__reactListeners$"+ae,Ze="__reactHandles$"+ae,it="__reactResources$"+ae,Je="__reactMarker$"+ae;function Ye(a){delete a[he],delete a[Ee],delete a[We],delete a[Fe],delete a[Ze]}function at(a){var l=a[he];if(l)return l;for(var d=a.parentNode;d;){if(l=d[Ue]||d[he]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(a=yj(a);a!==null;){if(d=a[he])return d;a=yj(a)}return l}a=d,d=a.parentNode}return null}function et(a){if(a=a[he]||a[Ue]){var l=a.tag;if(l===5||l===6||l===13||l===26||l===27||l===3)return a}return null}function un(a){var l=a.tag;if(l===5||l===26||l===27||l===6)return a.stateNode;throw Error(r(33))}function mn(a){var l=a[it];return l||(l=a[it]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function dt(a){a[Je]=!0}var Gt=new Set,Fi={};function Mr(a,l){ur(a,l),ur(a+"Capture",l)}function ur(a,l){for(Fi[a]=l,a=0;a<l.length;a++)Gt.add(l[a])}var Zr=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),dl={},so={};function ya(a){return It.call(so,a)?!0:It.call(dl,a)?!1:Zr.test(a)?so[a]=!0:(dl[a]=!0,!1)}function xa(a,l,d){if(ya(l))if(d===null)a.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":a.removeAttribute(l);return;case"boolean":var p=l.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){a.removeAttribute(l);return}}a.setAttribute(l,""+d)}}function ba(a,l,d){if(d===null)a.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(l);return}a.setAttribute(l,""+d)}}function Et(a,l,d,p){if(p===null)a.removeAttribute(d);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(d);return}a.setAttributeNS(l,d,""+p)}}var In,rs;function Jr(a){if(In===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);In=l&&l[1]||"",rs=-1<d.stack.indexOf(`
558
+ at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
559
+ `+In+a+rs}var wn=!1;function lo(a,l){if(!a||wn)return"";wn=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(l){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(oe){var re=oe}Reflect.construct(a,[],pe)}else{try{pe.call()}catch(oe){re=oe}a.call(pe.prototype)}}else{try{throw Error()}catch(oe){re=oe}(pe=a())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(oe){if(oe&&re&&typeof oe.stack=="string")return[oe.stack,re.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=p.DetermineComponentFrameRoot(),A=w[0],N=w[1];if(A&&N){var B=A.split(`
560
+ `),ne=N.split(`
561
+ `);for(x=p=0;p<B.length&&!B[p].includes("DetermineComponentFrameRoot");)p++;for(;x<ne.length&&!ne[x].includes("DetermineComponentFrameRoot");)x++;if(p===B.length||x===ne.length)for(p=B.length-1,x=ne.length-1;1<=p&&0<=x&&B[p]!==ne[x];)x--;for(;1<=p&&0<=x;p--,x--)if(B[p]!==ne[x]){if(p!==1||x!==1)do if(p--,x--,0>x||B[p]!==ne[x]){var de=`
562
+ `+B[p].replace(" at new "," at ");return a.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",a.displayName)),de}while(1<=p&&0<=x);break}}}finally{wn=!1,Error.prepareStackTrace=d}return(d=a?a.displayName||a.name:"")?Jr(d):""}function zd(a){switch(a.tag){case 26:case 27:case 5:return Jr(a.type);case 16:return Jr("Lazy");case 13:return Jr("Suspense");case 19:return Jr("SuspenseList");case 0:case 15:return lo(a.type,!1);case 11:return lo(a.type.render,!1);case 1:return lo(a.type,!0);case 31:return Jr("Activity");default:return""}}function Ud(a){try{var l="";do l+=zd(a),a=a.return;while(a);return l}catch(d){return`
563
+ Error generating stack: `+d.message+`
564
+ `+d.stack}}function ei(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function l1(a){var l=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function dP(a){var l=l1(a)?"checked":"value",d=Object.getOwnPropertyDescriptor(a.constructor.prototype,l),p=""+a[l];if(!a.hasOwnProperty(l)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var x=d.get,w=d.set;return Object.defineProperty(a,l,{configurable:!0,get:function(){return x.call(this)},set:function(A){p=""+A,w.call(this,A)}}),Object.defineProperty(a,l,{enumerable:d.enumerable}),{getValue:function(){return p},setValue:function(A){p=""+A},stopTracking:function(){a._valueTracker=null,delete a[l]}}}}function Bd(a){a._valueTracker||(a._valueTracker=dP(a))}function c1(a){if(!a)return!1;var l=a._valueTracker;if(!l)return!0;var d=l.getValue(),p="";return a&&(p=l1(a)?a.checked?"true":"false":a.value),a=p,a!==d?(l.setValue(a),!0):!1}function Vd(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}}var fP=/[\n"\\]/g;function ti(a){return a.replace(fP,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function xm(a,l,d,p,x,w,A,N){a.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?a.type=A:a.removeAttribute("type"),l!=null?A==="number"?(l===0&&a.value===""||a.value!=l)&&(a.value=""+ei(l)):a.value!==""+ei(l)&&(a.value=""+ei(l)):A!=="submit"&&A!=="reset"||a.removeAttribute("value"),l!=null?bm(a,A,ei(l)):d!=null?bm(a,A,ei(d)):p!=null&&a.removeAttribute("value"),x==null&&w!=null&&(a.defaultChecked=!!w),x!=null&&(a.checked=x&&typeof x!="function"&&typeof x!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?a.name=""+ei(N):a.removeAttribute("name")}function u1(a,l,d,p,x,w,A,N){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(a.type=w),l!=null||d!=null){if(!(w!=="submit"&&w!=="reset"||l!=null))return;d=d!=null?""+ei(d):"",l=l!=null?""+ei(l):d,N||l===a.value||(a.value=l),a.defaultValue=l}p=p??x,p=typeof p!="function"&&typeof p!="symbol"&&!!p,a.checked=N?a.checked:!!p,a.defaultChecked=!!p,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(a.name=A)}function bm(a,l,d){l==="number"&&Vd(a.ownerDocument)===a||a.defaultValue===""+d||(a.defaultValue=""+d)}function fl(a,l,d,p){if(a=a.options,l){l={};for(var x=0;x<d.length;x++)l["$"+d[x]]=!0;for(d=0;d<a.length;d++)x=l.hasOwnProperty("$"+a[d].value),a[d].selected!==x&&(a[d].selected=x),x&&p&&(a[d].defaultSelected=!0)}else{for(d=""+ei(d),l=null,x=0;x<a.length;x++){if(a[x].value===d){a[x].selected=!0,p&&(a[x].defaultSelected=!0);return}l!==null||a[x].disabled||(l=a[x])}l!==null&&(l.selected=!0)}}function d1(a,l,d){if(l!=null&&(l=""+ei(l),l!==a.value&&(a.value=l),d==null)){a.defaultValue!==l&&(a.defaultValue=l);return}a.defaultValue=d!=null?""+ei(d):""}function f1(a,l,d,p){if(l==null){if(p!=null){if(d!=null)throw Error(r(92));if(X(p)){if(1<p.length)throw Error(r(93));p=p[0]}d=p}d==null&&(d=""),l=d}d=ei(l),a.defaultValue=d,p=a.textContent,p===d&&p!==""&&p!==null&&(a.value=p)}function hl(a,l){if(l){var d=a.firstChild;if(d&&d===a.lastChild&&d.nodeType===3){d.nodeValue=l;return}}a.textContent=l}var hP=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function h1(a,l,d){var p=l.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?p?a.setProperty(l,""):l==="float"?a.cssFloat="":a[l]="":p?a.setProperty(l,d):typeof d!="number"||d===0||hP.has(l)?l==="float"?a.cssFloat=d:a[l]=(""+d).trim():a[l]=d+"px"}function p1(a,l,d){if(l!=null&&typeof l!="object")throw Error(r(62));if(a=a.style,d!=null){for(var p in d)!d.hasOwnProperty(p)||l!=null&&l.hasOwnProperty(p)||(p.indexOf("--")===0?a.setProperty(p,""):p==="float"?a.cssFloat="":a[p]="");for(var x in l)p=l[x],l.hasOwnProperty(x)&&d[x]!==p&&h1(a,x,p)}else for(var w in l)l.hasOwnProperty(w)&&h1(a,w,l[w])}function Sm(a){if(a.indexOf("-")===-1)return!1;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 pP=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),mP=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Fd(a){return mP.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}var wm=null;function jm(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var pl=null,ml=null;function m1(a){var l=et(a);if(l&&(a=l.stateNode)){var d=a[Ee]||null;e:switch(a=l.stateNode,l.type){case"input":if(xm(a,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),l=d.name,d.type==="radio"&&l!=null){for(d=a;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+ti(""+l)+'"][type="radio"]'),l=0;l<d.length;l++){var p=d[l];if(p!==a&&p.form===a.form){var x=p[Ee]||null;if(!x)throw Error(r(90));xm(p,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(l=0;l<d.length;l++)p=d[l],p.form===a.form&&c1(p)}break e;case"textarea":d1(a,d.value,d.defaultValue);break e;case"select":l=d.value,l!=null&&fl(a,!!d.multiple,l,!1)}}}var Cm=!1;function g1(a,l,d){if(Cm)return a(l,d);Cm=!0;try{var p=a(l);return p}finally{if(Cm=!1,(pl!==null||ml!==null)&&(Df(),pl&&(l=pl,a=ml,ml=pl=null,m1(l),a)))for(l=0;l<a.length;l++)m1(a[l])}}function zc(a,l){var d=a.stateNode;if(d===null)return null;var p=d[Ee]||null;if(p===null)return null;d=p[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(a=a.type,p=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!p;break e;default:a=!1}if(a)return null;if(d&&typeof d!="function")throw Error(r(231,l,typeof d));return d}var Sa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Em=!1;if(Sa)try{var Uc={};Object.defineProperty(Uc,"passive",{get:function(){Em=!0}}),window.addEventListener("test",Uc,Uc),window.removeEventListener("test",Uc,Uc)}catch{Em=!1}var co=null,Tm=null,Hd=null;function v1(){if(Hd)return Hd;var a,l=Tm,d=l.length,p,x="value"in co?co.value:co.textContent,w=x.length;for(a=0;a<d&&l[a]===x[a];a++);var A=d-a;for(p=1;p<=A&&l[d-p]===x[w-p];p++);return Hd=x.slice(a,1<p?1-p:void 0)}function qd(a){var l=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&l===13&&(a=13)):a=l,a===10&&(a=13),32<=a||a===13?a:0}function Gd(){return!0}function y1(){return!1}function Sr(a){function l(d,p,x,w,A){this._reactName=d,this._targetInst=x,this.type=p,this.nativeEvent=w,this.target=A,this.currentTarget=null;for(var N in a)a.hasOwnProperty(N)&&(d=a[N],this[N]=d?d(w):w[N]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?Gd:y1,this.isPropagationStopped=y1,this}return m(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Gd)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Gd)},persist:function(){},isPersistent:Gd}),l}var is={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wd=Sr(is),Bc=m({},is,{view:0,detail:0}),gP=Sr(Bc),Rm,_m,Vc,Qd=m({},Bc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Am,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!==Vc&&(Vc&&a.type==="mousemove"?(Rm=a.screenX-Vc.screenX,_m=a.screenY-Vc.screenY):_m=Rm=0,Vc=a),Rm)},movementY:function(a){return"movementY"in a?a.movementY:_m}}),x1=Sr(Qd),vP=m({},Qd,{dataTransfer:0}),yP=Sr(vP),xP=m({},Bc,{relatedTarget:0}),Dm=Sr(xP),bP=m({},is,{animationName:0,elapsedTime:0,pseudoElement:0}),SP=Sr(bP),wP=m({},is,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),jP=Sr(wP),CP=m({},is,{data:0}),b1=Sr(CP),EP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},TP={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"},RP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _P(a){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(a):(a=RP[a])?!!l[a]:!1}function Am(){return _P}var DP=m({},Bc,{key:function(a){if(a.key){var l=EP[a.key]||a.key;if(l!=="Unidentified")return l}return a.type==="keypress"?(a=qd(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?TP[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Am,charCode:function(a){return a.type==="keypress"?qd(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?qd(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),AP=Sr(DP),kP=m({},Qd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),S1=Sr(kP),PP=m({},Bc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Am}),NP=Sr(PP),OP=m({},is,{propertyName:0,elapsedTime:0,pseudoElement:0}),MP=Sr(OP),LP=m({},Qd,{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}),IP=Sr(LP),$P=m({},is,{newState:0,oldState:0}),zP=Sr($P),UP=[9,13,27,32],km=Sa&&"CompositionEvent"in window,Fc=null;Sa&&"documentMode"in document&&(Fc=document.documentMode);var BP=Sa&&"TextEvent"in window&&!Fc,w1=Sa&&(!km||Fc&&8<Fc&&11>=Fc),j1=" ",C1=!1;function E1(a,l){switch(a){case"keyup":return UP.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function T1(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var gl=!1;function VP(a,l){switch(a){case"compositionend":return T1(l);case"keypress":return l.which!==32?null:(C1=!0,j1);case"textInput":return a=l.data,a===j1&&C1?null:a;default:return null}}function FP(a,l){if(gl)return a==="compositionend"||!km&&E1(a,l)?(a=v1(),Hd=Tm=co=null,gl=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return w1&&l.locale!=="ko"?null:l.data;default:return null}}var HP={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 R1(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l==="input"?!!HP[a.type]:l==="textarea"}function _1(a,l,d,p){pl?ml?ml.push(p):ml=[p]:pl=p,l=Mf(l,"onChange"),0<l.length&&(d=new Wd("onChange","change",null,d,p),a.push({event:d,listeners:l}))}var Hc=null,qc=null;function qP(a){lj(a,0)}function Yd(a){var l=un(a);if(c1(l))return a}function D1(a,l){if(a==="change")return l}var A1=!1;if(Sa){var Pm;if(Sa){var Nm="oninput"in document;if(!Nm){var k1=document.createElement("div");k1.setAttribute("oninput","return;"),Nm=typeof k1.oninput=="function"}Pm=Nm}else Pm=!1;A1=Pm&&(!document.documentMode||9<document.documentMode)}function P1(){Hc&&(Hc.detachEvent("onpropertychange",N1),qc=Hc=null)}function N1(a){if(a.propertyName==="value"&&Yd(qc)){var l=[];_1(l,qc,a,jm(a)),g1(qP,l)}}function GP(a,l,d){a==="focusin"?(P1(),Hc=l,qc=d,Hc.attachEvent("onpropertychange",N1)):a==="focusout"&&P1()}function WP(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Yd(qc)}function QP(a,l){if(a==="click")return Yd(l)}function YP(a,l){if(a==="input"||a==="change")return Yd(l)}function XP(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var Lr=typeof Object.is=="function"?Object.is:XP;function Gc(a,l){if(Lr(a,l))return!0;if(typeof a!="object"||a===null||typeof l!="object"||l===null)return!1;var d=Object.keys(a),p=Object.keys(l);if(d.length!==p.length)return!1;for(p=0;p<d.length;p++){var x=d[p];if(!It.call(l,x)||!Lr(a[x],l[x]))return!1}return!0}function O1(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function M1(a,l){var d=O1(a);a=0;for(var p;d;){if(d.nodeType===3){if(p=a+d.textContent.length,a<=l&&p>=l)return{node:d,offset:l-a};a=p}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=O1(d)}}function L1(a,l){return a&&l?a===l?!0:a&&a.nodeType===3?!1:l&&l.nodeType===3?L1(a,l.parentNode):"contains"in a?a.contains(l):a.compareDocumentPosition?!!(a.compareDocumentPosition(l)&16):!1:!1}function I1(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var l=Vd(a.document);l instanceof a.HTMLIFrameElement;){try{var d=typeof l.contentWindow.location.href=="string"}catch{d=!1}if(d)a=l.contentWindow;else break;l=Vd(a.document)}return l}function Om(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l&&(l==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||l==="textarea"||a.contentEditable==="true")}var KP=Sa&&"documentMode"in document&&11>=document.documentMode,vl=null,Mm=null,Wc=null,Lm=!1;function $1(a,l,d){var p=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Lm||vl==null||vl!==Vd(p)||(p=vl,"selectionStart"in p&&Om(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Wc&&Gc(Wc,p)||(Wc=p,p=Mf(Mm,"onSelect"),0<p.length&&(l=new Wd("onSelect","select",null,l,d),a.push({event:l,listeners:p}),l.target=vl)))}function as(a,l){var d={};return d[a.toLowerCase()]=l.toLowerCase(),d["Webkit"+a]="webkit"+l,d["Moz"+a]="moz"+l,d}var yl={animationend:as("Animation","AnimationEnd"),animationiteration:as("Animation","AnimationIteration"),animationstart:as("Animation","AnimationStart"),transitionrun:as("Transition","TransitionRun"),transitionstart:as("Transition","TransitionStart"),transitioncancel:as("Transition","TransitionCancel"),transitionend:as("Transition","TransitionEnd")},Im={},z1={};Sa&&(z1=document.createElement("div").style,"AnimationEvent"in window||(delete yl.animationend.animation,delete yl.animationiteration.animation,delete yl.animationstart.animation),"TransitionEvent"in window||delete yl.transitionend.transition);function os(a){if(Im[a])return Im[a];if(!yl[a])return a;var l=yl[a],d;for(d in l)if(l.hasOwnProperty(d)&&d in z1)return Im[a]=l[d];return a}var U1=os("animationend"),B1=os("animationiteration"),V1=os("animationstart"),ZP=os("transitionrun"),JP=os("transitionstart"),eN=os("transitioncancel"),F1=os("transitionend"),H1=new Map,$m="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");$m.push("scrollEnd");function ji(a,l){H1.set(a,l),Mr(l,[a])}var q1=new WeakMap;function ni(a,l){if(typeof a=="object"&&a!==null){var d=q1.get(a);return d!==void 0?d:(l={value:a,source:l,stack:Ud(l)},q1.set(a,l),l)}return{value:a,source:l,stack:Ud(l)}}var ri=[],xl=0,zm=0;function Xd(){for(var a=xl,l=zm=xl=0;l<a;){var d=ri[l];ri[l++]=null;var p=ri[l];ri[l++]=null;var x=ri[l];ri[l++]=null;var w=ri[l];if(ri[l++]=null,p!==null&&x!==null){var A=p.pending;A===null?x.next=x:(x.next=A.next,A.next=x),p.pending=x}w!==0&&G1(d,x,w)}}function Kd(a,l,d,p){ri[xl++]=a,ri[xl++]=l,ri[xl++]=d,ri[xl++]=p,zm|=p,a.lanes|=p,a=a.alternate,a!==null&&(a.lanes|=p)}function Um(a,l,d,p){return Kd(a,l,d,p),Zd(a)}function bl(a,l){return Kd(a,null,null,l),Zd(a)}function G1(a,l,d){a.lanes|=d;var p=a.alternate;p!==null&&(p.lanes|=d);for(var x=!1,w=a.return;w!==null;)w.childLanes|=d,p=w.alternate,p!==null&&(p.childLanes|=d),w.tag===22&&(a=w.stateNode,a===null||a._visibility&1||(x=!0)),a=w,w=w.return;return a.tag===3?(w=a.stateNode,x&&l!==null&&(x=31-kt(d),a=w.hiddenUpdates,p=a[x],p===null?a[x]=[l]:p.push(l),l.lane=d|536870912),w):null}function Zd(a){if(50<yu)throw yu=0,Gg=null,Error(r(185));for(var l=a.return;l!==null;)a=l,l=a.return;return a.tag===3?a.stateNode:null}var Sl={};function tN(a,l,d,p){this.tag=a,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ir(a,l,d,p){return new tN(a,l,d,p)}function Bm(a){return a=a.prototype,!(!a||!a.isReactComponent)}function wa(a,l){var d=a.alternate;return d===null?(d=Ir(a.tag,l,a.key,a.mode),d.elementType=a.elementType,d.type=a.type,d.stateNode=a.stateNode,d.alternate=a,a.alternate=d):(d.pendingProps=l,d.type=a.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=a.flags&65011712,d.childLanes=a.childLanes,d.lanes=a.lanes,d.child=a.child,d.memoizedProps=a.memoizedProps,d.memoizedState=a.memoizedState,d.updateQueue=a.updateQueue,l=a.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=a.sibling,d.index=a.index,d.ref=a.ref,d.refCleanup=a.refCleanup,d}function W1(a,l){a.flags&=65011714;var d=a.alternate;return d===null?(a.childLanes=0,a.lanes=l,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=d.childLanes,a.lanes=d.lanes,a.child=d.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=d.memoizedProps,a.memoizedState=d.memoizedState,a.updateQueue=d.updateQueue,a.type=d.type,l=d.dependencies,a.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),a}function Jd(a,l,d,p,x,w){var A=0;if(p=a,typeof a=="function")Bm(a)&&(A=1);else if(typeof a=="string")A=r4(a,d,Se.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case z:return a=Ir(31,d,l,x),a.elementType=z,a.lanes=w,a;case S:return ss(d.children,x,w,l);case j:A=8,x|=24;break;case C:return a=Ir(12,d,l,x|2),a.elementType=C,a.lanes=w,a;case D:return a=Ir(13,d,l,x),a.elementType=D,a.lanes=w,a;case k:return a=Ir(19,d,l,x),a.elementType=k,a.lanes=w,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case T:case E:A=10;break e;case _:A=9;break e;case R:A=11;break e;case M:A=14;break e;case L:A=16,p=null;break e}A=29,d=Error(r(130,a===null?"null":typeof a,"")),p=null}return l=Ir(A,d,l,x),l.elementType=a,l.type=p,l.lanes=w,l}function ss(a,l,d,p){return a=Ir(7,a,p,l),a.lanes=d,a}function Vm(a,l,d){return a=Ir(6,a,null,l),a.lanes=d,a}function Fm(a,l,d){return l=Ir(4,a.children!==null?a.children:[],a.key,l),l.lanes=d,l.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},l}var wl=[],jl=0,ef=null,tf=0,ii=[],ai=0,ls=null,ja=1,Ca="";function cs(a,l){wl[jl++]=tf,wl[jl++]=ef,ef=a,tf=l}function Q1(a,l,d){ii[ai++]=ja,ii[ai++]=Ca,ii[ai++]=ls,ls=a;var p=ja;a=Ca;var x=32-kt(p)-1;p&=~(1<<x),d+=1;var w=32-kt(l)+x;if(30<w){var A=x-x%5;w=(p&(1<<A)-1).toString(32),p>>=A,x-=A,ja=1<<32-kt(l)+x|d<<x|p,Ca=w+a}else ja=1<<w|d<<x|p,Ca=a}function Hm(a){a.return!==null&&(cs(a,1),Q1(a,1,0))}function qm(a){for(;a===ef;)ef=wl[--jl],wl[jl]=null,tf=wl[--jl],wl[jl]=null;for(;a===ls;)ls=ii[--ai],ii[ai]=null,Ca=ii[--ai],ii[ai]=null,ja=ii[--ai],ii[ai]=null}var dr=null,_n=null,Vt=!1,us=null,Hi=!1,Gm=Error(r(519));function ds(a){var l=Error(r(418,""));throw Xc(ni(l,a)),Gm}function Y1(a){var l=a.stateNode,d=a.type,p=a.memoizedProps;switch(l[he]=a,l[Ee]=p,d){case"dialog":Dt("cancel",l),Dt("close",l);break;case"iframe":case"object":case"embed":Dt("load",l);break;case"video":case"audio":for(d=0;d<bu.length;d++)Dt(bu[d],l);break;case"source":Dt("error",l);break;case"img":case"image":case"link":Dt("error",l),Dt("load",l);break;case"details":Dt("toggle",l);break;case"input":Dt("invalid",l),u1(l,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0),Bd(l);break;case"select":Dt("invalid",l);break;case"textarea":Dt("invalid",l),f1(l,p.value,p.defaultValue,p.children),Bd(l)}d=p.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||l.textContent===""+d||p.suppressHydrationWarning===!0||fj(l.textContent,d)?(p.popover!=null&&(Dt("beforetoggle",l),Dt("toggle",l)),p.onScroll!=null&&Dt("scroll",l),p.onScrollEnd!=null&&Dt("scrollend",l),p.onClick!=null&&(l.onclick=Lf),l=!0):l=!1,l||ds(a)}function X1(a){for(dr=a.return;dr;)switch(dr.tag){case 5:case 13:Hi=!1;return;case 27:case 3:Hi=!0;return;default:dr=dr.return}}function Qc(a){if(a!==dr)return!1;if(!Vt)return X1(a),Vt=!0,!1;var l=a.tag,d;if((d=l!==3&&l!==27)&&((d=l===5)&&(d=a.type,d=!(d!=="form"&&d!=="button")||lv(a.type,a.memoizedProps)),d=!d),d&&_n&&ds(a),X1(a),l===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));e:{for(a=a.nextSibling,l=0;a;){if(a.nodeType===8)if(d=a.data,d==="/$"){if(l===0){_n=Ei(a.nextSibling);break e}l--}else d!=="$"&&d!=="$!"&&d!=="$?"||l++;a=a.nextSibling}_n=null}}else l===27?(l=_n,To(a.type)?(a=fv,fv=null,_n=a):_n=l):_n=dr?Ei(a.stateNode.nextSibling):null;return!0}function Yc(){_n=dr=null,Vt=!1}function K1(){var a=us;return a!==null&&(Cr===null?Cr=a:Cr.push.apply(Cr,a),us=null),a}function Xc(a){us===null?us=[a]:us.push(a)}var Wm=U(null),fs=null,Ea=null;function uo(a,l,d){ee(Wm,l._currentValue),l._currentValue=d}function Ta(a){a._currentValue=Wm.current,K(Wm)}function Qm(a,l,d){for(;a!==null;){var p=a.alternate;if((a.childLanes&l)!==l?(a.childLanes|=l,p!==null&&(p.childLanes|=l)):p!==null&&(p.childLanes&l)!==l&&(p.childLanes|=l),a===d)break;a=a.return}}function Ym(a,l,d,p){var x=a.child;for(x!==null&&(x.return=a);x!==null;){var w=x.dependencies;if(w!==null){var A=x.child;w=w.firstContext;e:for(;w!==null;){var N=w;w=x;for(var B=0;B<l.length;B++)if(N.context===l[B]){w.lanes|=d,N=w.alternate,N!==null&&(N.lanes|=d),Qm(w.return,d,a),p||(A=null);break e}w=N.next}}else if(x.tag===18){if(A=x.return,A===null)throw Error(r(341));A.lanes|=d,w=A.alternate,w!==null&&(w.lanes|=d),Qm(A,d,a),A=null}else A=x.child;if(A!==null)A.return=x;else for(A=x;A!==null;){if(A===a){A=null;break}if(x=A.sibling,x!==null){x.return=A.return,A=x;break}A=A.return}x=A}}function Kc(a,l,d,p){a=null;for(var x=l,w=!1;x!==null;){if(!w){if((x.flags&524288)!==0)w=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var A=x.alternate;if(A===null)throw Error(r(387));if(A=A.memoizedProps,A!==null){var N=x.type;Lr(x.pendingProps.value,A.value)||(a!==null?a.push(N):a=[N])}}else if(x===Ge.current){if(A=x.alternate,A===null)throw Error(r(387));A.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(a!==null?a.push(Tu):a=[Tu])}x=x.return}a!==null&&Ym(l,a,d,p),l.flags|=262144}function nf(a){for(a=a.firstContext;a!==null;){if(!Lr(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function hs(a){fs=a,Ea=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function nr(a){return Z1(fs,a)}function rf(a,l){return fs===null&&hs(a),Z1(a,l)}function Z1(a,l){var d=l._currentValue;if(l={context:l,memoizedValue:d,next:null},Ea===null){if(a===null)throw Error(r(308));Ea=l,a.dependencies={lanes:0,firstContext:l},a.flags|=524288}else Ea=Ea.next=l;return d}var nN=typeof AbortController<"u"?AbortController:function(){var a=[],l=this.signal={aborted:!1,addEventListener:function(d,p){a.push(p)}};this.abort=function(){l.aborted=!0,a.forEach(function(d){return d()})}},rN=e.unstable_scheduleCallback,iN=e.unstable_NormalPriority,Hn={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xm(){return{controller:new nN,data:new Map,refCount:0}}function Zc(a){a.refCount--,a.refCount===0&&rN(iN,function(){a.controller.abort()})}var Jc=null,Km=0,Cl=0,El=null;function aN(a,l){if(Jc===null){var d=Jc=[];Km=0,Cl=Jg(),El={status:"pending",value:void 0,then:function(p){d.push(p)}}}return Km++,l.then(J1,J1),l}function J1(){if(--Km===0&&Jc!==null){El!==null&&(El.status="fulfilled");var a=Jc;Jc=null,Cl=0,El=null;for(var l=0;l<a.length;l++)(0,a[l])()}}function oN(a,l){var d=[],p={status:"pending",value:null,reason:null,then:function(x){d.push(x)}};return a.then(function(){p.status="fulfilled",p.value=l;for(var x=0;x<d.length;x++)(0,d[x])(l)},function(x){for(p.status="rejected",p.reason=x,x=0;x<d.length;x++)(0,d[x])(void 0)}),p}var eS=P.S;P.S=function(a,l){typeof l=="object"&&l!==null&&typeof l.then=="function"&&aN(a,l),eS!==null&&eS(a,l)};var ps=U(null);function Zm(){var a=ps.current;return a!==null?a:dn.pooledCache}function af(a,l){l===null?ee(ps,ps.current):ee(ps,l.pool)}function tS(){var a=Zm();return a===null?null:{parent:Hn._currentValue,pool:a}}var eu=Error(r(460)),nS=Error(r(474)),of=Error(r(542)),Jm={then:function(){}};function rS(a){return a=a.status,a==="fulfilled"||a==="rejected"}function sf(){}function iS(a,l,d){switch(d=a[d],d===void 0?a.push(l):d!==l&&(l.then(sf,sf),l=d),l.status){case"fulfilled":return l.value;case"rejected":throw a=l.reason,oS(a),a;default:if(typeof l.status=="string")l.then(sf,sf);else{if(a=dn,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=l,a.status="pending",a.then(function(p){if(l.status==="pending"){var x=l;x.status="fulfilled",x.value=p}},function(p){if(l.status==="pending"){var x=l;x.status="rejected",x.reason=p}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw a=l.reason,oS(a),a}throw tu=l,eu}}var tu=null;function aS(){if(tu===null)throw Error(r(459));var a=tu;return tu=null,a}function oS(a){if(a===eu||a===of)throw Error(r(483))}var fo=!1;function eg(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function tg(a,l){a=a.updateQueue,l.updateQueue===a&&(l.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function ho(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function po(a,l,d){var p=a.updateQueue;if(p===null)return null;if(p=p.shared,(Qt&2)!==0){var x=p.pending;return x===null?l.next=l:(l.next=x.next,x.next=l),p.pending=l,l=Zd(a),G1(a,null,d),l}return Kd(a,p,l,d),Zd(a)}function nu(a,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194048)!==0)){var p=l.lanes;p&=a.pendingLanes,d|=p,l.lanes=d,oo(a,d)}}function ng(a,l){var d=a.updateQueue,p=a.alternate;if(p!==null&&(p=p.updateQueue,d===p)){var x=null,w=null;if(d=d.firstBaseUpdate,d!==null){do{var A={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};w===null?x=w=A:w=w.next=A,d=d.next}while(d!==null);w===null?x=w=l:w=w.next=l}else x=w=l;d={baseState:p.baseState,firstBaseUpdate:x,lastBaseUpdate:w,shared:p.shared,callbacks:p.callbacks},a.updateQueue=d;return}a=d.lastBaseUpdate,a===null?d.firstBaseUpdate=l:a.next=l,d.lastBaseUpdate=l}var rg=!1;function ru(){if(rg){var a=El;if(a!==null)throw a}}function iu(a,l,d,p){rg=!1;var x=a.updateQueue;fo=!1;var w=x.firstBaseUpdate,A=x.lastBaseUpdate,N=x.shared.pending;if(N!==null){x.shared.pending=null;var B=N,ne=B.next;B.next=null,A===null?w=ne:A.next=ne,A=B;var de=a.alternate;de!==null&&(de=de.updateQueue,N=de.lastBaseUpdate,N!==A&&(N===null?de.firstBaseUpdate=ne:N.next=ne,de.lastBaseUpdate=B))}if(w!==null){var pe=x.baseState;A=0,de=ne=B=null,N=w;do{var re=N.lane&-536870913,oe=re!==N.lane;if(oe?(Ot&re)===re:(p&re)===re){re!==0&&re===Cl&&(rg=!0),de!==null&&(de=de.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var ut=a,ot=N;re=l;var en=d;switch(ot.tag){case 1:if(ut=ot.payload,typeof ut=="function"){pe=ut.call(en,pe,re);break e}pe=ut;break e;case 3:ut.flags=ut.flags&-65537|128;case 0:if(ut=ot.payload,re=typeof ut=="function"?ut.call(en,pe,re):ut,re==null)break e;pe=m({},pe,re);break e;case 2:fo=!0}}re=N.callback,re!==null&&(a.flags|=64,oe&&(a.flags|=8192),oe=x.callbacks,oe===null?x.callbacks=[re]:oe.push(re))}else oe={lane:re,tag:N.tag,payload:N.payload,callback:N.callback,next:null},de===null?(ne=de=oe,B=pe):de=de.next=oe,A|=re;if(N=N.next,N===null){if(N=x.shared.pending,N===null)break;oe=N,N=oe.next,oe.next=null,x.lastBaseUpdate=oe,x.shared.pending=null}}while(!0);de===null&&(B=pe),x.baseState=B,x.firstBaseUpdate=ne,x.lastBaseUpdate=de,w===null&&(x.shared.lanes=0),wo|=A,a.lanes=A,a.memoizedState=pe}}function sS(a,l){if(typeof a!="function")throw Error(r(191,a));a.call(l)}function lS(a,l){var d=a.callbacks;if(d!==null)for(a.callbacks=null,a=0;a<d.length;a++)sS(d[a],l)}var Tl=U(null),lf=U(0);function cS(a,l){a=Na,ee(lf,a),ee(Tl,l),Na=a|l.baseLanes}function ig(){ee(lf,Na),ee(Tl,Tl.current)}function ag(){Na=lf.current,K(Tl),K(lf)}var mo=0,wt=null,Zt=null,$n=null,cf=!1,Rl=!1,ms=!1,uf=0,au=0,_l=null,sN=0;function kn(){throw Error(r(321))}function og(a,l){if(l===null)return!1;for(var d=0;d<l.length&&d<a.length;d++)if(!Lr(a[d],l[d]))return!1;return!0}function sg(a,l,d,p,x,w){return mo=w,wt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,P.H=a===null||a.memoizedState===null?GS:WS,ms=!1,w=d(p,x),ms=!1,Rl&&(w=dS(l,d,p,x)),uS(a),w}function uS(a){P.H=gf;var l=Zt!==null&&Zt.next!==null;if(mo=0,$n=Zt=wt=null,cf=!1,au=0,_l=null,l)throw Error(r(300));a===null||Wn||(a=a.dependencies,a!==null&&nf(a)&&(Wn=!0))}function dS(a,l,d,p){wt=a;var x=0;do{if(Rl&&(_l=null),au=0,Rl=!1,25<=x)throw Error(r(301));if(x+=1,$n=Zt=null,a.updateQueue!=null){var w=a.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}P.H=pN,w=l(d,p)}while(Rl);return w}function lN(){var a=P.H,l=a.useState()[0];return l=typeof l.then=="function"?ou(l):l,a=a.useState()[0],(Zt!==null?Zt.memoizedState:null)!==a&&(wt.flags|=1024),l}function lg(){var a=uf!==0;return uf=0,a}function cg(a,l,d){l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~d}function ug(a){if(cf){for(a=a.memoizedState;a!==null;){var l=a.queue;l!==null&&(l.pending=null),a=a.next}cf=!1}mo=0,$n=Zt=wt=null,Rl=!1,au=uf=0,_l=null}function wr(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $n===null?wt.memoizedState=$n=a:$n=$n.next=a,$n}function zn(){if(Zt===null){var a=wt.alternate;a=a!==null?a.memoizedState:null}else a=Zt.next;var l=$n===null?wt.memoizedState:$n.next;if(l!==null)$n=l,Zt=a;else{if(a===null)throw wt.alternate===null?Error(r(467)):Error(r(310));Zt=a,a={memoizedState:Zt.memoizedState,baseState:Zt.baseState,baseQueue:Zt.baseQueue,queue:Zt.queue,next:null},$n===null?wt.memoizedState=$n=a:$n=$n.next=a}return $n}function dg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ou(a){var l=au;return au+=1,_l===null&&(_l=[]),a=iS(_l,a,l),l=wt,($n===null?l.memoizedState:$n.next)===null&&(l=l.alternate,P.H=l===null||l.memoizedState===null?GS:WS),a}function df(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return ou(a);if(a.$$typeof===E)return nr(a)}throw Error(r(438,String(a)))}function fg(a){var l=null,d=wt.updateQueue;if(d!==null&&(l=d.memoCache),l==null){var p=wt.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(l={data:p.data.map(function(x){return x.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),d===null&&(d=dg(),wt.updateQueue=d),d.memoCache=l,d=l.data[l.index],d===void 0)for(d=l.data[l.index]=Array(a),p=0;p<a;p++)d[p]=F;return l.index++,d}function Ra(a,l){return typeof l=="function"?l(a):l}function ff(a){var l=zn();return hg(l,Zt,a)}function hg(a,l,d){var p=a.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=d;var x=a.baseQueue,w=p.pending;if(w!==null){if(x!==null){var A=x.next;x.next=w.next,w.next=A}l.baseQueue=x=w,p.pending=null}if(w=a.baseState,x===null)a.memoizedState=w;else{l=x.next;var N=A=null,B=null,ne=l,de=!1;do{var pe=ne.lane&-536870913;if(pe!==ne.lane?(Ot&pe)===pe:(mo&pe)===pe){var re=ne.revertLane;if(re===0)B!==null&&(B=B.next={lane:0,revertLane:0,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),pe===Cl&&(de=!0);else if((mo&re)===re){ne=ne.next,re===Cl&&(de=!0);continue}else pe={lane:0,revertLane:ne.revertLane,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},B===null?(N=B=pe,A=w):B=B.next=pe,wt.lanes|=re,wo|=re;pe=ne.action,ms&&d(w,pe),w=ne.hasEagerState?ne.eagerState:d(w,pe)}else re={lane:pe,revertLane:ne.revertLane,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},B===null?(N=B=re,A=w):B=B.next=re,wt.lanes|=pe,wo|=pe;ne=ne.next}while(ne!==null&&ne!==l);if(B===null?A=w:B.next=N,!Lr(w,a.memoizedState)&&(Wn=!0,de&&(d=El,d!==null)))throw d;a.memoizedState=w,a.baseState=A,a.baseQueue=B,p.lastRenderedState=w}return x===null&&(p.lanes=0),[a.memoizedState,p.dispatch]}function pg(a){var l=zn(),d=l.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=a;var p=d.dispatch,x=d.pending,w=l.memoizedState;if(x!==null){d.pending=null;var A=x=x.next;do w=a(w,A.action),A=A.next;while(A!==x);Lr(w,l.memoizedState)||(Wn=!0),l.memoizedState=w,l.baseQueue===null&&(l.baseState=w),d.lastRenderedState=w}return[w,p]}function fS(a,l,d){var p=wt,x=zn(),w=Vt;if(w){if(d===void 0)throw Error(r(407));d=d()}else d=l();var A=!Lr((Zt||x).memoizedState,d);A&&(x.memoizedState=d,Wn=!0),x=x.queue;var N=mS.bind(null,p,x,a);if(su(2048,8,N,[a]),x.getSnapshot!==l||A||$n!==null&&$n.memoizedState.tag&1){if(p.flags|=2048,Dl(9,hf(),pS.bind(null,p,x,d,l),null),dn===null)throw Error(r(349));w||(mo&124)!==0||hS(p,l,d)}return d}function hS(a,l,d){a.flags|=16384,a={getSnapshot:l,value:d},l=wt.updateQueue,l===null?(l=dg(),wt.updateQueue=l,l.stores=[a]):(d=l.stores,d===null?l.stores=[a]:d.push(a))}function pS(a,l,d,p){l.value=d,l.getSnapshot=p,gS(l)&&vS(a)}function mS(a,l,d){return d(function(){gS(l)&&vS(a)})}function gS(a){var l=a.getSnapshot;a=a.value;try{var d=l();return!Lr(a,d)}catch{return!0}}function vS(a){var l=bl(a,2);l!==null&&Vr(l,a,2)}function mg(a){var l=wr();if(typeof a=="function"){var d=a;if(a=d(),ms){qt(!0);try{d()}finally{qt(!1)}}}return l.memoizedState=l.baseState=a,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ra,lastRenderedState:a},l}function yS(a,l,d,p){return a.baseState=d,hg(a,Zt,typeof p=="function"?p:Ra)}function cN(a,l,d,p,x){if(mf(a))throw Error(r(485));if(a=l.action,a!==null){var w={payload:x,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){w.listeners.push(A)}};P.T!==null?d(!0):w.isTransition=!1,p(w),d=l.pending,d===null?(w.next=l.pending=w,xS(l,w)):(w.next=d.next,l.pending=d.next=w)}}function xS(a,l){var d=l.action,p=l.payload,x=a.state;if(l.isTransition){var w=P.T,A={};P.T=A;try{var N=d(x,p),B=P.S;B!==null&&B(A,N),bS(a,l,N)}catch(ne){gg(a,l,ne)}finally{P.T=w}}else try{w=d(x,p),bS(a,l,w)}catch(ne){gg(a,l,ne)}}function bS(a,l,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(p){SS(a,l,p)},function(p){return gg(a,l,p)}):SS(a,l,d)}function SS(a,l,d){l.status="fulfilled",l.value=d,wS(l),a.state=d,l=a.pending,l!==null&&(d=l.next,d===l?a.pending=null:(d=d.next,l.next=d,xS(a,d)))}function gg(a,l,d){var p=a.pending;if(a.pending=null,p!==null){p=p.next;do l.status="rejected",l.reason=d,wS(l),l=l.next;while(l!==p)}a.action=null}function wS(a){a=a.listeners;for(var l=0;l<a.length;l++)(0,a[l])()}function jS(a,l){return l}function CS(a,l){if(Vt){var d=dn.formState;if(d!==null){e:{var p=wt;if(Vt){if(_n){t:{for(var x=_n,w=Hi;x.nodeType!==8;){if(!w){x=null;break t}if(x=Ei(x.nextSibling),x===null){x=null;break t}}w=x.data,x=w==="F!"||w==="F"?x:null}if(x){_n=Ei(x.nextSibling),p=x.data==="F!";break e}}ds(p)}p=!1}p&&(l=d[0])}}return d=wr(),d.memoizedState=d.baseState=l,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jS,lastRenderedState:l},d.queue=p,d=FS.bind(null,wt,p),p.dispatch=d,p=mg(!1),w=Sg.bind(null,wt,!1,p.queue),p=wr(),x={state:l,dispatch:null,action:a,pending:null},p.queue=x,d=cN.bind(null,wt,x,w,d),x.dispatch=d,p.memoizedState=a,[l,d,!1]}function ES(a){var l=zn();return TS(l,Zt,a)}function TS(a,l,d){if(l=hg(a,l,jS)[0],a=ff(Ra)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var p=ou(l)}catch(A){throw A===eu?of:A}else p=l;l=zn();var x=l.queue,w=x.dispatch;return d!==l.memoizedState&&(wt.flags|=2048,Dl(9,hf(),uN.bind(null,x,d),null)),[p,w,a]}function uN(a,l){a.action=l}function RS(a){var l=zn(),d=Zt;if(d!==null)return TS(l,d,a);zn(),l=l.memoizedState,d=zn();var p=d.queue.dispatch;return d.memoizedState=a,[l,p,!1]}function Dl(a,l,d,p){return a={tag:a,create:d,deps:p,inst:l,next:null},l=wt.updateQueue,l===null&&(l=dg(),wt.updateQueue=l),d=l.lastEffect,d===null?l.lastEffect=a.next=a:(p=d.next,d.next=a,a.next=p,l.lastEffect=a),a}function hf(){return{destroy:void 0,resource:void 0}}function _S(){return zn().memoizedState}function pf(a,l,d,p){var x=wr();p=p===void 0?null:p,wt.flags|=a,x.memoizedState=Dl(1|l,hf(),d,p)}function su(a,l,d,p){var x=zn();p=p===void 0?null:p;var w=x.memoizedState.inst;Zt!==null&&p!==null&&og(p,Zt.memoizedState.deps)?x.memoizedState=Dl(l,w,d,p):(wt.flags|=a,x.memoizedState=Dl(1|l,w,d,p))}function DS(a,l){pf(8390656,8,a,l)}function AS(a,l){su(2048,8,a,l)}function kS(a,l){return su(4,2,a,l)}function PS(a,l){return su(4,4,a,l)}function NS(a,l){if(typeof l=="function"){a=a();var d=l(a);return function(){typeof d=="function"?d():l(null)}}if(l!=null)return a=a(),l.current=a,function(){l.current=null}}function OS(a,l,d){d=d!=null?d.concat([a]):null,su(4,4,NS.bind(null,l,a),d)}function vg(){}function MS(a,l){var d=zn();l=l===void 0?null:l;var p=d.memoizedState;return l!==null&&og(l,p[1])?p[0]:(d.memoizedState=[a,l],a)}function LS(a,l){var d=zn();l=l===void 0?null:l;var p=d.memoizedState;if(l!==null&&og(l,p[1]))return p[0];if(p=a(),ms){qt(!0);try{a()}finally{qt(!1)}}return d.memoizedState=[p,l],p}function yg(a,l,d){return d===void 0||(mo&1073741824)!==0?a.memoizedState=l:(a.memoizedState=d,a=zw(),wt.lanes|=a,wo|=a,d)}function IS(a,l,d,p){return Lr(d,l)?d:Tl.current!==null?(a=yg(a,d,p),Lr(a,l)||(Wn=!0),a):(mo&42)===0?(Wn=!0,a.memoizedState=d):(a=zw(),wt.lanes|=a,wo|=a,l)}function $S(a,l,d,p,x){var w=I.p;I.p=w!==0&&8>w?w:8;var A=P.T,N={};P.T=N,Sg(a,!1,l,d);try{var B=x(),ne=P.S;if(ne!==null&&ne(N,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var de=oN(B,p);lu(a,l,de,Br(a))}else lu(a,l,p,Br(a))}catch(pe){lu(a,l,{then:function(){},status:"rejected",reason:pe},Br())}finally{I.p=w,P.T=A}}function dN(){}function xg(a,l,d,p){if(a.tag!==5)throw Error(r(476));var x=zS(a).queue;$S(a,x,l,$,d===null?dN:function(){return US(a),d(p)})}function zS(a){var l=a.memoizedState;if(l!==null)return l;l={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ra,lastRenderedState:$},next:null};var d={};return l.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ra,lastRenderedState:d},next:null},a.memoizedState=l,a=a.alternate,a!==null&&(a.memoizedState=l),l}function US(a){var l=zS(a).next.queue;lu(a,l,{},Br())}function bg(){return nr(Tu)}function BS(){return zn().memoizedState}function VS(){return zn().memoizedState}function fN(a){for(var l=a.return;l!==null;){switch(l.tag){case 24:case 3:var d=Br();a=ho(d);var p=po(l,a,d);p!==null&&(Vr(p,l,d),nu(p,l,d)),l={cache:Xm()},a.payload=l;return}l=l.return}}function hN(a,l,d){var p=Br();d={lane:p,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null},mf(a)?HS(l,d):(d=Um(a,l,d,p),d!==null&&(Vr(d,a,p),qS(d,l,p)))}function FS(a,l,d){var p=Br();lu(a,l,d,p)}function lu(a,l,d,p){var x={lane:p,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null};if(mf(a))HS(l,x);else{var w=a.alternate;if(a.lanes===0&&(w===null||w.lanes===0)&&(w=l.lastRenderedReducer,w!==null))try{var A=l.lastRenderedState,N=w(A,d);if(x.hasEagerState=!0,x.eagerState=N,Lr(N,A))return Kd(a,l,x,0),dn===null&&Xd(),!1}catch{}finally{}if(d=Um(a,l,x,p),d!==null)return Vr(d,a,p),qS(d,l,p),!0}return!1}function Sg(a,l,d,p){if(p={lane:2,revertLane:Jg(),action:p,hasEagerState:!1,eagerState:null,next:null},mf(a)){if(l)throw Error(r(479))}else l=Um(a,d,p,2),l!==null&&Vr(l,a,2)}function mf(a){var l=a.alternate;return a===wt||l!==null&&l===wt}function HS(a,l){Rl=cf=!0;var d=a.pending;d===null?l.next=l:(l.next=d.next,d.next=l),a.pending=l}function qS(a,l,d){if((d&4194048)!==0){var p=l.lanes;p&=a.pendingLanes,d|=p,l.lanes=d,oo(a,d)}}var gf={readContext:nr,use:df,useCallback:kn,useContext:kn,useEffect:kn,useImperativeHandle:kn,useLayoutEffect:kn,useInsertionEffect:kn,useMemo:kn,useReducer:kn,useRef:kn,useState:kn,useDebugValue:kn,useDeferredValue:kn,useTransition:kn,useSyncExternalStore:kn,useId:kn,useHostTransitionStatus:kn,useFormState:kn,useActionState:kn,useOptimistic:kn,useMemoCache:kn,useCacheRefresh:kn},GS={readContext:nr,use:df,useCallback:function(a,l){return wr().memoizedState=[a,l===void 0?null:l],a},useContext:nr,useEffect:DS,useImperativeHandle:function(a,l,d){d=d!=null?d.concat([a]):null,pf(4194308,4,NS.bind(null,l,a),d)},useLayoutEffect:function(a,l){return pf(4194308,4,a,l)},useInsertionEffect:function(a,l){pf(4,2,a,l)},useMemo:function(a,l){var d=wr();l=l===void 0?null:l;var p=a();if(ms){qt(!0);try{a()}finally{qt(!1)}}return d.memoizedState=[p,l],p},useReducer:function(a,l,d){var p=wr();if(d!==void 0){var x=d(l);if(ms){qt(!0);try{d(l)}finally{qt(!1)}}}else x=l;return p.memoizedState=p.baseState=x,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:x},p.queue=a,a=a.dispatch=hN.bind(null,wt,a),[p.memoizedState,a]},useRef:function(a){var l=wr();return a={current:a},l.memoizedState=a},useState:function(a){a=mg(a);var l=a.queue,d=FS.bind(null,wt,l);return l.dispatch=d,[a.memoizedState,d]},useDebugValue:vg,useDeferredValue:function(a,l){var d=wr();return yg(d,a,l)},useTransition:function(){var a=mg(!1);return a=$S.bind(null,wt,a.queue,!0,!1),wr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,l,d){var p=wt,x=wr();if(Vt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=l(),dn===null)throw Error(r(349));(Ot&124)!==0||hS(p,l,d)}x.memoizedState=d;var w={value:d,getSnapshot:l};return x.queue=w,DS(mS.bind(null,p,w,a),[a]),p.flags|=2048,Dl(9,hf(),pS.bind(null,p,w,d,l),null),d},useId:function(){var a=wr(),l=dn.identifierPrefix;if(Vt){var d=Ca,p=ja;d=(p&~(1<<32-kt(p)-1)).toString(32)+d,l="«"+l+"R"+d,d=uf++,0<d&&(l+="H"+d.toString(32)),l+="»"}else d=sN++,l="«"+l+"r"+d.toString(32)+"»";return a.memoizedState=l},useHostTransitionStatus:bg,useFormState:CS,useActionState:CS,useOptimistic:function(a){var l=wr();l.memoizedState=l.baseState=a;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=d,l=Sg.bind(null,wt,!0,d),d.dispatch=l,[a,l]},useMemoCache:fg,useCacheRefresh:function(){return wr().memoizedState=fN.bind(null,wt)}},WS={readContext:nr,use:df,useCallback:MS,useContext:nr,useEffect:AS,useImperativeHandle:OS,useInsertionEffect:kS,useLayoutEffect:PS,useMemo:LS,useReducer:ff,useRef:_S,useState:function(){return ff(Ra)},useDebugValue:vg,useDeferredValue:function(a,l){var d=zn();return IS(d,Zt.memoizedState,a,l)},useTransition:function(){var a=ff(Ra)[0],l=zn().memoizedState;return[typeof a=="boolean"?a:ou(a),l]},useSyncExternalStore:fS,useId:BS,useHostTransitionStatus:bg,useFormState:ES,useActionState:ES,useOptimistic:function(a,l){var d=zn();return yS(d,Zt,a,l)},useMemoCache:fg,useCacheRefresh:VS},pN={readContext:nr,use:df,useCallback:MS,useContext:nr,useEffect:AS,useImperativeHandle:OS,useInsertionEffect:kS,useLayoutEffect:PS,useMemo:LS,useReducer:pg,useRef:_S,useState:function(){return pg(Ra)},useDebugValue:vg,useDeferredValue:function(a,l){var d=zn();return Zt===null?yg(d,a,l):IS(d,Zt.memoizedState,a,l)},useTransition:function(){var a=pg(Ra)[0],l=zn().memoizedState;return[typeof a=="boolean"?a:ou(a),l]},useSyncExternalStore:fS,useId:BS,useHostTransitionStatus:bg,useFormState:RS,useActionState:RS,useOptimistic:function(a,l){var d=zn();return Zt!==null?yS(d,Zt,a,l):(d.baseState=a,[a,d.queue.dispatch])},useMemoCache:fg,useCacheRefresh:VS},Al=null,cu=0;function vf(a){var l=cu;return cu+=1,Al===null&&(Al=[]),iS(Al,a,l)}function uu(a,l){l=l.props.ref,a.ref=l!==void 0?l:null}function yf(a,l){throw l.$$typeof===g?Error(r(525)):(a=Object.prototype.toString.call(l),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":a)))}function QS(a){var l=a._init;return l(a._payload)}function YS(a){function l(Q,q){if(a){var te=Q.deletions;te===null?(Q.deletions=[q],Q.flags|=16):te.push(q)}}function d(Q,q){if(!a)return null;for(;q!==null;)l(Q,q),q=q.sibling;return null}function p(Q){for(var q=new Map;Q!==null;)Q.key!==null?q.set(Q.key,Q):q.set(Q.index,Q),Q=Q.sibling;return q}function x(Q,q){return Q=wa(Q,q),Q.index=0,Q.sibling=null,Q}function w(Q,q,te){return Q.index=te,a?(te=Q.alternate,te!==null?(te=te.index,te<q?(Q.flags|=67108866,q):te):(Q.flags|=67108866,q)):(Q.flags|=1048576,q)}function A(Q){return a&&Q.alternate===null&&(Q.flags|=67108866),Q}function N(Q,q,te,fe){return q===null||q.tag!==6?(q=Vm(te,Q.mode,fe),q.return=Q,q):(q=x(q,te),q.return=Q,q)}function B(Q,q,te,fe){var He=te.type;return He===S?de(Q,q,te.props.children,fe,te.key):q!==null&&(q.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===L&&QS(He)===q.type)?(q=x(q,te.props),uu(q,te),q.return=Q,q):(q=Jd(te.type,te.key,te.props,null,Q.mode,fe),uu(q,te),q.return=Q,q)}function ne(Q,q,te,fe){return q===null||q.tag!==4||q.stateNode.containerInfo!==te.containerInfo||q.stateNode.implementation!==te.implementation?(q=Fm(te,Q.mode,fe),q.return=Q,q):(q=x(q,te.children||[]),q.return=Q,q)}function de(Q,q,te,fe,He){return q===null||q.tag!==7?(q=ss(te,Q.mode,fe,He),q.return=Q,q):(q=x(q,te),q.return=Q,q)}function pe(Q,q,te){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=Vm(""+q,Q.mode,te),q.return=Q,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case y:return te=Jd(q.type,q.key,q.props,null,Q.mode,te),uu(te,q),te.return=Q,te;case b:return q=Fm(q,Q.mode,te),q.return=Q,q;case L:var fe=q._init;return q=fe(q._payload),pe(Q,q,te)}if(X(q)||W(q))return q=ss(q,Q.mode,te,null),q.return=Q,q;if(typeof q.then=="function")return pe(Q,vf(q),te);if(q.$$typeof===E)return pe(Q,rf(Q,q),te);yf(Q,q)}return null}function re(Q,q,te,fe){var He=q!==null?q.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return He!==null?null:N(Q,q,""+te,fe);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case y:return te.key===He?B(Q,q,te,fe):null;case b:return te.key===He?ne(Q,q,te,fe):null;case L:return He=te._init,te=He(te._payload),re(Q,q,te,fe)}if(X(te)||W(te))return He!==null?null:de(Q,q,te,fe,null);if(typeof te.then=="function")return re(Q,q,vf(te),fe);if(te.$$typeof===E)return re(Q,q,rf(Q,te),fe);yf(Q,te)}return null}function oe(Q,q,te,fe,He){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return Q=Q.get(te)||null,N(q,Q,""+fe,He);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case y:return Q=Q.get(fe.key===null?te:fe.key)||null,B(q,Q,fe,He);case b:return Q=Q.get(fe.key===null?te:fe.key)||null,ne(q,Q,fe,He);case L:var Tt=fe._init;return fe=Tt(fe._payload),oe(Q,q,te,fe,He)}if(X(fe)||W(fe))return Q=Q.get(te)||null,de(q,Q,fe,He,null);if(typeof fe.then=="function")return oe(Q,q,te,vf(fe),He);if(fe.$$typeof===E)return oe(Q,q,te,rf(q,fe),He);yf(q,fe)}return null}function ut(Q,q,te,fe){for(var He=null,Tt=null,tt=q,lt=q=0,Yn=null;tt!==null&&lt<te.length;lt++){tt.index>lt?(Yn=tt,tt=null):Yn=tt.sibling;var Ut=re(Q,tt,te[lt],fe);if(Ut===null){tt===null&&(tt=Yn);break}a&&tt&&Ut.alternate===null&&l(Q,tt),q=w(Ut,q,lt),Tt===null?He=Ut:Tt.sibling=Ut,Tt=Ut,tt=Yn}if(lt===te.length)return d(Q,tt),Vt&&cs(Q,lt),He;if(tt===null){for(;lt<te.length;lt++)tt=pe(Q,te[lt],fe),tt!==null&&(q=w(tt,q,lt),Tt===null?He=tt:Tt.sibling=tt,Tt=tt);return Vt&&cs(Q,lt),He}for(tt=p(tt);lt<te.length;lt++)Yn=oe(tt,Q,lt,te[lt],fe),Yn!==null&&(a&&Yn.alternate!==null&&tt.delete(Yn.key===null?lt:Yn.key),q=w(Yn,q,lt),Tt===null?He=Yn:Tt.sibling=Yn,Tt=Yn);return a&&tt.forEach(function(ko){return l(Q,ko)}),Vt&&cs(Q,lt),He}function ot(Q,q,te,fe){if(te==null)throw Error(r(151));for(var He=null,Tt=null,tt=q,lt=q=0,Yn=null,Ut=te.next();tt!==null&&!Ut.done;lt++,Ut=te.next()){tt.index>lt?(Yn=tt,tt=null):Yn=tt.sibling;var ko=re(Q,tt,Ut.value,fe);if(ko===null){tt===null&&(tt=Yn);break}a&&tt&&ko.alternate===null&&l(Q,tt),q=w(ko,q,lt),Tt===null?He=ko:Tt.sibling=ko,Tt=ko,tt=Yn}if(Ut.done)return d(Q,tt),Vt&&cs(Q,lt),He;if(tt===null){for(;!Ut.done;lt++,Ut=te.next())Ut=pe(Q,Ut.value,fe),Ut!==null&&(q=w(Ut,q,lt),Tt===null?He=Ut:Tt.sibling=Ut,Tt=Ut);return Vt&&cs(Q,lt),He}for(tt=p(tt);!Ut.done;lt++,Ut=te.next())Ut=oe(tt,Q,lt,Ut.value,fe),Ut!==null&&(a&&Ut.alternate!==null&&tt.delete(Ut.key===null?lt:Ut.key),q=w(Ut,q,lt),Tt===null?He=Ut:Tt.sibling=Ut,Tt=Ut);return a&&tt.forEach(function(m4){return l(Q,m4)}),Vt&&cs(Q,lt),He}function en(Q,q,te,fe){if(typeof te=="object"&&te!==null&&te.type===S&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case y:e:{for(var He=te.key;q!==null;){if(q.key===He){if(He=te.type,He===S){if(q.tag===7){d(Q,q.sibling),fe=x(q,te.props.children),fe.return=Q,Q=fe;break e}}else if(q.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===L&&QS(He)===q.type){d(Q,q.sibling),fe=x(q,te.props),uu(fe,te),fe.return=Q,Q=fe;break e}d(Q,q);break}else l(Q,q);q=q.sibling}te.type===S?(fe=ss(te.props.children,Q.mode,fe,te.key),fe.return=Q,Q=fe):(fe=Jd(te.type,te.key,te.props,null,Q.mode,fe),uu(fe,te),fe.return=Q,Q=fe)}return A(Q);case b:e:{for(He=te.key;q!==null;){if(q.key===He)if(q.tag===4&&q.stateNode.containerInfo===te.containerInfo&&q.stateNode.implementation===te.implementation){d(Q,q.sibling),fe=x(q,te.children||[]),fe.return=Q,Q=fe;break e}else{d(Q,q);break}else l(Q,q);q=q.sibling}fe=Fm(te,Q.mode,fe),fe.return=Q,Q=fe}return A(Q);case L:return He=te._init,te=He(te._payload),en(Q,q,te,fe)}if(X(te))return ut(Q,q,te,fe);if(W(te)){if(He=W(te),typeof He!="function")throw Error(r(150));return te=He.call(te),ot(Q,q,te,fe)}if(typeof te.then=="function")return en(Q,q,vf(te),fe);if(te.$$typeof===E)return en(Q,q,rf(Q,te),fe);yf(Q,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,q!==null&&q.tag===6?(d(Q,q.sibling),fe=x(q,te),fe.return=Q,Q=fe):(d(Q,q),fe=Vm(te,Q.mode,fe),fe.return=Q,Q=fe),A(Q)):d(Q,q)}return function(Q,q,te,fe){try{cu=0;var He=en(Q,q,te,fe);return Al=null,He}catch(tt){if(tt===eu||tt===of)throw tt;var Tt=Ir(29,tt,null,Q.mode);return Tt.lanes=fe,Tt.return=Q,Tt}finally{}}}var kl=YS(!0),XS=YS(!1),oi=U(null),qi=null;function go(a){var l=a.alternate;ee(qn,qn.current&1),ee(oi,a),qi===null&&(l===null||Tl.current!==null||l.memoizedState!==null)&&(qi=a)}function KS(a){if(a.tag===22){if(ee(qn,qn.current),ee(oi,a),qi===null){var l=a.alternate;l!==null&&l.memoizedState!==null&&(qi=a)}}else vo()}function vo(){ee(qn,qn.current),ee(oi,oi.current)}function _a(a){K(oi),qi===a&&(qi=null),K(qn)}var qn=U(0);function xf(a){for(var l=a;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||dv(d)))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}function wg(a,l,d,p){l=a.memoizedState,d=d(p,l),d=d==null?l:m({},l,d),a.memoizedState=d,a.lanes===0&&(a.updateQueue.baseState=d)}var jg={enqueueSetState:function(a,l,d){a=a._reactInternals;var p=Br(),x=ho(p);x.payload=l,d!=null&&(x.callback=d),l=po(a,x,p),l!==null&&(Vr(l,a,p),nu(l,a,p))},enqueueReplaceState:function(a,l,d){a=a._reactInternals;var p=Br(),x=ho(p);x.tag=1,x.payload=l,d!=null&&(x.callback=d),l=po(a,x,p),l!==null&&(Vr(l,a,p),nu(l,a,p))},enqueueForceUpdate:function(a,l){a=a._reactInternals;var d=Br(),p=ho(d);p.tag=2,l!=null&&(p.callback=l),l=po(a,p,d),l!==null&&(Vr(l,a,d),nu(l,a,d))}};function ZS(a,l,d,p,x,w,A){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(p,w,A):l.prototype&&l.prototype.isPureReactComponent?!Gc(d,p)||!Gc(x,w):!0}function JS(a,l,d,p){a=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,p),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,p),l.state!==a&&jg.enqueueReplaceState(l,l.state,null)}function gs(a,l){var d=l;if("ref"in l){d={};for(var p in l)p!=="ref"&&(d[p]=l[p])}if(a=a.defaultProps){d===l&&(d=m({},d));for(var x in a)d[x]===void 0&&(d[x]=a[x])}return d}var bf=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)};function ew(a){bf(a)}function tw(a){console.error(a)}function nw(a){bf(a)}function Sf(a,l){try{var d=a.onUncaughtError;d(l.value,{componentStack:l.stack})}catch(p){setTimeout(function(){throw p})}}function rw(a,l,d){try{var p=a.onCaughtError;p(d.value,{componentStack:d.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function Cg(a,l,d){return d=ho(d),d.tag=3,d.payload={element:null},d.callback=function(){Sf(a,l)},d}function iw(a){return a=ho(a),a.tag=3,a}function aw(a,l,d,p){var x=d.type.getDerivedStateFromError;if(typeof x=="function"){var w=p.value;a.payload=function(){return x(w)},a.callback=function(){rw(l,d,p)}}var A=d.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(a.callback=function(){rw(l,d,p),typeof x!="function"&&(jo===null?jo=new Set([this]):jo.add(this));var N=p.stack;this.componentDidCatch(p.value,{componentStack:N!==null?N:""})})}function mN(a,l,d,p,x){if(d.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(l=d.alternate,l!==null&&Kc(l,d,x,!0),d=oi.current,d!==null){switch(d.tag){case 13:return qi===null?Qg():d.alternate===null&&Dn===0&&(Dn=3),d.flags&=-257,d.flags|=65536,d.lanes=x,p===Jm?d.flags|=16384:(l=d.updateQueue,l===null?d.updateQueue=new Set([p]):l.add(p),Xg(a,p,x)),!1;case 22:return d.flags|=65536,p===Jm?d.flags|=16384:(l=d.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([p])},d.updateQueue=l):(d=l.retryQueue,d===null?l.retryQueue=new Set([p]):d.add(p)),Xg(a,p,x)),!1}throw Error(r(435,d.tag))}return Xg(a,p,x),Qg(),!1}if(Vt)return l=oi.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=x,p!==Gm&&(a=Error(r(422),{cause:p}),Xc(ni(a,d)))):(p!==Gm&&(l=Error(r(423),{cause:p}),Xc(ni(l,d))),a=a.current.alternate,a.flags|=65536,x&=-x,a.lanes|=x,p=ni(p,d),x=Cg(a.stateNode,p,x),ng(a,x),Dn!==4&&(Dn=2)),!1;var w=Error(r(520),{cause:p});if(w=ni(w,d),vu===null?vu=[w]:vu.push(w),Dn!==4&&(Dn=2),l===null)return!0;p=ni(p,d),d=l;do{switch(d.tag){case 3:return d.flags|=65536,a=x&-x,d.lanes|=a,a=Cg(d.stateNode,p,a),ng(d,a),!1;case 1:if(l=d.type,w=d.stateNode,(d.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(jo===null||!jo.has(w))))return d.flags|=65536,x&=-x,d.lanes|=x,x=iw(x),aw(x,a,d,p),ng(d,x),!1}d=d.return}while(d!==null);return!1}var ow=Error(r(461)),Wn=!1;function Kn(a,l,d,p){l.child=a===null?XS(l,null,d,p):kl(l,a.child,d,p)}function sw(a,l,d,p,x){d=d.render;var w=l.ref;if("ref"in p){var A={};for(var N in p)N!=="ref"&&(A[N]=p[N])}else A=p;return hs(l),p=sg(a,l,d,A,w,x),N=lg(),a!==null&&!Wn?(cg(a,l,x),Da(a,l,x)):(Vt&&N&&Hm(l),l.flags|=1,Kn(a,l,p,x),l.child)}function lw(a,l,d,p,x){if(a===null){var w=d.type;return typeof w=="function"&&!Bm(w)&&w.defaultProps===void 0&&d.compare===null?(l.tag=15,l.type=w,cw(a,l,w,p,x)):(a=Jd(d.type,null,p,l,l.mode,x),a.ref=l.ref,a.return=l,l.child=a)}if(w=a.child,!Pg(a,x)){var A=w.memoizedProps;if(d=d.compare,d=d!==null?d:Gc,d(A,p)&&a.ref===l.ref)return Da(a,l,x)}return l.flags|=1,a=wa(w,p),a.ref=l.ref,a.return=l,l.child=a}function cw(a,l,d,p,x){if(a!==null){var w=a.memoizedProps;if(Gc(w,p)&&a.ref===l.ref)if(Wn=!1,l.pendingProps=p=w,Pg(a,x))(a.flags&131072)!==0&&(Wn=!0);else return l.lanes=a.lanes,Da(a,l,x)}return Eg(a,l,d,p,x)}function uw(a,l,d){var p=l.pendingProps,x=p.children,w=a!==null?a.memoizedState:null;if(p.mode==="hidden"){if((l.flags&128)!==0){if(p=w!==null?w.baseLanes|d:d,a!==null){for(x=l.child=a.child,w=0;x!==null;)w=w|x.lanes|x.childLanes,x=x.sibling;l.childLanes=w&~p}else l.childLanes=0,l.child=null;return dw(a,l,p,d)}if((d&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},a!==null&&af(l,w!==null?w.cachePool:null),w!==null?cS(l,w):ig(),KS(l);else return l.lanes=l.childLanes=536870912,dw(a,l,w!==null?w.baseLanes|d:d,d)}else w!==null?(af(l,w.cachePool),cS(l,w),vo(),l.memoizedState=null):(a!==null&&af(l,null),ig(),vo());return Kn(a,l,x,d),l.child}function dw(a,l,d,p){var x=Zm();return x=x===null?null:{parent:Hn._currentValue,pool:x},l.memoizedState={baseLanes:d,cachePool:x},a!==null&&af(l,null),ig(),KS(l),a!==null&&Kc(a,l,p,!0),null}function wf(a,l){var d=l.ref;if(d===null)a!==null&&a.ref!==null&&(l.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(r(284));(a===null||a.ref!==d)&&(l.flags|=4194816)}}function Eg(a,l,d,p,x){return hs(l),d=sg(a,l,d,p,void 0,x),p=lg(),a!==null&&!Wn?(cg(a,l,x),Da(a,l,x)):(Vt&&p&&Hm(l),l.flags|=1,Kn(a,l,d,x),l.child)}function fw(a,l,d,p,x,w){return hs(l),l.updateQueue=null,d=dS(l,p,d,x),uS(a),p=lg(),a!==null&&!Wn?(cg(a,l,w),Da(a,l,w)):(Vt&&p&&Hm(l),l.flags|=1,Kn(a,l,d,w),l.child)}function hw(a,l,d,p,x){if(hs(l),l.stateNode===null){var w=Sl,A=d.contextType;typeof A=="object"&&A!==null&&(w=nr(A)),w=new d(p,w),l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=jg,l.stateNode=w,w._reactInternals=l,w=l.stateNode,w.props=p,w.state=l.memoizedState,w.refs={},eg(l),A=d.contextType,w.context=typeof A=="object"&&A!==null?nr(A):Sl,w.state=l.memoizedState,A=d.getDerivedStateFromProps,typeof A=="function"&&(wg(l,d,A,p),w.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(A=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),A!==w.state&&jg.enqueueReplaceState(w,w.state,null),iu(l,p,w,x),ru(),w.state=l.memoizedState),typeof w.componentDidMount=="function"&&(l.flags|=4194308),p=!0}else if(a===null){w=l.stateNode;var N=l.memoizedProps,B=gs(d,N);w.props=B;var ne=w.context,de=d.contextType;A=Sl,typeof de=="object"&&de!==null&&(A=nr(de));var pe=d.getDerivedStateFromProps;de=typeof pe=="function"||typeof w.getSnapshotBeforeUpdate=="function",N=l.pendingProps!==N,de||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(N||ne!==A)&&JS(l,w,p,A),fo=!1;var re=l.memoizedState;w.state=re,iu(l,p,w,x),ru(),ne=l.memoizedState,N||re!==ne||fo?(typeof pe=="function"&&(wg(l,d,pe,p),ne=l.memoizedState),(B=fo||ZS(l,d,B,p,re,ne,A))?(de||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(l.flags|=4194308)):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=p,l.memoizedState=ne),w.props=p,w.state=ne,w.context=A,p=B):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),p=!1)}else{w=l.stateNode,tg(a,l),A=l.memoizedProps,de=gs(d,A),w.props=de,pe=l.pendingProps,re=w.context,ne=d.contextType,B=Sl,typeof ne=="object"&&ne!==null&&(B=nr(ne)),N=d.getDerivedStateFromProps,(ne=typeof N=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(A!==pe||re!==B)&&JS(l,w,p,B),fo=!1,re=l.memoizedState,w.state=re,iu(l,p,w,x),ru();var oe=l.memoizedState;A!==pe||re!==oe||fo||a!==null&&a.dependencies!==null&&nf(a.dependencies)?(typeof N=="function"&&(wg(l,d,N,p),oe=l.memoizedState),(de=fo||ZS(l,d,de,p,re,oe,B)||a!==null&&a.dependencies!==null&&nf(a.dependencies))?(ne||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(p,oe,B),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(p,oe,B)),typeof w.componentDidUpdate=="function"&&(l.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof w.componentDidUpdate!="function"||A===a.memoizedProps&&re===a.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||A===a.memoizedProps&&re===a.memoizedState||(l.flags|=1024),l.memoizedProps=p,l.memoizedState=oe),w.props=p,w.state=oe,w.context=B,p=de):(typeof w.componentDidUpdate!="function"||A===a.memoizedProps&&re===a.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||A===a.memoizedProps&&re===a.memoizedState||(l.flags|=1024),p=!1)}return w=p,wf(a,l),p=(l.flags&128)!==0,w||p?(w=l.stateNode,d=p&&typeof d.getDerivedStateFromError!="function"?null:w.render(),l.flags|=1,a!==null&&p?(l.child=kl(l,a.child,null,x),l.child=kl(l,null,d,x)):Kn(a,l,d,x),l.memoizedState=w.state,a=l.child):a=Da(a,l,x),a}function pw(a,l,d,p){return Yc(),l.flags|=256,Kn(a,l,d,p),l.child}var Tg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Rg(a){return{baseLanes:a,cachePool:tS()}}function _g(a,l,d){return a=a!==null?a.childLanes&~d:0,l&&(a|=si),a}function mw(a,l,d){var p=l.pendingProps,x=!1,w=(l.flags&128)!==0,A;if((A=w)||(A=a!==null&&a.memoizedState===null?!1:(qn.current&2)!==0),A&&(x=!0,l.flags&=-129),A=(l.flags&32)!==0,l.flags&=-33,a===null){if(Vt){if(x?go(l):vo(),Vt){var N=_n,B;if(B=N){e:{for(B=N,N=Hi;B.nodeType!==8;){if(!N){N=null;break e}if(B=Ei(B.nextSibling),B===null){N=null;break e}}N=B}N!==null?(l.memoizedState={dehydrated:N,treeContext:ls!==null?{id:ja,overflow:Ca}:null,retryLane:536870912,hydrationErrors:null},B=Ir(18,null,null,0),B.stateNode=N,B.return=l,l.child=B,dr=l,_n=null,B=!0):B=!1}B||ds(l)}if(N=l.memoizedState,N!==null&&(N=N.dehydrated,N!==null))return dv(N)?l.lanes=32:l.lanes=536870912,null;_a(l)}return N=p.children,p=p.fallback,x?(vo(),x=l.mode,N=jf({mode:"hidden",children:N},x),p=ss(p,x,d,null),N.return=l,p.return=l,N.sibling=p,l.child=N,x=l.child,x.memoizedState=Rg(d),x.childLanes=_g(a,A,d),l.memoizedState=Tg,p):(go(l),Dg(l,N))}if(B=a.memoizedState,B!==null&&(N=B.dehydrated,N!==null)){if(w)l.flags&256?(go(l),l.flags&=-257,l=Ag(a,l,d)):l.memoizedState!==null?(vo(),l.child=a.child,l.flags|=128,l=null):(vo(),x=p.fallback,N=l.mode,p=jf({mode:"visible",children:p.children},N),x=ss(x,N,d,null),x.flags|=2,p.return=l,x.return=l,p.sibling=x,l.child=p,kl(l,a.child,null,d),p=l.child,p.memoizedState=Rg(d),p.childLanes=_g(a,A,d),l.memoizedState=Tg,l=x);else if(go(l),dv(N)){if(A=N.nextSibling&&N.nextSibling.dataset,A)var ne=A.dgst;A=ne,p=Error(r(419)),p.stack="",p.digest=A,Xc({value:p,source:null,stack:null}),l=Ag(a,l,d)}else if(Wn||Kc(a,l,d,!1),A=(d&a.childLanes)!==0,Wn||A){if(A=dn,A!==null&&(p=d&-d,p=(p&42)!==0?1:ts(p),p=(p&(A.suspendedLanes|d))!==0?0:p,p!==0&&p!==B.retryLane))throw B.retryLane=p,bl(a,p),Vr(A,a,p),ow;N.data==="$?"||Qg(),l=Ag(a,l,d)}else N.data==="$?"?(l.flags|=192,l.child=a.child,l=null):(a=B.treeContext,_n=Ei(N.nextSibling),dr=l,Vt=!0,us=null,Hi=!1,a!==null&&(ii[ai++]=ja,ii[ai++]=Ca,ii[ai++]=ls,ja=a.id,Ca=a.overflow,ls=l),l=Dg(l,p.children),l.flags|=4096);return l}return x?(vo(),x=p.fallback,N=l.mode,B=a.child,ne=B.sibling,p=wa(B,{mode:"hidden",children:p.children}),p.subtreeFlags=B.subtreeFlags&65011712,ne!==null?x=wa(ne,x):(x=ss(x,N,d,null),x.flags|=2),x.return=l,p.return=l,p.sibling=x,l.child=p,p=x,x=l.child,N=a.child.memoizedState,N===null?N=Rg(d):(B=N.cachePool,B!==null?(ne=Hn._currentValue,B=B.parent!==ne?{parent:ne,pool:ne}:B):B=tS(),N={baseLanes:N.baseLanes|d,cachePool:B}),x.memoizedState=N,x.childLanes=_g(a,A,d),l.memoizedState=Tg,p):(go(l),d=a.child,a=d.sibling,d=wa(d,{mode:"visible",children:p.children}),d.return=l,d.sibling=null,a!==null&&(A=l.deletions,A===null?(l.deletions=[a],l.flags|=16):A.push(a)),l.child=d,l.memoizedState=null,d)}function Dg(a,l){return l=jf({mode:"visible",children:l},a.mode),l.return=a,a.child=l}function jf(a,l){return a=Ir(22,a,null,l),a.lanes=0,a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},a}function Ag(a,l,d){return kl(l,a.child,null,d),a=Dg(l,l.pendingProps.children),a.flags|=2,l.memoizedState=null,a}function gw(a,l,d){a.lanes|=l;var p=a.alternate;p!==null&&(p.lanes|=l),Qm(a.return,l,d)}function kg(a,l,d,p,x){var w=a.memoizedState;w===null?a.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:p,tail:d,tailMode:x}:(w.isBackwards=l,w.rendering=null,w.renderingStartTime=0,w.last=p,w.tail=d,w.tailMode=x)}function vw(a,l,d){var p=l.pendingProps,x=p.revealOrder,w=p.tail;if(Kn(a,l,p.children,d),p=qn.current,(p&2)!==0)p=p&1|2,l.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=l.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&gw(a,d,l);else if(a.tag===19)gw(a,d,l);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break e;for(;a.sibling===null;){if(a.return===null||a.return===l)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}p&=1}switch(ee(qn,p),x){case"forwards":for(d=l.child,x=null;d!==null;)a=d.alternate,a!==null&&xf(a)===null&&(x=d),d=d.sibling;d=x,d===null?(x=l.child,l.child=null):(x=d.sibling,d.sibling=null),kg(l,!1,x,d,w);break;case"backwards":for(d=null,x=l.child,l.child=null;x!==null;){if(a=x.alternate,a!==null&&xf(a)===null){l.child=x;break}a=x.sibling,x.sibling=d,d=x,x=a}kg(l,!0,d,null,w);break;case"together":kg(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Da(a,l,d){if(a!==null&&(l.dependencies=a.dependencies),wo|=l.lanes,(d&l.childLanes)===0)if(a!==null){if(Kc(a,l,d,!1),(d&l.childLanes)===0)return null}else return null;if(a!==null&&l.child!==a.child)throw Error(r(153));if(l.child!==null){for(a=l.child,d=wa(a,a.pendingProps),l.child=d,d.return=l;a.sibling!==null;)a=a.sibling,d=d.sibling=wa(a,a.pendingProps),d.return=l;d.sibling=null}return l.child}function Pg(a,l){return(a.lanes&l)!==0?!0:(a=a.dependencies,!!(a!==null&&nf(a)))}function gN(a,l,d){switch(l.tag){case 3:Me(l,l.stateNode.containerInfo),uo(l,Hn,a.memoizedState.cache),Yc();break;case 27:case 5:ke(l);break;case 4:Me(l,l.stateNode.containerInfo);break;case 10:uo(l,l.type,l.memoizedProps.value);break;case 13:var p=l.memoizedState;if(p!==null)return p.dehydrated!==null?(go(l),l.flags|=128,null):(d&l.child.childLanes)!==0?mw(a,l,d):(go(l),a=Da(a,l,d),a!==null?a.sibling:null);go(l);break;case 19:var x=(a.flags&128)!==0;if(p=(d&l.childLanes)!==0,p||(Kc(a,l,d,!1),p=(d&l.childLanes)!==0),x){if(p)return vw(a,l,d);l.flags|=128}if(x=l.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),ee(qn,qn.current),p)break;return null;case 22:case 23:return l.lanes=0,uw(a,l,d);case 24:uo(l,Hn,a.memoizedState.cache)}return Da(a,l,d)}function yw(a,l,d){if(a!==null)if(a.memoizedProps!==l.pendingProps)Wn=!0;else{if(!Pg(a,d)&&(l.flags&128)===0)return Wn=!1,gN(a,l,d);Wn=(a.flags&131072)!==0}else Wn=!1,Vt&&(l.flags&1048576)!==0&&Q1(l,tf,l.index);switch(l.lanes=0,l.tag){case 16:e:{a=l.pendingProps;var p=l.elementType,x=p._init;if(p=x(p._payload),l.type=p,typeof p=="function")Bm(p)?(a=gs(p,a),l.tag=1,l=hw(null,l,p,a,d)):(l.tag=0,l=Eg(null,l,p,a,d));else{if(p!=null){if(x=p.$$typeof,x===R){l.tag=11,l=sw(null,l,p,a,d);break e}else if(x===M){l.tag=14,l=lw(null,l,p,a,d);break e}}throw l=G(p)||p,Error(r(306,l,""))}}return l;case 0:return Eg(a,l,l.type,l.pendingProps,d);case 1:return p=l.type,x=gs(p,l.pendingProps),hw(a,l,p,x,d);case 3:e:{if(Me(l,l.stateNode.containerInfo),a===null)throw Error(r(387));p=l.pendingProps;var w=l.memoizedState;x=w.element,tg(a,l),iu(l,p,null,d);var A=l.memoizedState;if(p=A.cache,uo(l,Hn,p),p!==w.cache&&Ym(l,[Hn],d,!0),ru(),p=A.element,w.isDehydrated)if(w={element:p,isDehydrated:!1,cache:A.cache},l.updateQueue.baseState=w,l.memoizedState=w,l.flags&256){l=pw(a,l,p,d);break e}else if(p!==x){x=ni(Error(r(424)),l),Xc(x),l=pw(a,l,p,d);break e}else{switch(a=l.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(_n=Ei(a.firstChild),dr=l,Vt=!0,us=null,Hi=!0,d=XS(l,null,p,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling}else{if(Yc(),p===x){l=Da(a,l,d);break e}Kn(a,l,p,d)}l=l.child}return l;case 26:return wf(a,l),a===null?(d=wj(l.type,null,l.pendingProps,null))?l.memoizedState=d:Vt||(d=l.type,a=l.pendingProps,p=If(xe.current).createElement(d),p[he]=l,p[Ee]=a,Jn(p,d,a),dt(p),l.stateNode=p):l.memoizedState=wj(l.type,a.memoizedProps,l.pendingProps,a.memoizedState),null;case 27:return ke(l),a===null&&Vt&&(p=l.stateNode=xj(l.type,l.pendingProps,xe.current),dr=l,Hi=!0,x=_n,To(l.type)?(fv=x,_n=Ei(p.firstChild)):_n=x),Kn(a,l,l.pendingProps.children,d),wf(a,l),a===null&&(l.flags|=4194304),l.child;case 5:return a===null&&Vt&&((x=p=_n)&&(p=HN(p,l.type,l.pendingProps,Hi),p!==null?(l.stateNode=p,dr=l,_n=Ei(p.firstChild),Hi=!1,x=!0):x=!1),x||ds(l)),ke(l),x=l.type,w=l.pendingProps,A=a!==null?a.memoizedProps:null,p=w.children,lv(x,w)?p=null:A!==null&&lv(x,A)&&(l.flags|=32),l.memoizedState!==null&&(x=sg(a,l,lN,null,null,d),Tu._currentValue=x),wf(a,l),Kn(a,l,p,d),l.child;case 6:return a===null&&Vt&&((a=d=_n)&&(d=qN(d,l.pendingProps,Hi),d!==null?(l.stateNode=d,dr=l,_n=null,a=!0):a=!1),a||ds(l)),null;case 13:return mw(a,l,d);case 4:return Me(l,l.stateNode.containerInfo),p=l.pendingProps,a===null?l.child=kl(l,null,p,d):Kn(a,l,p,d),l.child;case 11:return sw(a,l,l.type,l.pendingProps,d);case 7:return Kn(a,l,l.pendingProps,d),l.child;case 8:return Kn(a,l,l.pendingProps.children,d),l.child;case 12:return Kn(a,l,l.pendingProps.children,d),l.child;case 10:return p=l.pendingProps,uo(l,l.type,p.value),Kn(a,l,p.children,d),l.child;case 9:return x=l.type._context,p=l.pendingProps.children,hs(l),x=nr(x),p=p(x),l.flags|=1,Kn(a,l,p,d),l.child;case 14:return lw(a,l,l.type,l.pendingProps,d);case 15:return cw(a,l,l.type,l.pendingProps,d);case 19:return vw(a,l,d);case 31:return p=l.pendingProps,d=l.mode,p={mode:p.mode,children:p.children},a===null?(d=jf(p,d),d.ref=l.ref,l.child=d,d.return=l,l=d):(d=wa(a.child,p),d.ref=l.ref,l.child=d,d.return=l,l=d),l;case 22:return uw(a,l,d);case 24:return hs(l),p=nr(Hn),a===null?(x=Zm(),x===null&&(x=dn,w=Xm(),x.pooledCache=w,w.refCount++,w!==null&&(x.pooledCacheLanes|=d),x=w),l.memoizedState={parent:p,cache:x},eg(l),uo(l,Hn,x)):((a.lanes&d)!==0&&(tg(a,l),iu(l,null,null,d),ru()),x=a.memoizedState,w=l.memoizedState,x.parent!==p?(x={parent:p,cache:p},l.memoizedState=x,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=x),uo(l,Hn,p)):(p=w.cache,uo(l,Hn,p),p!==x.cache&&Ym(l,[Hn],d,!0))),Kn(a,l,l.pendingProps.children,d),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function Aa(a){a.flags|=4}function xw(a,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!Rj(l)){if(l=oi.current,l!==null&&((Ot&4194048)===Ot?qi!==null:(Ot&62914560)!==Ot&&(Ot&536870912)===0||l!==qi))throw tu=Jm,nS;a.flags|=8192}}function Cf(a,l){l!==null&&(a.flags|=4),a.flags&16384&&(l=a.tag!==22?ao():536870912,a.lanes|=l,Ml|=l)}function du(a,l){if(!Vt)switch(a.tailMode){case"hidden":l=a.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?a.tail=null:d.sibling=null;break;case"collapsed":d=a.tail;for(var p=null;d!==null;)d.alternate!==null&&(p=d),d=d.sibling;p===null?l||a.tail===null?a.tail=null:a.tail.sibling=null:p.sibling=null}}function jn(a){var l=a.alternate!==null&&a.alternate.child===a.child,d=0,p=0;if(l)for(var x=a.child;x!==null;)d|=x.lanes|x.childLanes,p|=x.subtreeFlags&65011712,p|=x.flags&65011712,x.return=a,x=x.sibling;else for(x=a.child;x!==null;)d|=x.lanes|x.childLanes,p|=x.subtreeFlags,p|=x.flags,x.return=a,x=x.sibling;return a.subtreeFlags|=p,a.childLanes=d,l}function vN(a,l,d){var p=l.pendingProps;switch(qm(l),l.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jn(l),null;case 1:return jn(l),null;case 3:return d=l.stateNode,p=null,a!==null&&(p=a.memoizedState.cache),l.memoizedState.cache!==p&&(l.flags|=2048),Ta(Hn),nt(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(a===null||a.child===null)&&(Qc(l)?Aa(l):a===null||a.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,K1())),jn(l),null;case 26:return d=l.memoizedState,a===null?(Aa(l),d!==null?(jn(l),xw(l,d)):(jn(l),l.flags&=-16777217)):d?d!==a.memoizedState?(Aa(l),jn(l),xw(l,d)):(jn(l),l.flags&=-16777217):(a.memoizedProps!==p&&Aa(l),jn(l),l.flags&=-16777217),null;case 27:yt(l),d=xe.current;var x=l.type;if(a!==null&&l.stateNode!=null)a.memoizedProps!==p&&Aa(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return jn(l),null}a=Se.current,Qc(l)?Y1(l):(a=xj(x,p,d),l.stateNode=a,Aa(l))}return jn(l),null;case 5:if(yt(l),d=l.type,a!==null&&l.stateNode!=null)a.memoizedProps!==p&&Aa(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return jn(l),null}if(a=Se.current,Qc(l))Y1(l);else{switch(x=If(xe.current),a){case 1:a=x.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:a=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":a=x.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":a=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":a=x.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof p.is=="string"?x.createElement("select",{is:p.is}):x.createElement("select"),p.multiple?a.multiple=!0:p.size&&(a.size=p.size);break;default:a=typeof p.is=="string"?x.createElement(d,{is:p.is}):x.createElement(d)}}a[he]=l,a[Ee]=p;e:for(x=l.child;x!==null;){if(x.tag===5||x.tag===6)a.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===l)break e;for(;x.sibling===null;){if(x.return===null||x.return===l)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}l.stateNode=a;e:switch(Jn(a,d,p),d){case"button":case"input":case"select":case"textarea":a=!!p.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Aa(l)}}return jn(l),l.flags&=-16777217,null;case 6:if(a&&l.stateNode!=null)a.memoizedProps!==p&&Aa(l);else{if(typeof p!="string"&&l.stateNode===null)throw Error(r(166));if(a=xe.current,Qc(l)){if(a=l.stateNode,d=l.memoizedProps,p=null,x=dr,x!==null)switch(x.tag){case 27:case 5:p=x.memoizedProps}a[he]=l,a=!!(a.nodeValue===d||p!==null&&p.suppressHydrationWarning===!0||fj(a.nodeValue,d)),a||ds(l)}else a=If(a).createTextNode(p),a[he]=l,l.stateNode=a}return jn(l),null;case 13:if(p=l.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(x=Qc(l),p!==null&&p.dehydrated!==null){if(a===null){if(!x)throw Error(r(318));if(x=l.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[he]=l}else Yc(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;jn(l),x=!1}else x=K1(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=x),x=!0;if(!x)return l.flags&256?(_a(l),l):(_a(l),null)}if(_a(l),(l.flags&128)!==0)return l.lanes=d,l;if(d=p!==null,a=a!==null&&a.memoizedState!==null,d){p=l.child,x=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(x=p.alternate.memoizedState.cachePool.pool);var w=null;p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(w=p.memoizedState.cachePool.pool),w!==x&&(p.flags|=2048)}return d!==a&&d&&(l.child.flags|=8192),Cf(l,l.updateQueue),jn(l),null;case 4:return nt(),a===null&&rv(l.stateNode.containerInfo),jn(l),null;case 10:return Ta(l.type),jn(l),null;case 19:if(K(qn),x=l.memoizedState,x===null)return jn(l),null;if(p=(l.flags&128)!==0,w=x.rendering,w===null)if(p)du(x,!1);else{if(Dn!==0||a!==null&&(a.flags&128)!==0)for(a=l.child;a!==null;){if(w=xf(a),w!==null){for(l.flags|=128,du(x,!1),a=w.updateQueue,l.updateQueue=a,Cf(l,a),l.subtreeFlags=0,a=d,d=l.child;d!==null;)W1(d,a),d=d.sibling;return ee(qn,qn.current&1|2),l.child}a=a.sibling}x.tail!==null&&Te()>Rf&&(l.flags|=128,p=!0,du(x,!1),l.lanes=4194304)}else{if(!p)if(a=xf(w),a!==null){if(l.flags|=128,p=!0,a=a.updateQueue,l.updateQueue=a,Cf(l,a),du(x,!0),x.tail===null&&x.tailMode==="hidden"&&!w.alternate&&!Vt)return jn(l),null}else 2*Te()-x.renderingStartTime>Rf&&d!==536870912&&(l.flags|=128,p=!0,du(x,!1),l.lanes=4194304);x.isBackwards?(w.sibling=l.child,l.child=w):(a=x.last,a!==null?a.sibling=w:l.child=w,x.last=w)}return x.tail!==null?(l=x.tail,x.rendering=l,x.tail=l.sibling,x.renderingStartTime=Te(),l.sibling=null,a=qn.current,ee(qn,p?a&1|2:a&1),l):(jn(l),null);case 22:case 23:return _a(l),ag(),p=l.memoizedState!==null,a!==null?a.memoizedState!==null!==p&&(l.flags|=8192):p&&(l.flags|=8192),p?(d&536870912)!==0&&(l.flags&128)===0&&(jn(l),l.subtreeFlags&6&&(l.flags|=8192)):jn(l),d=l.updateQueue,d!==null&&Cf(l,d.retryQueue),d=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),p=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),p!==d&&(l.flags|=2048),a!==null&&K(ps),null;case 24:return d=null,a!==null&&(d=a.memoizedState.cache),l.memoizedState.cache!==d&&(l.flags|=2048),Ta(Hn),jn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function yN(a,l){switch(qm(l),l.tag){case 1:return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 3:return Ta(Hn),nt(),a=l.flags,(a&65536)!==0&&(a&128)===0?(l.flags=a&-65537|128,l):null;case 26:case 27:case 5:return yt(l),null;case 13:if(_a(l),a=l.memoizedState,a!==null&&a.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Yc()}return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 19:return K(qn),null;case 4:return nt(),null;case 10:return Ta(l.type),null;case 22:case 23:return _a(l),ag(),a!==null&&K(ps),a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 24:return Ta(Hn),null;case 25:return null;default:return null}}function bw(a,l){switch(qm(l),l.tag){case 3:Ta(Hn),nt();break;case 26:case 27:case 5:yt(l);break;case 4:nt();break;case 13:_a(l);break;case 19:K(qn);break;case 10:Ta(l.type);break;case 22:case 23:_a(l),ag(),a!==null&&K(ps);break;case 24:Ta(Hn)}}function fu(a,l){try{var d=l.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var x=p.next;d=x;do{if((d.tag&a)===a){p=void 0;var w=d.create,A=d.inst;p=w(),A.destroy=p}d=d.next}while(d!==x)}}catch(N){rn(l,l.return,N)}}function yo(a,l,d){try{var p=l.updateQueue,x=p!==null?p.lastEffect:null;if(x!==null){var w=x.next;p=w;do{if((p.tag&a)===a){var A=p.inst,N=A.destroy;if(N!==void 0){A.destroy=void 0,x=l;var B=d,ne=N;try{ne()}catch(de){rn(x,B,de)}}}p=p.next}while(p!==w)}}catch(de){rn(l,l.return,de)}}function Sw(a){var l=a.updateQueue;if(l!==null){var d=a.stateNode;try{lS(l,d)}catch(p){rn(a,a.return,p)}}}function ww(a,l,d){d.props=gs(a.type,a.memoizedProps),d.state=a.memoizedState;try{d.componentWillUnmount()}catch(p){rn(a,l,p)}}function hu(a,l){try{var d=a.ref;if(d!==null){switch(a.tag){case 26:case 27:case 5:var p=a.stateNode;break;case 30:p=a.stateNode;break;default:p=a.stateNode}typeof d=="function"?a.refCleanup=d(p):d.current=p}}catch(x){rn(a,l,x)}}function Gi(a,l){var d=a.ref,p=a.refCleanup;if(d!==null)if(typeof p=="function")try{p()}catch(x){rn(a,l,x)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(x){rn(a,l,x)}else d.current=null}function jw(a){var l=a.type,d=a.memoizedProps,p=a.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":d.autoFocus&&p.focus();break e;case"img":d.src?p.src=d.src:d.srcSet&&(p.srcset=d.srcSet)}}catch(x){rn(a,a.return,x)}}function Ng(a,l,d){try{var p=a.stateNode;zN(p,a.type,d,l),p[Ee]=l}catch(x){rn(a,a.return,x)}}function Cw(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&To(a.type)||a.tag===4}function Og(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Cw(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.tag===27&&To(a.type)||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 Mg(a,l,d){var p=a.tag;if(p===5||p===6)a=a.stateNode,l?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(a,l):(l=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,l.appendChild(a),d=d._reactRootContainer,d!=null||l.onclick!==null||(l.onclick=Lf));else if(p!==4&&(p===27&&To(a.type)&&(d=a.stateNode,l=null),a=a.child,a!==null))for(Mg(a,l,d),a=a.sibling;a!==null;)Mg(a,l,d),a=a.sibling}function Ef(a,l,d){var p=a.tag;if(p===5||p===6)a=a.stateNode,l?d.insertBefore(a,l):d.appendChild(a);else if(p!==4&&(p===27&&To(a.type)&&(d=a.stateNode),a=a.child,a!==null))for(Ef(a,l,d),a=a.sibling;a!==null;)Ef(a,l,d),a=a.sibling}function Ew(a){var l=a.stateNode,d=a.memoizedProps;try{for(var p=a.type,x=l.attributes;x.length;)l.removeAttributeNode(x[0]);Jn(l,p,d),l[he]=a,l[Ee]=d}catch(w){rn(a,a.return,w)}}var ka=!1,Pn=!1,Lg=!1,Tw=typeof WeakSet=="function"?WeakSet:Set,Qn=null;function xN(a,l){if(a=a.containerInfo,ov=Ff,a=I1(a),Om(a)){if("selectionStart"in a)var d={start:a.selectionStart,end:a.selectionEnd};else e:{d=(d=a.ownerDocument)&&d.defaultView||window;var p=d.getSelection&&d.getSelection();if(p&&p.rangeCount!==0){d=p.anchorNode;var x=p.anchorOffset,w=p.focusNode;p=p.focusOffset;try{d.nodeType,w.nodeType}catch{d=null;break e}var A=0,N=-1,B=-1,ne=0,de=0,pe=a,re=null;t:for(;;){for(var oe;pe!==d||x!==0&&pe.nodeType!==3||(N=A+x),pe!==w||p!==0&&pe.nodeType!==3||(B=A+p),pe.nodeType===3&&(A+=pe.nodeValue.length),(oe=pe.firstChild)!==null;)re=pe,pe=oe;for(;;){if(pe===a)break t;if(re===d&&++ne===x&&(N=A),re===w&&++de===p&&(B=A),(oe=pe.nextSibling)!==null)break;pe=re,re=pe.parentNode}pe=oe}d=N===-1||B===-1?null:{start:N,end:B}}else d=null}d=d||{start:0,end:0}}else d=null;for(sv={focusedElem:a,selectionRange:d},Ff=!1,Qn=l;Qn!==null;)if(l=Qn,a=l.child,(l.subtreeFlags&1024)!==0&&a!==null)a.return=l,Qn=a;else for(;Qn!==null;){switch(l=Qn,w=l.alternate,a=l.flags,l.tag){case 0:break;case 11:case 15:break;case 1:if((a&1024)!==0&&w!==null){a=void 0,d=l,x=w.memoizedProps,w=w.memoizedState,p=d.stateNode;try{var ut=gs(d.type,x,d.elementType===d.type);a=p.getSnapshotBeforeUpdate(ut,w),p.__reactInternalSnapshotBeforeUpdate=a}catch(ot){rn(d,d.return,ot)}}break;case 3:if((a&1024)!==0){if(a=l.stateNode.containerInfo,d=a.nodeType,d===9)uv(a);else if(d===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":uv(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=l.sibling,a!==null){a.return=l.return,Qn=a;break}Qn=l.return}}function Rw(a,l,d){var p=d.flags;switch(d.tag){case 0:case 11:case 15:xo(a,d),p&4&&fu(5,d);break;case 1:if(xo(a,d),p&4)if(a=d.stateNode,l===null)try{a.componentDidMount()}catch(A){rn(d,d.return,A)}else{var x=gs(d.type,l.memoizedProps);l=l.memoizedState;try{a.componentDidUpdate(x,l,a.__reactInternalSnapshotBeforeUpdate)}catch(A){rn(d,d.return,A)}}p&64&&Sw(d),p&512&&hu(d,d.return);break;case 3:if(xo(a,d),p&64&&(a=d.updateQueue,a!==null)){if(l=null,d.child!==null)switch(d.child.tag){case 27:case 5:l=d.child.stateNode;break;case 1:l=d.child.stateNode}try{lS(a,l)}catch(A){rn(d,d.return,A)}}break;case 27:l===null&&p&4&&Ew(d);case 26:case 5:xo(a,d),l===null&&p&4&&jw(d),p&512&&hu(d,d.return);break;case 12:xo(a,d);break;case 13:xo(a,d),p&4&&Aw(a,d),p&64&&(a=d.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(d=_N.bind(null,d),GN(a,d))));break;case 22:if(p=d.memoizedState!==null||ka,!p){l=l!==null&&l.memoizedState!==null||Pn,x=ka;var w=Pn;ka=p,(Pn=l)&&!w?bo(a,d,(d.subtreeFlags&8772)!==0):xo(a,d),ka=x,Pn=w}break;case 30:break;default:xo(a,d)}}function _w(a){var l=a.alternate;l!==null&&(a.alternate=null,_w(l)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(l=a.stateNode,l!==null&&Ye(l)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var xn=null,jr=!1;function Pa(a,l,d){for(d=d.child;d!==null;)Dw(a,l,d),d=d.sibling}function Dw(a,l,d){if(ht&&typeof ht.onCommitFiberUnmount=="function")try{ht.onCommitFiberUnmount(xt,d)}catch{}switch(d.tag){case 26:Pn||Gi(d,l),Pa(a,l,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:Pn||Gi(d,l);var p=xn,x=jr;To(d.type)&&(xn=d.stateNode,jr=!1),Pa(a,l,d),wu(d.stateNode),xn=p,jr=x;break;case 5:Pn||Gi(d,l);case 6:if(p=xn,x=jr,xn=null,Pa(a,l,d),xn=p,jr=x,xn!==null)if(jr)try{(xn.nodeType===9?xn.body:xn.nodeName==="HTML"?xn.ownerDocument.body:xn).removeChild(d.stateNode)}catch(w){rn(d,l,w)}else try{xn.removeChild(d.stateNode)}catch(w){rn(d,l,w)}break;case 18:xn!==null&&(jr?(a=xn,vj(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,d.stateNode),Au(a)):vj(xn,d.stateNode));break;case 4:p=xn,x=jr,xn=d.stateNode.containerInfo,jr=!0,Pa(a,l,d),xn=p,jr=x;break;case 0:case 11:case 14:case 15:Pn||yo(2,d,l),Pn||yo(4,d,l),Pa(a,l,d);break;case 1:Pn||(Gi(d,l),p=d.stateNode,typeof p.componentWillUnmount=="function"&&ww(d,l,p)),Pa(a,l,d);break;case 21:Pa(a,l,d);break;case 22:Pn=(p=Pn)||d.memoizedState!==null,Pa(a,l,d),Pn=p;break;default:Pa(a,l,d)}}function Aw(a,l){if(l.memoizedState===null&&(a=l.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Au(a)}catch(d){rn(l,l.return,d)}}function bN(a){switch(a.tag){case 13:case 19:var l=a.stateNode;return l===null&&(l=a.stateNode=new Tw),l;case 22:return a=a.stateNode,l=a._retryCache,l===null&&(l=a._retryCache=new Tw),l;default:throw Error(r(435,a.tag))}}function Ig(a,l){var d=bN(a);l.forEach(function(p){var x=DN.bind(null,a,p);d.has(p)||(d.add(p),p.then(x,x))})}function $r(a,l){var d=l.deletions;if(d!==null)for(var p=0;p<d.length;p++){var x=d[p],w=a,A=l,N=A;e:for(;N!==null;){switch(N.tag){case 27:if(To(N.type)){xn=N.stateNode,jr=!1;break e}break;case 5:xn=N.stateNode,jr=!1;break e;case 3:case 4:xn=N.stateNode.containerInfo,jr=!0;break e}N=N.return}if(xn===null)throw Error(r(160));Dw(w,A,x),xn=null,jr=!1,w=x.alternate,w!==null&&(w.return=null),x.return=null}if(l.subtreeFlags&13878)for(l=l.child;l!==null;)kw(l,a),l=l.sibling}var Ci=null;function kw(a,l){var d=a.alternate,p=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:$r(l,a),zr(a),p&4&&(yo(3,a,a.return),fu(3,a),yo(5,a,a.return));break;case 1:$r(l,a),zr(a),p&512&&(Pn||d===null||Gi(d,d.return)),p&64&&ka&&(a=a.updateQueue,a!==null&&(p=a.callbacks,p!==null&&(d=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=d===null?p:d.concat(p))));break;case 26:var x=Ci;if($r(l,a),zr(a),p&512&&(Pn||d===null||Gi(d,d.return)),p&4){var w=d!==null?d.memoizedState:null;if(p=a.memoizedState,d===null)if(p===null)if(a.stateNode===null){e:{p=a.type,d=a.memoizedProps,x=x.ownerDocument||x;t:switch(p){case"title":w=x.getElementsByTagName("title")[0],(!w||w[Je]||w[he]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=x.createElement(p),x.head.insertBefore(w,x.querySelector("head > title"))),Jn(w,p,d),w[he]=a,dt(w),p=w;break e;case"link":var A=Ej("link","href",x).get(p+(d.href||""));if(A){for(var N=0;N<A.length;N++)if(w=A[N],w.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&w.getAttribute("rel")===(d.rel==null?null:d.rel)&&w.getAttribute("title")===(d.title==null?null:d.title)&&w.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){A.splice(N,1);break t}}w=x.createElement(p),Jn(w,p,d),x.head.appendChild(w);break;case"meta":if(A=Ej("meta","content",x).get(p+(d.content||""))){for(N=0;N<A.length;N++)if(w=A[N],w.getAttribute("content")===(d.content==null?null:""+d.content)&&w.getAttribute("name")===(d.name==null?null:d.name)&&w.getAttribute("property")===(d.property==null?null:d.property)&&w.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&w.getAttribute("charset")===(d.charSet==null?null:d.charSet)){A.splice(N,1);break t}}w=x.createElement(p),Jn(w,p,d),x.head.appendChild(w);break;default:throw Error(r(468,p))}w[he]=a,dt(w),p=w}a.stateNode=p}else Tj(x,a.type,a.stateNode);else a.stateNode=Cj(x,p,a.memoizedProps);else w!==p?(w===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):w.count--,p===null?Tj(x,a.type,a.stateNode):Cj(x,p,a.memoizedProps)):p===null&&a.stateNode!==null&&Ng(a,a.memoizedProps,d.memoizedProps)}break;case 27:$r(l,a),zr(a),p&512&&(Pn||d===null||Gi(d,d.return)),d!==null&&p&4&&Ng(a,a.memoizedProps,d.memoizedProps);break;case 5:if($r(l,a),zr(a),p&512&&(Pn||d===null||Gi(d,d.return)),a.flags&32){x=a.stateNode;try{hl(x,"")}catch(oe){rn(a,a.return,oe)}}p&4&&a.stateNode!=null&&(x=a.memoizedProps,Ng(a,x,d!==null?d.memoizedProps:x)),p&1024&&(Lg=!0);break;case 6:if($r(l,a),zr(a),p&4){if(a.stateNode===null)throw Error(r(162));p=a.memoizedProps,d=a.stateNode;try{d.nodeValue=p}catch(oe){rn(a,a.return,oe)}}break;case 3:if(Uf=null,x=Ci,Ci=$f(l.containerInfo),$r(l,a),Ci=x,zr(a),p&4&&d!==null&&d.memoizedState.isDehydrated)try{Au(l.containerInfo)}catch(oe){rn(a,a.return,oe)}Lg&&(Lg=!1,Pw(a));break;case 4:p=Ci,Ci=$f(a.stateNode.containerInfo),$r(l,a),zr(a),Ci=p;break;case 12:$r(l,a),zr(a);break;case 13:$r(l,a),zr(a),a.child.flags&8192&&a.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Fg=Te()),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,Ig(a,p)));break;case 22:x=a.memoizedState!==null;var B=d!==null&&d.memoizedState!==null,ne=ka,de=Pn;if(ka=ne||x,Pn=de||B,$r(l,a),Pn=de,ka=ne,zr(a),p&8192)e:for(l=a.stateNode,l._visibility=x?l._visibility&-2:l._visibility|1,x&&(d===null||B||ka||Pn||vs(a)),d=null,l=a;;){if(l.tag===5||l.tag===26){if(d===null){B=d=l;try{if(w=B.stateNode,x)A=w.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{N=B.stateNode;var pe=B.memoizedProps.style,re=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;N.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(oe){rn(B,B.return,oe)}}}else if(l.tag===6){if(d===null){B=l;try{B.stateNode.nodeValue=x?"":B.memoizedProps}catch(oe){rn(B,B.return,oe)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===a)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break e;for(;l.sibling===null;){if(l.return===null||l.return===a)break e;d===l&&(d=null),l=l.return}d===l&&(d=null),l.sibling.return=l.return,l=l.sibling}p&4&&(p=a.updateQueue,p!==null&&(d=p.retryQueue,d!==null&&(p.retryQueue=null,Ig(a,d))));break;case 19:$r(l,a),zr(a),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,Ig(a,p)));break;case 30:break;case 21:break;default:$r(l,a),zr(a)}}function zr(a){var l=a.flags;if(l&2){try{for(var d,p=a.return;p!==null;){if(Cw(p)){d=p;break}p=p.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var x=d.stateNode,w=Og(a);Ef(a,w,x);break;case 5:var A=d.stateNode;d.flags&32&&(hl(A,""),d.flags&=-33);var N=Og(a);Ef(a,N,A);break;case 3:case 4:var B=d.stateNode.containerInfo,ne=Og(a);Mg(a,ne,B);break;default:throw Error(r(161))}}catch(de){rn(a,a.return,de)}a.flags&=-3}l&4096&&(a.flags&=-4097)}function Pw(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var l=a;Pw(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),a=a.sibling}}function xo(a,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)Rw(a,l.alternate,l),l=l.sibling}function vs(a){for(a=a.child;a!==null;){var l=a;switch(l.tag){case 0:case 11:case 14:case 15:yo(4,l,l.return),vs(l);break;case 1:Gi(l,l.return);var d=l.stateNode;typeof d.componentWillUnmount=="function"&&ww(l,l.return,d),vs(l);break;case 27:wu(l.stateNode);case 26:case 5:Gi(l,l.return),vs(l);break;case 22:l.memoizedState===null&&vs(l);break;case 30:vs(l);break;default:vs(l)}a=a.sibling}}function bo(a,l,d){for(d=d&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var p=l.alternate,x=a,w=l,A=w.flags;switch(w.tag){case 0:case 11:case 15:bo(x,w,d),fu(4,w);break;case 1:if(bo(x,w,d),p=w,x=p.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(ne){rn(p,p.return,ne)}if(p=w,x=p.updateQueue,x!==null){var N=p.stateNode;try{var B=x.shared.hiddenCallbacks;if(B!==null)for(x.shared.hiddenCallbacks=null,x=0;x<B.length;x++)sS(B[x],N)}catch(ne){rn(p,p.return,ne)}}d&&A&64&&Sw(w),hu(w,w.return);break;case 27:Ew(w);case 26:case 5:bo(x,w,d),d&&p===null&&A&4&&jw(w),hu(w,w.return);break;case 12:bo(x,w,d);break;case 13:bo(x,w,d),d&&A&4&&Aw(x,w);break;case 22:w.memoizedState===null&&bo(x,w,d),hu(w,w.return);break;case 30:break;default:bo(x,w,d)}l=l.sibling}}function $g(a,l){var d=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),a=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(a=l.memoizedState.cachePool.pool),a!==d&&(a!=null&&a.refCount++,d!=null&&Zc(d))}function zg(a,l){a=null,l.alternate!==null&&(a=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==a&&(l.refCount++,a!=null&&Zc(a))}function Wi(a,l,d,p){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Nw(a,l,d,p),l=l.sibling}function Nw(a,l,d,p){var x=l.flags;switch(l.tag){case 0:case 11:case 15:Wi(a,l,d,p),x&2048&&fu(9,l);break;case 1:Wi(a,l,d,p);break;case 3:Wi(a,l,d,p),x&2048&&(a=null,l.alternate!==null&&(a=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==a&&(l.refCount++,a!=null&&Zc(a)));break;case 12:if(x&2048){Wi(a,l,d,p),a=l.stateNode;try{var w=l.memoizedProps,A=w.id,N=w.onPostCommit;typeof N=="function"&&N(A,l.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(B){rn(l,l.return,B)}}else Wi(a,l,d,p);break;case 13:Wi(a,l,d,p);break;case 23:break;case 22:w=l.stateNode,A=l.alternate,l.memoizedState!==null?w._visibility&2?Wi(a,l,d,p):pu(a,l):w._visibility&2?Wi(a,l,d,p):(w._visibility|=2,Pl(a,l,d,p,(l.subtreeFlags&10256)!==0)),x&2048&&$g(A,l);break;case 24:Wi(a,l,d,p),x&2048&&zg(l.alternate,l);break;default:Wi(a,l,d,p)}}function Pl(a,l,d,p,x){for(x=x&&(l.subtreeFlags&10256)!==0,l=l.child;l!==null;){var w=a,A=l,N=d,B=p,ne=A.flags;switch(A.tag){case 0:case 11:case 15:Pl(w,A,N,B,x),fu(8,A);break;case 23:break;case 22:var de=A.stateNode;A.memoizedState!==null?de._visibility&2?Pl(w,A,N,B,x):pu(w,A):(de._visibility|=2,Pl(w,A,N,B,x)),x&&ne&2048&&$g(A.alternate,A);break;case 24:Pl(w,A,N,B,x),x&&ne&2048&&zg(A.alternate,A);break;default:Pl(w,A,N,B,x)}l=l.sibling}}function pu(a,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var d=a,p=l,x=p.flags;switch(p.tag){case 22:pu(d,p),x&2048&&$g(p.alternate,p);break;case 24:pu(d,p),x&2048&&zg(p.alternate,p);break;default:pu(d,p)}l=l.sibling}}var mu=8192;function Nl(a){if(a.subtreeFlags&mu)for(a=a.child;a!==null;)Ow(a),a=a.sibling}function Ow(a){switch(a.tag){case 26:Nl(a),a.flags&mu&&a.memoizedState!==null&&a4(Ci,a.memoizedState,a.memoizedProps);break;case 5:Nl(a);break;case 3:case 4:var l=Ci;Ci=$f(a.stateNode.containerInfo),Nl(a),Ci=l;break;case 22:a.memoizedState===null&&(l=a.alternate,l!==null&&l.memoizedState!==null?(l=mu,mu=16777216,Nl(a),mu=l):Nl(a));break;default:Nl(a)}}function Mw(a){var l=a.alternate;if(l!==null&&(a=l.child,a!==null)){l.child=null;do l=a.sibling,a.sibling=null,a=l;while(a!==null)}}function gu(a){var l=a.deletions;if((a.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var p=l[d];Qn=p,Iw(p,a)}Mw(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Lw(a),a=a.sibling}function Lw(a){switch(a.tag){case 0:case 11:case 15:gu(a),a.flags&2048&&yo(9,a,a.return);break;case 3:gu(a);break;case 12:gu(a);break;case 22:var l=a.stateNode;a.memoizedState!==null&&l._visibility&2&&(a.return===null||a.return.tag!==13)?(l._visibility&=-3,Tf(a)):gu(a);break;default:gu(a)}}function Tf(a){var l=a.deletions;if((a.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var p=l[d];Qn=p,Iw(p,a)}Mw(a)}for(a=a.child;a!==null;){switch(l=a,l.tag){case 0:case 11:case 15:yo(8,l,l.return),Tf(l);break;case 22:d=l.stateNode,d._visibility&2&&(d._visibility&=-3,Tf(l));break;default:Tf(l)}a=a.sibling}}function Iw(a,l){for(;Qn!==null;){var d=Qn;switch(d.tag){case 0:case 11:case 15:yo(8,d,l);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var p=d.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:Zc(d.memoizedState.cache)}if(p=d.child,p!==null)p.return=d,Qn=p;else e:for(d=a;Qn!==null;){p=Qn;var x=p.sibling,w=p.return;if(_w(p),p===d){Qn=null;break e}if(x!==null){x.return=w,Qn=x;break e}Qn=w}}}var SN={getCacheForType:function(a){var l=nr(Hn),d=l.data.get(a);return d===void 0&&(d=a(),l.data.set(a,d)),d}},wN=typeof WeakMap=="function"?WeakMap:Map,Qt=0,dn=null,_t=null,Ot=0,Yt=0,Ur=null,So=!1,Ol=!1,Ug=!1,Na=0,Dn=0,wo=0,ys=0,Bg=0,si=0,Ml=0,vu=null,Cr=null,Vg=!1,Fg=0,Rf=1/0,_f=null,jo=null,Zn=0,Co=null,Ll=null,Il=0,Hg=0,qg=null,$w=null,yu=0,Gg=null;function Br(){if((Qt&2)!==0&&Ot!==0)return Ot&-Ot;if(P.T!==null){var a=Cl;return a!==0?a:Jg()}return V()}function zw(){si===0&&(si=(Ot&536870912)===0||Vt?ga():536870912);var a=oi.current;return a!==null&&(a.flags|=32),si}function Vr(a,l,d){(a===dn&&(Yt===2||Yt===9)||a.cancelPendingCommit!==null)&&($l(a,0),Eo(a,Ot,si,!1)),br(a,d),((Qt&2)===0||a!==dn)&&(a===dn&&((Qt&2)===0&&(ys|=d),Dn===4&&Eo(a,Ot,si,!1)),Qi(a))}function Uw(a,l,d){if((Qt&6)!==0)throw Error(r(327));var p=!d&&(l&124)===0&&(l&a.expiredLanes)===0||Kr(a,l),x=p?EN(a,l):Yg(a,l,!0),w=p;do{if(x===0){Ol&&!p&&Eo(a,l,0,!1);break}else{if(d=a.current.alternate,w&&!jN(d)){x=Yg(a,l,!1),w=!1;continue}if(x===2){if(w=l,a.errorRecoveryDisabledLanes&w)var A=0;else A=a.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){l=A;e:{var N=a;x=vu;var B=N.current.memoizedState.isDehydrated;if(B&&($l(N,A).flags|=256),A=Yg(N,A,!1),A!==2){if(Ug&&!B){N.errorRecoveryDisabledLanes|=w,ys|=w,x=4;break e}w=Cr,Cr=x,w!==null&&(Cr===null?Cr=w:Cr.push.apply(Cr,w))}x=A}if(w=!1,x!==2)continue}}if(x===1){$l(a,0),Eo(a,l,0,!0);break}e:{switch(p=a,w=x,w){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Eo(p,l,si,!So);break e;case 2:Cr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(x=Fg+300-Te(),10<x)){if(Eo(p,l,si,!So),wi(p,0,!0)!==0)break e;p.timeoutHandle=mj(Bw.bind(null,p,d,Cr,_f,Vg,l,si,ys,Ml,So,w,2,-0,0),x);break e}Bw(p,d,Cr,_f,Vg,l,si,ys,Ml,So,w,0,-0,0)}}break}while(!0);Qi(a)}function Bw(a,l,d,p,x,w,A,N,B,ne,de,pe,re,oe){if(a.timeoutHandle=-1,pe=l.subtreeFlags,(pe&8192||(pe&16785408)===16785408)&&(Eu={stylesheets:null,count:0,unsuspend:i4},Ow(l),pe=o4(),pe!==null)){a.cancelPendingCommit=pe(Qw.bind(null,a,l,w,d,p,x,A,N,B,de,1,re,oe)),Eo(a,w,A,!ne);return}Qw(a,l,w,d,p,x,A,N,B)}function jN(a){for(var l=a;;){var d=l.tag;if((d===0||d===11||d===15)&&l.flags&16384&&(d=l.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var p=0;p<d.length;p++){var x=d[p],w=x.getSnapshot;x=x.value;try{if(!Lr(w(),x))return!1}catch{return!1}}if(d=l.child,l.subtreeFlags&16384&&d!==null)d.return=l,l=d;else{if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Eo(a,l,d,p){l&=~Bg,l&=~ys,a.suspendedLanes|=l,a.pingedLanes&=~l,p&&(a.warmLanes|=l),p=a.expirationTimes;for(var x=l;0<x;){var w=31-kt(x),A=1<<w;p[w]=-1,x&=~A}d!==0&&va(a,d,l)}function Df(){return(Qt&6)===0?(xu(0),!1):!0}function Wg(){if(_t!==null){if(Yt===0)var a=_t.return;else a=_t,Ea=fs=null,ug(a),Al=null,cu=0,a=_t;for(;a!==null;)bw(a.alternate,a),a=a.return;_t=null}}function $l(a,l){var d=a.timeoutHandle;d!==-1&&(a.timeoutHandle=-1,BN(d)),d=a.cancelPendingCommit,d!==null&&(a.cancelPendingCommit=null,d()),Wg(),dn=a,_t=d=wa(a.current,null),Ot=l,Yt=0,Ur=null,So=!1,Ol=Kr(a,l),Ug=!1,Ml=si=Bg=ys=wo=Dn=0,Cr=vu=null,Vg=!1,(l&8)!==0&&(l|=l&32);var p=a.entangledLanes;if(p!==0)for(a=a.entanglements,p&=l;0<p;){var x=31-kt(p),w=1<<x;l|=a[x],p&=~w}return Na=l,Xd(),d}function Vw(a,l){wt=null,P.H=gf,l===eu||l===of?(l=aS(),Yt=3):l===nS?(l=aS(),Yt=4):Yt=l===ow?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Ur=l,_t===null&&(Dn=1,Sf(a,ni(l,a.current)))}function Fw(){var a=P.H;return P.H=gf,a===null?gf:a}function Hw(){var a=P.A;return P.A=SN,a}function Qg(){Dn=4,So||(Ot&4194048)!==Ot&&oi.current!==null||(Ol=!0),(wo&134217727)===0&&(ys&134217727)===0||dn===null||Eo(dn,Ot,si,!1)}function Yg(a,l,d){var p=Qt;Qt|=2;var x=Fw(),w=Hw();(dn!==a||Ot!==l)&&(_f=null,$l(a,l)),l=!1;var A=Dn;e:do try{if(Yt!==0&&_t!==null){var N=_t,B=Ur;switch(Yt){case 8:Wg(),A=6;break e;case 3:case 2:case 9:case 6:oi.current===null&&(l=!0);var ne=Yt;if(Yt=0,Ur=null,zl(a,N,B,ne),d&&Ol){A=0;break e}break;default:ne=Yt,Yt=0,Ur=null,zl(a,N,B,ne)}}CN(),A=Dn;break}catch(de){Vw(a,de)}while(!0);return l&&a.shellSuspendCounter++,Ea=fs=null,Qt=p,P.H=x,P.A=w,_t===null&&(dn=null,Ot=0,Xd()),A}function CN(){for(;_t!==null;)qw(_t)}function EN(a,l){var d=Qt;Qt|=2;var p=Fw(),x=Hw();dn!==a||Ot!==l?(_f=null,Rf=Te()+500,$l(a,l)):Ol=Kr(a,l);e:do try{if(Yt!==0&&_t!==null){l=_t;var w=Ur;t:switch(Yt){case 1:Yt=0,Ur=null,zl(a,l,w,1);break;case 2:case 9:if(rS(w)){Yt=0,Ur=null,Gw(l);break}l=function(){Yt!==2&&Yt!==9||dn!==a||(Yt=7),Qi(a)},w.then(l,l);break e;case 3:Yt=7;break e;case 4:Yt=5;break e;case 7:rS(w)?(Yt=0,Ur=null,Gw(l)):(Yt=0,Ur=null,zl(a,l,w,7));break;case 5:var A=null;switch(_t.tag){case 26:A=_t.memoizedState;case 5:case 27:var N=_t;if(!A||Rj(A)){Yt=0,Ur=null;var B=N.sibling;if(B!==null)_t=B;else{var ne=N.return;ne!==null?(_t=ne,Af(ne)):_t=null}break t}}Yt=0,Ur=null,zl(a,l,w,5);break;case 6:Yt=0,Ur=null,zl(a,l,w,6);break;case 8:Wg(),Dn=6;break e;default:throw Error(r(462))}}TN();break}catch(de){Vw(a,de)}while(!0);return Ea=fs=null,P.H=p,P.A=x,Qt=d,_t!==null?0:(dn=null,Ot=0,Xd(),Dn)}function TN(){for(;_t!==null&&!At();)qw(_t)}function qw(a){var l=yw(a.alternate,a,Na);a.memoizedProps=a.pendingProps,l===null?Af(a):_t=l}function Gw(a){var l=a,d=l.alternate;switch(l.tag){case 15:case 0:l=fw(d,l,l.pendingProps,l.type,void 0,Ot);break;case 11:l=fw(d,l,l.pendingProps,l.type.render,l.ref,Ot);break;case 5:ug(l);default:bw(d,l),l=_t=W1(l,Na),l=yw(d,l,Na)}a.memoizedProps=a.pendingProps,l===null?Af(a):_t=l}function zl(a,l,d,p){Ea=fs=null,ug(l),Al=null,cu=0;var x=l.return;try{if(mN(a,x,l,d,Ot)){Dn=1,Sf(a,ni(d,a.current)),_t=null;return}}catch(w){if(x!==null)throw _t=x,w;Dn=1,Sf(a,ni(d,a.current)),_t=null;return}l.flags&32768?(Vt||p===1?a=!0:Ol||(Ot&536870912)!==0?a=!1:(So=a=!0,(p===2||p===9||p===3||p===6)&&(p=oi.current,p!==null&&p.tag===13&&(p.flags|=16384))),Ww(l,a)):Af(l)}function Af(a){var l=a;do{if((l.flags&32768)!==0){Ww(l,So);return}a=l.return;var d=vN(l.alternate,l,Na);if(d!==null){_t=d;return}if(l=l.sibling,l!==null){_t=l;return}_t=l=a}while(l!==null);Dn===0&&(Dn=5)}function Ww(a,l){do{var d=yN(a.alternate,a);if(d!==null){d.flags&=32767,_t=d;return}if(d=a.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!l&&(a=a.sibling,a!==null)){_t=a;return}_t=a=d}while(a!==null);Dn=6,_t=null}function Qw(a,l,d,p,x,w,A,N,B){a.cancelPendingCommit=null;do kf();while(Zn!==0);if((Qt&6)!==0)throw Error(r(327));if(l!==null){if(l===a.current)throw Error(r(177));if(w=l.lanes|l.childLanes,w|=zm,Gn(a,d,w,A,N,B),a===dn&&(_t=dn=null,Ot=0),Ll=l,Co=a,Il=d,Hg=w,qg=x,$w=p,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,AN(me,function(){return Jw(),null})):(a.callbackNode=null,a.callbackPriority=0),p=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||p){p=P.T,P.T=null,x=I.p,I.p=2,A=Qt,Qt|=4;try{xN(a,l,d)}finally{Qt=A,I.p=x,P.T=p}}Zn=1,Yw(),Xw(),Kw()}}function Yw(){if(Zn===1){Zn=0;var a=Co,l=Ll,d=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||d){d=P.T,P.T=null;var p=I.p;I.p=2;var x=Qt;Qt|=4;try{kw(l,a);var w=sv,A=I1(a.containerInfo),N=w.focusedElem,B=w.selectionRange;if(A!==N&&N&&N.ownerDocument&&L1(N.ownerDocument.documentElement,N)){if(B!==null&&Om(N)){var ne=B.start,de=B.end;if(de===void 0&&(de=ne),"selectionStart"in N)N.selectionStart=ne,N.selectionEnd=Math.min(de,N.value.length);else{var pe=N.ownerDocument||document,re=pe&&pe.defaultView||window;if(re.getSelection){var oe=re.getSelection(),ut=N.textContent.length,ot=Math.min(B.start,ut),en=B.end===void 0?ot:Math.min(B.end,ut);!oe.extend&&ot>en&&(A=en,en=ot,ot=A);var Q=M1(N,ot),q=M1(N,en);if(Q&&q&&(oe.rangeCount!==1||oe.anchorNode!==Q.node||oe.anchorOffset!==Q.offset||oe.focusNode!==q.node||oe.focusOffset!==q.offset)){var te=pe.createRange();te.setStart(Q.node,Q.offset),oe.removeAllRanges(),ot>en?(oe.addRange(te),oe.extend(q.node,q.offset)):(te.setEnd(q.node,q.offset),oe.addRange(te))}}}}for(pe=[],oe=N;oe=oe.parentNode;)oe.nodeType===1&&pe.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<pe.length;N++){var fe=pe[N];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}Ff=!!ov,sv=ov=null}finally{Qt=x,I.p=p,P.T=d}}a.current=l,Zn=2}}function Xw(){if(Zn===2){Zn=0;var a=Co,l=Ll,d=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||d){d=P.T,P.T=null;var p=I.p;I.p=2;var x=Qt;Qt|=4;try{Rw(a,l.alternate,l)}finally{Qt=x,I.p=p,P.T=d}}Zn=3}}function Kw(){if(Zn===4||Zn===3){Zn=0,nn();var a=Co,l=Ll,d=Il,p=$w;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Zn=5:(Zn=0,Ll=Co=null,Zw(a,a.pendingLanes));var x=a.pendingLanes;if(x===0&&(jo=null),ns(d),l=l.stateNode,ht&&typeof ht.onCommitFiberRoot=="function")try{ht.onCommitFiberRoot(xt,l,void 0,(l.current.flags&128)===128)}catch{}if(p!==null){l=P.T,x=I.p,I.p=2,P.T=null;try{for(var w=a.onRecoverableError,A=0;A<p.length;A++){var N=p[A];w(N.value,{componentStack:N.stack})}}finally{P.T=l,I.p=x}}(Il&3)!==0&&kf(),Qi(a),x=a.pendingLanes,(d&4194090)!==0&&(x&42)!==0?a===Gg?yu++:(yu=0,Gg=a):yu=0,xu(0)}}function Zw(a,l){(a.pooledCacheLanes&=l)===0&&(l=a.pooledCache,l!=null&&(a.pooledCache=null,Zc(l)))}function kf(a){return Yw(),Xw(),Kw(),Jw()}function Jw(){if(Zn!==5)return!1;var a=Co,l=Hg;Hg=0;var d=ns(Il),p=P.T,x=I.p;try{I.p=32>d?32:d,P.T=null,d=qg,qg=null;var w=Co,A=Il;if(Zn=0,Ll=Co=null,Il=0,(Qt&6)!==0)throw Error(r(331));var N=Qt;if(Qt|=4,Lw(w.current),Nw(w,w.current,A,d),Qt=N,xu(0,!1),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(xt,w)}catch{}return!0}finally{I.p=x,P.T=p,Zw(a,l)}}function ej(a,l,d){l=ni(d,l),l=Cg(a.stateNode,l,2),a=po(a,l,2),a!==null&&(br(a,2),Qi(a))}function rn(a,l,d){if(a.tag===3)ej(a,a,d);else for(;l!==null;){if(l.tag===3){ej(l,a,d);break}else if(l.tag===1){var p=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(jo===null||!jo.has(p))){a=ni(d,a),d=iw(2),p=po(l,d,2),p!==null&&(aw(d,p,l,a),br(p,2),Qi(p));break}}l=l.return}}function Xg(a,l,d){var p=a.pingCache;if(p===null){p=a.pingCache=new wN;var x=new Set;p.set(l,x)}else x=p.get(l),x===void 0&&(x=new Set,p.set(l,x));x.has(d)||(Ug=!0,x.add(d),a=RN.bind(null,a,l,d),l.then(a,a))}function RN(a,l,d){var p=a.pingCache;p!==null&&p.delete(l),a.pingedLanes|=a.suspendedLanes&d,a.warmLanes&=~d,dn===a&&(Ot&d)===d&&(Dn===4||Dn===3&&(Ot&62914560)===Ot&&300>Te()-Fg?(Qt&2)===0&&$l(a,0):Bg|=d,Ml===Ot&&(Ml=0)),Qi(a)}function tj(a,l){l===0&&(l=ao()),a=bl(a,l),a!==null&&(br(a,l),Qi(a))}function _N(a){var l=a.memoizedState,d=0;l!==null&&(d=l.retryLane),tj(a,d)}function DN(a,l){var d=0;switch(a.tag){case 13:var p=a.stateNode,x=a.memoizedState;x!==null&&(d=x.retryLane);break;case 19:p=a.stateNode;break;case 22:p=a.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(l),tj(a,d)}function AN(a,l){return $t(a,l)}var Pf=null,Ul=null,Kg=!1,Nf=!1,Zg=!1,xs=0;function Qi(a){a!==Ul&&a.next===null&&(Ul===null?Pf=Ul=a:Ul=Ul.next=a),Nf=!0,Kg||(Kg=!0,PN())}function xu(a,l){if(!Zg&&Nf){Zg=!0;do for(var d=!1,p=Pf;p!==null;){if(a!==0){var x=p.pendingLanes;if(x===0)var w=0;else{var A=p.suspendedLanes,N=p.pingedLanes;w=(1<<31-kt(42|a)+1)-1,w&=x&~(A&~N),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(d=!0,aj(p,w))}else w=Ot,w=wi(p,p===dn?w:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(w&3)===0||Kr(p,w)||(d=!0,aj(p,w));p=p.next}while(d);Zg=!1}}function kN(){nj()}function nj(){Nf=Kg=!1;var a=0;xs!==0&&(UN()&&(a=xs),xs=0);for(var l=Te(),d=null,p=Pf;p!==null;){var x=p.next,w=rj(p,l);w===0?(p.next=null,d===null?Pf=x:d.next=x,x===null&&(Ul=d)):(d=p,(a!==0||(w&3)!==0)&&(Nf=!0)),p=x}xu(a)}function rj(a,l){for(var d=a.suspendedLanes,p=a.pingedLanes,x=a.expirationTimes,w=a.pendingLanes&-62914561;0<w;){var A=31-kt(w),N=1<<A,B=x[A];B===-1?((N&d)===0||(N&p)!==0)&&(x[A]=ul(N,l)):B<=l&&(a.expiredLanes|=N),w&=~N}if(l=dn,d=Ot,d=wi(a,a===l?d:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),p=a.callbackNode,d===0||a===l&&(Yt===2||Yt===9)||a.cancelPendingCommit!==null)return p!==null&&p!==null&&vt(p),a.callbackNode=null,a.callbackPriority=0;if((d&3)===0||Kr(a,d)){if(l=d&-d,l===a.callbackPriority)return l;switch(p!==null&&vt(p),ns(d)){case 2:case 8:d=Re;break;case 32:d=me;break;case 268435456:d=Ne;break;default:d=me}return p=ij.bind(null,a),d=$t(d,p),a.callbackPriority=l,a.callbackNode=d,l}return p!==null&&p!==null&&vt(p),a.callbackPriority=2,a.callbackNode=null,2}function ij(a,l){if(Zn!==0&&Zn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var d=a.callbackNode;if(kf()&&a.callbackNode!==d)return null;var p=Ot;return p=wi(a,a===dn?p:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),p===0?null:(Uw(a,p,l),rj(a,Te()),a.callbackNode!=null&&a.callbackNode===d?ij.bind(null,a):null)}function aj(a,l){if(kf())return null;Uw(a,l,!0)}function PN(){VN(function(){(Qt&6)!==0?$t(Qe,kN):nj()})}function Jg(){return xs===0&&(xs=ga()),xs}function oj(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Fd(""+a)}function sj(a,l){var d=l.ownerDocument.createElement("input");return d.name=l.name,d.value=l.value,a.id&&d.setAttribute("form",a.id),l.parentNode.insertBefore(d,l),a=new FormData(a),d.parentNode.removeChild(d),a}function NN(a,l,d,p,x){if(l==="submit"&&d&&d.stateNode===x){var w=oj((x[Ee]||null).action),A=p.submitter;A&&(l=(l=A[Ee]||null)?oj(l.formAction):A.getAttribute("formAction"),l!==null&&(w=l,A=null));var N=new Wd("action","action",null,p,x);a.push({event:N,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(xs!==0){var B=A?sj(x,A):new FormData(x);xg(d,{pending:!0,data:B,method:x.method,action:w},null,B)}}else typeof w=="function"&&(N.preventDefault(),B=A?sj(x,A):new FormData(x),xg(d,{pending:!0,data:B,method:x.method,action:w},w,B))},currentTarget:x}]})}}for(var ev=0;ev<$m.length;ev++){var tv=$m[ev],ON=tv.toLowerCase(),MN=tv[0].toUpperCase()+tv.slice(1);ji(ON,"on"+MN)}ji(U1,"onAnimationEnd"),ji(B1,"onAnimationIteration"),ji(V1,"onAnimationStart"),ji("dblclick","onDoubleClick"),ji("focusin","onFocus"),ji("focusout","onBlur"),ji(ZP,"onTransitionRun"),ji(JP,"onTransitionStart"),ji(eN,"onTransitionCancel"),ji(F1,"onTransitionEnd"),ur("onMouseEnter",["mouseout","mouseover"]),ur("onMouseLeave",["mouseout","mouseover"]),ur("onPointerEnter",["pointerout","pointerover"]),ur("onPointerLeave",["pointerout","pointerover"]),Mr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Mr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Mr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Mr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Mr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Mr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bu="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(" "),LN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bu));function lj(a,l){l=(l&4)!==0;for(var d=0;d<a.length;d++){var p=a[d],x=p.event;p=p.listeners;e:{var w=void 0;if(l)for(var A=p.length-1;0<=A;A--){var N=p[A],B=N.instance,ne=N.currentTarget;if(N=N.listener,B!==w&&x.isPropagationStopped())break e;w=N,x.currentTarget=ne;try{w(x)}catch(de){bf(de)}x.currentTarget=null,w=B}else for(A=0;A<p.length;A++){if(N=p[A],B=N.instance,ne=N.currentTarget,N=N.listener,B!==w&&x.isPropagationStopped())break e;w=N,x.currentTarget=ne;try{w(x)}catch(de){bf(de)}x.currentTarget=null,w=B}}}}function Dt(a,l){var d=l[We];d===void 0&&(d=l[We]=new Set);var p=a+"__bubble";d.has(p)||(cj(l,a,2,!1),d.add(p))}function nv(a,l,d){var p=0;l&&(p|=4),cj(d,a,p,l)}var Of="_reactListening"+Math.random().toString(36).slice(2);function rv(a){if(!a[Of]){a[Of]=!0,Gt.forEach(function(d){d!=="selectionchange"&&(LN.has(d)||nv(d,!1,a),nv(d,!0,a))});var l=a.nodeType===9?a:a.ownerDocument;l===null||l[Of]||(l[Of]=!0,nv("selectionchange",!1,l))}}function cj(a,l,d,p){switch(Nj(l)){case 2:var x=c4;break;case 8:x=u4;break;default:x=vv}d=x.bind(null,l,d,a),x=void 0,!Em||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(x=!0),p?x!==void 0?a.addEventListener(l,d,{capture:!0,passive:x}):a.addEventListener(l,d,!0):x!==void 0?a.addEventListener(l,d,{passive:x}):a.addEventListener(l,d,!1)}function iv(a,l,d,p,x){var w=p;if((l&1)===0&&(l&2)===0&&p!==null)e:for(;;){if(p===null)return;var A=p.tag;if(A===3||A===4){var N=p.stateNode.containerInfo;if(N===x)break;if(A===4)for(A=p.return;A!==null;){var B=A.tag;if((B===3||B===4)&&A.stateNode.containerInfo===x)return;A=A.return}for(;N!==null;){if(A=at(N),A===null)return;if(B=A.tag,B===5||B===6||B===26||B===27){p=w=A;continue e}N=N.parentNode}}p=p.return}g1(function(){var ne=w,de=jm(d),pe=[];e:{var re=H1.get(a);if(re!==void 0){var oe=Wd,ut=a;switch(a){case"keypress":if(qd(d)===0)break e;case"keydown":case"keyup":oe=AP;break;case"focusin":ut="focus",oe=Dm;break;case"focusout":ut="blur",oe=Dm;break;case"beforeblur":case"afterblur":oe=Dm;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=x1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=yP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=NP;break;case U1:case B1:case V1:oe=SP;break;case F1:oe=MP;break;case"scroll":case"scrollend":oe=gP;break;case"wheel":oe=IP;break;case"copy":case"cut":case"paste":oe=jP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=S1;break;case"toggle":case"beforetoggle":oe=zP}var ot=(l&4)!==0,en=!ot&&(a==="scroll"||a==="scrollend"),Q=ot?re!==null?re+"Capture":null:re;ot=[];for(var q=ne,te;q!==null;){var fe=q;if(te=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||te===null||Q===null||(fe=zc(q,Q),fe!=null&&ot.push(Su(q,fe,te))),en)break;q=q.return}0<ot.length&&(re=new oe(re,ut,null,d,de),pe.push({event:re,listeners:ot}))}}if((l&7)===0){e:{if(re=a==="mouseover"||a==="pointerover",oe=a==="mouseout"||a==="pointerout",re&&d!==wm&&(ut=d.relatedTarget||d.fromElement)&&(at(ut)||ut[Ue]))break e;if((oe||re)&&(re=de.window===de?de:(re=de.ownerDocument)?re.defaultView||re.parentWindow:window,oe?(ut=d.relatedTarget||d.toElement,oe=ne,ut=ut?at(ut):null,ut!==null&&(en=o(ut),ot=ut.tag,ut!==en||ot!==5&&ot!==27&&ot!==6)&&(ut=null)):(oe=null,ut=ne),oe!==ut)){if(ot=x1,fe="onMouseLeave",Q="onMouseEnter",q="mouse",(a==="pointerout"||a==="pointerover")&&(ot=S1,fe="onPointerLeave",Q="onPointerEnter",q="pointer"),en=oe==null?re:un(oe),te=ut==null?re:un(ut),re=new ot(fe,q+"leave",oe,d,de),re.target=en,re.relatedTarget=te,fe=null,at(de)===ne&&(ot=new ot(Q,q+"enter",ut,d,de),ot.target=te,ot.relatedTarget=en,fe=ot),en=fe,oe&&ut)t:{for(ot=oe,Q=ut,q=0,te=ot;te;te=Bl(te))q++;for(te=0,fe=Q;fe;fe=Bl(fe))te++;for(;0<q-te;)ot=Bl(ot),q--;for(;0<te-q;)Q=Bl(Q),te--;for(;q--;){if(ot===Q||Q!==null&&ot===Q.alternate)break t;ot=Bl(ot),Q=Bl(Q)}ot=null}else ot=null;oe!==null&&uj(pe,re,oe,ot,!1),ut!==null&&en!==null&&uj(pe,en,ut,ot,!0)}}e:{if(re=ne?un(ne):window,oe=re.nodeName&&re.nodeName.toLowerCase(),oe==="select"||oe==="input"&&re.type==="file")var He=D1;else if(R1(re))if(A1)He=YP;else{He=WP;var Tt=GP}else oe=re.nodeName,!oe||oe.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?ne&&Sm(ne.elementType)&&(He=D1):He=QP;if(He&&(He=He(a,ne))){_1(pe,He,d,de);break e}Tt&&Tt(a,re,ne),a==="focusout"&&ne&&re.type==="number"&&ne.memoizedProps.value!=null&&bm(re,"number",re.value)}switch(Tt=ne?un(ne):window,a){case"focusin":(R1(Tt)||Tt.contentEditable==="true")&&(vl=Tt,Mm=ne,Wc=null);break;case"focusout":Wc=Mm=vl=null;break;case"mousedown":Lm=!0;break;case"contextmenu":case"mouseup":case"dragend":Lm=!1,$1(pe,d,de);break;case"selectionchange":if(KP)break;case"keydown":case"keyup":$1(pe,d,de)}var tt;if(km)e:{switch(a){case"compositionstart":var lt="onCompositionStart";break e;case"compositionend":lt="onCompositionEnd";break e;case"compositionupdate":lt="onCompositionUpdate";break e}lt=void 0}else gl?E1(a,d)&&(lt="onCompositionEnd"):a==="keydown"&&d.keyCode===229&&(lt="onCompositionStart");lt&&(w1&&d.locale!=="ko"&&(gl||lt!=="onCompositionStart"?lt==="onCompositionEnd"&&gl&&(tt=v1()):(co=de,Tm="value"in co?co.value:co.textContent,gl=!0)),Tt=Mf(ne,lt),0<Tt.length&&(lt=new b1(lt,a,null,d,de),pe.push({event:lt,listeners:Tt}),tt?lt.data=tt:(tt=T1(d),tt!==null&&(lt.data=tt)))),(tt=BP?VP(a,d):FP(a,d))&&(lt=Mf(ne,"onBeforeInput"),0<lt.length&&(Tt=new b1("onBeforeInput","beforeinput",null,d,de),pe.push({event:Tt,listeners:lt}),Tt.data=tt)),NN(pe,a,ne,d,de)}lj(pe,l)})}function Su(a,l,d){return{instance:a,listener:l,currentTarget:d}}function Mf(a,l){for(var d=l+"Capture",p=[];a!==null;){var x=a,w=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||w===null||(x=zc(a,d),x!=null&&p.unshift(Su(a,x,w)),x=zc(a,l),x!=null&&p.push(Su(a,x,w))),a.tag===3)return p;a=a.return}return[]}function Bl(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function uj(a,l,d,p,x){for(var w=l._reactName,A=[];d!==null&&d!==p;){var N=d,B=N.alternate,ne=N.stateNode;if(N=N.tag,B!==null&&B===p)break;N!==5&&N!==26&&N!==27||ne===null||(B=ne,x?(ne=zc(d,w),ne!=null&&A.unshift(Su(d,ne,B))):x||(ne=zc(d,w),ne!=null&&A.push(Su(d,ne,B)))),d=d.return}A.length!==0&&a.push({event:l,listeners:A})}var IN=/\r\n?/g,$N=/\u0000|\uFFFD/g;function dj(a){return(typeof a=="string"?a:""+a).replace(IN,`
565
+ `).replace($N,"")}function fj(a,l){return l=dj(l),dj(a)===l}function Lf(){}function Jt(a,l,d,p,x,w){switch(d){case"children":typeof p=="string"?l==="body"||l==="textarea"&&p===""||hl(a,p):(typeof p=="number"||typeof p=="bigint")&&l!=="body"&&hl(a,""+p);break;case"className":ba(a,"class",p);break;case"tabIndex":ba(a,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":ba(a,d,p);break;case"style":p1(a,p,w);break;case"data":if(l!=="object"){ba(a,"data",p);break}case"src":case"href":if(p===""&&(l!=="a"||d!=="href")){a.removeAttribute(d);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){a.removeAttribute(d);break}p=Fd(""+p),a.setAttribute(d,p);break;case"action":case"formAction":if(typeof p=="function"){a.setAttribute(d,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(d==="formAction"?(l!=="input"&&Jt(a,l,"name",x.name,x,null),Jt(a,l,"formEncType",x.formEncType,x,null),Jt(a,l,"formMethod",x.formMethod,x,null),Jt(a,l,"formTarget",x.formTarget,x,null)):(Jt(a,l,"encType",x.encType,x,null),Jt(a,l,"method",x.method,x,null),Jt(a,l,"target",x.target,x,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){a.removeAttribute(d);break}p=Fd(""+p),a.setAttribute(d,p);break;case"onClick":p!=null&&(a.onclick=Lf);break;case"onScroll":p!=null&&Dt("scroll",a);break;case"onScrollEnd":p!=null&&Dt("scrollend",a);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(d=p.__html,d!=null){if(x.children!=null)throw Error(r(60));a.innerHTML=d}}break;case"multiple":a.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":a.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){a.removeAttribute("xlink:href");break}d=Fd(""+p),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(d,""+p):a.removeAttribute(d);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(d,""):a.removeAttribute(d);break;case"capture":case"download":p===!0?a.setAttribute(d,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(d,p):a.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?a.setAttribute(d,p):a.removeAttribute(d);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?a.removeAttribute(d):a.setAttribute(d,p);break;case"popover":Dt("beforetoggle",a),Dt("toggle",a),xa(a,"popover",p);break;case"xlinkActuate":Et(a,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":Et(a,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":Et(a,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":Et(a,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":Et(a,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":Et(a,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":Et(a,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":Et(a,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":Et(a,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":xa(a,"is",p);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=pP.get(d)||d,xa(a,d,p))}}function av(a,l,d,p,x,w){switch(d){case"style":p1(a,p,w);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(d=p.__html,d!=null){if(x.children!=null)throw Error(r(60));a.innerHTML=d}}break;case"children":typeof p=="string"?hl(a,p):(typeof p=="number"||typeof p=="bigint")&&hl(a,""+p);break;case"onScroll":p!=null&&Dt("scroll",a);break;case"onScrollEnd":p!=null&&Dt("scrollend",a);break;case"onClick":p!=null&&(a.onclick=Lf);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fi.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(x=d.endsWith("Capture"),l=d.slice(2,x?d.length-7:void 0),w=a[Ee]||null,w=w!=null?w[d]:null,typeof w=="function"&&a.removeEventListener(l,w,x),typeof p=="function")){typeof w!="function"&&w!==null&&(d in a?a[d]=null:a.hasAttribute(d)&&a.removeAttribute(d)),a.addEventListener(l,p,x);break e}d in a?a[d]=p:p===!0?a.setAttribute(d,""):xa(a,d,p)}}}function Jn(a,l,d){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Dt("error",a),Dt("load",a);var p=!1,x=!1,w;for(w in d)if(d.hasOwnProperty(w)){var A=d[w];if(A!=null)switch(w){case"src":p=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Jt(a,l,w,A,d,null)}}x&&Jt(a,l,"srcSet",d.srcSet,d,null),p&&Jt(a,l,"src",d.src,d,null);return;case"input":Dt("invalid",a);var N=w=A=x=null,B=null,ne=null;for(p in d)if(d.hasOwnProperty(p)){var de=d[p];if(de!=null)switch(p){case"name":x=de;break;case"type":A=de;break;case"checked":B=de;break;case"defaultChecked":ne=de;break;case"value":w=de;break;case"defaultValue":N=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,l));break;default:Jt(a,l,p,de,d,null)}}u1(a,w,N,B,ne,A,x,!1),Bd(a);return;case"select":Dt("invalid",a),p=A=w=null;for(x in d)if(d.hasOwnProperty(x)&&(N=d[x],N!=null))switch(x){case"value":w=N;break;case"defaultValue":A=N;break;case"multiple":p=N;default:Jt(a,l,x,N,d,null)}l=w,d=A,a.multiple=!!p,l!=null?fl(a,!!p,l,!1):d!=null&&fl(a,!!p,d,!0);return;case"textarea":Dt("invalid",a),w=x=p=null;for(A in d)if(d.hasOwnProperty(A)&&(N=d[A],N!=null))switch(A){case"value":p=N;break;case"defaultValue":x=N;break;case"children":w=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(r(91));break;default:Jt(a,l,A,N,d,null)}f1(a,p,x,w),Bd(a);return;case"option":for(B in d)if(d.hasOwnProperty(B)&&(p=d[B],p!=null))switch(B){case"selected":a.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:Jt(a,l,B,p,d,null)}return;case"dialog":Dt("beforetoggle",a),Dt("toggle",a),Dt("cancel",a),Dt("close",a);break;case"iframe":case"object":Dt("load",a);break;case"video":case"audio":for(p=0;p<bu.length;p++)Dt(bu[p],a);break;case"image":Dt("error",a),Dt("load",a);break;case"details":Dt("toggle",a);break;case"embed":case"source":case"link":Dt("error",a),Dt("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ne in d)if(d.hasOwnProperty(ne)&&(p=d[ne],p!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Jt(a,l,ne,p,d,null)}return;default:if(Sm(l)){for(de in d)d.hasOwnProperty(de)&&(p=d[de],p!==void 0&&av(a,l,de,p,d,void 0));return}}for(N in d)d.hasOwnProperty(N)&&(p=d[N],p!=null&&Jt(a,l,N,p,d,null))}function zN(a,l,d,p){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,w=null,A=null,N=null,B=null,ne=null,de=null;for(oe in d){var pe=d[oe];if(d.hasOwnProperty(oe)&&pe!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":B=pe;default:p.hasOwnProperty(oe)||Jt(a,l,oe,null,p,pe)}}for(var re in p){var oe=p[re];if(pe=d[re],p.hasOwnProperty(re)&&(oe!=null||pe!=null))switch(re){case"type":w=oe;break;case"name":x=oe;break;case"checked":ne=oe;break;case"defaultChecked":de=oe;break;case"value":A=oe;break;case"defaultValue":N=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,l));break;default:oe!==pe&&Jt(a,l,re,oe,p,pe)}}xm(a,A,N,B,ne,de,w,x);return;case"select":oe=A=N=re=null;for(w in d)if(B=d[w],d.hasOwnProperty(w)&&B!=null)switch(w){case"value":break;case"multiple":oe=B;default:p.hasOwnProperty(w)||Jt(a,l,w,null,p,B)}for(x in p)if(w=p[x],B=d[x],p.hasOwnProperty(x)&&(w!=null||B!=null))switch(x){case"value":re=w;break;case"defaultValue":N=w;break;case"multiple":A=w;default:w!==B&&Jt(a,l,x,w,p,B)}l=N,d=A,p=oe,re!=null?fl(a,!!d,re,!1):!!p!=!!d&&(l!=null?fl(a,!!d,l,!0):fl(a,!!d,d?[]:"",!1));return;case"textarea":oe=re=null;for(N in d)if(x=d[N],d.hasOwnProperty(N)&&x!=null&&!p.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Jt(a,l,N,null,p,x)}for(A in p)if(x=p[A],w=d[A],p.hasOwnProperty(A)&&(x!=null||w!=null))switch(A){case"value":re=x;break;case"defaultValue":oe=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:x!==w&&Jt(a,l,A,x,p,w)}d1(a,re,oe);return;case"option":for(var ut in d)if(re=d[ut],d.hasOwnProperty(ut)&&re!=null&&!p.hasOwnProperty(ut))switch(ut){case"selected":a.selected=!1;break;default:Jt(a,l,ut,null,p,re)}for(B in p)if(re=p[B],oe=d[B],p.hasOwnProperty(B)&&re!==oe&&(re!=null||oe!=null))switch(B){case"selected":a.selected=re&&typeof re!="function"&&typeof re!="symbol";break;default:Jt(a,l,B,re,p,oe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ot in d)re=d[ot],d.hasOwnProperty(ot)&&re!=null&&!p.hasOwnProperty(ot)&&Jt(a,l,ot,null,p,re);for(ne in p)if(re=p[ne],oe=d[ne],p.hasOwnProperty(ne)&&re!==oe&&(re!=null||oe!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,l));break;default:Jt(a,l,ne,re,p,oe)}return;default:if(Sm(l)){for(var en in d)re=d[en],d.hasOwnProperty(en)&&re!==void 0&&!p.hasOwnProperty(en)&&av(a,l,en,void 0,p,re);for(de in p)re=p[de],oe=d[de],!p.hasOwnProperty(de)||re===oe||re===void 0&&oe===void 0||av(a,l,de,re,p,oe);return}}for(var Q in d)re=d[Q],d.hasOwnProperty(Q)&&re!=null&&!p.hasOwnProperty(Q)&&Jt(a,l,Q,null,p,re);for(pe in p)re=p[pe],oe=d[pe],!p.hasOwnProperty(pe)||re===oe||re==null&&oe==null||Jt(a,l,pe,re,p,oe)}var ov=null,sv=null;function If(a){return a.nodeType===9?a:a.ownerDocument}function hj(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function pj(a,l){if(a===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&l==="foreignObject"?0:a}function lv(a,l){return a==="textarea"||a==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var cv=null;function UN(){var a=window.event;return a&&a.type==="popstate"?a===cv?!1:(cv=a,!0):(cv=null,!1)}var mj=typeof setTimeout=="function"?setTimeout:void 0,BN=typeof clearTimeout=="function"?clearTimeout:void 0,gj=typeof Promise=="function"?Promise:void 0,VN=typeof queueMicrotask=="function"?queueMicrotask:typeof gj<"u"?function(a){return gj.resolve(null).then(a).catch(FN)}:mj;function FN(a){setTimeout(function(){throw a})}function To(a){return a==="head"}function vj(a,l){var d=l,p=0,x=0;do{var w=d.nextSibling;if(a.removeChild(d),w&&w.nodeType===8)if(d=w.data,d==="/$"){if(0<p&&8>p){d=p;var A=a.ownerDocument;if(d&1&&wu(A.documentElement),d&2&&wu(A.body),d&4)for(d=A.head,wu(d),A=d.firstChild;A;){var N=A.nextSibling,B=A.nodeName;A[Je]||B==="SCRIPT"||B==="STYLE"||B==="LINK"&&A.rel.toLowerCase()==="stylesheet"||d.removeChild(A),A=N}}if(x===0){a.removeChild(w),Au(l);return}x--}else d==="$"||d==="$?"||d==="$!"?x++:p=d.charCodeAt(0)-48;else p=0;d=w}while(d);Au(l)}function uv(a){var l=a.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var d=l;switch(l=l.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":uv(d),Ye(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}a.removeChild(d)}}function HN(a,l,d,p){for(;a.nodeType===1;){var x=d;if(a.nodeName.toLowerCase()!==l.toLowerCase()){if(!p&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(p){if(!a[Je])switch(l){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(w=a.getAttribute("rel"),w==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(w!==x.rel||a.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||a.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||a.getAttribute("title")!==(x.title==null?null:x.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(w=a.getAttribute("src"),(w!==(x.src==null?null:x.src)||a.getAttribute("type")!==(x.type==null?null:x.type)||a.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&w&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(l==="input"&&a.type==="hidden"){var w=x.name==null?null:""+x.name;if(x.type==="hidden"&&a.getAttribute("name")===w)return a}else return a;if(a=Ei(a.nextSibling),a===null)break}return null}function qN(a,l,d){if(l==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!d||(a=Ei(a.nextSibling),a===null))return null;return a}function dv(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState==="complete"}function GN(a,l){var d=a.ownerDocument;if(a.data!=="$?"||d.readyState==="complete")l();else{var p=function(){l(),d.removeEventListener("DOMContentLoaded",p)};d.addEventListener("DOMContentLoaded",p),a._reactRetry=p}}function Ei(a){for(;a!=null;a=a.nextSibling){var l=a.nodeType;if(l===1||l===3)break;if(l===8){if(l=a.data,l==="$"||l==="$!"||l==="$?"||l==="F!"||l==="F")break;if(l==="/$")return null}}return a}var fv=null;function yj(a){a=a.previousSibling;for(var l=0;a;){if(a.nodeType===8){var d=a.data;if(d==="$"||d==="$!"||d==="$?"){if(l===0)return a;l--}else d==="/$"&&l++}a=a.previousSibling}return null}function xj(a,l,d){switch(l=If(d),a){case"html":if(a=l.documentElement,!a)throw Error(r(452));return a;case"head":if(a=l.head,!a)throw Error(r(453));return a;case"body":if(a=l.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function wu(a){for(var l=a.attributes;l.length;)a.removeAttributeNode(l[0]);Ye(a)}var li=new Map,bj=new Set;function $f(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Oa=I.d;I.d={f:WN,r:QN,D:YN,C:XN,L:KN,m:ZN,X:e4,S:JN,M:t4};function WN(){var a=Oa.f(),l=Df();return a||l}function QN(a){var l=et(a);l!==null&&l.tag===5&&l.type==="form"?US(l):Oa.r(a)}var Vl=typeof document>"u"?null:document;function Sj(a,l,d){var p=Vl;if(p&&typeof l=="string"&&l){var x=ti(l);x='link[rel="'+a+'"][href="'+x+'"]',typeof d=="string"&&(x+='[crossorigin="'+d+'"]'),bj.has(x)||(bj.add(x),a={rel:a,crossOrigin:d,href:l},p.querySelector(x)===null&&(l=p.createElement("link"),Jn(l,"link",a),dt(l),p.head.appendChild(l)))}}function YN(a){Oa.D(a),Sj("dns-prefetch",a,null)}function XN(a,l){Oa.C(a,l),Sj("preconnect",a,l)}function KN(a,l,d){Oa.L(a,l,d);var p=Vl;if(p&&a&&l){var x='link[rel="preload"][as="'+ti(l)+'"]';l==="image"&&d&&d.imageSrcSet?(x+='[imagesrcset="'+ti(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(x+='[imagesizes="'+ti(d.imageSizes)+'"]')):x+='[href="'+ti(a)+'"]';var w=x;switch(l){case"style":w=Fl(a);break;case"script":w=Hl(a)}li.has(w)||(a=m({rel:"preload",href:l==="image"&&d&&d.imageSrcSet?void 0:a,as:l},d),li.set(w,a),p.querySelector(x)!==null||l==="style"&&p.querySelector(ju(w))||l==="script"&&p.querySelector(Cu(w))||(l=p.createElement("link"),Jn(l,"link",a),dt(l),p.head.appendChild(l)))}}function ZN(a,l){Oa.m(a,l);var d=Vl;if(d&&a){var p=l&&typeof l.as=="string"?l.as:"script",x='link[rel="modulepreload"][as="'+ti(p)+'"][href="'+ti(a)+'"]',w=x;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=Hl(a)}if(!li.has(w)&&(a=m({rel:"modulepreload",href:a},l),li.set(w,a),d.querySelector(x)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(Cu(w)))return}p=d.createElement("link"),Jn(p,"link",a),dt(p),d.head.appendChild(p)}}}function JN(a,l,d){Oa.S(a,l,d);var p=Vl;if(p&&a){var x=mn(p).hoistableStyles,w=Fl(a);l=l||"default";var A=x.get(w);if(!A){var N={loading:0,preload:null};if(A=p.querySelector(ju(w)))N.loading=5;else{a=m({rel:"stylesheet",href:a,"data-precedence":l},d),(d=li.get(w))&&hv(a,d);var B=A=p.createElement("link");dt(B),Jn(B,"link",a),B._p=new Promise(function(ne,de){B.onload=ne,B.onerror=de}),B.addEventListener("load",function(){N.loading|=1}),B.addEventListener("error",function(){N.loading|=2}),N.loading|=4,zf(A,l,p)}A={type:"stylesheet",instance:A,count:1,state:N},x.set(w,A)}}}function e4(a,l){Oa.X(a,l);var d=Vl;if(d&&a){var p=mn(d).hoistableScripts,x=Hl(a),w=p.get(x);w||(w=d.querySelector(Cu(x)),w||(a=m({src:a,async:!0},l),(l=li.get(x))&&pv(a,l),w=d.createElement("script"),dt(w),Jn(w,"link",a),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(x,w))}}function t4(a,l){Oa.M(a,l);var d=Vl;if(d&&a){var p=mn(d).hoistableScripts,x=Hl(a),w=p.get(x);w||(w=d.querySelector(Cu(x)),w||(a=m({src:a,async:!0,type:"module"},l),(l=li.get(x))&&pv(a,l),w=d.createElement("script"),dt(w),Jn(w,"link",a),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(x,w))}}function wj(a,l,d,p){var x=(x=xe.current)?$f(x):null;if(!x)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(l=Fl(d.href),d=mn(x).hoistableStyles,p=d.get(l),p||(p={type:"style",instance:null,count:0,state:null},d.set(l,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){a=Fl(d.href);var w=mn(x).hoistableStyles,A=w.get(a);if(A||(x=x.ownerDocument||x,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(a,A),(w=x.querySelector(ju(a)))&&!w._p&&(A.instance=w,A.state.loading=5),li.has(a)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},li.set(a,d),w||n4(x,a,d,A.state))),l&&p===null)throw Error(r(528,""));return A}if(l&&p!==null)throw Error(r(529,""));return null;case"script":return l=d.async,d=d.src,typeof d=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Hl(d),d=mn(x).hoistableScripts,p=d.get(l),p||(p={type:"script",instance:null,count:0,state:null},d.set(l,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Fl(a){return'href="'+ti(a)+'"'}function ju(a){return'link[rel="stylesheet"]['+a+"]"}function jj(a){return m({},a,{"data-precedence":a.precedence,precedence:null})}function n4(a,l,d,p){a.querySelector('link[rel="preload"][as="style"]['+l+"]")?p.loading=1:(l=a.createElement("link"),p.preload=l,l.addEventListener("load",function(){return p.loading|=1}),l.addEventListener("error",function(){return p.loading|=2}),Jn(l,"link",d),dt(l),a.head.appendChild(l))}function Hl(a){return'[src="'+ti(a)+'"]'}function Cu(a){return"script[async]"+a}function Cj(a,l,d){if(l.count++,l.instance===null)switch(l.type){case"style":var p=a.querySelector('style[data-href~="'+ti(d.href)+'"]');if(p)return l.instance=p,dt(p),p;var x=m({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return p=(a.ownerDocument||a).createElement("style"),dt(p),Jn(p,"style",x),zf(p,d.precedence,a),l.instance=p;case"stylesheet":x=Fl(d.href);var w=a.querySelector(ju(x));if(w)return l.state.loading|=4,l.instance=w,dt(w),w;p=jj(d),(x=li.get(x))&&hv(p,x),w=(a.ownerDocument||a).createElement("link"),dt(w);var A=w;return A._p=new Promise(function(N,B){A.onload=N,A.onerror=B}),Jn(w,"link",p),l.state.loading|=4,zf(w,d.precedence,a),l.instance=w;case"script":return w=Hl(d.src),(x=a.querySelector(Cu(w)))?(l.instance=x,dt(x),x):(p=d,(x=li.get(w))&&(p=m({},d),pv(p,x)),a=a.ownerDocument||a,x=a.createElement("script"),dt(x),Jn(x,"link",p),a.head.appendChild(x),l.instance=x);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(p=l.instance,l.state.loading|=4,zf(p,d.precedence,a));return l.instance}function zf(a,l,d){for(var p=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=p.length?p[p.length-1]:null,w=x,A=0;A<p.length;A++){var N=p[A];if(N.dataset.precedence===l)w=N;else if(w!==x)break}w?w.parentNode.insertBefore(a,w.nextSibling):(l=d.nodeType===9?d.head:d,l.insertBefore(a,l.firstChild))}function hv(a,l){a.crossOrigin==null&&(a.crossOrigin=l.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=l.referrerPolicy),a.title==null&&(a.title=l.title)}function pv(a,l){a.crossOrigin==null&&(a.crossOrigin=l.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=l.referrerPolicy),a.integrity==null&&(a.integrity=l.integrity)}var Uf=null;function Ej(a,l,d){if(Uf===null){var p=new Map,x=Uf=new Map;x.set(d,p)}else x=Uf,p=x.get(d),p||(p=new Map,x.set(d,p));if(p.has(a))return p;for(p.set(a,null),d=d.getElementsByTagName(a),x=0;x<d.length;x++){var w=d[x];if(!(w[Je]||w[he]||a==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var A=w.getAttribute(l)||"";A=a+A;var N=p.get(A);N?N.push(w):p.set(A,[w])}}return p}function Tj(a,l,d){a=a.ownerDocument||a,a.head.insertBefore(d,l==="title"?a.querySelector("head > title"):null)}function r4(a,l,d){if(d===1||l.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return a=l.disabled,typeof l.precedence=="string"&&a==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function Rj(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}var Eu=null;function i4(){}function a4(a,l,d){if(Eu===null)throw Error(r(475));var p=Eu;if(l.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var x=Fl(d.href),w=a.querySelector(ju(x));if(w){a=w._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(p.count++,p=Bf.bind(p),a.then(p,p)),l.state.loading|=4,l.instance=w,dt(w);return}w=a.ownerDocument||a,d=jj(d),(x=li.get(x))&&hv(d,x),w=w.createElement("link"),dt(w);var A=w;A._p=new Promise(function(N,B){A.onload=N,A.onerror=B}),Jn(w,"link",d),l.instance=w}p.stylesheets===null&&(p.stylesheets=new Map),p.stylesheets.set(l,a),(a=l.state.preload)&&(l.state.loading&3)===0&&(p.count++,l=Bf.bind(p),a.addEventListener("load",l),a.addEventListener("error",l))}}function o4(){if(Eu===null)throw Error(r(475));var a=Eu;return a.stylesheets&&a.count===0&&mv(a,a.stylesheets),0<a.count?function(l){var d=setTimeout(function(){if(a.stylesheets&&mv(a,a.stylesheets),a.unsuspend){var p=a.unsuspend;a.unsuspend=null,p()}},6e4);return a.unsuspend=l,function(){a.unsuspend=null,clearTimeout(d)}}:null}function Bf(){if(this.count--,this.count===0){if(this.stylesheets)mv(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Vf=null;function mv(a,l){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Vf=new Map,l.forEach(s4,a),Vf=null,Bf.call(a))}function s4(a,l){if(!(l.state.loading&4)){var d=Vf.get(a);if(d)var p=d.get(null);else{d=new Map,Vf.set(a,d);for(var x=a.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<x.length;w++){var A=x[w];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(d.set(A.dataset.precedence,A),p=A)}p&&d.set(null,p)}x=l.instance,A=x.getAttribute("data-precedence"),w=d.get(A)||p,w===p&&d.set(null,x),d.set(A,x),this.count++,p=Bf.bind(this),x.addEventListener("load",p),x.addEventListener("error",p),w?w.parentNode.insertBefore(x,w.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(x,a.firstChild)),l.state.loading|=4}}var Tu={$$typeof:E,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function l4(a,l,d,p,x,w,A,N){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Vi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vi(0),this.hiddenUpdates=Vi(null),this.identifierPrefix=p,this.onUncaughtError=x,this.onCaughtError=w,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function _j(a,l,d,p,x,w,A,N,B,ne,de,pe){return a=new l4(a,l,d,A,N,B,ne,pe),l=1,w===!0&&(l|=24),w=Ir(3,null,null,l),a.current=w,w.stateNode=a,l=Xm(),l.refCount++,a.pooledCache=l,l.refCount++,w.memoizedState={element:p,isDehydrated:d,cache:l},eg(w),a}function Dj(a){return a?(a=Sl,a):Sl}function Aj(a,l,d,p,x,w){x=Dj(x),p.context===null?p.context=x:p.pendingContext=x,p=ho(l),p.payload={element:d},w=w===void 0?null:w,w!==null&&(p.callback=w),d=po(a,p,l),d!==null&&(Vr(d,a,l),nu(d,a,l))}function kj(a,l){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var d=a.retryLane;a.retryLane=d!==0&&d<l?d:l}}function gv(a,l){kj(a,l),(a=a.alternate)&&kj(a,l)}function Pj(a){if(a.tag===13){var l=bl(a,67108864);l!==null&&Vr(l,a,67108864),gv(a,67108864)}}var Ff=!0;function c4(a,l,d,p){var x=P.T;P.T=null;var w=I.p;try{I.p=2,vv(a,l,d,p)}finally{I.p=w,P.T=x}}function u4(a,l,d,p){var x=P.T;P.T=null;var w=I.p;try{I.p=8,vv(a,l,d,p)}finally{I.p=w,P.T=x}}function vv(a,l,d,p){if(Ff){var x=yv(p);if(x===null)iv(a,l,p,Hf,d),Oj(a,p);else if(f4(x,a,l,d,p))p.stopPropagation();else if(Oj(a,p),l&4&&-1<d4.indexOf(a)){for(;x!==null;){var w=et(x);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var A=Fn(w.pendingLanes);if(A!==0){var N=w;for(N.pendingLanes|=2,N.entangledLanes|=2;A;){var B=1<<31-kt(A);N.entanglements[1]|=B,A&=~B}Qi(w),(Qt&6)===0&&(Rf=Te()+500,xu(0))}}break;case 13:N=bl(w,2),N!==null&&Vr(N,w,2),Df(),gv(w,2)}if(w=yv(p),w===null&&iv(a,l,p,Hf,d),w===x)break;x=w}x!==null&&p.stopPropagation()}else iv(a,l,p,null,d)}}function yv(a){return a=jm(a),xv(a)}var Hf=null;function xv(a){if(Hf=null,a=at(a),a!==null){var l=o(a);if(l===null)a=null;else{var d=l.tag;if(d===13){if(a=c(l),a!==null)return a;a=null}else if(d===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;a=null}else l!==a&&(a=null)}}return Hf=a,null}function Nj(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(De()){case Qe:return 2;case Re:return 8;case me:case ge:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var bv=!1,Ro=null,_o=null,Do=null,Ru=new Map,_u=new Map,Ao=[],d4="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Oj(a,l){switch(a){case"focusin":case"focusout":Ro=null;break;case"dragenter":case"dragleave":_o=null;break;case"mouseover":case"mouseout":Do=null;break;case"pointerover":case"pointerout":Ru.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":_u.delete(l.pointerId)}}function Du(a,l,d,p,x,w){return a===null||a.nativeEvent!==w?(a={blockedOn:l,domEventName:d,eventSystemFlags:p,nativeEvent:w,targetContainers:[x]},l!==null&&(l=et(l),l!==null&&Pj(l)),a):(a.eventSystemFlags|=p,l=a.targetContainers,x!==null&&l.indexOf(x)===-1&&l.push(x),a)}function f4(a,l,d,p,x){switch(l){case"focusin":return Ro=Du(Ro,a,l,d,p,x),!0;case"dragenter":return _o=Du(_o,a,l,d,p,x),!0;case"mouseover":return Do=Du(Do,a,l,d,p,x),!0;case"pointerover":var w=x.pointerId;return Ru.set(w,Du(Ru.get(w)||null,a,l,d,p,x)),!0;case"gotpointercapture":return w=x.pointerId,_u.set(w,Du(_u.get(w)||null,a,l,d,p,x)),!0}return!1}function Mj(a){var l=at(a.target);if(l!==null){var d=o(l);if(d!==null){if(l=d.tag,l===13){if(l=c(d),l!==null){a.blockedOn=l,Z(a.priority,function(){if(d.tag===13){var p=Br();p=ts(p);var x=bl(d,p);x!==null&&Vr(x,d,p),gv(d,p)}});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){a.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}a.blockedOn=null}function qf(a){if(a.blockedOn!==null)return!1;for(var l=a.targetContainers;0<l.length;){var d=yv(a.nativeEvent);if(d===null){d=a.nativeEvent;var p=new d.constructor(d.type,d);wm=p,d.target.dispatchEvent(p),wm=null}else return l=et(d),l!==null&&Pj(l),a.blockedOn=d,!1;l.shift()}return!0}function Lj(a,l,d){qf(a)&&d.delete(l)}function h4(){bv=!1,Ro!==null&&qf(Ro)&&(Ro=null),_o!==null&&qf(_o)&&(_o=null),Do!==null&&qf(Do)&&(Do=null),Ru.forEach(Lj),_u.forEach(Lj)}function Gf(a,l){a.blockedOn===l&&(a.blockedOn=null,bv||(bv=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,h4)))}var Wf=null;function Ij(a){Wf!==a&&(Wf=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Wf===a&&(Wf=null);for(var l=0;l<a.length;l+=3){var d=a[l],p=a[l+1],x=a[l+2];if(typeof p!="function"){if(xv(p||d)===null)continue;break}var w=et(d);w!==null&&(a.splice(l,3),l-=3,xg(w,{pending:!0,data:x,method:d.method,action:p},p,x))}}))}function Au(a){function l(B){return Gf(B,a)}Ro!==null&&Gf(Ro,a),_o!==null&&Gf(_o,a),Do!==null&&Gf(Do,a),Ru.forEach(l),_u.forEach(l);for(var d=0;d<Ao.length;d++){var p=Ao[d];p.blockedOn===a&&(p.blockedOn=null)}for(;0<Ao.length&&(d=Ao[0],d.blockedOn===null);)Mj(d),d.blockedOn===null&&Ao.shift();if(d=(a.ownerDocument||a).$$reactFormReplay,d!=null)for(p=0;p<d.length;p+=3){var x=d[p],w=d[p+1],A=x[Ee]||null;if(typeof w=="function")A||Ij(d);else if(A){var N=null;if(w&&w.hasAttribute("formAction")){if(x=w,A=w[Ee]||null)N=A.formAction;else if(xv(x)!==null)continue}else N=A.action;typeof N=="function"?d[p+1]=N:(d.splice(p,3),p-=3),Ij(d)}}}function Sv(a){this._internalRoot=a}Qf.prototype.render=Sv.prototype.render=function(a){var l=this._internalRoot;if(l===null)throw Error(r(409));var d=l.current,p=Br();Aj(d,p,a,l,null,null)},Qf.prototype.unmount=Sv.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var l=a.containerInfo;Aj(a.current,2,null,a,null,null),Df(),l[Ue]=null}};function Qf(a){this._internalRoot=a}Qf.prototype.unstable_scheduleHydration=function(a){if(a){var l=V();a={blockedOn:null,target:a,priority:l};for(var d=0;d<Ao.length&&l!==0&&l<Ao[d].priority;d++);Ao.splice(d,0,a),d===0&&Mj(a)}};var $j=t.version;if($j!=="19.1.0")throw Error(r(527,$j,"19.1.0"));I.findDOMNode=function(a){var l=a._reactInternals;if(l===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=f(l),a=a!==null?h(a):null,a=a===null?null:a.stateNode,a};var p4={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yf.isDisabled&&Yf.supportsFiber)try{xt=Yf.inject(p4),ht=Yf}catch{}}return Iu.createRoot=function(a,l){if(!i(a))throw Error(r(299));var d=!1,p="",x=ew,w=tw,A=nw,N=null;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(x=l.onUncaughtError),l.onCaughtError!==void 0&&(w=l.onCaughtError),l.onRecoverableError!==void 0&&(A=l.onRecoverableError),l.unstable_transitionCallbacks!==void 0&&(N=l.unstable_transitionCallbacks)),l=_j(a,1,!1,null,null,d,p,x,w,A,N,null),a[Ue]=l.current,rv(a),new Sv(l)},Iu.hydrateRoot=function(a,l,d){if(!i(a))throw Error(r(299));var p=!1,x="",w=ew,A=tw,N=nw,B=null,ne=null;return d!=null&&(d.unstable_strictMode===!0&&(p=!0),d.identifierPrefix!==void 0&&(x=d.identifierPrefix),d.onUncaughtError!==void 0&&(w=d.onUncaughtError),d.onCaughtError!==void 0&&(A=d.onCaughtError),d.onRecoverableError!==void 0&&(N=d.onRecoverableError),d.unstable_transitionCallbacks!==void 0&&(B=d.unstable_transitionCallbacks),d.formState!==void 0&&(ne=d.formState)),l=_j(a,1,!0,l,d??null,p,x,w,A,N,B,ne),l.context=Dj(null),d=l.current,p=Br(),p=ts(p),x=ho(p),x.callback=null,po(d,x,p),d=p,l.current.lanes=d,br(l,d),Qi(l),a[Ue]=l.current,rv(a),new Qf(l)},Iu.version="19.1.0",Iu}var gT;function _K(){if(gT)return oy.exports;gT=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(),oy.exports=RK(),oy.exports}var DK=_K();/**
566
+ * react-router v7.7.1
567
+ *
568
+ * Copyright (c) Remix Software Inc.
569
+ *
570
+ * This source code is licensed under the MIT license found in the
571
+ * LICENSE.md file in the root directory of this source tree.
572
+ *
573
+ * @license MIT
574
+ */var vk=e=>{throw TypeError(e)},AK=(e,t,n)=>t.has(e)||vk("Cannot "+n),cy=(e,t,n)=>(AK(e,t,"read from private field"),n?n.call(e):t.get(e)),kK=(e,t,n)=>t.has(e)?vk("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),vT="popstate";function PK(e={}){function t(r,i){let{pathname:o,search:c,hash:u}=r.location;return od("",{pathname:o,search:c,hash:u},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Go(i)}return OK(t,n,null,e)}function St(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Mn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function NK(){return Math.random().toString(36).substring(2,10)}function yT(e,t){return{usr:e.state,key:e.key,idx:t}}function od(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?io(t):t,state:n,key:t&&t.key||r||NK()}}function Go({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function io(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function OK(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:o=!1}=r,c=i.history,u="POP",f=null,h=m();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function m(){return(c.state||{idx:null}).idx}function g(){u="POP";let C=m(),T=C==null?null:C-h;h=C,f&&f({action:u,location:j.location,delta:T})}function y(C,T){u="PUSH";let _=od(j.location,C,T);h=m()+1;let E=yT(_,h),R=j.createHref(_);try{c.pushState(E,"",R)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;i.location.assign(R)}o&&f&&f({action:u,location:j.location,delta:1})}function b(C,T){u="REPLACE";let _=od(j.location,C,T);h=m();let E=yT(_,h),R=j.createHref(_);c.replaceState(E,"",R),o&&f&&f({action:u,location:j.location,delta:0})}function S(C){return yk(C)}let j={get action(){return u},get location(){return e(i,c)},listen(C){if(f)throw new Error("A history only accepts one active listener");return i.addEventListener(vT,g),f=C,()=>{i.removeEventListener(vT,g),f=null}},createHref(C){return t(i,C)},createURL:S,encodeLocation(C){let T=S(C);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:y,replace:b,go(C){return c.go(C)}};return j}function yk(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),St(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Go(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Fu,xT=class{constructor(e){if(kK(this,Fu,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(cy(this,Fu).has(e))return cy(this,Fu).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){cy(this,Fu).set(e,t)}};Fu=new WeakMap;var MK=new Set(["lazy","caseSensitive","path","id","index","children"]);function LK(e){return MK.has(e)}var IK=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function $K(e){return IK.has(e)}function zK(e){return e.index===!0}function sd(e,t,n=[],r={},i=!1){return e.map((o,c)=>{let u=[...n,String(c)],f=typeof o.id=="string"?o.id:u.join("-");if(St(o.index!==!0||!o.children,"Cannot specify children on an index route"),St(i||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),zK(o)){let h={...o,...t(o),id:f};return r[f]=h,h}else{let h={...o,...t(o),id:f,children:void 0};return r[f]=h,o.children&&(h.children=sd(o.children,t,u,r,i)),h}})}function zo(e,t,n="/"){return wh(e,t,n,!1)}function wh(e,t,n,r){let i=typeof t=="string"?io(t):t,o=vi(i.pathname||"/",n);if(o==null)return null;let c=xk(e);BK(c);let u=null;for(let f=0;u==null&&f<c.length;++f){let h=ZK(o);u=XK(c[f],h,r)}return u}function UK(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function xk(e,t=[],n=[],r=""){let i=(o,c,u)=>{let f={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:c,route:o};f.relativePath.startsWith("/")&&(St(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length));let h=oa([r,f.relativePath]),m=n.concat(f);o.children&&o.children.length>0&&(St(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),xk(o.children,t,m,h)),!(o.path==null&&!o.index)&&t.push({path:h,score:QK(h,o.index),routesMeta:m})};return e.forEach((o,c)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))i(o,c);else for(let f of bk(o.path))i(o,c,f)}),t}function bk(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let c=bk(r.join("/")),u=[];return u.push(...c.map(f=>f===""?o:[o,f].join("/"))),i&&u.push(...c),u.map(f=>e.startsWith("/")&&f===""?"/":f)}function BK(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:YK(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var VK=/^:[\w-]+$/,FK=3,HK=2,qK=1,GK=10,WK=-2,bT=e=>e==="*";function QK(e,t){let n=e.split("/"),r=n.length;return n.some(bT)&&(r+=WK),t&&(r+=HK),n.filter(i=>!bT(i)).reduce((i,o)=>i+(VK.test(o)?FK:o===""?qK:GK),r)}function YK(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function XK(e,t,n=!1){let{routesMeta:r}=e,i={},o="/",c=[];for(let u=0;u<r.length;++u){let f=r[u],h=u===r.length-1,m=o==="/"?t:t.slice(o.length)||"/",g=Jh({path:f.relativePath,caseSensitive:f.caseSensitive,end:h},m),y=f.route;if(!g&&h&&n&&!r[r.length-1].route.index&&(g=Jh({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!g)return null;Object.assign(i,g.params),c.push({params:i,pathname:oa([o,g.pathname]),pathnameBase:nZ(oa([o,g.pathnameBase])),route:y}),g.pathnameBase!=="/"&&(o=oa([o,g.pathnameBase]))}return c}function Jh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=KK(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],c=o.replace(/(.)\/+$/,"$1"),u=i.slice(1);return{params:r.reduce((h,{paramName:m,isOptional:g},y)=>{if(m==="*"){let S=u[y]||"";c=o.slice(0,o.length-S.length).replace(/(.)\/+$/,"$1")}const b=u[y];return g&&!b?h[m]=void 0:h[m]=(b||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:c,pattern:e}}function KK(e,t=!1,n=!0){Mn(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=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,u,f)=>(r.push({paramName:u,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function ZK(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Mn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function vi(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 JK({basename:e,pathname:t}){return t==="/"?e:oa([e,t])}function eZ(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?io(e):e;return{pathname:n?n.startsWith("/")?n:tZ(n,t):t,search:rZ(r),hash:iZ(i)}}function tZ(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function uy(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 Sk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function qb(e){let t=Sk(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Gb(e,t,n,r=!1){let i;typeof e=="string"?i=io(e):(i={...e},St(!i.pathname||!i.pathname.includes("?"),uy("?","pathname","search",i)),St(!i.pathname||!i.pathname.includes("#"),uy("#","pathname","hash",i)),St(!i.search||!i.search.includes("#"),uy("#","search","hash",i)));let o=e===""||i.pathname==="",c=o?"/":i.pathname,u;if(c==null)u=n;else{let g=t.length-1;if(!r&&c.startsWith("..")){let y=c.split("/");for(;y[0]==="..";)y.shift(),g-=1;i.pathname=y.join("/")}u=g>=0?t[g]:"/"}let f=eZ(i,u),h=c&&c!=="/"&&c.endsWith("/"),m=(o||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||m)&&(f.pathname+="/"),f}var oa=e=>e.join("/").replace(/\/\/+/g,"/"),nZ=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),rZ=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,iZ=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ep=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ld(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var wk=["POST","PUT","PATCH","DELETE"],aZ=new Set(wk),oZ=["GET",...wk],sZ=new Set(oZ),lZ=new Set([301,302,303,307,308]),cZ=new Set([307,308]),dy={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},uZ={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},$u={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},dZ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Wb=e=>dZ.test(e),fZ=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),jk="remix-router-transitions",Ck=Symbol("ResetLoaderData");function hZ(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";St(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||fZ,o={},c=sd(e.routes,i,void 0,o),u,f=e.basename||"/",h=e.dataStrategy||yZ,m={unstable_middleware:!1,...e.future},g=null,y=new Set,b=null,S=null,j=null,C=e.hydrationData!=null,T=zo(c,e.history.location,f),_=!1,E=null,R;if(T==null&&!e.patchRoutesOnNavigation){let V=di(404,{pathname:e.history.location.pathname}),{matches:Z,route:ae}=PT(c);R=!0,T=Z,E={[ae.id]:V}}else if(T&&!e.hydrationData&&va(T,c,e.history.location.pathname).active&&(T=null),T)if(T.some(V=>V.route.lazy))R=!1;else if(!T.some(V=>V.route.loader))R=!0;else{let V=e.hydrationData?e.hydrationData.loaderData:null,Z=e.hydrationData?e.hydrationData.errors:null;if(Z){let ae=T.findIndex(he=>Z[he.route.id]!==void 0);R=T.slice(0,ae+1).every(he=>!nx(he.route,V,Z))}else R=T.every(ae=>!nx(ae.route,V,Z))}else{R=!1,T=[];let V=va(null,c,e.history.location.pathname);V.active&&V.matches&&(_=!0,T=V.matches)}let D,k={historyAction:e.history.action,location:e.history.location,matches:T,initialized:R,navigation:dy,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||E,fetchers:new Map,blockers:new Map},M="POP",L=!1,z,F=!1,Y=new Map,W=null,J=!1,G=!1,X=new Set,P=new Map,I=0,$=-1,H=new Map,O=new Set,U=new Map,K=new Map,ee=new Set,Se=new Map,be,xe=null;function Ge(){if(g=e.history.listen(({action:V,location:Z,delta:ae})=>{if(be){be(),be=void 0;return}Mn(Se.size===0||ae!=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 he=ul({currentLocation:k.location,nextLocation:Z,historyAction:V});if(he&&ae!=null){let Ee=new Promise(Ue=>{be=Ue});e.history.go(ae*-1),Kr(he,{state:"blocked",location:Z,proceed(){Kr(he,{state:"proceeding",proceed:void 0,reset:void 0,location:Z}),Ee.then(()=>e.history.go(ae))},reset(){let Ue=new Map(k.blockers);Ue.set(he,$u),ke({blockers:Ue})}});return}return vt(V,Z)}),n){DZ(t,Y);let V=()=>AZ(t,Y);t.addEventListener("pagehide",V),W=()=>t.removeEventListener("pagehide",V)}return k.initialized||vt("POP",k.location,{initialHydration:!0}),D}function Me(){g&&g(),W&&W(),y.clear(),z&&z.abort(),k.fetchers.forEach((V,Z)=>kt(Z)),k.blockers.forEach((V,Z)=>wi(Z))}function nt(V){return y.add(V),()=>y.delete(V)}function ke(V,Z={}){V.matches&&(V.matches=V.matches.map(Ee=>{let Ue=o[Ee.route.id],We=Ee.route;return We.element!==Ue.element||We.errorElement!==Ue.errorElement||We.hydrateFallbackElement!==Ue.hydrateFallbackElement?{...Ee,route:Ue}:Ee})),k={...k,...V};let ae=[],he=[];k.fetchers.forEach((Ee,Ue)=>{Ee.state==="idle"&&(ee.has(Ue)?ae.push(Ue):he.push(Ue))}),ee.forEach(Ee=>{!k.fetchers.has(Ee)&&!P.has(Ee)&&ae.push(Ee)}),[...y].forEach(Ee=>Ee(k,{deletedFetchers:ae,viewTransitionOpts:Z.viewTransitionOpts,flushSync:Z.flushSync===!0})),ae.forEach(Ee=>kt(Ee)),he.forEach(Ee=>k.fetchers.delete(Ee))}function yt(V,Z,{flushSync:ae}={}){var Je,Ye;let he=k.actionData!=null&&k.navigation.formMethod!=null&&Tr(k.navigation.formMethod)&&k.navigation.state==="loading"&&((Je=V.state)==null?void 0:Je._isRedirect)!==!0,Ee;Z.actionData?Object.keys(Z.actionData).length>0?Ee=Z.actionData:Ee=null:he?Ee=k.actionData:Ee=null;let Ue=Z.loaderData?AT(k.loaderData,Z.loaderData,Z.matches||[],Z.errors):k.loaderData,We=k.blockers;We.size>0&&(We=new Map(We),We.forEach((at,et)=>We.set(et,$u)));let Fe=J?!1:Gn(V,Z.matches||k.matches),Ze=L===!0||k.navigation.formMethod!=null&&Tr(k.navigation.formMethod)&&((Ye=V.state)==null?void 0:Ye._isRedirect)!==!0;u&&(c=u,u=void 0),J||M==="POP"||(M==="PUSH"?e.history.push(V,V.state):M==="REPLACE"&&e.history.replace(V,V.state));let it;if(M==="POP"){let at=Y.get(k.location.pathname);at&&at.has(V.pathname)?it={currentLocation:k.location,nextLocation:V}:Y.has(V.pathname)&&(it={currentLocation:V,nextLocation:k.location})}else if(F){let at=Y.get(k.location.pathname);at?at.add(V.pathname):(at=new Set([V.pathname]),Y.set(k.location.pathname,at)),it={currentLocation:k.location,nextLocation:V}}ke({...Z,actionData:Ee,loaderData:Ue,historyAction:M,location:V,initialized:!0,navigation:dy,revalidation:"idle",restoreScrollPosition:Fe,preventScrollReset:Ze,blockers:We},{viewTransitionOpts:it,flushSync:ae===!0}),M="POP",L=!1,F=!1,J=!1,G=!1,xe==null||xe.resolve(),xe=null}async function It(V,Z){if(typeof V=="number"){e.history.go(V);return}let ae=tx(k.location,k.matches,f,V,Z==null?void 0:Z.fromRouteId,Z==null?void 0:Z.relative),{path:he,submission:Ee,error:Ue}=ST(!1,ae,Z),We=k.location,Fe=od(k.location,he,Z&&Z.state);Fe={...Fe,...e.history.encodeLocation(Fe)};let Ze=Z&&Z.replace!=null?Z.replace:void 0,it="PUSH";Ze===!0?it="REPLACE":Ze===!1||Ee!=null&&Tr(Ee.formMethod)&&Ee.formAction===k.location.pathname+k.location.search&&(it="REPLACE");let Je=Z&&"preventScrollReset"in Z?Z.preventScrollReset===!0:void 0,Ye=(Z&&Z.flushSync)===!0,at=ul({currentLocation:We,nextLocation:Fe,historyAction:it});if(at){Kr(at,{state:"blocked",location:Fe,proceed(){Kr(at,{state:"proceeding",proceed:void 0,reset:void 0,location:Fe}),It(V,Z)},reset(){let et=new Map(k.blockers);et.set(at,$u),ke({blockers:et})}});return}await vt(it,Fe,{submission:Ee,pendingError:Ue,preventScrollReset:Je,replace:Z&&Z.replace,enableViewTransition:Z&&Z.viewTransition,flushSync:Ye})}function $t(){xe||(xe=kZ()),ze(),ke({revalidation:"loading"});let V=xe.promise;return k.navigation.state==="submitting"?V:k.navigation.state==="idle"?(vt(k.historyAction,k.location,{startUninterruptedRevalidation:!0}),V):(vt(M||k.historyAction,k.navigation.location,{overrideNavigation:k.navigation,enableViewTransition:F===!0}),V)}async function vt(V,Z,ae){z&&z.abort(),z=null,M=V,J=(ae&&ae.startUninterruptedRevalidation)===!0,br(k.location,k.matches),L=(ae&&ae.preventScrollReset)===!0,F=(ae&&ae.enableViewTransition)===!0;let he=u||c,Ee=ae&&ae.overrideNavigation,Ue=ae!=null&&ae.initialHydration&&k.matches&&k.matches.length>0&&!_?k.matches:zo(he,Z,f),We=(ae&&ae.flushSync)===!0;if(Ue&&k.initialized&&!G&&CZ(k.location,Z)&&!(ae&&ae.submission&&Tr(ae.submission.formMethod))){yt(Z,{matches:Ue},{flushSync:We});return}let Fe=va(Ue,he,Z.pathname);if(Fe.active&&Fe.matches&&(Ue=Fe.matches),!Ue){let{error:mn,notFoundMatches:dt,route:Gt}=ga(Z.pathname);yt(Z,{matches:dt,loaderData:{},errors:{[Gt.id]:mn}},{flushSync:We});return}z=new AbortController;let Ze=ic(e.history,Z,z.signal,ae&&ae.submission),it=new xT(e.unstable_getContext?await e.unstable_getContext():void 0),Je;if(ae&&ae.pendingError)Je=[Rs(Ue).route.id,{type:"error",error:ae.pendingError}];else if(ae&&ae.submission&&Tr(ae.submission.formMethod)){let mn=await At(Ze,Z,ae.submission,Ue,it,Fe.active,ae&&ae.initialHydration===!0,{replace:ae.replace,flushSync:We});if(mn.shortCircuited)return;if(mn.pendingActionResult){let[dt,Gt]=mn.pendingActionResult;if(Hr(Gt)&&ld(Gt.error)&&Gt.error.status===404){z=null,yt(Z,{matches:mn.matches,loaderData:{},errors:{[dt]:Gt.error}});return}}Ue=mn.matches||Ue,Je=mn.pendingActionResult,Ee=fy(Z,ae.submission),We=!1,Fe.active=!1,Ze=ic(e.history,Ze.url,Ze.signal)}let{shortCircuited:Ye,matches:at,loaderData:et,errors:un}=await nn(Ze,Z,Ue,it,Fe.active,Ee,ae&&ae.submission,ae&&ae.fetcherSubmission,ae&&ae.replace,ae&&ae.initialHydration===!0,We,Je);Ye||(z=null,yt(Z,{matches:at||Ue,...kT(Je),loaderData:et,errors:un}))}async function At(V,Z,ae,he,Ee,Ue,We,Fe={}){ze();let Ze=RZ(Z,ae);if(ke({navigation:Ze},{flushSync:Fe.flushSync===!0}),Ue){let Ye=await oo(he,Z.pathname,V.signal);if(Ye.type==="aborted")return{shortCircuited:!0};if(Ye.type==="error"){let at=Rs(Ye.partialMatches).route.id;return{matches:Ye.partialMatches,pendingActionResult:[at,{type:"error",error:Ye.error}]}}else if(Ye.matches)he=Ye.matches;else{let{notFoundMatches:at,error:et,route:un}=ga(Z.pathname);return{matches:at,pendingActionResult:[un.id,{type:"error",error:et}]}}}let it,Je=jh(he,Z);if(!Je.route.action&&!Je.route.lazy)it={type:"error",error:di(405,{method:V.method,pathname:Z.pathname,routeId:Je.route.id})};else{let Ye=uc(i,o,V,he,Je,We?[]:r,Ee),at=await Ne(V,Ye,Ee,null);if(it=at[Je.route.id],!it){for(let et of he)if(at[et.route.id]){it=at[et.route.id];break}}if(V.signal.aborted)return{shortCircuited:!0}}if(Ms(it)){let Ye;return Fe&&Fe.replace!=null?Ye=Fe.replace:Ye=RT(it.response.headers.get("Location"),new URL(V.url),f)===k.location.pathname+k.location.search,await ge(V,it,!0,{submission:ae,replace:Ye}),{shortCircuited:!0}}if(Hr(it)){let Ye=Rs(he,Je.route.id);return(Fe&&Fe.replace)!==!0&&(M="PUSH"),{matches:he,pendingActionResult:[Ye.route.id,it,Je.route.id]}}return{matches:he,pendingActionResult:[Je.route.id,it]}}async function nn(V,Z,ae,he,Ee,Ue,We,Fe,Ze,it,Je,Ye){let at=Ue||fy(Z,We),et=We||Fe||OT(at),un=!J&&!it;if(Ee){if(un){let In=Te(Ye);ke({navigation:at,...In!==void 0?{actionData:In}:{}},{flushSync:Je})}let Et=await oo(ae,Z.pathname,V.signal);if(Et.type==="aborted")return{shortCircuited:!0};if(Et.type==="error"){let In=Rs(Et.partialMatches).route.id;return{matches:Et.partialMatches,loaderData:{},errors:{[In]:Et.error}}}else if(Et.matches)ae=Et.matches;else{let{error:In,notFoundMatches:rs,route:Jr}=ga(Z.pathname);return{matches:rs,loaderData:{},errors:{[Jr.id]:In}}}}let mn=u||c,{dsMatches:dt,revalidatingFetchers:Gt}=wT(V,he,i,o,e.history,k,ae,et,Z,it?[]:r,it===!0,G,X,ee,U,O,mn,f,e.patchRoutesOnNavigation!=null,Ye);if($=++I,!e.dataStrategy&&!dt.some(Et=>Et.shouldLoad)&&Gt.length===0){let Et=Si();return yt(Z,{matches:ae,loaderData:{},errors:Ye&&Hr(Ye[1])?{[Ye[0]]:Ye[1].error}:null,...kT(Ye),...Et?{fetchers:new Map(k.fetchers)}:{}},{flushSync:Je}),{shortCircuited:!0}}if(un){let Et={};if(!Ee){Et.navigation=at;let In=Te(Ye);In!==void 0&&(Et.actionData=In)}Gt.length>0&&(Et.fetchers=De(Gt)),ke(Et,{flushSync:Je})}Gt.forEach(Et=>{Ct(Et.key),Et.controller&&P.set(Et.key,Et.controller)});let Fi=()=>Gt.forEach(Et=>Ct(Et.key));z&&z.signal.addEventListener("abort",Fi);let{loaderResults:Mr,fetcherResults:ur}=await we(dt,Gt,V,he);if(V.signal.aborted)return{shortCircuited:!0};z&&z.signal.removeEventListener("abort",Fi),Gt.forEach(Et=>P.delete(Et.key));let Zr=lh(Mr);if(Zr)return await ge(V,Zr.result,!0,{replace:Ze}),{shortCircuited:!0};if(Zr=lh(ur),Zr)return O.add(Zr.key),await ge(V,Zr.result,!0,{replace:Ze}),{shortCircuited:!0};let{loaderData:dl,errors:so}=DT(k,ae,Mr,Ye,Gt,ur);it&&k.errors&&(so={...k.errors,...so});let ya=Si(),xa=ma($),ba=ya||xa||Gt.length>0;return{matches:ae,loaderData:dl,errors:so,...ba?{fetchers:new Map(k.fetchers)}:{}}}function Te(V){if(V&&!Hr(V[1]))return{[V[0]]:V[1].data};if(k.actionData)return Object.keys(k.actionData).length===0?null:k.actionData}function De(V){return V.forEach(Z=>{let ae=k.fetchers.get(Z.key),he=zu(void 0,ae?ae.data:void 0);k.fetchers.set(Z.key,he)}),new Map(k.fetchers)}async function Qe(V,Z,ae,he){Ct(V);let Ee=(he&&he.flushSync)===!0,Ue=u||c,We=tx(k.location,k.matches,f,ae,Z,he==null?void 0:he.relative),Fe=zo(Ue,We,f),Ze=va(Fe,Ue,We);if(Ze.active&&Ze.matches&&(Fe=Ze.matches),!Fe){ht(V,Z,di(404,{pathname:We}),{flushSync:Ee});return}let{path:it,submission:Je,error:Ye}=ST(!0,We,he);if(Ye){ht(V,Z,Ye,{flushSync:Ee});return}let at=new xT(e.unstable_getContext?await e.unstable_getContext():void 0),et=(he&&he.preventScrollReset)===!0;if(Je&&Tr(Je.formMethod)){await Re(V,Z,it,Fe,at,Ze.active,Ee,et,Je);return}U.set(V,{routeId:Z,path:it}),await me(V,Z,it,Fe,at,Ze.active,Ee,et,Je)}async function Re(V,Z,ae,he,Ee,Ue,We,Fe,Ze){ze(),U.delete(V);let it=k.fetchers.get(V);xt(V,_Z(Ze,it),{flushSync:We});let Je=new AbortController,Ye=ic(e.history,ae,Je.signal,Ze);if(Ue){let wn=await oo(he,new URL(Ye.url).pathname,Ye.signal,V);if(wn.type==="aborted")return;if(wn.type==="error"){ht(V,Z,wn.error,{flushSync:We});return}else if(wn.matches)he=wn.matches;else{ht(V,Z,di(404,{pathname:ae}),{flushSync:We});return}}let at=jh(he,ae);if(!at.route.action&&!at.route.lazy){let wn=di(405,{method:Ze.formMethod,pathname:ae,routeId:Z});ht(V,Z,wn,{flushSync:We});return}P.set(V,Je);let et=I,un=uc(i,o,Ye,he,at,r,Ee),dt=(await Ne(Ye,un,Ee,V))[at.route.id];if(Ye.signal.aborted){P.get(V)===Je&&P.delete(V);return}if(ee.has(V)){if(Ms(dt)||Hr(dt)){xt(V,Oo(void 0));return}}else{if(Ms(dt))if(P.delete(V),$>et){xt(V,Oo(void 0));return}else return O.add(V),xt(V,zu(Ze)),ge(Ye,dt,!1,{fetcherSubmission:Ze,preventScrollReset:Fe});if(Hr(dt)){ht(V,Z,dt.error);return}}let Gt=k.navigation.location||k.location,Fi=ic(e.history,Gt,Je.signal),Mr=u||c,ur=k.navigation.state!=="idle"?zo(Mr,k.navigation.location,f):k.matches;St(ur,"Didn't find any matches after fetcher action");let Zr=++I;H.set(V,Zr);let dl=zu(Ze,dt.data);k.fetchers.set(V,dl);let{dsMatches:so,revalidatingFetchers:ya}=wT(Fi,Ee,i,o,e.history,k,ur,Ze,Gt,r,!1,G,X,ee,U,O,Mr,f,e.patchRoutesOnNavigation!=null,[at.route.id,dt]);ya.filter(wn=>wn.key!==V).forEach(wn=>{let lo=wn.key,zd=k.fetchers.get(lo),Ud=zu(void 0,zd?zd.data:void 0);k.fetchers.set(lo,Ud),Ct(lo),wn.controller&&P.set(lo,wn.controller)}),ke({fetchers:new Map(k.fetchers)});let xa=()=>ya.forEach(wn=>Ct(wn.key));Je.signal.addEventListener("abort",xa);let{loaderResults:ba,fetcherResults:Et}=await we(so,ya,Fi,Ee);if(Je.signal.aborted)return;if(Je.signal.removeEventListener("abort",xa),H.delete(V),P.delete(V),ya.forEach(wn=>P.delete(wn.key)),k.fetchers.has(V)){let wn=Oo(dt.data);k.fetchers.set(V,wn)}let In=lh(ba);if(In)return ge(Fi,In.result,!1,{preventScrollReset:Fe});if(In=lh(Et),In)return O.add(In.key),ge(Fi,In.result,!1,{preventScrollReset:Fe});let{loaderData:rs,errors:Jr}=DT(k,ur,ba,void 0,ya,Et);ma(Zr),k.navigation.state==="loading"&&Zr>$?(St(M,"Expected pending action"),z&&z.abort(),yt(k.navigation.location,{matches:ur,loaderData:rs,errors:Jr,fetchers:new Map(k.fetchers)})):(ke({errors:Jr,loaderData:AT(k.loaderData,rs,ur,Jr),fetchers:new Map(k.fetchers)}),G=!1)}async function me(V,Z,ae,he,Ee,Ue,We,Fe,Ze){let it=k.fetchers.get(V);xt(V,zu(Ze,it?it.data:void 0),{flushSync:We});let Je=new AbortController,Ye=ic(e.history,ae,Je.signal);if(Ue){let Gt=await oo(he,new URL(Ye.url).pathname,Ye.signal,V);if(Gt.type==="aborted")return;if(Gt.type==="error"){ht(V,Z,Gt.error,{flushSync:We});return}else if(Gt.matches)he=Gt.matches;else{ht(V,Z,di(404,{pathname:ae}),{flushSync:We});return}}let at=jh(he,ae);P.set(V,Je);let et=I,un=uc(i,o,Ye,he,at,r,Ee),dt=(await Ne(Ye,un,Ee,V))[at.route.id];if(P.get(V)===Je&&P.delete(V),!Ye.signal.aborted){if(ee.has(V)){xt(V,Oo(void 0));return}if(Ms(dt))if($>et){xt(V,Oo(void 0));return}else{O.add(V),await ge(Ye,dt,!1,{preventScrollReset:Fe});return}if(Hr(dt)){ht(V,Z,dt.error);return}xt(V,Oo(dt.data))}}async function ge(V,Z,ae,{submission:he,fetcherSubmission:Ee,preventScrollReset:Ue,replace:We}={}){Z.response.headers.has("X-Remix-Revalidate")&&(G=!0);let Fe=Z.response.headers.get("Location");St(Fe,"Expected a Location header on the redirect Response"),Fe=RT(Fe,new URL(V.url),f);let Ze=od(k.location,Fe,{_isRedirect:!0});if(n){let un=!1;if(Z.response.headers.has("X-Remix-Reload-Document"))un=!0;else if(Wb(Fe)){const mn=yk(Fe,!0);un=mn.origin!==t.location.origin||vi(mn.pathname,f)==null}if(un){We?t.location.replace(Fe):t.location.assign(Fe);return}}z=null;let it=We===!0||Z.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Je,formAction:Ye,formEncType:at}=k.navigation;!he&&!Ee&&Je&&Ye&&at&&(he=OT(k.navigation));let et=he||Ee;if(cZ.has(Z.response.status)&&et&&Tr(et.formMethod))await vt(it,Ze,{submission:{...et,formAction:Fe},preventScrollReset:Ue||L,enableViewTransition:ae?F:void 0});else{let un=fy(Ze,he);await vt(it,Ze,{overrideNavigation:un,fetcherSubmission:Ee,preventScrollReset:Ue||L,enableViewTransition:ae?F:void 0})}}async function Ne(V,Z,ae,he){let Ee,Ue={};try{Ee=await xZ(h,V,Z,he,ae,!1)}catch(We){return Z.filter(Fe=>Fe.shouldLoad).forEach(Fe=>{Ue[Fe.route.id]={type:"error",error:We}}),Ue}if(V.signal.aborted)return Ue;for(let[We,Fe]of Object.entries(Ee))if(EZ(Fe)){let Ze=Fe.result;Ue[We]={type:"redirect",response:wZ(Ze,V,We,Z,f)}}else Ue[We]=await SZ(Fe);return Ue}async function we(V,Z,ae,he){let Ee=Ne(ae,V,he,null),Ue=Promise.all(Z.map(async Ze=>{if(Ze.matches&&Ze.match&&Ze.request&&Ze.controller){let Je=(await Ne(Ze.request,Ze.matches,he,Ze.key))[Ze.match.route.id];return{[Ze.key]:Je}}else return Promise.resolve({[Ze.key]:{type:"error",error:di(404,{pathname:Ze.path})}})})),We=await Ee,Fe=(await Ue).reduce((Ze,it)=>Object.assign(Ze,it),{});return{loaderResults:We,fetcherResults:Fe}}function ze(){G=!0,U.forEach((V,Z)=>{P.has(Z)&&X.add(Z),Ct(Z)})}function xt(V,Z,ae={}){k.fetchers.set(V,Z),ke({fetchers:new Map(k.fetchers)},{flushSync:(ae&&ae.flushSync)===!0})}function ht(V,Z,ae,he={}){let Ee=Rs(k.matches,Z);kt(V),ke({errors:{[Ee.route.id]:ae},fetchers:new Map(k.fetchers)},{flushSync:(he&&he.flushSync)===!0})}function qt(V){return K.set(V,(K.get(V)||0)+1),ee.has(V)&&ee.delete(V),k.fetchers.get(V)||uZ}function kt(V){let Z=k.fetchers.get(V);P.has(V)&&!(Z&&Z.state==="loading"&&H.has(V))&&Ct(V),U.delete(V),H.delete(V),O.delete(V),ee.delete(V),X.delete(V),k.fetchers.delete(V)}function cn(V){let Z=(K.get(V)||0)-1;Z<=0?(K.delete(V),ee.add(V)):K.set(V,Z),ke({fetchers:new Map(k.fetchers)})}function Ct(V){let Z=P.get(V);Z&&(Z.abort(),P.delete(V))}function Bi(V){for(let Z of V){let ae=qt(Z),he=Oo(ae.data);k.fetchers.set(Z,he)}}function Si(){let V=[],Z=!1;for(let ae of O){let he=k.fetchers.get(ae);St(he,`Expected fetcher: ${ae}`),he.state==="loading"&&(O.delete(ae),V.push(ae),Z=!0)}return Bi(V),Z}function ma(V){let Z=[];for(let[ae,he]of H)if(he<V){let Ee=k.fetchers.get(ae);St(Ee,`Expected fetcher: ${ae}`),Ee.state==="loading"&&(Ct(ae),H.delete(ae),Z.push(ae))}return Bi(Z),Z.length>0}function Fn(V,Z){let ae=k.blockers.get(V)||$u;return Se.get(V)!==Z&&Se.set(V,Z),ae}function wi(V){k.blockers.delete(V),Se.delete(V)}function Kr(V,Z){let ae=k.blockers.get(V)||$u;St(ae.state==="unblocked"&&Z.state==="blocked"||ae.state==="blocked"&&Z.state==="blocked"||ae.state==="blocked"&&Z.state==="proceeding"||ae.state==="blocked"&&Z.state==="unblocked"||ae.state==="proceeding"&&Z.state==="unblocked",`Invalid blocker state transition: ${ae.state} -> ${Z.state}`);let he=new Map(k.blockers);he.set(V,Z),ke({blockers:he})}function ul({currentLocation:V,nextLocation:Z,historyAction:ae}){if(Se.size===0)return;Se.size>1&&Mn(!1,"A router only supports one blocker at a time");let he=Array.from(Se.entries()),[Ee,Ue]=he[he.length-1],We=k.blockers.get(Ee);if(!(We&&We.state==="proceeding")&&Ue({currentLocation:V,nextLocation:Z,historyAction:ae}))return Ee}function ga(V){let Z=di(404,{pathname:V}),ae=u||c,{matches:he,route:Ee}=PT(ae);return{notFoundMatches:he,route:Ee,error:Z}}function ao(V,Z,ae){if(b=V,j=Z,S=ae||null,!C&&k.navigation===dy){C=!0;let he=Gn(k.location,k.matches);he!=null&&ke({restoreScrollPosition:he})}return()=>{b=null,j=null,S=null}}function Vi(V,Z){return S&&S(V,Z.map(he=>UK(he,k.loaderData)))||V.key}function br(V,Z){if(b&&j){let ae=Vi(V,Z);b[ae]=j()}}function Gn(V,Z){if(b){let ae=Vi(V,Z),he=b[ae];if(typeof he=="number")return he}return null}function va(V,Z,ae){if(e.patchRoutesOnNavigation)if(V){if(Object.keys(V[0].params).length>0)return{active:!0,matches:wh(Z,ae,f,!0)}}else return{active:!0,matches:wh(Z,ae,f,!0)||[]};return{active:!1,matches:null}}async function oo(V,Z,ae,he){if(!e.patchRoutesOnNavigation)return{type:"success",matches:V};let Ee=V;for(;;){let Ue=u==null,We=u||c,Fe=o;try{await e.patchRoutesOnNavigation({signal:ae,path:Z,matches:Ee,fetcherKey:he,patch:(Je,Ye)=>{ae.aborted||jT(Je,Ye,We,Fe,i,!1)}})}catch(Je){return{type:"error",error:Je,partialMatches:Ee}}finally{Ue&&!ae.aborted&&(c=[...c])}if(ae.aborted)return{type:"aborted"};let Ze=zo(We,Z,f);if(Ze)return{type:"success",matches:Ze};let it=wh(We,Z,f,!0);if(!it||Ee.length===it.length&&Ee.every((Je,Ye)=>Je.route.id===it[Ye].route.id))return{type:"success",matches:null};Ee=it}}function ts(V){o={},u=sd(V,i,void 0,o)}function ns(V,Z,ae=!1){let he=u==null;jT(V,Z,u||c,o,i,ae),he&&(c=[...c],ke({}))}return D={get basename(){return f},get future(){return m},get state(){return k},get routes(){return c},get window(){return t},initialize:Ge,subscribe:nt,enableScrollRestoration:ao,navigate:It,fetch:Qe,revalidate:$t,createHref:V=>e.history.createHref(V),encodeLocation:V=>e.history.encodeLocation(V),getFetcher:qt,deleteFetcher:cn,dispose:Me,getBlocker:Fn,deleteBlocker:wi,patchRoutes:ns,_internalFetchControllers:P,_internalSetRoutes:ts,_internalSetStateDoNotUseOrYouWillBreakYourApp(V){ke(V)}},D}function pZ(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function tx(e,t,n,r,i,o){let c,u;if(i){c=[];for(let h of t)if(c.push(h),h.route.id===i){u=h;break}}else c=t,u=t[t.length-1];let f=Gb(r||".",qb(c),vi(e.pathname,n)||e.pathname,o==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&u){let h=Qb(f.search);if(u.route.index&&!h)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&h){let m=new URLSearchParams(f.search),g=m.getAll("index");m.delete("index"),g.filter(b=>b).forEach(b=>m.append("index",b));let y=m.toString();f.search=y?`?${y}`:""}}return n!=="/"&&(f.pathname=JK({basename:n,pathname:f.pathname})),Go(f)}function ST(e,t,n){if(!n||!pZ(n))return{path:t};if(n.formMethod&&!TZ(n.formMethod))return{path:t,error:di(405,{method:n.formMethod})};let r=()=>({path:t,error:di(400,{type:"invalid-body"})}),o=(n.formMethod||"get").toUpperCase(),c=Ak(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Tr(o))return r();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((y,[b,S])=>`${y}${b}=${S}
575
+ `,""):String(n.body);return{path:t,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!Tr(o))return r();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return r()}}}St(typeof FormData=="function","FormData is not available in this environment");let u,f;if(n.formData)u=ix(n.formData),f=n.formData;else if(n.body instanceof FormData)u=ix(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=_T(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=_T(u)}catch{return r()}let h={formMethod:o,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(Tr(h.formMethod))return{path:t,submission:h};let m=io(t);return e&&m.search&&Qb(m.search)&&u.append("index",""),m.search=`?${u}`,{path:Go(m),submission:h}}function wT(e,t,n,r,i,o,c,u,f,h,m,g,y,b,S,j,C,T,_,E){var J;let R=E?Hr(E[1])?E[1].error:E[1].data:void 0,D=i.createURL(o.location),k=i.createURL(f),M;if(m&&o.errors){let G=Object.keys(o.errors)[0];M=c.findIndex(X=>X.route.id===G)}else if(E&&Hr(E[1])){let G=E[0];M=c.findIndex(X=>X.route.id===G)-1}let L=E?E[1].statusCode:void 0,z=L&&L>=400,F={currentUrl:D,currentParams:((J=o.matches[0])==null?void 0:J.params)||{},nextUrl:k,nextParams:c[0].params,...u,actionResult:R,actionStatus:L},Y=c.map((G,X)=>{let{route:P}=G,I=null;if(M!=null&&X>M?I=!1:P.lazy?I=!0:P.loader==null?I=!1:m?I=nx(P,o.loaderData,o.errors):mZ(o.loaderData,o.matches[X],G)&&(I=!0),I!==null)return rx(n,r,e,G,h,t,I);let $=z?!1:g||D.pathname+D.search===k.pathname+k.search||D.search!==k.search||gZ(o.matches[X],G),H={...F,defaultShouldRevalidate:$},O=tp(G,H);return rx(n,r,e,G,h,t,O,H)}),W=[];return S.forEach((G,X)=>{if(m||!c.some(ee=>ee.route.id===G.routeId)||b.has(X))return;let P=o.fetchers.get(X),I=P&&P.state!=="idle"&&P.data===void 0,$=zo(C,G.path,T);if(!$){if(_&&I)return;W.push({key:X,routeId:G.routeId,path:G.path,matches:null,match:null,request:null,controller:null});return}if(j.has(X))return;let H=jh($,G.path),O=new AbortController,U=ic(i,G.path,O.signal),K=null;if(y.has(X))y.delete(X),K=uc(n,r,U,$,H,h,t);else if(I)g&&(K=uc(n,r,U,$,H,h,t));else{let ee={...F,defaultShouldRevalidate:z?!1:g};tp(H,ee)&&(K=uc(n,r,U,$,H,h,t,ee))}K&&W.push({key:X,routeId:G.routeId,path:G.path,matches:K,match:H,request:U,controller:O})}),{dsMatches:Y,revalidatingFetchers:W}}function nx(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function mZ(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function gZ(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function tp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function jT(e,t,n,r,i,o){let c;if(e){let h=r[e];St(h,`No route found to patch children into: routeId = ${e}`),h.children||(h.children=[]),c=h.children}else c=n;let u=[],f=[];if(t.forEach(h=>{let m=c.find(g=>Ek(h,g));m?f.push({existingRoute:m,newRoute:h}):u.push(h)}),u.length>0){let h=sd(u,i,[e||"_","patch",String((c==null?void 0:c.length)||"0")],r);c.push(...h)}if(o&&f.length>0)for(let h=0;h<f.length;h++){let{existingRoute:m,newRoute:g}=f[h],y=m,[b]=sd([g],i,[],{},!0);Object.assign(y,{element:b.element?b.element:y.element,errorElement:b.errorElement?b.errorElement:y.errorElement,hydrateFallbackElement:b.hydrateFallbackElement?b.hydrateFallbackElement:y.hydrateFallbackElement})}}function Ek(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 i;return(i=t.children)==null?void 0:i.some(o=>Ek(n,o))}):!1}var CT=new WeakMap,Tk=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(St(i,"No route found in manifest"),!i.lazy||typeof i.lazy!="object")return;let o=i.lazy[e];if(!o)return;let c=CT.get(i);c||(c={},CT.set(i,c));let u=c[e];if(u)return u;let f=(async()=>{let h=LK(e),g=i[e]!==void 0&&e!=="hasErrorBoundary";if(h)Mn(!h,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(g)Mn(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let y=await o();y!=null&&(Object.assign(i,{[e]:y}),Object.assign(i,r(i)))}typeof i.lazy=="object"&&(i.lazy[e]=void 0,Object.values(i.lazy).every(y=>y===void 0)&&(i.lazy=void 0))})();return c[e]=f,f},ET=new WeakMap;function vZ(e,t,n,r,i){let o=n[e.id];if(St(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=ET.get(o);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let g=(async()=>{St(typeof e.lazy=="function","No lazy route function found");let y=await e.lazy(),b={};for(let S in y){let j=y[S];if(j===void 0)continue;let C=$K(S),_=o[S]!==void 0&&S!=="hasErrorBoundary";C?Mn(!C,"Route property "+S+" is not a supported property to be returned from a lazy route function. This property will be ignored."):_?Mn(!_,`Route "${o.id}" has a static property "${S}" defined but its lazy function is also returning a value for this property. The lazy route property "${S}" will be ignored.`):b[S]=j}Object.assign(o,b),Object.assign(o,{...r(o),lazy:void 0})})();return ET.set(o,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let c=Object.keys(e.lazy),u=[],f;for(let m of c){if(i&&i.includes(m))continue;let g=Tk({key:m,route:e,manifest:n,mapRouteProperties:r});g&&(u.push(g),m===t&&(f=g))}let h=u.length>0?Promise.all(u).then(()=>{}):void 0;return h==null||h.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:f}}async function TT(e){let t=e.matches.filter(i=>i.shouldLoad),n={};return(await Promise.all(t.map(i=>i.resolve()))).forEach((i,o)=>{n[t[o].route.id]=i}),n}async function yZ(e){return e.matches.some(t=>t.route.unstable_middleware)?Rk(e,!1,()=>TT(e),(t,n)=>({[n]:{type:"error",result:t}})):TT(e)}async function Rk(e,t,n,r){let{matches:i,request:o,params:c,context:u}=e,f={handlerResult:void 0};try{let h=i.flatMap(g=>g.route.unstable_middleware?g.route.unstable_middleware.map(y=>[g.route.id,y]):[]),m=await _k({request:o,params:c,context:u},h,t,f,n);return t?m:f.handlerResult}catch(h){if(!f.middlewareError)throw h;let m=await r(f.middlewareError.error,f.middlewareError.routeId);return f.handlerResult?Object.assign(f.handlerResult,m):m}}async function _k(e,t,n,r,i,o=0){let{request:c}=e;if(c.signal.aborted)throw c.signal.reason?c.signal.reason:new Error(`Request aborted without an \`AbortSignal.reason\`: ${c.method} ${c.url}`);let u=t[o];if(!u)return r.handlerResult=await i(),r.handlerResult;let[f,h]=u,m=!1,g,y=async()=>{if(m)throw new Error("You may only call `next()` once per middleware");m=!0,await _k(e,t,n,r,i,o+1)};try{let b=await h({request:e.request,params:e.params,context:e.context},y);return m?b===void 0?g:b:y()}catch(b){throw r.middlewareError?r.middlewareError.error!==b&&(r.middlewareError={routeId:f,error:b}):r.middlewareError={routeId:f,error:b},b}}function Dk(e,t,n,r,i){let o=Tk({key:"unstable_middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=vZ(r.route,Tr(n.method)?"action":"loader",t,e,i);return{middleware:o,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function rx(e,t,n,r,i,o,c,u=null){let f=!1,h=Dk(e,t,n,r,i);return{...r,_lazyPromises:h,shouldLoad:c,unstable_shouldRevalidateArgs:u,unstable_shouldCallHandler(m){return f=!0,u?typeof m=="boolean"?tp(r,{...u,defaultShouldRevalidate:m}):tp(r,u):c},resolve(m){return f||c||m&&!Tr(n.method)&&(r.route.lazy||r.route.loader)?bZ({request:n,match:r,lazyHandlerPromise:h==null?void 0:h.handler,lazyRoutePromise:h==null?void 0:h.route,handlerOverride:m,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}}function uc(e,t,n,r,i,o,c,u=null){return r.map(f=>f.route.id!==i.route.id?{...f,shouldLoad:!1,unstable_shouldRevalidateArgs:u,unstable_shouldCallHandler:()=>!1,_lazyPromises:Dk(e,t,n,f,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:rx(e,t,n,f,o,c,!0,u))}async function xZ(e,t,n,r,i,o){n.some(h=>{var m;return(m=h._lazyPromises)==null?void 0:m.middleware})&&await Promise.all(n.map(h=>{var m;return(m=h._lazyPromises)==null?void 0:m.middleware}));let c={request:t,params:n[0].params,context:i,matches:n},f=await e({...c,fetcherKey:r,unstable_runClientMiddleware:h=>{let m=c;return Rk(m,!1,()=>h({...m,fetcherKey:r,unstable_runClientMiddleware:()=>{throw new Error("Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler")}}),(g,y)=>({[y]:{type:"error",result:g}}))}});try{await Promise.all(n.flatMap(h=>{var m,g;return[(m=h._lazyPromises)==null?void 0:m.handler,(g=h._lazyPromises)==null?void 0:g.route]}))}catch{}return f}async function bZ({request:e,match:t,lazyHandlerPromise:n,lazyRoutePromise:r,handlerOverride:i,scopedContext:o}){let c,u,f=Tr(e.method),h=f?"action":"loader",m=g=>{let y,b=new Promise((C,T)=>y=T);u=()=>y(),e.signal.addEventListener("abort",u);let S=C=>typeof g!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${h}" [routeId: ${t.route.id}]`)):g({request:e,params:t.params,context:o},...C!==void 0?[C]:[]),j=(async()=>{try{return{type:"data",result:await(i?i(T=>S(T)):S())}}catch(C){return{type:"error",result:C}}})();return Promise.race([j,b])};try{let g=f?t.route.action:t.route.loader;if(n||r)if(g){let y,[b]=await Promise.all([m(g).catch(S=>{y=S}),n,r]);if(y!==void 0)throw y;c=b}else{await n;let y=f?t.route.action:t.route.loader;if(y)[c]=await Promise.all([m(y),r]);else if(h==="action"){let b=new URL(e.url),S=b.pathname+b.search;throw di(405,{method:e.method,pathname:S,routeId:t.route.id})}else return{type:"data",result:void 0}}else if(g)c=await m(g);else{let y=new URL(e.url),b=y.pathname+y.search;throw di(404,{pathname:b})}}catch(g){return{type:"error",result:g}}finally{u&&e.signal.removeEventListener("abort",u)}return c}async function SZ(e){var r,i,o,c,u,f;let{result:t,type:n}=e;if(kk(t)){let h;try{let m=t.headers.get("Content-Type");m&&/\bapplication\/json\b/.test(m)?t.body==null?h=null:h=await t.json():h=await t.text()}catch(m){return{type:"error",error:m}}return n==="error"?{type:"error",error:new ep(t.status,t.statusText,h),statusCode:t.status,headers:t.headers}:{type:"data",data:h,statusCode:t.status,headers:t.headers}}return n==="error"?NT(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new ep(((o=t.init)==null?void 0:o.status)||500,void 0,t.data),statusCode:ld(t)?t.status:void 0,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:ld(t)?t.status:void 0}:NT(t)?{type:"data",data:t.data,statusCode:(u=t.init)==null?void 0:u.status,headers:(f=t.init)!=null&&f.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function wZ(e,t,n,r,i){let o=e.headers.get("Location");if(St(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Wb(o)){let c=r.slice(0,r.findIndex(u=>u.route.id===n)+1);o=tx(new URL(t.url),c,i,o),e.headers.set("Location",o)}return e}function RT(e,t,n){if(Wb(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=vi(i.pathname,n)!=null;if(i.origin===t.origin&&o)return i.pathname+i.search+i.hash}return e}function ic(e,t,n,r){let i=e.createURL(Ak(t)).toString(),o={signal:n};if(r&&Tr(r.formMethod)){let{formMethod:c,formEncType:u}=r;o.method=c.toUpperCase(),u==="application/json"?(o.headers=new Headers({"Content-Type":u}),o.body=JSON.stringify(r.json)):u==="text/plain"?o.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?o.body=ix(r.formData):o.body=r.formData}return new Request(i,o)}function ix(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function _T(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function jZ(e,t,n,r=!1,i=!1){let o={},c=null,u,f=!1,h={},m=n&&Hr(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let y=g.route.id,b=t[y];if(St(!Ms(b),"Cannot handle redirect results in processLoaderData"),Hr(b)){let S=b.error;if(m!==void 0&&(S=m,m=void 0),c=c||{},i)c[y]=S;else{let j=Rs(e,y);c[j.route.id]==null&&(c[j.route.id]=S)}r||(o[y]=Ck),f||(f=!0,u=ld(b.error)?b.error.status:500),b.headers&&(h[y]=b.headers)}else o[y]=b.data,b.statusCode&&b.statusCode!==200&&!f&&(u=b.statusCode),b.headers&&(h[y]=b.headers)}),m!==void 0&&n&&(c={[n[0]]:m},n[2]&&(o[n[2]]=void 0)),{loaderData:o,errors:c,statusCode:u||200,loaderHeaders:h}}function DT(e,t,n,r,i,o){let{loaderData:c,errors:u}=jZ(t,n,r);return i.filter(f=>!f.matches||f.matches.some(h=>h.shouldLoad)).forEach(f=>{let{key:h,match:m,controller:g}=f,y=o[h];if(St(y,"Did not find corresponding fetcher result"),!(g&&g.signal.aborted))if(Hr(y)){let b=Rs(e.matches,m==null?void 0:m.route.id);u&&u[b.route.id]||(u={...u,[b.route.id]:y.error}),e.fetchers.delete(h)}else if(Ms(y))St(!1,"Unhandled fetcher revalidation redirect");else{let b=Oo(y.data);e.fetchers.set(h,b)}}),{loaderData:c,errors:u}}function AT(e,t,n,r){let i=Object.entries(t).filter(([,o])=>o!==Ck).reduce((o,[c,u])=>(o[c]=u,o),{});for(let o of n){let c=o.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&o.route.loader&&(i[c]=e[c]),r&&r.hasOwnProperty(c))break}return i}function kT(e){return e?Hr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Rs(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 PT(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 di(e,{pathname:t,routeId:n,method:r,type:i,message:o}={}){let c="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&n?u=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i==="invalid-body"&&(u="Unable to encode submission body")):e===403?(c="Forbidden",u=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",u=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",r&&t&&n?u=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(u=`Invalid request method "${r.toUpperCase()}"`)),new ep(e||500,c,new Error(u),!0)}function lh(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(Ms(i))return{key:r,result:i}}}function Ak(e){let t=typeof e=="string"?io(e):e;return Go({...t,hash:""})}function CZ(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function EZ(e){return kk(e.result)&&lZ.has(e.result.status)}function Hr(e){return e.type==="error"}function Ms(e){return(e&&e.type)==="redirect"}function NT(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function kk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function TZ(e){return sZ.has(e.toUpperCase())}function Tr(e){return aZ.has(e.toUpperCase())}function Qb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function jh(e,t){let n=typeof t=="string"?io(t).search:t.search;if(e[e.length-1].route.index&&Qb(n||""))return e[e.length-1];let r=Sk(e);return r[r.length-1]}function OT(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:o,json:c}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:c,text:void 0}}}function fy(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 RZ(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 zu(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 _Z(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 Oo(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 DZ(e,t){try{let n=e.sessionStorage.getItem(jk);if(n){let r=JSON.parse(n);for(let[i,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(i,new Set(o||[]))}}catch{}}function AZ(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(jk,JSON.stringify(n))}catch(r){Mn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function kZ(){let e,t,n=new Promise((r,i)=>{e=async o=>{r(o);try{await n}catch{}},t=async o=>{i(o);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var sl=v.createContext(null);sl.displayName="DataRouter";var Od=v.createContext(null);Od.displayName="DataRouterState";v.createContext(!1);var Yb=v.createContext({isTransitioning:!1});Yb.displayName="ViewTransition";var Pk=v.createContext(new Map);Pk.displayName="Fetchers";var PZ=v.createContext(null);PZ.displayName="Await";var pa=v.createContext(null);pa.displayName="Navigation";var Md=v.createContext(null);Md.displayName="Location";var Ui=v.createContext({outlet:null,matches:[],isDataRoute:!1});Ui.displayName="Route";var Xb=v.createContext(null);Xb.displayName="RouteError";function NZ(e,{relative:t}={}){St(Ld(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=v.useContext(pa),{hash:i,pathname:o,search:c}=Id(e,{relative:t}),u=o;return n!=="/"&&(u=o==="/"?n:oa([n,o])),r.createHref({pathname:u,search:c,hash:i})}function Ld(){return v.useContext(Md)!=null}function Or(){return St(Ld(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Md).location}var Nk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ok(e){v.useContext(pa).static||v.useLayoutEffect(e)}function Sn(){let{isDataRoute:e}=v.useContext(Ui);return e?QZ():OZ()}function OZ(){St(Ld(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(sl),{basename:t,navigator:n}=v.useContext(pa),{matches:r}=v.useContext(Ui),{pathname:i}=Or(),o=JSON.stringify(qb(r)),c=v.useRef(!1);return Ok(()=>{c.current=!0}),v.useCallback((f,h={})=>{if(Mn(c.current,Nk),!c.current)return;if(typeof f=="number"){n.go(f);return}let m=Gb(f,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:oa([t,m.pathname])),(h.replace?n.replace:n.push)(m,h.state,h)},[t,n,o,i,e])}var MZ=v.createContext(null);function LZ(e){let t=v.useContext(Ui).outlet;return t&&v.createElement(MZ.Provider,{value:e},t)}function Ht(){let{matches:e}=v.useContext(Ui),t=e[e.length-1];return t?t.params:{}}function Id(e,{relative:t}={}){let{matches:n}=v.useContext(Ui),{pathname:r}=Or(),i=JSON.stringify(qb(n));return v.useMemo(()=>Gb(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function IZ(e,t){return Mk(e,t)}function Mk(e,t,n,r){var T;St(Ld(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=v.useContext(pa),{matches:o}=v.useContext(Ui),c=o[o.length-1],u=c?c.params:{},f=c?c.pathname:"/",h=c?c.pathnameBase:"/",m=c&&c.route;{let _=m&&m.path||"";Lk(f,!m||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${_}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
576
+
577
+ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let g=Or(),y;if(t){let _=typeof t=="string"?io(t):t;St(h==="/"||((T=_.pathname)==null?void 0:T.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${_.pathname}" was given in the \`location\` prop.`),y=_}else y=g;let b=y.pathname||"/",S=b;if(h!=="/"){let _=h.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(_.length).join("/")}let j=zo(e,{pathname:S});Mn(m||j!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),Mn(j==null||j[j.length-1].route.element!==void 0||j[j.length-1].route.Component!==void 0||j[j.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let C=VZ(j&&j.map(_=>Object.assign({},_,{params:Object.assign({},u,_.params),pathname:oa([h,i.encodeLocation?i.encodeLocation(_.pathname).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?h:oa([h,i.encodeLocation?i.encodeLocation(_.pathnameBase).pathname:_.pathnameBase])})),o,n,r);return t&&C?v.createElement(Md.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...y},navigationType:"POP"}},C):C}function $Z(){let e=WZ(),t=ld(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:o},"ErrorBoundary")," or"," ",v.createElement("code",{style:o},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:i},n):null,c)}var zZ=v.createElement($Z,null),UZ=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?v.createElement(Ui.Provider,{value:this.props.routeContext},v.createElement(Xb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function BZ({routeContext:e,match:t,children:n}){let r=v.useContext(sl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(Ui.Provider,{value:e},n)}function VZ(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,o=n==null?void 0:n.errors;if(o!=null){let f=i.findIndex(h=>h.route.id&&(o==null?void 0:o[h.route.id])!==void 0);St(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,f+1))}let c=!1,u=-1;if(n)for(let f=0;f<i.length;f++){let h=i[f];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=f),h.route.id){let{loaderData:m,errors:g}=n,y=h.route.loader&&!m.hasOwnProperty(h.route.id)&&(!g||g[h.route.id]===void 0);if(h.route.lazy||y){c=!0,u>=0?i=i.slice(0,u+1):i=[i[0]];break}}}return i.reduceRight((f,h,m)=>{let g,y=!1,b=null,S=null;n&&(g=o&&h.route.id?o[h.route.id]:void 0,b=h.route.errorElement||zZ,c&&(u<0&&m===0?(Lk("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,S=null):u===m&&(y=!0,S=h.route.hydrateFallbackElement||null)));let j=t.concat(i.slice(0,m+1)),C=()=>{let T;return g?T=b:y?T=S:h.route.Component?T=v.createElement(h.route.Component,null):h.route.element?T=h.route.element:T=f,v.createElement(BZ,{match:h,routeContext:{outlet:f,matches:j,isDataRoute:n!=null},children:T})};return n&&(h.route.ErrorBoundary||h.route.errorElement||m===0)?v.createElement(UZ,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:C(),routeContext:{outlet:null,matches:j,isDataRoute:!0}}):C()},null)}function Kb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function FZ(e){let t=v.useContext(sl);return St(t,Kb(e)),t}function HZ(e){let t=v.useContext(Od);return St(t,Kb(e)),t}function qZ(e){let t=v.useContext(Ui);return St(t,Kb(e)),t}function Zb(e){let t=qZ(e),n=t.matches[t.matches.length-1];return St(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function GZ(){return Zb("useRouteId")}function WZ(){var r;let e=v.useContext(Xb),t=HZ("useRouteError"),n=Zb("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function QZ(){let{router:e}=FZ("useNavigate"),t=Zb("useNavigate"),n=v.useRef(!1);return Ok(()=>{n.current=!0}),v.useCallback(async(i,o={})=>{Mn(n.current,Nk),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...o}))},[e,t])}var MT={};function Lk(e,t,n){!t&&!MT[e]&&(MT[e]=!0,Mn(!1,n))}var LT={};function IT(e,t){!e&&!LT[t]&&(LT[t]=!0,console.warn(t))}function YZ(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Mn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:v.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Mn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Mn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var XZ=["HydrateFallback","hydrateFallbackElement"],KZ=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function ZZ({router:e,flushSync:t}){let[n,r]=v.useState(e.state),[i,o]=v.useState(),[c,u]=v.useState({isTransitioning:!1}),[f,h]=v.useState(),[m,g]=v.useState(),[y,b]=v.useState(),S=v.useRef(new Map),j=v.useCallback((E,{deletedFetchers:R,flushSync:D,viewTransitionOpts:k})=>{E.fetchers.forEach((L,z)=>{L.data!==void 0&&S.current.set(z,L.data)}),R.forEach(L=>S.current.delete(L)),IT(D===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let M=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(IT(k==null||M,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!k||!M){t&&D?t(()=>r(E)):v.startTransition(()=>r(E));return}if(t&&D){t(()=>{m&&(f&&f.resolve(),m.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:k.currentLocation,nextLocation:k.nextLocation})});let L=e.window.document.startViewTransition(()=>{t(()=>r(E))});L.finished.finally(()=>{t(()=>{h(void 0),g(void 0),o(void 0),u({isTransitioning:!1})})}),t(()=>g(L));return}m?(f&&f.resolve(),m.skipTransition(),b({state:E,currentLocation:k.currentLocation,nextLocation:k.nextLocation})):(o(E),u({isTransitioning:!0,flushSync:!1,currentLocation:k.currentLocation,nextLocation:k.nextLocation}))},[e.window,t,m,f]);v.useLayoutEffect(()=>e.subscribe(j),[e,j]),v.useEffect(()=>{c.isTransitioning&&!c.flushSync&&h(new KZ)},[c]),v.useEffect(()=>{if(f&&i&&e.window){let E=i,R=f.promise,D=e.window.document.startViewTransition(async()=>{v.startTransition(()=>r(E)),await R});D.finished.finally(()=>{h(void 0),g(void 0),o(void 0),u({isTransitioning:!1})}),g(D)}},[i,f,e.window]),v.useEffect(()=>{f&&i&&n.location.key===i.location.key&&f.resolve()},[f,m,n.location,i]),v.useEffect(()=>{!c.isTransitioning&&y&&(o(y.state),u({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}),b(void 0))},[c.isTransitioning,y]);let C=v.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:E=>e.navigate(E),push:(E,R,D)=>e.navigate(E,{state:R,preventScrollReset:D==null?void 0:D.preventScrollReset}),replace:(E,R,D)=>e.navigate(E,{replace:!0,state:R,preventScrollReset:D==null?void 0:D.preventScrollReset})}),[e]),T=e.basename||"/",_=v.useMemo(()=>({router:e,navigator:C,static:!1,basename:T}),[e,C,T]);return v.createElement(v.Fragment,null,v.createElement(sl.Provider,{value:_},v.createElement(Od.Provider,{value:n},v.createElement(Pk.Provider,{value:S.current},v.createElement(Yb.Provider,{value:c},v.createElement(tJ,{basename:T,location:n.location,navigationType:n.historyAction,navigator:C},v.createElement(JZ,{routes:e.routes,future:e.future,state:n})))))),null)}var JZ=v.memo(eJ);function eJ({routes:e,future:t,state:n}){return Mk(e,void 0,n,t)}function Jb(e){return LZ(e.context)}function Ve(e){St(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function tJ({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:o=!1}){St(!Ld(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=v.useMemo(()=>({basename:c,navigator:i,static:o,future:{}}),[c,i,o]);typeof n=="string"&&(n=io(n));let{pathname:f="/",search:h="",hash:m="",state:g=null,key:y="default"}=n,b=v.useMemo(()=>{let S=vi(f,c);return S==null?null:{location:{pathname:S,search:h,hash:m,state:g,key:y},navigationType:r}},[c,f,h,m,g,y,r]);return Mn(b!=null,`<Router basename="${c}"> is not able to match the URL "${f}${h}${m}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:v.createElement(pa.Provider,{value:u},v.createElement(Md.Provider,{children:t,value:b}))}function nJ({children:e,location:t}){return IZ(ax(e),t)}function ax(e,t=[]){let n=[];return v.Children.forEach(e,(r,i)=>{if(!v.isValidElement(r))return;let o=[...t,i];if(r.type===v.Fragment){n.push.apply(n,ax(r.props.children,o));return}St(r.type===Ve,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),St(!r.props.index||!r.props.children,"An index route cannot have child routes.");let c={id:r.props.id||o.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,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(c.children=ax(r.props.children,o)),n.push(c)}),n}var Ch="get",Eh="application/x-www-form-urlencoded";function gm(e){return e!=null&&typeof e.tagName=="string"}function rJ(e){return gm(e)&&e.tagName.toLowerCase()==="button"}function iJ(e){return gm(e)&&e.tagName.toLowerCase()==="form"}function aJ(e){return gm(e)&&e.tagName.toLowerCase()==="input"}function oJ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function sJ(e,t){return e.button===0&&(!t||t==="_self")&&!oJ(e)}function ox(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function lJ(e,t){let n=ox(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}var ch=null;function cJ(){if(ch===null)try{new FormData(document.createElement("form"),0),ch=!1}catch{ch=!0}return ch}var uJ=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function hy(e){return e!=null&&!uJ.has(e)?(Mn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Eh}"`),null):e}function dJ(e,t){let n,r,i,o,c;if(iJ(e)){let u=e.getAttribute("action");r=u?vi(u,t):null,n=e.getAttribute("method")||Ch,i=hy(e.getAttribute("enctype"))||Eh,o=new FormData(e)}else if(rJ(e)||aJ(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||u.getAttribute("action");if(r=f?vi(f,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Ch,i=hy(e.getAttribute("formenctype"))||hy(u.getAttribute("enctype"))||Eh,o=new FormData(u,e),!cJ()){let{name:h,type:m,value:g}=e;if(m==="image"){let y=h?`${h}.`:"";o.append(`${y}x`,"0"),o.append(`${y}y`,"0")}else h&&o.append(h,g)}}else{if(gm(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ch,r=null,i=Eh,c=e}return o&&i==="text/plain"&&(c=o,o=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:o,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function e1(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function fJ(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&vi(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function hJ(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function pJ(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function mJ(e,t,n){let r=await Promise.all(e.map(async i=>{let o=t.routes[i.route.id];if(o){let c=await hJ(o,n);return c.links?c.links():[]}return[]}));return xJ(r.flat(1).filter(pJ).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function $T(e,t,n,r,i,o){let c=(f,h)=>n[h]?f.route.id!==n[h].route.id:!0,u=(f,h)=>{var m;return n[h].pathname!==f.pathname||((m=n[h].route.path)==null?void 0:m.endsWith("*"))&&n[h].params["*"]!==f.params["*"]};return o==="assets"?t.filter((f,h)=>c(f,h)||u(f,h)):o==="data"?t.filter((f,h)=>{var g;let m=r.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(c(f,h)||u(f,h))return!0;if(f.route.shouldRevalidate){let y=f.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function gJ(e,t,{includeHydrateFallback:n}={}){return vJ(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let o=[i.module];return i.clientActionModule&&(o=o.concat(i.clientActionModule)),i.clientLoaderModule&&(o=o.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(o=o.concat(i.hydrateFallbackModule)),i.imports&&(o=o.concat(i.imports)),o}).flat(1))}function vJ(e){return[...new Set(e)]}function yJ(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function xJ(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let o=JSON.stringify(yJ(i));return n.has(o)||(n.add(o),r.push({key:o,link:i})),r},[])}function Ik(){let e=v.useContext(sl);return e1(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function bJ(){let e=v.useContext(Od);return e1(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var t1=v.createContext(void 0);t1.displayName="FrameworkContext";function $k(){let e=v.useContext(t1);return e1(e,"You must render this element inside a <HydratedRouter> element"),e}function SJ(e,t){let n=v.useContext(t1),[r,i]=v.useState(!1),[o,c]=v.useState(!1),{onFocus:u,onBlur:f,onMouseEnter:h,onMouseLeave:m,onTouchStart:g}=t,y=v.useRef(null);v.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=T=>{T.forEach(_=>{c(_.isIntersecting)})},C=new IntersectionObserver(j,{threshold:.5});return y.current&&C.observe(y.current),()=>{C.disconnect()}}},[e]),v.useEffect(()=>{if(r){let j=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(j)}}},[r]);let b=()=>{i(!0)},S=()=>{i(!1),c(!1)};return n?e!=="intent"?[o,y,{}]:[o,y,{onFocus:Uu(u,b),onBlur:Uu(f,S),onMouseEnter:Uu(h,b),onMouseLeave:Uu(m,S),onTouchStart:Uu(g,b)}]:[!1,y,{}]}function Uu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function wJ({page:e,...t}){let{router:n}=Ik(),r=v.useMemo(()=>zo(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(CJ,{page:e,matches:r,...t}):null}function jJ(e){let{manifest:t,routeModules:n}=$k(),[r,i]=v.useState([]);return v.useEffect(()=>{let o=!1;return mJ(e,t,n).then(c=>{o||i(c)}),()=>{o=!0}},[e,t,n]),r}function CJ({page:e,matches:t,...n}){let r=Or(),{manifest:i,routeModules:o}=$k(),{basename:c}=Ik(),{loaderData:u,matches:f}=bJ(),h=v.useMemo(()=>$T(e,t,f,i,r,"data"),[e,t,f,i,r]),m=v.useMemo(()=>$T(e,t,f,i,r,"assets"),[e,t,f,i,r]),g=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let S=new Set,j=!1;if(t.forEach(T=>{var E;let _=i.routes[T.route.id];!_||!_.hasLoader||(!h.some(R=>R.route.id===T.route.id)&&T.route.id in u&&((E=o[T.route.id])!=null&&E.shouldRevalidate)||_.hasClientLoader?j=!0:S.add(T.route.id))}),S.size===0)return[];let C=fJ(e,c,"data");return j&&S.size>0&&C.searchParams.set("_routes",t.filter(T=>S.has(T.route.id)).map(T=>T.route.id).join(",")),[C.pathname+C.search]},[c,u,r,i,h,t,e,o]),y=v.useMemo(()=>gJ(m,i),[m,i]),b=jJ(m);return v.createElement(v.Fragment,null,g.map(S=>v.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),y.map(S=>v.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),b.map(({key:S,link:j})=>v.createElement("link",{key:S,...j})))}function EJ(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var zk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{zk&&(window.__reactRouterVersion="7.7.1")}catch{}function TJ(e,t){return hZ({basename:t==null?void 0:t.basename,unstable_getContext:t==null?void 0:t.unstable_getContext,future:t==null?void 0:t.future,history:PK({window:t==null?void 0:t.window}),hydrationData:RJ(),routes:e,mapRouteProperties:YZ,hydrationRouteProperties:XZ,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function RJ(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:_J(e.errors)}),e}function _J(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new ep(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let o=window[i.__subType];if(typeof o=="function")try{let c=new o(i.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let o=new Error(i.message);o.stack="",n[r]=o}}else n[r]=i;return n}var Uk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Bk=v.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:o,replace:c,state:u,target:f,to:h,preventScrollReset:m,viewTransition:g,...y},b){let{basename:S}=v.useContext(pa),j=typeof h=="string"&&Uk.test(h),C,T=!1;if(typeof h=="string"&&j&&(C=h,zk))try{let z=new URL(window.location.href),F=h.startsWith("//")?new URL(z.protocol+h):new URL(h),Y=vi(F.pathname,S);F.origin===z.origin&&Y!=null?h=Y+F.search+F.hash:T=!0}catch{Mn(!1,`<Link to="${h}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let _=NZ(h,{relative:i}),[E,R,D]=SJ(r,y),k=PJ(h,{replace:c,state:u,target:f,preventScrollReset:m,relative:i,viewTransition:g});function M(z){t&&t(z),z.defaultPrevented||k(z)}let L=v.createElement("a",{...y,...D,href:C||_,onClick:T||o?t:M,ref:EJ(b,R),target:f,"data-discover":!j&&n==="render"?"true":void 0});return E&&!j?v.createElement(v.Fragment,null,L,v.createElement(wJ,{page:_})):L});Bk.displayName="Link";var DJ=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:o,to:c,viewTransition:u,children:f,...h},m){let g=Id(c,{relative:h.relative}),y=Or(),b=v.useContext(Od),{navigator:S,basename:j}=v.useContext(pa),C=b!=null&&IJ(g)&&u===!0,T=S.encodeLocation?S.encodeLocation(g).pathname:g.pathname,_=y.pathname,E=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(_=_.toLowerCase(),E=E?E.toLowerCase():null,T=T.toLowerCase()),E&&j&&(E=vi(E,j)||E);const R=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let D=_===T||!i&&_.startsWith(T)&&_.charAt(R)==="/",k=E!=null&&(E===T||!i&&E.startsWith(T)&&E.charAt(T.length)==="/"),M={isActive:D,isPending:k,isTransitioning:C},L=D?t:void 0,z;typeof r=="function"?z=r(M):z=[r,D?"active":null,k?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let F=typeof o=="function"?o(M):o;return v.createElement(Bk,{...h,"aria-current":L,className:z,ref:m,style:F,to:c,viewTransition:u},typeof f=="function"?f(M):f)});DJ.displayName="NavLink";var AJ=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:o,method:c=Ch,action:u,onSubmit:f,relative:h,preventScrollReset:m,viewTransition:g,...y},b)=>{let S=MJ(),j=LJ(u,{relative:h}),C=c.toLowerCase()==="get"?"get":"post",T=typeof u=="string"&&Uk.test(u),_=E=>{if(f&&f(E),E.defaultPrevented)return;E.preventDefault();let R=E.nativeEvent.submitter,D=(R==null?void 0:R.getAttribute("formmethod"))||c;S(R||E.currentTarget,{fetcherKey:t,method:D,navigate:n,replace:i,state:o,relative:h,preventScrollReset:m,viewTransition:g})};return v.createElement("form",{ref:b,method:C,action:j,onSubmit:r?f:_,...y,"data-discover":!T&&e==="render"?"true":void 0})});AJ.displayName="Form";function kJ(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Vk(e){let t=v.useContext(sl);return St(t,kJ(e)),t}function PJ(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:o,viewTransition:c}={}){let u=Sn(),f=Or(),h=Id(e,{relative:o});return v.useCallback(m=>{if(sJ(m,t)){m.preventDefault();let g=n!==void 0?n:Go(f)===Go(h);u(e,{replace:g,state:r,preventScrollReset:i,relative:o,viewTransition:c})}},[f,u,h,n,r,t,e,i,o,c])}function n1(e){Mn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=v.useRef(ox(e)),n=v.useRef(!1),r=Or(),i=v.useMemo(()=>lJ(r.search,n.current?null:t.current),[r.search]),o=Sn(),c=v.useCallback((u,f)=>{const h=ox(typeof u=="function"?u(new URLSearchParams(i)):u);n.current=!0,o("?"+h,f)},[o,i]);return[i,c]}var NJ=0,OJ=()=>`__${String(++NJ)}__`;function MJ(){let{router:e}=Vk("useSubmit"),{basename:t}=v.useContext(pa),n=GZ();return v.useCallback(async(r,i={})=>{let{action:o,method:c,encType:u,formData:f,body:h}=dJ(r,t);if(i.navigate===!1){let m=i.fetcherKey||OJ();await e.fetch(m,n,i.action||o,{preventScrollReset:i.preventScrollReset,formData:f,body:h,formMethod:i.method||c,formEncType:i.encType||u,flushSync:i.flushSync})}else await e.navigate(i.action||o,{preventScrollReset:i.preventScrollReset,formData:f,body:h,formMethod:i.method||c,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[e,t,n])}function LJ(e,{relative:t}={}){let{basename:n}=v.useContext(pa),r=v.useContext(Ui);St(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),o={...Id(e||".",{relative:t})},c=Or();if(e==null){o.search=c.search;let u=new URLSearchParams(o.search),f=u.getAll("index");if(f.some(m=>m==="")){u.delete("index"),f.filter(g=>g).forEach(g=>u.append("index",g));let m=u.toString();o.search=m?`?${m}`:""}}return(!e||e===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:oa([n,o.pathname])),Go(o)}function IJ(e,{relative:t}={}){let n=v.useContext(Yb);St(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Vk("useViewTransitionState"),i=Id(e,{relative:t});if(!n.isTransitioning)return!1;let o=vi(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=vi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Jh(i.pathname,c)!=null||Jh(i.pathname,o)!=null}const $J=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 wc(e,t,n){const r=zJ(e),{webkitRelativePath:i}=e,o=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&zT(r,"path",o),zT(r,"relativePath",o),r}function zJ(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=$J.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function zT(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var ll=(e,t,n)=>new Promise((r,i)=>{var o=f=>{try{u(n.next(f))}catch(h){i(h)}},c=f=>{try{u(n.throw(f))}catch(h){i(h)}},u=f=>f.done?r(f.value):Promise.resolve(f.value).then(o,c);u((n=n.apply(e,t)).next())});const UJ=[".DS_Store","Thumbs.db"];function BJ(e){return ll(this,null,function*(){return np(e)&&VJ(e.dataTransfer)?GJ(e.dataTransfer,e.type):FJ(e)?HJ(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?qJ(e):[]})}function VJ(e){return np(e)}function FJ(e){return np(e)&&np(e.target)}function np(e){return typeof e=="object"&&e!==null}function HJ(e){return sx(e.target.files).map(t=>wc(t))}function qJ(e){return ll(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>wc(n))})}function GJ(e,t){return ll(this,null,function*(){if(e.items){const n=sx(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(WJ));return UT(Fk(r))}return UT(sx(e.files).map(n=>wc(n)))})}function UT(e){return e.filter(t=>UJ.indexOf(t.name)===-1)}function sx(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 WJ(e){if(typeof e.webkitGetAsEntry!="function")return BT(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?Hk(t):BT(e,t)}function Fk(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?Fk(n):[n]],[])}function BT(e,t){var n;if(typeof e.getAsFileSystemHandle=="function")return e.getAsFileSystemHandle().then(o=>ll(this,null,function*(){const c=yield o.getFile();return c.handle=o,wc(c)}));const r=e.getAsFile();if(!r)return Promise.reject(`${e} is not a File`);const i=wc(r,(n=t==null?void 0:t.fullPath)!=null?n:void 0);return Promise.resolve(i)}function QJ(e){return ll(this,null,function*(){return e.isDirectory?Hk(e):YJ(e)})}function Hk(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function o(){t.readEntries(c=>ll(this,null,function*(){if(c.length){const u=Promise.all(c.map(QJ));i.push(u),o()}else try{const u=yield Promise.all(i);n(u)}catch(u){r(u)}}),c=>{r(c)})}o()})}function YJ(e){return ll(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const i=wc(r,e.fullPath);t(i)},r=>{n(r)})})})}function py(e,t){if(e&&t){const n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;const r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(c=>{const u=c.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?o===u.replace(/\/.*$/,""):i===u})}return!0}var XJ=Object.defineProperty,KJ=Object.defineProperties,ZJ=Object.getOwnPropertyDescriptors,VT=Object.getOwnPropertySymbols,JJ=Object.prototype.hasOwnProperty,eee=Object.prototype.propertyIsEnumerable,FT=(e,t,n)=>t in e?XJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tee=(e,t)=>{for(var n in t||(t={}))JJ.call(t,n)&&FT(e,n,t[n]);if(VT)for(var n of VT(t))eee.call(t,n)&&FT(e,n,t[n]);return e},nee=(e,t)=>KJ(e,ZJ(t));const ree=typeof py=="function"?py:py.default,iee="file-invalid-type",aee="file-too-large",oee="file-too-small",see="too-many-files",lee=(e="")=>{const t=e.split(","),n=t.length>1?`one of ${t.join(", ")}`:t[0];return{code:iee,message:`File type must be ${n}`}},HT=e=>({code:aee,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),qT=e=>({code:oee,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),cee={code:see,message:"Too many files"};function qk(e,t){const n=e.type==="application/x-moz-file"||ree(e,t);return[n,n?null:lee(t)]}function Gk(e,t,n){if(_s(e.size))if(_s(t)&&_s(n)){if(e.size>n)return[!1,HT(n)];if(e.size<t)return[!1,qT(t)]}else{if(_s(t)&&e.size<t)return[!1,qT(t)];if(_s(n)&&e.size>n)return[!1,HT(n)]}return[!0,null]}function _s(e){return e!=null}function uee({files:e,accept:t,minSize:n,maxSize:r,multiple:i,maxFiles:o,validator:c}){return!i&&e.length>1||i&&o>=1&&e.length>o?!1:e.every(u=>{const[f]=qk(u,t),[h]=Gk(u,n,r),m=c?c(u):null;return f&&h&&!m})}function rp(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function uh(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 GT(e){e.preventDefault()}function dee(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function fee(e){return e.indexOf("Edge/")!==-1}function hee(e=window.navigator.userAgent){return dee(e)||fee(e)}function Xi(...e){return(t,...n)=>e.some(r=>(!rp(t)&&r&&r(t,...n),rp(t)))}function pee(){return"showOpenFilePicker"in window}function mee(e){return _s(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let i=!0;return Wk(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.`),i=!1),(!Array.isArray(r)||!r.every(Qk))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),i=!1),i}).reduce((n,[r,i])=>nee(tee({},n),{[r]:i}),{})}]:e}function gee(e){if(_s(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>Wk(t)||Qk(t)).join(",")}function vee(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function yee(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Wk(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function Qk(e){return/^.*\.[\w]+$/.test(e)}var xee=Object.defineProperty,bee=Object.defineProperties,See=Object.getOwnPropertyDescriptors,ip=Object.getOwnPropertySymbols,Yk=Object.prototype.hasOwnProperty,Xk=Object.prototype.propertyIsEnumerable,WT=(e,t,n)=>t in e?xee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pr=(e,t)=>{for(var n in t||(t={}))Yk.call(t,n)&&WT(e,n,t[n]);if(ip)for(var n of ip(t))Xk.call(t,n)&&WT(e,n,t[n]);return e},Io=(e,t)=>bee(e,See(t)),ap=(e,t)=>{var n={};for(var r in e)Yk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ip)for(var r of ip(e))t.indexOf(r)<0&&Xk.call(e,r)&&(n[r]=e[r]);return n};const r1=v.forwardRef((e,t)=>{var n=e,{children:r}=n,i=ap(n,["children"]);const o=Zk(i),{open:c}=o,u=ap(o,["open"]);return v.useImperativeHandle(t,()=>({open:c}),[c]),En.createElement(v.Fragment,null,r(Io(pr({},u),{open:c})))});r1.displayName="Dropzone";const Kk={disabled:!1,getFilesFromEvent:BJ,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};r1.defaultProps=Kk;r1.propTypes={children:an.func,accept:an.objectOf(an.arrayOf(an.string)),multiple:an.bool,preventDropOnDocument:an.bool,noClick:an.bool,noKeyboard:an.bool,noDrag:an.bool,noDragEventsBubbling:an.bool,minSize:an.number,maxSize:an.number,maxFiles:an.number,disabled:an.bool,getFilesFromEvent:an.func,onFileDialogCancel:an.func,onFileDialogOpen:an.func,useFsAccessApi:an.bool,autoFocus:an.bool,onDragEnter:an.func,onDragLeave:an.func,onDragOver:an.func,onDrop:an.func,onDropAccepted:an.func,onDropRejected:an.func,onError:an.func,validator:an.func};const lx={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Zk(e={}){const{accept:t,disabled:n,getFilesFromEvent:r,maxSize:i,minSize:o,multiple:c,maxFiles:u,onDragEnter:f,onDragLeave:h,onDragOver:m,onDrop:g,onDropAccepted:y,onDropRejected:b,onFileDialogCancel:S,onFileDialogOpen:j,useFsAccessApi:C,autoFocus:T,preventDropOnDocument:_,noClick:E,noKeyboard:R,noDrag:D,noDragEventsBubbling:k,onError:M,validator:L}=pr(pr({},Kk),e),z=v.useMemo(()=>gee(t),[t]),F=v.useMemo(()=>mee(t),[t]),Y=v.useMemo(()=>typeof j=="function"?j:QT,[j]),W=v.useMemo(()=>typeof S=="function"?S:QT,[S]),J=v.useRef(null),G=v.useRef(null),[X,P]=v.useReducer(wee,lx),{isFocused:I,isFileDialogActive:$}=X,H=v.useRef(typeof window<"u"&&window.isSecureContext&&C&&pee()),O=()=>{!H.current&&$&&setTimeout(()=>{if(G.current){const{files:me}=G.current;me.length||(P({type:"closeDialog"}),W())}},300)};v.useEffect(()=>(window.addEventListener("focus",O,!1),()=>{window.removeEventListener("focus",O,!1)}),[G,$,W,H]);const U=v.useRef([]),K=me=>{J.current&&J.current.contains(me.target)||(me.preventDefault(),U.current=[])};v.useEffect(()=>(_&&(document.addEventListener("dragover",GT,!1),document.addEventListener("drop",K,!1)),()=>{_&&(document.removeEventListener("dragover",GT),document.removeEventListener("drop",K))}),[J,_]),v.useEffect(()=>(!n&&T&&J.current&&J.current.focus(),()=>{}),[J,T,n]);const ee=v.useCallback(me=>{M?M(me):console.error(me)},[M]),Se=v.useCallback(me=>{me.preventDefault(),me.persist(),Te(me),U.current=[...U.current,me.target],uh(me)&&Promise.resolve(r(me)).then(ge=>{if(rp(me)&&!k)return;const Ne=ge.length,we=Ne>0&&uee({files:ge,accept:z,minSize:o,maxSize:i,multiple:c,maxFiles:u,validator:L}),ze=Ne>0&&!we;P({isDragAccept:we,isDragReject:ze,isDragActive:!0,type:"setDraggedFiles"}),f&&f(me)}).catch(ge=>ee(ge))},[r,f,ee,k,z,o,i,c,u,L]),be=v.useCallback(me=>{me.preventDefault(),me.persist(),Te(me);const ge=uh(me);if(ge&&me.dataTransfer)try{me.dataTransfer.dropEffect="copy"}catch{}return ge&&m&&m(me),!1},[m,k]),xe=v.useCallback(me=>{me.preventDefault(),me.persist(),Te(me);const ge=U.current.filter(we=>J.current&&J.current.contains(we)),Ne=ge.indexOf(me.target);Ne!==-1&&ge.splice(Ne,1),U.current=ge,!(ge.length>0)&&(P({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),uh(me)&&h&&h(me))},[J,h,k]),Ge=v.useCallback((me,ge)=>{const Ne=[],we=[];me.forEach(ze=>{const[xt,ht]=qk(ze,z),[qt,kt]=Gk(ze,o,i),cn=L?L(ze):null;if(xt&&qt&&!cn)Ne.push(ze);else{let Ct=[ht,kt];cn&&(Ct=Ct.concat(cn)),we.push({file:ze,errors:Ct.filter(Bi=>Bi)})}}),(!c&&Ne.length>1||c&&u>=1&&Ne.length>u)&&(Ne.forEach(ze=>{we.push({file:ze,errors:[cee]})}),Ne.splice(0)),P({acceptedFiles:Ne,fileRejections:we,isDragReject:we.length>0,type:"setFiles"}),g&&g(Ne,we,ge),we.length>0&&b&&b(we,ge),Ne.length>0&&y&&y(Ne,ge)},[P,c,z,o,i,u,g,y,b,L]),Me=v.useCallback(me=>{me.preventDefault(),me.persist(),Te(me),U.current=[],uh(me)&&Promise.resolve(r(me)).then(ge=>{rp(me)&&!k||Ge(ge,me)}).catch(ge=>ee(ge)),P({type:"reset"})},[r,Ge,ee,k]),nt=v.useCallback(()=>{if(H.current){P({type:"openDialog"}),Y();const me={multiple:c,types:F};window.showOpenFilePicker(me).then(ge=>r(ge)).then(ge=>{Ge(ge,null),P({type:"closeDialog"})}).catch(ge=>{vee(ge)?(W(ge),P({type:"closeDialog"})):yee(ge)?(H.current=!1,G.current?(G.current.value=null,G.current.click()):ee(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."))):ee(ge)});return}G.current&&(P({type:"openDialog"}),Y(),G.current.value=null,G.current.click())},[P,Y,W,C,Ge,ee,F,c]),ke=v.useCallback(me=>{!J.current||!J.current.isEqualNode(me.target)||(me.key===" "||me.key==="Enter"||me.keyCode===32||me.keyCode===13)&&(me.preventDefault(),nt())},[J,nt]),yt=v.useCallback(()=>{P({type:"focus"})},[]),It=v.useCallback(()=>{P({type:"blur"})},[]),$t=v.useCallback(()=>{E||(hee()?setTimeout(nt,0):nt())},[E,nt]),vt=me=>n?null:me,At=me=>R?null:vt(me),nn=me=>D?null:vt(me),Te=me=>{k&&me.stopPropagation()},De=v.useMemo(()=>(me={})=>{var ge=me,{refKey:Ne="ref",role:we,onKeyDown:ze,onFocus:xt,onBlur:ht,onClick:qt,onDragEnter:kt,onDragOver:cn,onDragLeave:Ct,onDrop:Bi}=ge,Si=ap(ge,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return pr(pr({onKeyDown:At(Xi(ze,ke)),onFocus:At(Xi(xt,yt)),onBlur:At(Xi(ht,It)),onClick:vt(Xi(qt,$t)),onDragEnter:nn(Xi(kt,Se)),onDragOver:nn(Xi(cn,be)),onDragLeave:nn(Xi(Ct,xe)),onDrop:nn(Xi(Bi,Me)),role:typeof we=="string"&&we!==""?we:"presentation",[Ne]:J},!n&&!R?{tabIndex:0}:{}),Si)},[J,ke,yt,It,$t,Se,be,xe,Me,R,D,n]),Qe=v.useCallback(me=>{me.stopPropagation()},[]),Re=v.useMemo(()=>(me={})=>{var ge=me,{refKey:Ne="ref",onChange:we,onClick:ze}=ge,xt=ap(ge,["refKey","onChange","onClick"]);const ht={accept:z,multiple:c,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:vt(Xi(we,Me)),onClick:vt(Xi(ze,Qe)),tabIndex:-1,[Ne]:G};return pr(pr({},ht),xt)},[G,t,c,Me,n]);return Io(pr({},X),{isFocused:I&&!n,getRootProps:De,getInputProps:Re,rootRef:J,inputRef:G,open:vt(nt)})}function wee(e,t){switch(t.type){case"focus":return Io(pr({},e),{isFocused:!0});case"blur":return Io(pr({},e),{isFocused:!1});case"openDialog":return Io(pr({},lx),{isFileDialogActive:!0});case"closeDialog":return Io(pr({},e),{isFileDialogActive:!1});case"setDraggedFiles":return Io(pr({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Io(pr({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return pr({},lx);default:return e}}function QT(){}const[jee,Cee]=vr("Dropzone component was not found in tree");function i1(e){const t=n=>{const{children:r,...i}=se(`Dropzone${Yj(e)}`,{},n),o=Cee(),c=Ga(r)?r:s.jsx("span",{children:r});return o[e]?v.cloneElement(c,i):null};return t.displayName=`@mantine/dropzone/${Yj(e)}`,t}const Eee=i1("accept"),Tee=i1("reject"),Ree=i1("idle");var cd={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const _ee={loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},Dee=(e,{radius:t,variant:n,acceptColor:r,rejectColor:i})=>{const o=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),c=e.variantColorResolver({color:i||"red",theme:e,variant:n});return{root:{"--dropzone-radius":Bt(t),"--dropzone-accept-color":o.color,"--dropzone-accept-bg":o.background,"--dropzone-reject-color":c.color,"--dropzone-reject-bg":c.background}}},Jo=ve((e,t)=>{const n=se("Dropzone",_ee,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,radius:h,disabled:m,loading:g,multiple:y,maxSize:b,accept:S,children:j,onDropAny:C,onDrop:T,onReject:_,openRef:E,name:R,maxFiles:D,autoFocus:k,activateOnClick:M,activateOnDrag:L,dragEventsBubbling:z,activateOnKeyboard:F,onDragEnter:Y,onDragLeave:W,onDragOver:J,onFileDialogCancel:G,onFileDialogOpen:X,preventDropOnDocument:P,useFsAccessApi:I,getFilesFromEvent:$,validator:H,rejectColor:O,acceptColor:U,enablePointerEvents:K,loaderProps:ee,inputProps:Se,mod:be,...xe}=n,Ge=Le({name:"Dropzone",classes:cd,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:Dee}),{getRootProps:Me,getInputProps:nt,isDragAccept:ke,isDragReject:yt,isDragActive:It,open:$t}=Zk({onDrop:C,onDropAccepted:T,onDropRejected:_,disabled:m||g,accept:Array.isArray(S)?S.reduce((Te,De)=>({...Te,[De]:[]}),{}):S,multiple:y,maxSize:b,maxFiles:D,autoFocus:k,noClick:!M,noDrag:!L,noDragEventsBubbling:!z,noKeyboard:!F,onDragEnter:Y,onDragLeave:W,onDragOver:J,onFileDialogCancel:G,onFileDialogOpen:X,preventDropOnDocument:P,useFsAccessApi:I,validator:H,...$?{getFilesFromEvent:$}:null});Qu(E,$t);const vt=It&&ke,At=It&&yt,nn=!vt&&!At;return s.jsx(jee,{value:{accept:vt,reject:At,idle:nn},children:s.jsxs(ce,{...Me(),...Ge("root",{focusable:!0}),...xe,mod:[{accept:vt,reject:At,idle:nn,disabled:m,loading:g,"activate-on-click":M},be],children:[s.jsx(Rp,{visible:g,overlayProps:{radius:h},unstyled:u,loaderProps:ee}),s.jsx("input",{...nt(Se),name:R}),s.jsx("div",{...Ge("inner"),ref:t,"data-enable-pointer-events":K||void 0,children:j})]})})});Jo.classes=cd;Jo.displayName="@mantine/dropzone/Dropzone";Jo.Accept=Eee;Jo.Idle=Ree;Jo.Reject=Tee;const Aee={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Qr("max"),withinPortal:!0},a1=ve((e,t)=>{const n=se("DropzoneFullScreen",Aee,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,active:h,onDrop:m,onReject:g,zIndex:y,withinPortal:b,portalProps:S,...j}=n,C=Le({name:"DropzoneFullScreen",classes:cd,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"fullScreen"}),{resolvedClassNames:T,resolvedStyles:_}=Ks({classNames:r,styles:c,props:n}),[E,R]=v.useState(0),[D,{open:k,close:M}]=lp(!1),L=F=>{var Y;(Y=F.dataTransfer)!=null&&Y.types.includes("Files")&&(R(W=>W+1),k())},z=()=>{R(F=>F-1)};return v.useEffect(()=>{E===0&&M()},[E]),v.useEffect(()=>{if(h)return document.addEventListener("dragenter",L,!1),document.addEventListener("dragleave",z,!1),()=>{document.removeEventListener("dragenter",L,!1),document.removeEventListener("dragleave",z,!1)}},[h]),s.jsx(Qo,{...S,withinPortal:b,children:s.jsx(ce,{...C("fullScreen",{style:{opacity:D?1:0,pointerEvents:D?"all":"none",zIndex:y}}),ref:t,children:s.jsx(Jo,{...j,classNames:T,styles:_,unstyled:u,className:cd.dropzone,onDrop:F=>{m==null||m(F),M(),R(0)},onReject:F=>{g==null||g(F),M(),R(0)}})})})});a1.classes=cd;a1.displayName="@mantine/dropzone/DropzoneFullScreen";Jo.FullScreen=a1;const dh=Jo,kee='{"resourceType": "Bundle"}';function my({id:e,title:t,message:n,color:r,icon:i,withCloseButton:o=!1,method:c="show",loading:u}){fi[c]({id:e,loading:u,title:t,message:n,color:r,icon:i,withCloseButton:o,autoClose:!1})}function Pee(){const e=bn(),t=Ae(),[n,r]=v.useState({}),i=v.useCallback(async(u,f)=>{const h="batch-upload";my({id:h,title:"Batch Upload in Progress",message:"Your batch data is being uploaded. This may take a moment...",method:"show",loading:!0});try{r({});let m=JSON.parse(u);m.type!=="batch"&&m.type!=="transaction"&&(m=qD(m));const g=await t.executeBatch(m);r(y=>({...y,[f]:g})),my({id:h,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:s.jsx(ro,{size:"1rem"}),withCloseButton:!0})}catch(m){my({id:h,title:"Batch Upload Failed",color:"red",message:Ke(m),method:"update",icon:s.jsx(Gs,{size:"1rem"}),withCloseButton:!0})}},[t]),o=v.useCallback(async u=>{for(const f of u){const h=new FileReader;h.onload=m=>{var g;return i((g=m.target)==null?void 0:g.result,f.name)},h.readAsText(f)}},[i]),c=v.useCallback(async u=>{await i(u.input,"JSON Data")},[i]);return s.jsxs(st,{children:[s.jsx(Ie,{children:"Batch Create"}),s.jsxs(_e,{children:["Use this page to create, read, or update multiple resources. For more details, see"," ",s.jsx(Pt,{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(n).length===0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Input"}),s.jsxs(Rt,{defaultValue:"upload",children:[s.jsxs(Rt.List,{children:[s.jsx(Rt.Tab,{value:"upload",children:"File Upload"}),s.jsx(Rt.Tab,{value:"json",children:"JSON"})]}),s.jsx(Rt.Panel,{value:"upload",pt:"xs",children:s.jsx(dh,{onDrop:o,accept:["application/json"],children:s.jsxs(je,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[s.jsx(dh.Accept,{children:s.jsx(BE,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),s.jsx(dh.Reject,{children:s.jsx(Gs,{size:50,stroke:1.5,color:e.colors.red[5]})}),s.jsx(dh.Idle,{children:s.jsx(BE,{size:50,stroke:1.5})}),s.jsxs("div",{children:[s.jsx(_e,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),s.jsx(_e,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),s.jsx(Rt.Panel,{value:"json",pt:"xs",children:s.jsxs(mt,{onSubmit:c,children:[s.jsx(Ac,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:kee,deserialize:JSON.parse}),s.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Pe,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Output"}),s.jsxs(Rt,{defaultValue:Object.keys(n)[0],children:[s.jsx(Rt.List,{children:Object.keys(n).map(u=>s.jsx(Rt.Tab,{value:u,children:u},u))}),Object.keys(n).map(u=>s.jsx(Rt.Panel,{value:u,children:s.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[u],void 0,2)})},u))]}),s.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Pe,{onClick:()=>r({}),children:"Start over"})})]})]})}function Nee(){const{resourceType:e}=Ht(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(i=>!!i),[r]=Sc("Questionnaire",`subject-type=${e}`);return r?r.length===0?s.jsxs(st,{children:[s.jsxs(Ie,{children:["No apps for ",e]}),s.jsx(gt,{to:`/${e}`,children:"Return to search page"})]}):s.jsx(st,{children:s.jsx("div",{children:r.map(i=>s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(gt,{to:`/forms/${i.id}?subject=`+n.map(o=>`${e}/${o}`).join(","),children:i.name})}),s.jsx("p",{children:i.description})]},i.id))})}):s.jsx(gi,{})}function Oee(){const e=Ae(),[t,n]=v.useState(),[r,i]=v.useState(!1);return s.jsx(st,{width:450,children:s.jsxs(mt,{onSubmit:o=>{n(void 0),e.post("auth/changepassword",o).then(()=>i(!0)).catch(c=>n(Kt(c)))},children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx(zi,{size:32}),s.jsx(Ie,{children:"Change password"})]}),!r&&s.jsxs(qe,{gap:"xl",mt:"xl",children:[s.jsx(ki,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:Nt(t,"oldPassword")}),s.jsx(ki,{name:"newPassword",label:"New password",required:!0,error:Nt(t,"newPassword")}),s.jsx(ki,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Nt(t,"confirmPassword")}),s.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Pe,{type:"submit",children:"Change password"})})]}),r&&s.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const cx=["Form","JSON","Profiles"],Mee=["Profiles"],gy=cx[0].toLowerCase();function Lee(){const e=Sn(),t=bn(),{resourceType:n}=Ht(),[r,i]=v.useState(()=>{const c=window.location.pathname.split("/").pop();return c&&cx.map(u=>u.toLowerCase()).includes(c)?c:gy});function o(c){var u;c||(c=gy),i(c),(u=e(`/${n}/new/${c}`))==null||u.catch(console.error)}return s.jsxs(s.Fragment,{children:[s.jsxs(lr,{children:[s.jsxs(_e,{p:"md",fw:500,children:["New ",n]}),s.jsx(Yr,{children:s.jsx(Rt,{defaultValue:gy,value:r,onChange:o,children:s.jsx(Rt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:cx.map(c=>s.jsx(Rt.Tab,{value:c.toLowerCase(),px:"md",children:Mee.includes(c)?s.jsxs(je,{gap:"xs",wrap:"nowrap",children:[c,s.jsx(Tp,{color:t.primaryColor,size:"sm",children:"Beta"})]}):c},c))})})})]}),s.jsx(Jb,{})]})}function Iee(){return s.jsx(st,{children:s.jsxs(qe,{children:[s.jsx(Ie,{order:1,children:"Unexpected Error"}),s.jsx(_e,{children:"We're sorry, something went wrong."}),s.jsxs(_e,{children:["Please contact ",s.jsx(Pt,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}function Jk(e){const t=Wt(e.resource);if(!t)return null;const n=[{key:"Type",value:s.jsx(gt,{to:`/${t.resourceType}`,children:t.resourceType})}];function r(c,u){c&&u&&n.push({key:c,value:u})}function i(c){c&&r(c.system,c.value)}function o(c,u){Array.isArray(u)?u.forEach(f=>o(c,f)):typeof u=="string"?r(c,u):u&&(Array.isArray(u.coding)?r(c,u.coding.map(f=>f.display||f.code).join(", ")):r(c,u.text))}if("name"in t){const c=qa(t);c!==Mt(t)&&r("Name",c)}return"category"in t&&o("Category",t.category),t.resourceType!=="Bot"&&"code"in t&&o("Code",t.code),"identifier"in t&&(Array.isArray(t.identifier)?t.identifier.forEach(i):i(t.identifier)),n.length===1&&n.push({key:"ID",value:t.id}),s.jsx(pt,{children:n.map((c,u)=>s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:c.key}),s.jsx(pt.Value,{children:c.value})]},`${c.key}-${u}`))})}function o1(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function $ee(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 es(e){var t;return Vs((t=e.getActiveLogin())==null?void 0:t.project)}function zee(){const{id:e}=Ht(),t=Or(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,i=Ae(),[o,c]=v.useState(!0),[u,f]=v.useState(),[h,m]=v.useState(),[g,y]=v.useState(),[b,S]=v.useState(),[j,C]=v.useState();if(v.useEffect(()=>{const E={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const R=r.split(",").filter(D=>!!D);R.length===1&&E.entry.push({request:{method:"GET",url:R[0]}}),m(R)}i.executeBatch(E).then(R=>{var D,k,M,L,z,F,Y,W;((M=(k=(D=R.entry)==null?void 0:D[0])==null?void 0:k.response)==null?void 0:M.status)!=="200"?S((F=(z=(L=R.entry)==null?void 0:L[0])==null?void 0:z.response)==null?void 0:F.outcome):(f((Y=R.entry[0])==null?void 0:Y.resource),y((W=R.entry[1])==null?void 0:W.resource)),c(!1)}).catch(R=>{S(R),c(!1)})},[i,e,r]),b)return s.jsx(st,{children:s.jsx("pre",{"data-testid":"error",children:JSON.stringify(b,void 0,2)})});if(j)return s.jsxs(st,{children:[s.jsx(Ie,{children:u==null?void 0:u.title}),s.jsx("p",{children:"Your response has been recorded."}),s.jsxs("ul",{children:[j.length===1&&s.jsx("li",{children:s.jsx(gt,{to:j[0],children:"Review your answers"})}),j.length>1&&s.jsxs("li",{children:["Review your answers:",s.jsx("ul",{children:j.map(E=>s.jsx("li",{children:s.jsx(gt,{to:E,children:Mt(E)})},E.id))})]}),g&&s.jsx("li",{children:s.jsxs(gt,{to:g,children:["Back to ",qa(g)]})}),s.jsx("li",{children:s.jsx(gt,{to:"/",children:"Go back home"})})]})]});if(o||!u)return s.jsx(gi,{});const T=g&&o1(g);return s.jsxs(s.Fragment,{children:[s.jsxs(lr,{shadow:"xs",radius:0,children:[T&&s.jsx(ok,{patient:T}),g&&g.resourceType!=="Patient"&&s.jsx(Jk,{resource:g}),s.jsx(ce,{px:"xl",py:"md",children:s.jsxs(_e,{children:[qa(u),h&&h.length>1&&s.jsxs(s.Fragment,{children:[" (for ",h.length," resources)"]})]})})]}),s.jsx(st,{children:s.jsx(mk,{questionnaire:u,subject:g&&tn(g),onSubmit:_})})]});async function _(E){const R=[];if(!h||h.length===0)R.push(await i.createResource(E));else for(const D of h)R.push(await i.createResource({...E,subject:{reference:D}}));C(R)}}const Uee="_paper_unw9o_1",Bee={paper:Uee},Vee={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function eP(e,t){const n=e.resourceType||Fee(t),r=e.fields??Hee(n),i=e.filters??(e.resourceType?void 0:qee(n)),o=e.sortRules??Gee(n),c=e.offset??0,u=e.count??Kp;return{...e,resourceType:n,fields:r,filters:i,sortRules:o,offset:c,count:u}}function Fee(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 Hee(e){const t=s1(e);if(t!=null&&t.fields)return t.fields;const n=["id","_lastUpdated"];switch(e){case"Patient":n.push("name","birthDate","gender");break;case"AsyncJob":n.push("status","dataVersion");break;case"AccessPolicy":case"Bot":case"ClientApplication":case"Practitioner":case"Project":case"Organization":case"Questionnaire":case"UserConfiguration":n.push("name");break;case"CodeSystem":case"ValueSet":n.push("name","title","status");break;case"Condition":n.push("subject","code","clinicalStatus");break;case"Device":n.push("manufacturer","deviceName","patient");break;case"DeviceDefinition":n.push("manufacturer[x]","deviceName");break;case"DeviceRequest":n.push("code[x]","subject");break;case"DiagnosticReport":case"Observation":n.push("subject","code","status");break;case"Encounter":n.push("subject");break;case"ServiceRequest":n.push("subject","code","status","orderDetail");break;case"Subscription":n.push("criteria");break;case"User":n.push("email");break}return n}function qee(e){var t;return(t=s1(e))==null?void 0:t.filters}function Gee(e){const t=s1(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function s1(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function Wee(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function Qee(e,t){const n={...e,count:1e3,offset:0},r=eP(n,t.getUserConfiguration()),i=await t.search(r.resourceType,Bo({...r,total:"accurate",fields:void 0}));return qD(i)}function YT(){const e=Ae(),t=Sn(),n=Or(),[r,i]=v.useState();return v.useEffect(()=>{var u;const o=BD(n.pathname+n.search),c=eP(o,e.getUserConfiguration());n.pathname===`/${c.resourceType}`&&n.search===Bo(c)?(Wee(c),i(c)):(u=t(`/${c.resourceType}${Bo(c)}`))==null||u.catch(console.error)},[e,t,n]),!(r!=null&&r.resourceType)||!r.fields||r.fields.length===0?s.jsx(gi,{}):s.jsx(lr,{shadow:"xs",m:"md",p:"xs",className:Bee.paper,children:s.jsx($c,{checkboxesEnabled:!0,search:r,onClick:o=>{var c;return(c=t(`/${o.resource.resourceType}/${o.resource.id}`))==null?void 0:c.catch(console.error)},onAuxClick:o=>window.open(`/${o.resource.resourceType}/${o.resource.id}`,"_blank"),onChange:o=>{var c;(c=t(`/${r.resourceType}${Bo(o.definition)}`))==null||c.catch(console.error)},onNew:()=>{var o;(o=t(Vee[r.resourceType]??`/${r.resourceType}/new`))==null||o.catch(console.error)},onExportCsv:()=>{const o=e.fhirUrl(r.resourceType,"$csv")+Bo(r);e.download(o).then(c=>{window.open(window.URL.createObjectURL(c),"_blank")}).catch(c=>Oe({color:"red",message:Ke(c),autoClose:!1}))},onExportTransactionBundle:async()=>{Qee(r,e).then(o=>wA(JSON.stringify(o,void 0,2))).catch(o=>Oe({color:"red",message:Ke(o),autoClose:!1}))},onDelete:o=>{window.confirm("Are you sure you want to delete these resources?")&&(e.invalidateSearches(r.resourceType),e.executeBatch({resourceType:"Bundle",type:"batch",entry:o.map(c=>({request:{method:"DELETE",url:`${r.resourceType}/${c}`}}))}).then(()=>i({...r})).catch(c=>Oe({color:"red",message:Ke(c),autoClose:!1})))},onBulk:o=>{var c;(c=t(`/bulk/${r.resourceType}?ids=${o.join(",")}`))==null||c.catch(console.error)}})})}function Yee(){const e=Ae(),[t,n]=v.useState(),[r,i]=v.useState(void 0),[o,c]=v.useState(!1),u=v.useCallback(()=>{e.get("auth/mfa/status",{cache:"no-cache"}).then(m=>{n(m.enrollQrCode),i(m.enrolled)}).catch(m=>Oe({color:"red",message:Ke(m),autoClose:!1}))},[e]);v.useEffect(()=>{u()},[u]);const f=v.useCallback(m=>{e.post("auth/mfa/enroll",m).then(()=>{i(!0),Oe({color:"green",message:"Success"})}).catch(g=>Oe({color:"red",message:Ke(g),autoClose:!1}))},[e]),h=v.useCallback(async m=>e.post("auth/mfa/disable",{token:m.token}),[e]);return r===void 0?null:r?s.jsxs(st,{children:[s.jsx(Vn,{title:"Disable MFA",opened:o,onClose:()=>c(!1),children:s.jsx(NA,{onSubmit:async m=>{await h(m),c(!1),i(!1),Oe({id:"mfa-disabled",color:"green",title:"Success",message:"MFA disabled",icon:s.jsx(nH,{})}),u()}})}),s.jsxs(je,{children:[s.jsx(Ie,{children:"MFA is enabled"}),s.jsx(Pe,{onClick:()=>c(!0),children:"Disable MFA"})]})]}):s.jsx(st,{width:400,children:s.jsxs(mt,{onSubmit:f,children:[s.jsx(Ie,{children:"Multi Factor Auth Setup"}),s.jsx(er,{children:s.jsx("img",{src:t,alt:"Multi Factor Auth QR Code"})}),s.jsx($e,{name:"token",label:"Code"}),s.jsx(je,{justify:"flex-end",mt:"xl",children:s.jsx(Pe,{type:"submit",children:"Enroll"})})]})})}const vy={},ux={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__",awsTextractEnabled:vy==null?void 0:vy.MEDPLUM_AWS_TEXTRACT_ENABLED};function $d(){return ux}function tP(){return nP("registerEnabled")}function Xee(){return nP("awsTextractEnabled")}function nP(e){try{return ux[e]!==!1&&ux[e]!=="false"}catch{return!0}}function Kee(){var g,y;const e=Sn(),[t]=n1(),n=Ae(),r=t.get("scope")||"openid",[i,o]=v.useState(),[c,u]=v.useState(!0),f=t.get("client_id"),h=t.get("login");if(v.useEffect(()=>{if(!f||f==="medplum-cli")return;async function b(){try{const S=await n.get(`/auth/clientinfo/${f}`);o(S)}catch(S){Oe({id:"clientinfofail",title:"Failed to retrieve client information.",color:"red",message:Ke(S),withCloseButton:!0})}finally{u(!1)}}b().catch(console.error)},[n,f]),!f)return null;function m(b){const S=new URL(t.get("redirect_uri"));for(const j of["scope","state","nonce"])t.has(j)&&S.searchParams.set(j,t.get(j));S.searchParams.set("code",b),window.location.assign(S.toString())}return s.jsx(OA,{onCode:m,onForgotPassword:()=>{var b;return(b=e("/resetpassword"))==null?void 0:b.catch(console.error)},onRegister:()=>{var b;return(b=e("/register"))==null?void 0:b.catch(console.error)},googleClientId:$d().googleClientId,clientId:f||void 0,redirectUri:t.get("redirect_uri")||void 0,scope:r,nonce:t.get("nonce")||void 0,launch:t.get("launch")||void 0,codeChallenge:t.get("code_challenge")||void 0,codeChallengeMethod:t.get("code_challenge_method")||void 0,chooseScopes:r!=="openid",login:h||void 0,children:!c&&s.jsxs(s.Fragment,{children:[(g=i==null?void 0:i.logo)!=null&&g.url?s.jsx("img",{src:(y=i==null?void 0:i.logo)==null?void 0:y.url,alt:"Welcome Logo",height:60,style:{width:"auto"}}):s.jsx(zi,{size:32}),s.jsx(Ie,{children:(i==null?void 0:i.welcomeString)??"Sign in to Medplum"})]})})}function Zee(){const e=Ae(),t=Sn(),n=$d();return v.useEffect(()=>{var r;e.getProfile()&&((r=t("/signin?project=new"))==null||r.catch(console.error))},[e,t]),tP()?s.jsxs(NG,{type:"project",projectId:"new",onSuccess:()=>{window.location.href="/"},googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[s.jsx(zi,{size:32}),s.jsx(Ie,{children:"Create a new account"})]}):s.jsx(st,{width:450,children:s.jsx(Za,{icon:s.jsx(al,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function Jee(){const e=Sn(),t=Ae(),[n,r]=v.useState(),[i,o]=v.useState(!1),c=$d().recaptchaSiteKey;return v.useEffect(()=>{kA(c)},[c]),s.jsx(st,{width:450,children:s.jsxs(mt,{onSubmit:async u=>{let f="";f=await PA(c),t.post("auth/resetpassword",{...u,recaptchaToken:f}).then(()=>o(!0)).catch(h=>r(Kt(h)))},children:[s.jsxs(qe,{gap:"lg",mb:"xl",align:"center",children:[s.jsx(zi,{size:32}),s.jsx(Ie,{children:"Medplum Password Reset"})]}),s.jsxs(qe,{gap:"xl",children:[s.jsx(Xr,{issues:Ad(n,void 0)}),!i&&s.jsxs(s.Fragment,{children:[s.jsx($e,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:Nt(n,"email")}),s.jsxs(je,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(Pt,{component:"button",type:"button",color:"dimmed",onClick:()=>{var u;return(u=e("/register"))==null?void 0:u.catch(console.error)},size:"xs",children:"Register"}),s.jsx(Pe,{type:"submit",children:"Reset password"})]})]}),i&&s.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function ete(){var o;const e=Sn(),t=Ae(),[n,r]=v.useState();v.useEffect(()=>{t.get("auth/me",{cache:"no-cache"}).then(r).catch(c=>Oe({color:"red",message:Ke(c),autoClose:!1}))},[t]);function i(c){t.post("auth/revoke",{loginId:c}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>Oe({color:"green",message:"Login revoked"})).catch(u=>Oe({color:"red",message:Ke(u),autoClose:!1}))}return n?s.jsxs(s.Fragment,{children:[s.jsxs(st,{children:[s.jsx(Ie,{children:"Security"}),s.jsxs(Db,{children:[s.jsx(Ua,{term:"ID",children:s.jsx(Pt,{href:`/${Mt(n.profile)}`,children:n.profile.id})}),s.jsx(Ua,{term:"Resource Type",children:n.profile.resourceType}),s.jsx(Ua,{term:"Name",children:Mc((o=n.profile.name)==null?void 0:o[0])})]})]}),s.jsxs(st,{children:[s.jsx(Ie,{children:"Sessions"}),s.jsxs(ye,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"OS"}),s.jsx("th",{children:"Browser"}),s.jsx("th",{children:"IP Address"}),s.jsx("th",{children:"Auth Method"}),s.jsx("th",{children:"Last Updated"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:n.security.sessions.map(c=>s.jsxs("tr",{children:[s.jsx("td",{children:c.os}),s.jsx("td",{children:c.browser}),s.jsx("td",{children:c.remoteAddress}),s.jsx("td",{children:c.authMethod}),s.jsx("td",{children:gr(c.lastUpdated)}),s.jsx("td",{children:s.jsx(Pt,{href:"#",onClick:()=>i(c.id),children:"Revoke"})})]},c.id))})]})]}),s.jsxs(st,{children:[s.jsx(Ie,{children:"Password"}),s.jsx(Pe,{onClick:()=>{var c;return(c=e("/changepassword"))==null?void 0:c.catch(console.error)},children:"Change password"})]}),s.jsxs(st,{children:[s.jsx(Ie,{children:"Multi Factor Auth"}),s.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&s.jsx(Pe,{onClick:()=>{var c;return(c=e("/mfa"))==null?void 0:c.catch(console.error)},children:"Enroll"})]})]}):null}function tte(){const{id:e,secret:t}=Ht(),n=Ae(),[r,i]=v.useState(),[o,c]=v.useState(!1),u=Ad(r,void 0);return s.jsxs(st,{width:450,children:[s.jsx(Xr,{issues:u}),s.jsxs(mt,{onSubmit:f=>{if(f.password!==f.confirmPassword){i(ra("Passwords do not match","confirmPassword"));return}i(void 0);const h={id:e,secret:t,password:f.password};n.post("auth/setpassword",h).then(()=>c(!0)).catch(m=>i(Kt(m)))},children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx(zi,{size:32}),s.jsx(Ie,{children:"Set password"})]}),!o&&s.jsxs(qe,{children:[s.jsx(ki,{name:"password",label:"New password",required:!0,error:Nt(r,"password")}),s.jsx(ki,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Nt(r,"confirmPassword")}),s.jsx(je,{justify:"flex-end",mt:"xl",children:s.jsx(Pe,{type:"submit",children:"Set password"})})]}),o&&s.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",s.jsx(gt,{to:"/signin",children:"sign in"}),"."]})]})]})}function nte(){const e=im(),t=Sn(),[n]=n1(),r=$d(),i=v.useCallback(()=>{var c;const o=n.get("next");(c=t(o!=null&&o.startsWith("/")?o:"/"))==null||c.catch(console.error)},[n,t]);return v.useEffect(()=>{e&&n.has("next")&&i()},[e,n,i]),s.jsxs(OA,{onSuccess:()=>i(),onForgotPassword:()=>{var o;return(o=t("/resetpassword"))==null?void 0:o.catch(console.error)},onRegister:tP()?()=>{var o;return(o=t("/register"))==null?void 0:o.catch(console.error)}:void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[s.jsx(zi,{size:32}),s.jsx(Ie,{children:"Sign in to Medplum"}),n.get("project")==="new"&&s.jsx("div",{children:"Sign in again to create a new project"})]})}function rte(){const e=Sn(),t=Or(),[n,r]=v.useState(),[i,o]=v.useState(),[c,u]=v.useState();return v.useEffect(()=>{const f=Object.fromEntries(new URLSearchParams(t.search).entries());r(f.resourceType),o(f.query),u(JSON.parse(f.fields))},[t]),!n||!i||!c?null:s.jsx(kY,{resourceType:n,checkboxesEnabled:!0,query:i,fields:c,onClick:f=>{var h;return(h=e(`/${n}/${f.resource.id}`))==null?void 0:h.catch(console.error)},onAuxClick:f=>window.open(`/${n}/${f.resource.id}`,"_blank"),onBulk:f=>{var h;(h=e(`/bulk/${n}?ids=${f.join(",")}`))==null||h.catch(console.error)}})}function vm(e){const t=Ae(),n=es(t),r=Sn(),[i,o]=v.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:ue.EQUALS,value:"Project/"+n},{code:"profile-type",operator:ue.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return s.jsx($c,{search:i,onClick:c=>{var u;return(u=r(`/admin/members/${c.resource.id}`))==null?void 0:u.catch(console.error)},onChange:c=>o(c.definition),hideFilters:!0,hideToolbar:!0})}function ite(){return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Bots"}),s.jsx(vm,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(je,{justify:"flex-end",children:s.jsx(gt,{to:"/admin/bots/new",children:"Create new bot"})})]})}function ate(){return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Clients"}),s.jsx(vm,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(je,{justify:"flex-end",children:s.jsx(gt,{to:"/admin/clients/new",children:"Create new client"})})]})}function ym(e){return s.jsx(ol,{resourceType:"AccessPolicy",name:e.name,defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{ha(t)?e.onChange(tn(t)):e.onChange(void 0)}})}function ote(){const e=Ae(),t=es(e),[n,r]=v.useState(""),[i,o]=v.useState(""),[c,u]=v.useState(),[f,h]=v.useState(),[m,g]=v.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Create new Bot"}),s.jsxs(mt,{onSubmit:()=>{const y={name:n,description:i,accessPolicy:c};e.post("admin/projects/"+t+"/bot",y).then(b=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),g(b),Oe({color:"green",message:"Bot created"})}).catch(b=>{Oe({color:"red",message:Ke(b),autoClose:!1}),h(Kt(b))})},children:[!m&&s.jsxs(qe,{children:[s.jsx(Lt,{title:"Name",htmlFor:"name",outcome:f,children:s.jsx($e,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:y=>r(y.currentTarget.value),error:Nt(f,"name")})}),s.jsx(Lt,{title:"Description",htmlFor:"description",outcome:f,children:s.jsx($e,{id:"description",name:"description",onChange:y=>o(y.currentTarget.value),error:Nt(f,"description")})}),s.jsx(Lt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:s.jsx(ym,{name:"accessPolicy",onChange:u})}),s.jsx(je,{justify:"flex-end",children:s.jsx(Pe,{type:"submit",children:"Create Bot"})})]}),m&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(_e,{children:"Bot created"}),s.jsxs(mr,{children:[s.jsx(mr.Item,{children:s.jsx(gt,{to:m,children:"Go to new bot"})}),s.jsx(mr.Item,{children:s.jsx(gt,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function ste(){const e=Ae(),t=es(e),[n,r]=v.useState(""),[i,o]=v.useState(""),[c,u]=v.useState(""),[f,h]=v.useState(),[m,g]=v.useState(),[y,b]=v.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Create new Client"}),s.jsxs(mt,{onSubmit:()=>{const S={name:n,description:i,redirectUri:c,accessPolicy:f};e.post("admin/projects/"+t+"/client",S).then(j=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),b(j),Oe({color:"green",message:"Client created"})}).catch(j=>{Oe({color:"red",message:Ke(j),autoClose:!1}),g(Kt(j))})},children:[!y&&s.jsxs(qe,{children:[s.jsx(Lt,{title:"Name",htmlFor:"name",outcome:m,children:s.jsx($e,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:S=>r(S.currentTarget.value),error:Nt(m,"name")})}),s.jsx(Lt,{title:"Description",htmlFor:"description",outcome:m,children:s.jsx($e,{id:"description",name:"description",onChange:S=>o(S.currentTarget.value),error:Nt(m,"description")})}),s.jsx(Lt,{title:"Redirect URI",htmlFor:"redirectUri",outcome:m,children:s.jsx($e,{id:"redirectUri",name:"redirectUri",onChange:S=>u(S.currentTarget.value),error:Nt(m,"redirectUri")})}),s.jsx(Lt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:m,children:s.jsx(ym,{name:"accessPolicy",onChange:h})}),s.jsx(je,{justify:"flex-end",children:s.jsx(Pe,{type:"submit",children:"Create Client"})})]}),y&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(_e,{children:"Client created"}),s.jsxs(mr,{children:[s.jsx(mr.Item,{children:s.jsx(gt,{to:y,children:"Go to new client"})}),s.jsx(mr.Item,{children:s.jsx(gt,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function lte(e){return s.jsx(ol,{resourceType:"UserConfiguration",name:e.name,defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{ha(t)?e.onChange(tn(t)):e.onChange(void 0)}})}function cte(){const{membershipId:e}=Ht(),t=Ae(),n=es(t),r=Sn(),i=t.get(`admin/projects/${n}/members/${e}`).read(),[o,c]=v.useState(i.accessPolicy),[u,f]=v.useState(i.userConfiguration),[h,m]=v.useState(i.admin),[g,y]=v.useState(),[b,S]=v.useState(!1);function j(){window.confirm("Are you sure?")&&t.delete(`admin/projects/${n}/members/${e}`).then(()=>t.get(`admin/projects/${n}`,{cache:"no-cache"})).then(()=>r("/admin/project")).catch(C=>y(Kt(C)))}return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Edit membership"}),s.jsx("h3",{children:s.jsx(cc,{value:i.profile,link:!0})}),s.jsxs(mt,{onSubmit:()=>{const C={...i,accessPolicy:o,userConfiguration:u,admin:h};t.post(`admin/projects/${n}/members/${e}`,C).then(()=>S(!0)).catch(T=>y(Kt(T)))},children:[!b&&s.jsxs(qe,{children:[s.jsx(Lt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:g,children:s.jsx(ym,{name:"accessPolicy",defaultValue:o,onChange:c})}),s.jsx(Lt,{title:"User Configuration",htmlFor:"userConfiguration",outcome:g,children:s.jsx(lte,{name:"userConfiguration",defaultValue:u,onChange:f})}),s.jsx(Lt,{title:"Admin",htmlFor:"admin",outcome:g,children:s.jsx(Un,{id:"admin",name:"admin",defaultChecked:h,onChange:C=>m(C.currentTarget.checked)})}),s.jsxs(je,{justify:"flex-end",mt:"xl",children:[s.jsx(Pe,{type:"submit",children:"Save"}),s.jsx(Pe,{type:"button",color:"red",variant:"outline",onClick:j,children:"Remove user"})]})]}),b&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User updated"}),s.jsx("pre",{children:JSON.stringify(g,void 0,2)}),s.jsxs("p",{children:["Click ",s.jsx(gt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function ute(){const e=Ae(),[t,n]=v.useState(e.getProject()),[r,i]=v.useState(),[o,c]=v.useState(),[u,f]=v.useState(!1),[h,m]=v.useState(void 0),g=v.useCallback(y=>{const b={resourceType:y.resourceType,firstName:y.firstName,lastName:y.lastName,email:y.email,sendEmail:y.sendEmail==="on",accessPolicy:r,admin:y.isAdmin==="on",scope:y.isProjectScoped==="on"?"project":"server"};return e.invite(t==null?void 0:t.id,b).then(S=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),Wp(S)?c(S):m(S),f(b.sendEmail??!1),Oe({color:"green",message:"Invite success"})}).catch(S=>{Oe({color:"red",message:Ke(S),autoClose:!1}),c(Kt(S))})},[e,t,r]);return s.jsxs(mt,{onSubmit:g,children:[!h&&!o&&s.jsxs(qe,{children:[s.jsx(Ie,{children:"Invite new member"}),e.isSuperAdmin()&&s.jsx(Lt,{title:"Project",htmlFor:"project",outcome:o,children:s.jsx(ol,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),s.jsx(sn,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:Nt(o,"resourceType")}),s.jsx($e,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:Nt(o,"firstName")}),s.jsx($e,{name:"lastName",label:"Last Name",required:!0,error:Nt(o,"lastName")}),s.jsx($e,{name:"email",type:"email",label:"Email",required:!0,error:Nt(o,"email")}),s.jsx(Lt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:o,children:s.jsx(ym,{name:"accessPolicy",onChange:i})}),s.jsx(Un,{name:"sendEmail",label:"Send email",defaultChecked:!0}),s.jsx(Un,{name:"isAdmin",label:"Admin"}),s.jsx(Un,{name:"isProjectScoped",label:"Project scoped"}),s.jsx(je,{justify:"flex-end",children:s.jsx(xr,{children:"Invite"})})]}),o&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User created, email couldn't be sent"}),s.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),s.jsxs("p",{children:["Click ",s.jsx(gt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),h&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(_e,{children:"User created"}),u&&s.jsx(_e,{children:"Email sent"}),s.jsxs(mr,{children:[s.jsx(mr.Item,{children:s.jsx(gt,{to:h,children:"Go to new membership"})}),s.jsx(mr.Item,{children:s.jsx(gt,{to:h.profile,children:"Go to new profile"})}),s.jsx(mr.Item,{children:s.jsx(gt,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function dte(){return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Patients"}),s.jsx(vm,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),s.jsx(je,{justify:"flex-end",children:s.jsx(gt,{to:"/admin/invite",children:"Invite new patient"})})]})}function fte(){const e=Ae();if(!e.isLoading()&&!e.isProjectAdmin())return s.jsx(Xr,{outcome:Z0});function t(n){e.post("admin/projects/setpassword",n).then(()=>Oe({color:"green",message:"Done"})).catch(r=>Oe({color:"red",message:Ke(r),autoClose:!1}))}return s.jsxs(st,{width:600,children:[s.jsx(Ie,{order:1,children:"Project Admin"}),s.jsx(Cn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Force Set Password"}),s.jsx(_e,{children:"Sets the password for the specified user in this project."}),s.jsx(_e,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),s.jsx(mt,{onSubmit:t,children:s.jsxs(qe,{children:[s.jsx($e,{name:"email",label:"Email",required:!0}),s.jsx(ki,{name:"password",label:"Password",required:!0}),s.jsx(Pe,{type:"submit",children:"Force Set Password"})]})})]})}function XT(){const e=Ae(),t=es(e),n=e.get(`admin/projects/${t}`).read();return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Details"}),s.jsxs(Db,{children:[s.jsx(Ua,{term:"ID",children:n.project.id}),s.jsx(Ua,{term:"Name",children:n.project.name})]})]})}const KT=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function hte(){const e=Sn(),n=Or().pathname.replace("/admin/","")||KT[0],r=Ae(),i=es(r),o=v.useMemo(()=>r.get("admin/projects/"+i).read(),[r,i]);function c(u){var f;(f=e(`/admin/${u}`))==null||f.catch(console.error)}return s.jsxs(s.Fragment,{children:[s.jsxs(lr,{children:[s.jsx(pt,{children:s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Project"}),s.jsx(pt.Value,{children:o.project.name})]})}),s.jsx(Yr,{children:s.jsx(Rt,{value:n.toLowerCase(),onChange:c,children:s.jsx(Rt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:KT.map(u=>s.jsx(Rt.Tab,{value:u.toLowerCase(),children:u},u))})})})]}),s.jsx(st,{children:s.jsx(Jb,{})})]})}function pte(){const e=Ae(),t=es(e),n=e.get(`admin/projects/${t}`).read(),[r,i]=v.useState(!1),[o,c]=v.useState();return v.useEffect(()=>{e.requestSchema("Project").then(()=>i(!0)).catch(console.log)},[e]),v.useEffect(()=>{n&&c(Wr(n.project.secret||[]))},[e,n]),!r||!o?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:u=>{u.preventDefault(),e.post(`admin/projects/${t}/secrets`,o).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>Oe({color:"green",message:"Saved"})).catch(console.log)},children:[s.jsx(Ie,{children:"Project Secrets"}),s.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),s.jsx(Pd,{property:Ko("Project","secret"),name:"secret",path:"Project.secret",defaultValue:o,onChange:c,outcome:void 0}),s.jsx(Pe,{type:"submit",children:"Save"})]})}function mte(){const e=Ae(),t=es(e),n=e.get(`admin/projects/${t}`).read(),[r,i]=v.useState(!1),[o,c]=v.useState();return v.useEffect(()=>{e.requestSchema("Project").then(()=>i(!0)).catch(console.log)},[e]),v.useEffect(()=>{n&&c(Wr(n.project.site||[]))},[e,n]),!r||!o?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:u=>{u.preventDefault(),e.post(`admin/projects/${t}/sites`,o).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>Oe({color:"green",message:"Saved"})).catch(f=>{var m,g,y,b;const h=Kt(f);Oe({color:"red",message:`Error ${(g=(m=h.issue)==null?void 0:m[0].details)==null?void 0:g.text} ${(b=(y=h.issue)==null?void 0:y[0].expression)==null?void 0:b[0]}`,autoClose:!1})})},children:[s.jsx(Ie,{children:"Project Sites"}),s.jsx("p",{children:"Use project sites configure your project on a separate domain."}),s.jsx(Pd,{property:Ko("Project","site"),name:"site",path:"Project.site",defaultValue:o,onChange:c,outcome:void 0}),s.jsx(Pe,{type:"submit",children:"Save"})]})}function rP(e,t,n,r){const i=Date.now().toString();Oe({id:i,loading:!0,title:t,message:"Running...",autoClose:!1,withCloseButton:!1});const o={method:"POST",pollStatusOnAccepted:!0};return r&&(o.body=JSON.stringify(r)),e.startAsyncRequest(n,o).then(c=>{var f,h,m;let u="Done";return c.resourceType==="AsyncJob"?u=s.jsx(gt,{to:c,children:"View AsyncJob"}):c.resourceType==="OperationOutcome"&&((m=(h=(f=c.issue)==null?void 0:f[0])==null?void 0:h.details)!=null&&m.text)&&(u=s.jsx(_e,{children:c.issue[0].details.text})),fi.update({id:i,color:"green",title:t,message:u,icon:s.jsx(ro,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c}).catch(c=>{throw fi.update({id:i,color:"red",title:t,message:Ke(c),icon:s.jsx(Gs,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c})}function ws(e,t,n,r){rP(e,t,n,r).catch(()=>{})}const iP="System AsyncJob",aP="Post-deploy Migrations",fh=[aP,iP];function gte(){const e=Ae(),[t,n]=v.useState(fh[0]);function r(i){i||(i=fh[0]),fh.includes(i)&&n(i)}return!e.isLoading()&&!e.isSuperAdmin()?s.jsx(Xr,{outcome:Z0}):s.jsx(Lc,{miw:"1600",maw:"2000",children:s.jsxs(sm,{children:[s.jsx(Ie,{order:1,children:"AsyncJob Dashboard"}),s.jsxs(Rt,{keepMounted:!1,value:t,onChange:r,children:[s.jsx(Rt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:fh.map(i=>s.jsx(Rt.Tab,{value:i,children:i},i))}),s.jsx(Rt.Panel,{value:iP,pt:"md",children:s.jsx(yte,{})}),s.jsx(Rt.Panel,{value:aP,pt:"md",children:s.jsx(bte,{})})]})]})})}const vte={resourceType:"AsyncJob",fields:["id","_lastUpdated","request","status","type"],filters:[{code:"_project",operator:ue.MISSING,value:"true"}],sortRules:[{code:"_lastUpdated",descending:!0}]};function yte(){const e=Sn(),[t]=v.useState(vte);return s.jsxs(qe,{children:[s.jsx(gt,{to:`/${t.resourceType}/${Bo(t)}`,children:"Show in search page"}),s.jsx($c,{checkboxesEnabled:!1,search:t,onClick:n=>{var r;return(r=e(ZT(n.resource)))==null?void 0:r.catch(console.error)},onAuxClick:n=>window.open(ZT(n.resource),"_blank")})]})}const xte={resourceType:"AsyncJob",fields:["id","_lastUpdated","request","status","type"],filters:[{code:"_project",operator:ue.MISSING,value:"true"},{code:"type",operator:ue.EQUALS,value:"data-migration"}],count:1e3,sortRules:[{code:"_lastUpdated",descending:!0}]};function bte(){const e=Ae(),[t,n]=v.useState(),[r,i]=v.useState(),[o,c]=v.useState([]),[u,f]=v.useState(0),[h,m]=v.useState([]);v.useEffect(()=>{const j="info";m(C=>C.includes(j)?C:[...C,j]),e.get("admin/super/migrations",{cache:"no-cache"}).then(C=>{C.postDeployMigrations.sort((T,_)=>_-T),n(C)}).catch(C=>{Oe({color:"red",message:Ke(C),autoClose:!1})}).finally(()=>m(C=>C.filter(T=>T!==j)))},[e,u]),v.useEffect(()=>{const j="jobs";m(C=>C.includes(j)?C:[...C,j]),e.requestSchema("AsyncJob").then(()=>e.search("AsyncJob",Bo({...xte,total:"accurate",fields:void 0}),{cache:"no-cache"}).then(C=>{var T;i((T=C.entry)==null?void 0:T.map(_=>_.resource))})).catch(C=>{i(void 0),Oe({color:"red",message:Ke(C),autoClose:!1})}).finally(()=>m(C=>C.filter(T=>T!==j)))},[e,u]);function g(){f(j=>j+1)}function y(j){rP(e,"Run Pending Data Migration","admin/super/migrate",{dataVersion:j}).finally(()=>{g()}).catch(()=>{}),g()}const b=h.length>0;function S(j,{isLoading:C}){return s.jsxs("div",{style:{position:"relative"},children:[s.jsx(Rp,{visible:C}),s.jsxs(ye,{children:[s.jsx(ye.Thead,{children:s.jsxs(ye.Tr,{children:[s.jsx(ye.Th,{children:"Version"}),s.jsx(ye.Th,{children:"Action"}),s.jsx(ye.Th,{children:"Status"}),s.jsx(ye.Th,{children:"AsyncJob"}),s.jsx(ye.Th,{children:"Last Updated"}),s.jsx(ye.Th,{children:"Request Time"}),s.jsx(ye.Th,{children:"Duration"}),s.jsx(ye.Th,{children:"Attempts"})]})}),s.jsx(ye.Tbody,{children:j()})]})]})}return s.jsxs(s.Fragment,{children:[s.jsx(Pe,{size:"xs",mb:"xs",variant:"subtle",leftSection:s.jsx(yA,{size:14}),onClick:g,loading:b,children:"Refresh"}),S(()=>{var j;if(!b){if(!t)return s.jsx(ye.Tr,{children:s.jsx(ye.Td,{colSpan:6,children:"Failed to load migration info"})});if(!r)return s.jsx(ye.Tr,{children:s.jsx(ye.Td,{colSpan:6,children:"Failed to load async jobs"})})}return!t||!r?null:(j=t.postDeployMigrations)==null?void 0:j.map(C=>{var M;const{status:T,asyncJob:_,asyncJobs:E}=Ste(C,r??[],t==null?void 0:t.pendingPostDeployMigration),R=o.includes(C),D=C===(t==null?void 0:t.pendingPostDeployMigration)&&(!_||(_==null?void 0:_.status)==="error"),k=[s.jsxs(ye.Tr,{children:[s.jsx(ye.Td,{children:C}),s.jsx(ye.Td,{children:D&&s.jsx(Pe,{color:"green",size:"xs",onClick:()=>y(C),children:"Start"})}),s.jsx(ye.Td,{children:T}),s.jsx(ye.Td,{children:_&&s.jsx(gt,{to:`/AsyncJob/${_==null?void 0:_.id}`,children:_==null?void 0:_.id})}),s.jsx(ye.Td,{children:(M=_==null?void 0:_.meta)==null?void 0:M.lastUpdated}),s.jsx(ye.Td,{children:_==null?void 0:_.requestTime}),s.jsx(ye.Td,{children:JT(_)}),s.jsx(ye.Td,{display:"flex",children:s.jsxs(je,{gap:"xs",children:[E.length?E.length:"",R&&E.length>1&&s.jsx(Pe,{leftSection:s.jsx(BH,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(L=>L.includes(C)?L.filter(z=>z!==C):L),children:"Hide all"}),!R&&E.length>1&&s.jsx(Pe,{leftSection:s.jsx(vA,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(L=>L.includes(C)?L:[...L,C]),children:"Show all"})]})})]},C)];return R&&k.push(...E.filter(L=>L.id!==(_==null?void 0:_.id)).map(L=>{var z;return s.jsxs(ye.Tr,{bg:"gray.1",children:[s.jsx(ye.Td,{children:C}),s.jsx(ye.Td,{}),s.jsx(ye.Td,{children:L.status}),s.jsx(ye.Td,{children:s.jsx(gt,{to:`/AsyncJob/${L.id}`,children:L.id})}),s.jsx(ye.Td,{children:(z=L.meta)==null?void 0:z.lastUpdated}),s.jsx(ye.Td,{children:L.requestTime}),s.jsx(ye.Td,{children:JT(L)}),s.jsx(ye.Td,{})]},L.id)})),k})},{isLoading:b})]})}function Ste(e,t,n){const r=t.filter(c=>c.dataVersion===e),i=r.find(c=>c.status==="completed")??r[0];let o;return n===0?o=(i==null?void 0:i.status)??"completed":e>n?o=(i==null?void 0:i.status)??"pending":e===n?o=(i==null?void 0:i.status)??"next":o=(i==null?void 0:i.status)??"completed",{status:o,asyncJob:i,asyncJobs:r}}function ZT(e){return`/${e.resourceType}/${e.id}`}function JT(e){var u;const t=e==null?void 0:e.requestTime,n=(e==null?void 0:e.transactionTime)??((u=e==null?void 0:e.meta)==null?void 0:u.lastUpdated);if(!t||!n)return"";const r=new Date(t),o=new Date(n).getTime()-r.getTime();if(o<1e3)return`${o.toFixed(0)}ms`;const c=o/1e3;return c<60?`${c.toFixed(2)}s`:c<3600?`${(c/60).toFixed(2)}m`:`${(c/3600).toFixed(2)}h`}function wte(){const e=Ae(),[t,{open:n,close:r}]=lp(!1),[i,o]=v.useState(""),[c,u]=v.useState();if(!e.isLoading()&&!e.isSuperAdmin())return s.jsx(Xr,{outcome:Z0});function f(){ws(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function h(){ws(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function m(){ws(e,"Rebuilding Value Sets","admin/super/valuesets")}function g(D){ws(e,"Reindexing Resources","admin/super/reindex",D)}function y(){ws(e,"Reload Cron Resources","admin/super/reloadcron")}function b(){ws(e,"Run Pending Data Migration","admin/super/migrate")}function S(D){e.post("admin/super/removebotidjobsfromqueue",D).then(()=>Oe({color:"green",message:"Done"})).catch(k=>Oe({color:"red",message:Ke(k),autoClose:!1}))}function j(D){e.post("admin/super/purge",{...D,before:Pb(D.before)}).then(()=>Oe({color:"green",message:"Done"})).catch(k=>Oe({color:"red",message:Ke(k),autoClose:!1}))}function C(D){e.post("admin/super/setpassword",D).then(()=>Oe({color:"green",message:"Done"})).catch(k=>Oe({color:"red",message:Ke(k),autoClose:!1}))}function T(D){e.post("fhir/R4/$db-stats",D.tableNames?{resourceType:"Parameters",parameter:[{name:"tableNames",valueString:D.tableNames}]}:void 0).then(k=>{var M,L;o("Database Stats"),u(s.jsx("pre",{children:(L=(M=k.parameter)==null?void 0:M.find(z=>z.name==="tableString"))==null?void 0:L.valueString})),n()}).catch(k=>Oe({color:"red",message:Ke(k),autoClose:!1}))}function _(){e.post("fhir/R4/$db-invalid-indexes").then(D=>{var k;o("Database Invalid Indexes"),u(s.jsx("pre",{children:(k=D.parameter)==null?void 0:k.filter(M=>M.name==="invalidIndex").map(M=>M.valueString).join(`
578
+ `)})),n()}).catch(D=>Oe({color:"red",message:Ke(D),autoClose:!1}))}function E(){e.post("fhir/R4/$db-schema-diff").then(D=>{var k,M;o("Schema Diff"),u(s.jsx("pre",{children:(M=(k=D.parameter)==null?void 0:k.find(L=>L.name==="migrationString"))==null?void 0:M.valueString})),n()}).catch(D=>Oe({color:"red",message:Ke(D),autoClose:!1}))}function R(){ws(e,"Reconcile Schema Diff","admin/super/reconcile-db-schema-drift")}return s.jsxs(st,{width:600,children:[s.jsx(Ie,{order:1,children:"Super Admin"}),s.jsx(Cn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Structure Definitions"}),s.jsx("p",{children:"StructureDefinition resources contain the metadata about resource types. They are provided with the FHIR specification. Medplum also includes some custom StructureDefinition resources for internal data types. Press this button to update the database StructureDefinitions from the FHIR specification."}),s.jsx(mt,{children:s.jsx(Pe,{onClick:f,children:"Rebuild StructureDefinitions"})}),s.jsx(Cn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Search Parameters"}),s.jsx("p",{children:"SearchParameter resources contain the metadata about filters and sorting. They are provided with the FHIR specification. Medplum also includes some custom SearchParameter resources for internal data types. Press this button to update the database SearchParameters from the FHIR specification."}),s.jsx(mt,{children:s.jsx(Pe,{onClick:h,children:"Rebuild SearchParameters"})}),s.jsx(Cn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Value Sets"}),s.jsx("p",{children:"ValueSet resources enum values for a wide variety of use cases. Press this button to update the database ValueSets from the FHIR specification."}),s.jsx(mt,{children:s.jsx(Pe,{onClick:m,children:"Rebuild ValueSets"})}),s.jsx(Cn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Run Pending Data Migration"}),s.jsx("p",{children:"When a Medplum version releases with data migrations to apply, you can run them here. Press this button to kick off the background data migration process."}),s.jsx(mt,{onSubmit:b,children:s.jsx(qe,{children:s.jsx(Pe,{type:"submit",children:"Start Migration"})})}),s.jsx(Cn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Reindex Resources"}),s.jsx("p",{children:"When Medplum changes how resources are indexed, the system may require a reindex for old resources to be indexed properly."}),s.jsx(mt,{onSubmit:g,children:s.jsxs(qe,{children:[s.jsx(Lt,{title:"Resource Type",htmlFor:"resourceType",children:s.jsx($e,{id:"resourceType",name:"resourceType",placeholder:"Reindex Resource Type"})}),s.jsx(Lt,{title:"Search Filter",htmlFor:"filter",children:s.jsx($e,{id:"filter",name:"filter",placeholder:"e.g. name=Sam&birthdate=lt2000-01-01"})}),s.jsx(Lt,{title:"Max Resource Version",htmlFor:"maxResourceVersion",children:s.jsx(jte,{})}),s.jsx(Pe,{type:"submit",children:"Reindex"})]})}),s.jsx(Cn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Purge Resources"}),s.jsx("p",{children:"As system generated resources accumulate, the system may require a purge to remove old resources."}),s.jsx(mt,{onSubmit:j,children:s.jsxs(qe,{children:[s.jsx(Lt,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:s.jsx(sn,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),s.jsx(Lt,{title:"Purge Before",htmlFor:"before",children:s.jsx(aa,{name:"before",placeholder:"Before Date"})}),s.jsx(Pe,{type:"submit",children:"Purge"})]})}),s.jsx(Cn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Remove Bot ID Jobs from Queue"}),s.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),s.jsx(mt,{onSubmit:S,children:s.jsxs(qe,{children:[s.jsx(Lt,{title:"Bot ID",children:s.jsx($e,{name:"botId",placeholder:"Bot Id"})}),s.jsx(Pe,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),s.jsx(Cn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Force Set Password"}),s.jsx("p",{children:'Note that this applies to all projects for the user. Therefore, this should only be used in extreme circumstances. Always prefer to use the "Forgot Password" flow first.'}),s.jsx(mt,{onSubmit:C,children:s.jsxs(qe,{children:[s.jsx($e,{name:"email",label:"Email",required:!0}),s.jsx(ki,{name:"password",label:"Password",required:!0}),s.jsx($e,{name:"projectId",label:"Project ID"}),s.jsx(Pe,{type:"submit",children:"Force Set Password"})]})}),s.jsx(Cn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Database Stats"}),s.jsx("p",{children:"Query current table statistics from the database."}),s.jsx(mt,{onSubmit:T,children:s.jsxs(qe,{children:[s.jsx(Lt,{title:"Table Names (comma-delimited)",htmlFor:"tableNames",children:s.jsx($e,{id:"tableNames",name:"tableNames",placeholder:"Observation,Observation_History"})}),s.jsx(Pe,{type:"submit",children:"Get Database Stats"})]})}),s.jsx(Cn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Database Invalid Indexes"}),s.jsx("p",{children:"Query invalid indexes from the database."}),s.jsx(mt,{onSubmit:_,children:s.jsx(qe,{children:s.jsx(Pe,{type:"submit",children:"Get Database Invalid Indexes"})})}),s.jsx(Cn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Database Schema Drift"}),s.jsx("p",{children:"Show the schema migration needed to match the expected database schema."}),s.jsxs(or,{children:[s.jsx(or.Col,{span:6,children:s.jsx(mt,{onSubmit:E,children:s.jsx(qe,{children:s.jsx(Pe,{type:"submit",children:"Get Schema Drift"})})})}),s.jsx(or.Col,{span:6,children:s.jsx(mt,{onSubmit:R,children:s.jsx(qe,{children:s.jsx(Pe,{type:"submit",children:"Reconcile Schema Drift"})})})})]}),s.jsx(Cn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Reload Cron Resources"}),s.jsx("p",{children:"Obliterates the cron queue and rebuilds all the cron job schedulers for cron resources (eg. cron bots)."}),s.jsx(mt,{onSubmit:y,children:s.jsx(qe,{children:s.jsx(Pe,{type:"submit",children:"Reload Cron Resources"})})}),s.jsx(Vn,{opened:t,onClose:r,title:i,centered:!0,size:"auto",children:c})]})}function jte(){const[e,t]=v.useState("outdated");return s.jsxs(s.Fragment,{children:[s.jsx(sn,{id:"reindexType",name:"reindexType",value:e,onChange:n=>t(n.target.value),data:[{label:"Outdated resources",value:"outdated"},{label:"All resources",value:"all"},{label:"Less than or equal to a specific version",value:"specific"}]}),e==="specific"&&s.jsx($p,{required:!0,name:"maxResourceVersion",placeholder:"Max Resource Version",min:0})]})}function Cte(){return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Users"}),s.jsx(vm,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(je,{justify:"flex-end",children:s.jsx(gt,{to:"/admin/invite",children:"Invite new user"})})]})}function Ete(){const[e]=Sc("ObservationDefinition","_count=100");return e?s.jsxs(ye,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Code"}),s.jsx("th",{children:"Method"}),s.jsx("th",{children:"Unit"}),s.jsx("th",{children:"Precision"}),s.jsx("th",{children:"Ranges"})]})}),s.jsx("tbody",{children:e.map(t=>{var n,r,i,o;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ia,{value:(n=t.category)==null?void 0:n[0]})}),s.jsx("td",{children:s.jsx(ia,{value:t.code})}),s.jsx("td",{children:s.jsx(ia,{value:t.method})}),s.jsx("td",{children:(i=(r=t.quantitativeDetails)==null?void 0:r.unit)==null?void 0:i.text}),s.jsx("td",{children:(o=t.quantitativeDetails)==null?void 0:o.decimalPrecision}),s.jsx("td",{children:s.jsx(dx,{ranges:t.qualifiedInterval})})]},t.id)})})]}):s.jsx(gi,{})}function dx(e){const{ranges:t}=e;if(!t)return null;const n=eR(t.map(i=>i.gender));if(n.length>1)return nd(n),s.jsx(s.Fragment,{children:n.map(i=>{var o;return s.jsxs(v.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:Ln(i)})}),s.jsx(dx,{ranges:(o=e.ranges)==null?void 0:o.filter(c=>c.gender===i)})]},i)})});const r=eR(t.map(i=>i.age&&rd(i.age)));return r.length>1?(nd(r),s.jsx(s.Fragment,{children:r.map(i=>{var o;return s.jsxs(v.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:Ln(i)})}),s.jsx(dx,{ranges:(o=e.ranges)==null?void 0:o.filter(c=>rd(c.age)===i)})]},i)})})):s.jsx(s.Fragment,{children:t.map(i=>s.jsx("table",{children:s.jsx("tbody",{children:s.jsxs("tr",{children:[s.jsx("td",{children:i.condition}),s.jsx("td",{children:s.jsx(kb,{value:i.range})})]})})},`range-${i.condition}`))})}function eR(e){return[...new Set(e.filter(t=>!!t))]}function Tte(){const[e]=Sc("ActivityDefinition","_count=100"),[t]=Sc("ObservationDefinition","_count=100");return!e||!t?s.jsx(gi,{}):s.jsxs(ye,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Assay"}),e.map(n=>s.jsx("th",{children:n.name},n.id))]})}),s.jsx("tbody",{children:t.map(n=>{var r;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ia,{value:(r=n.category)==null?void 0:r[0]})}),s.jsx("td",{children:s.jsx(ia,{value:n.code})}),e.map(i=>{var o;return s.jsx("td",{children:(o=i.observationResultRequirement)!=null&&o.find(c=>{var u;return(u=c.reference)==null?void 0:u.includes(n.id)})?"✅":""},i.id)})]},n.id)})})]})}function Rte(e){var c;const t=Ae(),[n,r]=v.useState(),[i,o]=v.useState();return i?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"Request group created successfully."}),s.jsxs("ul",{children:[s.jsxs("li",{children:["Go to the"," ",s.jsx(gt,{to:i,suffix:"checklist",children:"Request Group"})]}),s.jsxs("li",{children:["Back to the ",s.jsx(gt,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):s.jsx(mt,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueString:n==null?void 0:n.reference}]}).then(o).catch(console.log)},children:s.jsxs(qe,{children:[s.jsxs(Ie,{children:['Start "',e.planDefinition.title,'"']}),s.jsxs(_e,{children:["Use the ",s.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),s.jsx(_e,{children:"The following tasks will be created:"}),s.jsx("ul",{children:(c=e.planDefinition.action)==null?void 0:c.map((u,f)=>{var h;return s.jsxs("li",{children:[((h=u.definitionCanonical)==null?void 0:h.startsWith("Questionnaire/"))&&"Questionnaire request: ",u.title&&s.jsx(s.Fragment,{children:u.title}),u.code&&s.jsx(ia,{value:u.code[0]})]},`action-${f}`)})}),s.jsx(Lt,{title:"Subject",children:s.jsx(kd,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),s.jsx(je,{justify:"flex-end",mt:"xl",children:s.jsx(Pe,{type:"submit",children:"Go"})})]})})}function _te(){const{resourceType:e,id:t}=Ht(),n=Wt({reference:e+"/"+t});return n?s.jsx(st,{children:s.jsx(Rte,{planDefinition:n})}):null}function Dte(){const{resourceType:e,id:t}=Ht(),n=Wt({reference:e+"/"+t}),[r,i]=Sc("Questionnaire","subject-type="+e),[o,c]=Sc("ClientApplication",{_count:1e3});if(!n||i||c)return s.jsx(gi,{});const u=o==null?void 0:o.filter(m=>Ate(e)&&!!m.launchUri);if((!r||r.length===0)&&(!u||u.length===0))return s.jsxs(st,{children:[s.jsx(Ie,{children:"Apps"}),s.jsxs("p",{children:["No apps found. Contact your administrator or ",s.jsx("a",{href:"mailto:support@medplum.com",children:"Medplum Support"})," to add automation here."]})]});let f,h;return n.resourceType==="Patient"?f=tn(n):n.resourceType==="Encounter"&&(f=n.subject,h=tn(n)),s.jsxs(st,{children:[r==null?void 0:r.map(m=>s.jsxs("div",{children:[s.jsx(Ie,{order:3,children:s.jsx(gt,{to:`/forms/${m.id}?subject=${Mt(n)}`,children:m.title||m.name})}),s.jsx(_e,{children:m.description})]},m.id)),u==null?void 0:u.map(m=>s.jsxs("div",{children:[s.jsx(Ie,{order:3,children:s.jsx(CK,{client:m,patient:f,encounter:h,children:m.name})}),s.jsx(_e,{children:m.description})]},m.id))]})}function Ate(e){return e==="Patient"||e==="Encounter"}function kte(){const{resourceType:e,id:t}=Ht(),n=Sn(),[r,i]=v.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:ue.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return s.jsx(st,{children:s.jsx($c,{search:r,onClick:o=>{var c;return(c=n(`/${o.resource.resourceType}/${o.resource.id}`))==null?void 0:c.catch(console.error)},onChange:o=>i(o.definition),hideFilters:!0})})}function Pte(){const e=Ae(),{resourceType:t,id:n}=Ht(),r=e.readHistory(t,n).read();return s.jsx(st,{children:s.jsx(hK,{history:r})})}const Nte="_hl7Input_k5xm3_1",Ote={hl7Input:Nte};function Mte(e){return s.jsx("iframe",{title:"Bot Runner",frameBorder:"0",src:"https://codeeditor.medplum.com/bot-runner.html",className:e.className,ref:e.iframeRef,"data-testid":e.testId,style:{width:"100%",height:"100%",minHeight:e.minHeight}})}function Lte(e){const t=e.defaultValue,n=new URL(`https://codeeditor.medplum.com/${e.language}-editor.html`);return e.module&&n.searchParams.set("module",e.module),s.jsx("iframe",{title:"Code Editor",frameBorder:"0",src:n.toString(),style:{width:"100%",height:"100%",minHeight:e.minHeight},ref:e.iframeRef,"data-testid":e.testId,onLoad:r=>{qu(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const Ite=`{
579
+ "resourceType": "Patient",
580
+ "name": [
581
+ {
582
+ "given": [
583
+ "Alice"
584
+ ],
585
+ "family": "Smith"
586
+ }
587
+ ]
588
+ }`,$te="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 zte(){const e=Ae(),{id:t}=Ht(),[n,r]=v.useState(),[i,o]=v.useState(),[c,u]=v.useState(Ite),[f,h]=v.useState($te),[m,g]=v.useState(fn.FHIR_JSON),y=v.useRef(null),b=v.useRef(null),[S,j]=v.useState(!1);v.useEffect(()=>{e.readResource("Bot",t).then(async k=>{r(k),o(await Ute(e,k))}).catch(k=>Oe({color:"red",message:Ke(k),autoClose:!1}))},[e,t]);const C=v.useCallback(async()=>qu(y.current,{command:"getValue"}),[]),T=v.useCallback(async()=>qu(y.current,{command:"getOutput"}),[]),_=v.useCallback(async()=>m===fn.FHIR_JSON?JSON.parse(c):f,[m,c,f]),E=v.useCallback(async k=>{k.preventDefault(),k.stopPropagation(),j(!0);try{const M=await C(),L=await T(),z=await e.createAttachment({data:M,filename:"index.ts",contentType:"text/typescript"}),F=await e.createAttachment({data:L,filename:"index.js",contentType:"text/typescript"}),Y=[{op:"add",path:"/sourceCode",value:z},{op:"add",path:"/executableCode",value:F}];await e.patchResource("Bot",t,Y),Oe({color:"green",message:"Saved"})}catch(M){Oe({color:"red",message:Ke(M),autoClose:!1})}finally{j(!1)}},[e,t,C,T]),R=v.useCallback(async k=>{k.preventDefault(),k.stopPropagation(),j(!0);try{await e.post(e.fhirUrl("Bot",t,"$deploy")),Oe({color:"green",message:"Deployed"})}catch(M){Oe({color:"red",message:Ke(M),autoClose:!1})}finally{j(!1)}},[e,t]),D=v.useCallback(async k=>{k.preventDefault(),k.stopPropagation(),j(!0);try{const M=await _(),L=await e.post(e.fhirUrl("Bot",t,"$execute"),M,m);await qu(b.current,{command:"setValue",value:L}),Oe({color:"green",message:"Success"})}catch(M){Oe({color:"red",message:Ke(M),autoClose:!1})}finally{j(!1)}},[e,t,_,m]);return!n||i===void 0?null:s.jsxs(or,{m:0,gutter:0,style:{overflow:"hidden"},children:[s.jsx(or.Col,{span:8,children:s.jsxs(lr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[s.jsx(Lte,{iframeRef:y,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:i,minHeight:"528px"}),s.jsxs(je,{justify:"flex-end",gap:"xs",children:[s.jsx(Pe,{type:"button",onClick:E,loading:S,leftSection:s.jsx(fH,{size:"1rem"}),children:"Save"}),s.jsx(Pe,{type:"button",onClick:R,loading:S,leftSection:s.jsx(wb,{size:"1rem"}),children:"Deploy"}),s.jsx(Pe,{type:"button",onClick:D,loading:S,leftSection:s.jsx(YH,{size:"1rem"}),children:"Execute"})]})]})}),s.jsxs(or.Col,{span:4,children:[s.jsxs(lr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[s.jsx(sn,{data:[{label:"FHIR",value:fn.FHIR_JSON},{label:"HL7",value:fn.HL7_V2}],onChange:k=>g(k.currentTarget.value)}),m===fn.FHIR_JSON?s.jsx(Ac,{value:c,onChange:k=>u(k),autosize:!0,minRows:15}):s.jsx("textarea",{className:Ote.hl7Input,value:f,onChange:k=>h(k.currentTarget.value),rows:15})]}),s.jsx(lr,{m:2,p:"xs",shadow:"md",children:s.jsx(Mte,{iframeRef:b,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function Ute(e,t){var n,r,i;if((n=t.sourceCode)!=null&&n.url){const o=(i=(r=t.sourceCode.url)==null?void 0:r.split("/"))==null?void 0:i.find(RD);return(await e.download(e.fhirUrl("Binary",o))).text()}return t.code??""}function cl(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function Bte(){const e=Ae(),{resourceType:t,id:n}=Ht(),r={reference:t+"/"+n},i=v.useCallback(o=>{e.updateResource(cl(o)).then(()=>{Oe({color:"green",message:"Success"})}).catch(c=>{Oe({color:"red",message:Ke(c),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return s.jsx(st,{children:s.jsx(YY,{value:r,onSubmit:i})});case"Questionnaire":return s.jsx(st,{children:s.jsx(jX,{questionnaire:r,onSubmit:i})});default:return null}}function Vte(){const{resourceType:e,id:t}=Ht(),n=Wt({reference:e+"/"+t}),r=Sn();return n?s.jsx(st,{children:s.jsx(YX,{value:n,onStart:(i,o)=>{var c;return(c=r(`/forms/${Vs(o)}`))==null?void 0:c.catch(console.error)},onEdit:(i,o,c)=>{var u;return(u=r(`/${c.reference}}`))==null?void 0:u.catch(console.error)}})}):null}function Fte(){const e=Ae(),{resourceType:t,id:n}=Ht(),r=Sn();return s.jsxs(st,{children:[s.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),s.jsx(Pe,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>{var i;return(i=r(`/${t}`))==null?void 0:i.catch(console.error)}).catch(i=>Oe({color:"red",message:Ke(i),autoClose:!1}))},children:"Delete"})]})}const Hte="_selectProfileBtn_tbaz6_1",qte="_chevron_tbaz6_13",tR={selectProfileBtn:Hte,chevron:qte};function Gte(){var f,h;const{resourceType:e,id:t}=Ht(),n=Wt({reference:e+"/"+t}),[r,i]=v.useState(),o=gd({onDropdownClose:()=>o.resetSelectedOption()}),c=v.useMemo(()=>{var m;if(Tn((m=n==null?void 0:n.meta)==null?void 0:m.profile))return[s.jsx(ct.Option,{value:"",children:"None"},""),...n.meta.profile.map(g=>s.jsx(ct.Option,{value:g,children:g},g))]},[(f=n==null?void 0:n.meta)==null?void 0:f.profile]);if(v.useEffect(()=>{var m,g;((g=(m=n==null?void 0:n.meta)==null?void 0:m.profile)==null?void 0:g.length)===1&&i(n.meta.profile[0])},[(h=n==null?void 0:n.meta)==null?void 0:h.profile]),!n)return null;let u;return Tn(c)&&(u=s.jsx(je,{justify:"flex-end",children:s.jsxs(qe,{align:"flex-end",gap:"xs",children:[s.jsxs(ct,{store:o,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:m=>{i(m),o.closeDropdown()},children:[s.jsx(ct.Target,{children:s.jsx(tr,{onClick:()=>o.toggleDropdown(),children:s.jsxs(g0,{fw:"bold",fs:"sm",className:tR.selectProfileBtn,children:[s.jsx("span",{children:"Pick profile"}),s.jsx(Sb,{stroke:1.5,className:tR.chevron})]})})}),s.jsx(ct.Dropdown,{w:"max-content",children:s.jsx(ct.Options,{children:c})})]}),s.jsx(ce,{children:r?s.jsxs(s.Fragment,{children:[s.jsx(_e,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),s.jsx(_e,{span:!0,size:"sm",children:r||"Nothing selected"})]}):s.jsx(_e,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),s.jsx(st,{children:s.jsxs(qe,{gap:"xl",children:[u,s.jsx($b,{value:n,profileUrl:r})]})})}function Wte(){const e=Ae(),{resourceType:t,id:n}=Ht(),[r,i]=v.useState(),[o,c]=v.useState(),u=Sn(),[f,h]=v.useState();v.useEffect(()=>{e.readResource(t,n).then(b=>{i(Wr(b)),c(Wr(b))}).catch(b=>{h(Kt(b)),Oe({color:"red",message:Ke(b),autoClose:!1})})},[e,t,n]);const m=v.useCallback(b=>{h(void 0),e.updateResource(cl(b)).then(()=>{var S;(S=u(`/${t}/${n}/details`))==null||S.catch(console.error),Oe({id:"succes",color:"green",message:"Success"})}).catch(S=>{h(Kt(S)),Oe({color:"red",message:Ke(S),autoClose:!1})})},[e,t,n,u]),g=v.useCallback(b=>{h(void 0);const S=KA.createPatch(r,b);e.patchResource(t,n,S).then(()=>{var j;(j=u(`/${t}/${n}/details`))==null||j.catch(console.error),Oe({id:"succes",color:"green",message:"Success"})}).catch(j=>{h(Kt(j)),Oe({color:"red",message:Ke(j),autoClose:!1})})},[e,t,n,r,u]),y=v.useCallback(()=>{var b;return(b=u(`/${t}/${n}/delete`))==null?void 0:b.catch(console.error)},[u,t,n]);return o?s.jsx(st,{children:s.jsx(Zh,{defaultValue:o,onSubmit:m,onPatch:g,onDelete:y,outcome:f})}):null}function Qte(){const{resourceType:e,id:t}=Ht(),n=Wt({reference:e+"/"+t});return n?s.jsx(st,{maw:700,children:n.resourceType==="Patient"?s.jsx(FY,{patient:n}):s.jsx(Za,{icon:s.jsx(al,{size:16}),title:"Unsupported export type",color:"red",children:"This page is only supported for Patient resources"})}):null}function oP({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,i=Ae(),[o,c]=v.useState();return v.useEffect(()=>{i.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(u=>{c(u.filter(uW))}).catch(console.error)},[i,n,r]),s.jsx(Rt,{value:t==null?void 0:t.url,onChange:u=>{const f=o==null?void 0:o.find(h=>h.url===u);f&&n(f)},children:s.jsx(Rt.List,{children:o==null?void 0:o.map(u=>{var m,g;const f=(g=(m=e.meta)==null?void 0:m.profile)==null?void 0:g.includes(u.url),h=f?"This profile is present in this resource's meta.profile property.":"This profile is not included in this resource's meta.profile property.";return s.jsx(Rt.Tab,{value:u.url,title:h,rightSection:f&&s.jsx(X0,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:s.jsx(Rq,{size:"90%"})}),children:u.title||u.name},u.url)})})})}function sP(e,t){const n=Ae(),r=Sn();return{defaultValue:{resourceType:e},handleSubmit:c=>{t&&t(void 0),n.createResource(c).then(u=>r("/"+u.resourceType+"/"+u.id)).catch(u=>{t&&t(Kt(u)),Oe({color:"red",message:Ke(u),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function yy(){const{resourceType:e}=Ht(),t=Or(),[n,r]=v.useState(),{defaultValue:i,handleSubmit:o}=sP(e,r),[c,u]=v.useState(),f=t.pathname.toLowerCase().endsWith("profiles"),h=v.useCallback(m=>{const g=cl(m);c&&PD(g,c.url),o(g)},[c,o]);return f?s.jsx(st,{children:s.jsxs(qe,{children:[s.jsx(oP,{resource:i,currentProfile:c,onChange:u}),c?s.jsx(Zh,{defaultValue:i,onSubmit:h,outcome:n,profileUrl:c.url},c.url):s.jsx(_e,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):s.jsx(st,{children:s.jsx(Zh,{defaultValue:i,onSubmit:o,outcome:n})})}function Yte(){const e=Ae(),{resourceType:t,id:n}=Ht(),r=e.readHistory(t,n).read();return s.jsx(st,{children:s.jsx(bK,{history:r})})}function Xte(){const{resourceType:e}=Ht(),[t,n]=v.useState(),{defaultValue:r,handleSubmit:i}=sP(e,n),o=v.useCallback(c=>{i(JSON.parse(c["new-resource"]))},[i]);return s.jsxs(st,{children:[t&&s.jsx(Xr,{outcome:t}),s.jsxs(mt,{onSubmit:o,children:[s.jsx(Ac,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:Oi(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Pe,{type:"submit",children:"OK"})})]})]})}function Kte(){const e=Ae(),{resourceType:t,id:n}=Ht(),r=Wt({reference:t+"/"+n}),i=Sn(),[o,c]=v.useState(),u=v.useCallback(f=>{e.updateResource(cl(JSON.parse(f.resource))).then(()=>{var h;c(void 0),(h=i(`/${t}/${n}/details`))==null||h.catch(console.error),Oe({color:"green",message:"Success"})}).catch(h=>{Oe({color:"red",message:Ke(h),autoClose:!1})})},[e,t,n,i]);return r?s.jsxs(st,{children:[o&&s.jsx(Xr,{outcome:o}),s.jsxs(mt,{onSubmit:u,children:[s.jsx(Ac,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:Oi(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Pe,{type:"submit",children:"OK"})})]})]}):null}function Zte(){const{resourceType:e,id:t}=Ht();return Wt({reference:e+"/"+t})?s.jsxs(st,{children:[s.jsxs(Za,{icon:s.jsx(al,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",s.jsx("br",{}),s.jsx(Pt,{href:`/forms/${t}`,children:`/forms/${t}`})]}),s.jsx(mk,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function Jte(){const e=Ae(),{resourceType:t,id:n}=Ht(),[r,i]=v.useState(),[o,c]=v.useState();return v.useEffect(()=>{e.readResource(t,n).then(u=>i(Wr(u))).catch(u=>{Oe({color:"red",message:Ke(u)})})},[e,t,n]),r?s.jsxs(st,{children:[s.jsxs(Ie,{order:2,children:["Available ",t," profiles"]}),s.jsx(qe,{children:s.jsxs(s.Fragment,{children:[s.jsx(oP,{resource:r,currentProfile:o,onChange:c}),o?s.jsx(ene,{profile:o,resource:r,onResourceUpdated:u=>i(u)},o.url):s.jsx(_e,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const ene=({profile:e,resource:t,onResourceUpdated:n})=>{const r=Ae(),[i,o]=v.useState(),[c,u]=v.useState(()=>{var h,m;return(m=(h=t.meta)==null?void 0:h.profile)==null?void 0:m.includes(e.url)}),f=v.useCallback(h=>{o(void 0);const m=cl(h);c?PD(m,e.url):mU(m,e.url),r.updateResource(m).then(g=>{n(g),Oe({color:"green",message:"Success"})}).catch(g=>{o(Kt(g)),Oe({color:"red",message:Ke(g),autoClose:!1})})},[r,e.url,n,c]);return s.jsxs(qe,{children:[s.jsx(Sd,{size:"md",checked:c,label:`Conform resource to ${e.title}`,onChange:h=>u(h.currentTarget.checked),"data-testid":"profile-toggle"}),c?s.jsx(Zh,{profileUrl:e.url,defaultValue:t,onSubmit:f,outcome:i}):s.jsx("form",{noValidate:!0,onSubmit:h=>{h.preventDefault(),f(t)},children:s.jsx(je,{justify:"flex-end",mt:"xl",children:s.jsx(Pe,{type:"submit",children:"OK"})})})]})},lP={"Create Only":"create","Update Only":"update","Delete Only":"delete","All Interactions":void 0},tne=Object.keys(lP);function nne(){const e=Ae(),{id:t}=Ht(),n=Wt({reference:`Questionnaire/${t}`}),[r,i]=v.useState(),[o,c]=v.useState("create"),[u,f]=v.useState(0),h=e.searchResources("Subscription","status=active&_count=100").read().filter(g=>rne(g,n));function m(){r&&n&&e.createResource({resourceType:"Subscription",status:"active",reason:`Connect bot ${r.name} to questionnaire responses`,criteria:`QuestionnaireResponse?questionnaire=${n.url?`${n.url},${Mt(n)}`:Mt(n)}`,channel:{type:"rest-hook",endpoint:Mt(r)},...o?{extension:[{url:"https://medplum.com/fhir/StructureDefinition/subscription-supported-interaction",valueCode:o}]}:void 0}).then(()=>{i(void 0),f(Date.now()),e.invalidateSearches("Subscription"),Oe({color:"green",message:"Success"})}).catch(g=>Oe({color:"red",message:Ke(g),autoClose:!1}))}return s.jsxs(st,{children:[s.jsx(Ie,{children:"Bots"}),s.jsxs(qe,{children:[h.length===0&&s.jsx("p",{children:"No bots found."}),h.map(g=>{var y;return s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(Ic,{value:{reference:(y=g.channel)==null?void 0:y.endpoint},link:!0})}),s.jsxs("p",{children:["Criteria: ",g.criteria]})]},g.id)})]}),s.jsx(Cn,{}),s.jsxs(qe,{mt:10,children:[s.jsx(fd,{size:"lg",htmlFor:"bot",children:"Connect to bot"}),s.jsxs(je,{children:[s.jsx(ol,{name:"bot",resourceType:"Bot",onChange:g=>i(g)}),s.jsx(Pe,{onClick:m,children:"Connect"})]}),s.jsx(je,{children:s.jsx(sn,{name:"subscription-trigger-event",defaultValue:"Create Only",label:"Subscription Trigger Event",data:tne,onChange:g=>c(lP[g.target.value])})})]}),s.jsx("div",{style:{display:"none"},children:u})]})}function rne(e,t){var i;if(!t)return!1;const n=e.criteria||"",r=((i=e.channel)==null?void 0:i.endpoint)||"";return n.startsWith("QuestionnaireResponse?")&&r.startsWith("Bot/")&&(n.includes(Mt(t))||(t.url?n.includes(t.url):!1))}function ine(){const{id:e}=Ht(),t=Sn(),r=Ae().readReference({reference:`Questionnaire/${e}`}).read(),[i,o]=v.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:ue.EQUALS,value:r.url?`${r.url},Questionnaire/${e}`:`Questionnaire/${e}`}],fields:["id","_lastUpdated"]});return s.jsx(st,{children:s.jsx($c,{search:i,onClick:c=>{var u;return(u=t(`/${c.resource.resourceType}/${c.resource.id}`))==null?void 0:u.catch(console.error)},onChange:c=>o(c.definition),hideFilters:!0,hideToolbar:!0})})}function ane(){const e=Ae(),{resourceType:t,id:n}=Ht(),r=Wt({reference:t+"/"+n}),i=v.useCallback(o=>{e.updateResource(cl(o)).then(()=>{Oe({color:"green",message:"Success"})}).catch(c=>{Oe({color:"red",message:Ke(c),autoClose:!1})})},[e]);return r?s.jsx(st,{children:s.jsx(BX,{onSubmit:i,definition:r})}):null}function one(){const{resourceType:e,id:t}=Ht(),n=Wt({reference:e+"/"+t});return n?s.jsx(st,{children:e==="MeasureReport"?s.jsx(BY,{measureReport:n}):s.jsx(Ib,{value:n})}):null}const sne="_container_1ue98_1",lne="_entry_1ue98_14",cne="_active_1ue98_21",xy={container:sne,entry:lne,active:cne};function une(e){const t=Ae(),n=Wt(e.value),[r,i]=v.useState();return v.useEffect(()=>{if(!n)return;const o=o1(n);if(!o)return;const c="reference"in o?o.reference:Mt(o);t.search("ServiceRequest","subject="+c).then(u=>{const h=(u.entry??[]).map(m=>m.resource);ZA(h),h.reverse(),i(h)}).catch(u=>Oe({color:"red",message:Ke(u),autoClose:!1}))},[t,n]),r?s.jsx("div",{"data-testid":"quick-service-requests",className:xy.container,children:r.map(o=>{var c,u,f,h,m,g,y;return s.jsxs("div",{className:zt(xy.entry,{[xy.active]:o.id===(n==null?void 0:n.id)}),children:[s.jsx("p",{children:s.jsx(gt,{to:o,children:dne(o)})}),((u=(c=o.category)==null?void 0:c[0])==null?void 0:u.text)&&s.jsx("p",{children:(f=o.category[0])==null?void 0:f.text}),((g=(m=(h=o.code)==null?void 0:h.coding)==null?void 0:m[0])==null?void 0:g.code)&&s.jsx("p",{children:(y=o.code.coding[0])==null?void 0:y.code}),s.jsx("p",{children:fne(o)})]},o.id)})}):null}function dne(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function fne(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const hne="_container_1l2dh_1",pne={container:hne};function mne(e){var i,o,c,u;const t=Wt(e.valueSet);if(!t)return null;const n=[""],r=(u=(c=(o=(i=t.compose)==null?void 0:i.include)==null?void 0:o[0])==null?void 0:c.concept)==null?void 0:u.map(f=>f.code);return r&&n.push(...r),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),s.jsx("div",{className:pne.container,children:s.jsx(sn,{defaultValue:e.defaultValue,onChange:f=>e.onChange(f.currentTarget.value),data:n})})}function gne(e){var n,r;const t=Wt(e.specimen);return t?s.jsxs(pt,{children:[s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Type"}),s.jsx(pt.Value,{children:"Specimen"})]}),s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Collected"}),s.jsx(pt.Value,{children:gr((n=t.collection)==null?void 0:n.collectedDateTime)})]}),s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Specimen Age"}),s.jsx(pt.Value,{children:vne(t)})]}),(r=t.collection)!=null&&r.collectedDateTime&&t.receivedTime?s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Specimen Stability"}),s.jsx(pt.Value,{children:yne(t)})]}):s.jsx(s.Fragment,{})]}):null}function vne(e){var i;const t=(i=e.collection)==null?void 0:i.collectedDateTime;if(!t)return;const n=new Date(t);return cP(uP(n,new Date))}function yne(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 cP(uP(t,n))}function cP(e){return e.toString().padStart(3,"0")+"D"}function uP(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function xne(e){const t=["Timeline"];return e==="Bot"&&t.push("Editor","Subscriptions"),e==="PlanDefinition"&&t.push("Apply","Builder"),e==="Questionnaire"&&t.push("Preview","Builder","Bots","Responses"),(e==="DiagnosticReport"||e==="MeasureReport")&&t.push("Report"),e==="RequestGroup"&&t.push("Checklist"),e==="ObservationDefinition"&&t.push("Ranges"),e==="Agent"&&t.push("Tools"),t.push("Details","Edit","Event","History","Blame","JSON","Apps","Profiles"),e==="Patient"&&t.push("Export"),t}function bne(){var _,E,R,D,k,M,L;const e=Ae(),{resourceType:t,id:n}=Ht(),r={reference:t+"/"+n},i=Sn(),[o,c]=v.useState(),u=Wt(r,c),f=xne(t),[h,m]=v.useState(()=>{const z=window.location.pathname.split("/").pop();return z&&f.map(F=>F.toLowerCase()).includes(z)?z:f[0].toLowerCase()});async function g(){var Y,W;const F=(W=(Y=(await e.readHistory(t,n)).entry)==null?void 0:Y.find(J=>!!J.resource))==null?void 0:W.resource;F?y(F):Oe({color:"red",message:"No history to restore",autoClose:!1})}function y(z){e.updateResource(cl(z)).then(()=>{c(void 0),Oe({color:"green",message:"Success"})}).catch(F=>{Oe({color:"red",message:Ke(F),autoClose:!1})})}if(o)return Ez(o)?s.jsxs(st,{children:[s.jsx(Ie,{children:"Deleted"}),s.jsx("p",{children:"The resource was deleted."}),s.jsx(Pe,{color:"red",onClick:g,children:"Restore"})]}):s.jsx(Xr,{outcome:o});function b(z){var F;z||(z=f[0].toLowerCase()),m(z),(F=i(`/${t}/${n}/${z}`))==null||F.catch(console.error)}function S(z){const F=u,Y=F.orderDetail||[];Y.length===0&&Y.push({}),Y[0].text!==z&&(Y[0].text=z,y({...F,orderDetail:Y}))}const j=u&&o1(u),C=u&&$ee(u),T=(R=(E=(_=e.getUserConfiguration())==null?void 0:_.option)==null?void 0:E.find(z=>z.id==="statusValueSet"))==null?void 0:R.valueString;return s.jsxs(s.Fragment,{children:[(u==null?void 0:u.resourceType)==="ServiceRequest"&&T&&s.jsx(mne,{valueSet:{reference:T},defaultValue:(k=(D=u.orderDetail)==null?void 0:D[0])==null?void 0:k.text,onChange:S},Mt(u)+"-"+((L=(M=u.orderDetail)==null?void 0:M[0])==null?void 0:L.text)),u&&s.jsx(une,{value:u}),u&&s.jsxs(lr,{children:[j&&s.jsx(ok,{patient:j}),C&&s.jsx(gne,{specimen:C}),t!=="Patient"&&s.jsx(Jk,{resource:r}),s.jsx(Yr,{children:s.jsx(Rt,{value:h.toLowerCase(),onChange:b,children:s.jsx(Rt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:f.map(z=>s.jsx(Rt.Tab,{value:z.toLowerCase(),children:z},z))})})})]}),s.jsx(Jb,{})]})}function nR(){var T,_,E,R;const e=Sn(),{resourceType:t,id:n,versionId:r,tab:i}=Ht(),o=Ae(),[c,u]=v.useState(!0),[f,h]=v.useState(),[m,g]=v.useState();if(v.useEffect(()=>{g(void 0),u(!0),o.readHistory(t,n).then(D=>h(D)).then(()=>u(!1)).catch(D=>{g(D),u(!1)})},[o,t,n]),c)return s.jsx(gi,{});if(!f)return s.jsxs(st,{children:[s.jsx(Ie,{children:"Resource not found"}),s.jsx(gt,{to:`/${t}`,children:"Return to search page"})]});const y=f.entry??[],b=y.findIndex(D=>{var k,M;return((M=(k=D.resource)==null?void 0:k.meta)==null?void 0:M.versionId)===r});if(b===-1)return s.jsxs(st,{children:[s.jsx(Ie,{children:"Version not found"}),s.jsx(gt,{to:`/${t}/${n}`,children:"Return to resource"})]});const S=y[b].resource,j=b<y.length-1?y[b+1].resource:void 0,C="diff";return s.jsxs(Rt,{value:i||C,onChange:D=>{var k;return(k=e(`/${t}/${n}/_history/${r}/${D||C}`))==null?void 0:k.catch(console.error)},children:[s.jsxs(lr,{children:[s.jsx(Lc,{fluid:!0,p:"md",children:s.jsx(_e,{children:`${t} ${n}`})}),s.jsxs(Rt.List,{children:[s.jsx(Rt.Tab,{value:"diff",children:"Diff"}),s.jsx(Rt.Tab,{value:"raw",children:"Raw"})]})]}),s.jsxs(st,{children:[m&&s.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)}),s.jsx(Rt.Panel,{value:"diff",children:j?s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(T=S.meta)==null?void 0:T.versionId]}),s.jsxs("li",{children:["Previous:"," ",s.jsx(gt,{to:`/${t}/${n}/_history/${(_=j.meta)==null?void 0:_.versionId}`,children:(E=j.meta)==null?void 0:E.versionId})]})]}),s.jsx(gK,{original:j,revised:S})]}):s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(R=S.meta)==null?void 0:R.versionId]}),s.jsx("li",{children:"Previous: (none)"})]}),s.jsx("pre",{children:JSON.stringify(S,void 0,2)})]})}),s.jsx(Rt.Panel,{value:"raw",children:s.jsx("pre",{children:JSON.stringify(S,void 0,2)})})]})]})}function Sne(){const{resourceType:e,id:t}=Ht(),n=Sn(),[r,i]=v.useState({resourceType:"Subscription",filters:[{code:"url",operator:ue.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return s.jsx(st,{children:s.jsx(EY,{search:r,onClick:o=>{var c;return(c=n(`/${o.resource.resourceType}/${o.resource.id}`))==null?void 0:c.catch(console.error)},onChange:o=>i(o.definition),hideFilters:!0})})}function wne(e){const t=Ae(),{resource:n,opened:r,onClose:i}=e,[o,c]=v.useState(!1),[u,f]=v.useState(),[h,m]=v.useState(!1),g=v.useCallback(async()=>{if(n!=null&&n.id)try{await t.post(t.fhirUrl(n.resourceType,n.id,"$resend"),{subscription:o&&u?Mt(u):void 0,verbose:h}),Oe({color:"green",message:"Done"}),i()}catch(y){Oe({color:"red",message:Ke(y),autoClose:!1})}},[t,n,i,o,u,h]);return s.jsx(Vn,{opened:r,onClose:i,title:"Resend Subscriptions",children:s.jsx(mt,{onSubmit:g,children:s.jsxs(qe,{children:[s.jsx(Un,{label:"Choose subscription (all subscriptions by default)",onChange:y=>c(y.currentTarget.checked)}),o&&s.jsx(ol,{name:"subscription",resourceType:"Subscription",placeholder:"Subscription",onChange:f}),s.jsx(Un,{label:"Verbose mode",onChange:y=>m(y.currentTarget.checked)}),s.jsx(je,{justify:"flex-end",children:s.jsx(Pe,{type:"submit",children:"Resend"})})]})})})}function rR(){const e=Ae(),t=rm(),{resourceType:n,id:r}=Ht(),i={reference:n+"/"+r},[o,c]=v.useState(),u=lp(!1);function f(_,E){return e.updateResource({..._,priority:E})}function h(_,E){f(_,"stat").then(E).catch(console.error)}function m(_,E){f(_,"routine").then(E).catch(console.error)}function g(_){t(`/${_.resourceType}/${_.id}`)}function y(_){t(`/${_.resourceType}/${_.id}/edit`)}function b(_){t(`/${_.resourceType}/${_.id}/delete`)}function S(_){c(_),u[1].open()}function j(_){var E;t(`/${_.resourceType}/${_.id}/_history/${(E=_.meta)==null?void 0:E.versionId}`)}function C(_,E){const R="aws-textract";Oe({id:R,title:"AWS Textract in Progress",message:"Extracting text... This may take a moment...",loading:!0,autoClose:!1}),e.post(e.fhirUrl(_.resourceType,_.id,"$aws-textract"),{}).then(()=>{E(),As({id:R,title:"AWS Textract Successful",message:"Text successfully extracted.",color:"green",icon:s.jsx(ro,{size:"1rem"}),loading:!1,withCloseButton:!0})}).catch(D=>As({id:R,title:"AWS Textract Error",color:"red",message:Ke(D),icon:s.jsx(Gs,{size:"1rem"}),loading:!1,withCloseButton:!0}))}function T(_){var P;const{primaryResource:E,currentResource:R,reloadTimeline:D}=_,k=R.resourceType===E.resourceType&&R.id===E.id,M=R.resourceType==="Communication"&&R.priority!=="stat",L=R.resourceType==="Communication"&&R.priority==="stat",z=k,F=!k,Y=!k,W=!k,J=(P=e.getProjectMembership())==null?void 0:P.admin,G=J,X=Xee()&&(R.resourceType==="DocumentReference"||R.resourceType==="Media");return s.jsxs(Ce.Dropdown,{children:[s.jsx(Ce.Label,{children:"Resource"}),M&&s.jsx(Ce.Item,{leftSection:s.jsx(qH,{size:14}),onClick:()=>h(R,D),"aria-label":`Pin ${Mt(R)}`,children:"Pin"}),L&&s.jsx(Ce.Item,{leftSection:s.jsx(WH,{size:14}),onClick:()=>m(R,D),"aria-label":`Unpin ${Mt(R)}`,children:"Unpin"}),F&&s.jsx(Ce.Item,{leftSection:s.jsx(UE,{size:14}),onClick:()=>g(R),"aria-label":`Details ${Mt(R)}`,children:"Details"}),z&&s.jsx(Ce.Item,{leftSection:s.jsx(UE,{size:14}),onClick:()=>j(R),"aria-label":`Details ${Mt(R)}`,children:"Details"}),Y&&s.jsx(Ce.Item,{leftSection:s.jsx(pA,{size:14}),onClick:()=>y(R),"aria-label":`Edit ${Mt(R)}`,children:"Edit"}),J&&s.jsxs(s.Fragment,{children:[s.jsx(Ce.Divider,{}),s.jsx(Ce.Label,{children:"Admin"}),G&&s.jsx(Ce.Item,{leftSection:s.jsx(tq,{size:14}),onClick:()=>S(R),"aria-label":`Resend Subscriptions ${Mt(R)}`,children:"Resend Subscriptions"})]}),X&&s.jsxs(s.Fragment,{children:[s.jsx(Ce.Divider,{}),s.jsx(Ce.Label,{children:"AWS AI"}),s.jsx(Ce.Item,{leftSection:s.jsx(bq,{size:14}),onClick:()=>C(R,D),"aria-label":`AWS Textract ${Mt(R)}`,children:"AWS Textract"})]}),W&&s.jsxs(s.Fragment,{children:[s.jsx(Ce.Divider,{}),s.jsx(Ce.Label,{children:"Danger zone"}),s.jsx(Ce.Item,{color:"red",leftSection:s.jsx(am,{size:14}),onClick:()=>b(R),"aria-label":`Delete ${Mt(R)}`,children:"Delete"})]})]})}return s.jsxs(s.Fragment,{children:[n==="Encounter"&&s.jsx(NQ,{encounter:i,getMenu:T}),n==="Patient"&&s.jsx(GY,{patient:i,getMenu:T}),n==="ServiceRequest"&&s.jsx(jK,{serviceRequest:i,getMenu:T}),n!=="Encounter"&&n!=="Patient"&&n!=="ServiceRequest"&&s.jsx(PQ,{resource:i,getMenu:T}),s.jsx(wne,{resource:o,opened:u[0],onClose:u[1].close},`resend-subscriptions-${o==null?void 0:o.id}`)]})}function jne(e){const{opened:t,close:n,version:r,loadingStatus:i,handleStatus:o,handleUpgrade:c}=e,[u,f]=v.useState(),[h,m]=v.useState(!1);return v.useEffect(()=>{t&&(u||GV("app-tools-page").then(f).catch(console.error),o())},[t,u,o]),u&&r&&!i?r==="unknown"?s.jsx("p",{children:"Unable to determine the current version of the agent. Check the network connectivity of the agent."}):r.startsWith(u)?s.jsxs("p",{children:["This agent is already on the latest version (",u,")."]}):s.jsxs(s.Fragment,{children:[s.jsxs("p",{children:["Are you sure you want to upgrade this agent from version ",r," to version ",u,"?"]}),s.jsxs(je,{children:[s.jsx(Pe,{onClick:()=>{c(h),n()},"aria-label":"Confirm upgrade",children:"Confirm Upgrade"}),s.jsx(Un,{label:"Force",onChange:g=>m(g.currentTarget.checked)})]})]}):s.jsx(gi,{})}function Cne(){const e=Ae(),{id:t}=Ht(),n=v.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,i]=v.useState(!1),[o,c]=v.useState(!1),[u,f]=v.useState(!1),[h,m]=v.useState(),[g,y]=v.useState(),[b,S]=v.useState(),[j,C]=v.useState(),[T,_]=v.useState(!1),[E,R]=v.useState(!1),[D,{open:k,close:M}]=lp(!1);v.useEffect(()=>{if(r||o||u||T){R(!0);return}R(!1)},[r,o,u,T]);const L=v.useCallback(()=>{i(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(G=>{var X,P,I,$,H,O;m((P=(X=G.parameter)==null?void 0:X.find(U=>U.name==="status"))==null?void 0:P.valueCode),y(($=(I=G.parameter)==null?void 0:I.find(U=>U.name==="version"))==null?void 0:$.valueString),S((O=(H=G.parameter)==null?void 0:H.find(U=>U.name==="lastUpdated"))==null?void 0:O.valueInstant)}).catch(G=>J(Ke(G))).finally(()=>i(!1))},[e,t]),z=v.useCallback(G=>{const X=G.host,P=G.pingCount||1;X&&(_(!0),e.pushToAgent(n,X,`PING ${P}`,fn.PING,!0).then(I=>C(I)).catch(I=>J(Ke(I))).finally(()=>_(!1)))},[e,n]),F=v.useCallback(()=>{c(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(G=>{W("Agent config reloaded successfully.")}).catch(G=>J(Ke(G))).finally(()=>c(!1))},[e,t]),Y=v.useCallback(G=>{f(!0),e.get(e.fhirUrl("Agent",t,"$upgrade",`?force=${G}`),{cache:"reload"}).then(X=>{W("Agent upgraded successfully.")}).catch(X=>J(Ke(X))).finally(()=>f(!1))},[e,t]);function W(G){Oe({color:"green",title:"Success",icon:s.jsx(ro,{size:"1rem"}),message:G})}function J(G){Oe({color:"red",title:"Error",message:G,autoClose:!1})}return s.jsxs(st,{children:[s.jsx(Vn,{opened:D,onClose:M,title:"Upgrade Agent",centered:!0,children:s.jsx(jne,{opened:D,close:M,version:g,loadingStatus:r,handleStatus:L,handleUpgrade:Y})}),s.jsx(Ie,{order:1,children:"Agent Tools"}),s.jsxs("div",{style:{marginBottom:10},children:["Agent: ",s.jsx(Ic,{value:n,link:!0})]}),s.jsx(Cn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Agent Status"}),s.jsx("p",{children:"Retrieve the status of the agent. This tests whether the agent is connected to the Medplum server, and the last time it was able to communicate."}),s.jsx(Pe,{onClick:L,loading:r,disabled:E&&!r,children:"Get Status"}),!r&&h&&s.jsx(ye,{children:s.jsxs(ye.Tbody,{children:[s.jsxs(ye.Tr,{children:[s.jsx(ye.Td,{children:"Status"}),s.jsx(ye.Td,{children:s.jsx(um,{status:h})})]}),s.jsxs(ye.Tr,{children:[s.jsx(ye.Td,{children:"Version"}),s.jsx(ye.Td,{children:g})]}),s.jsxs(ye.Tr,{children:[s.jsx(ye.Td,{children:"Last Updated"}),s.jsx(ye.Td,{children:gr(b,void 0,{timeZoneName:"longOffset"})})]})]})}),s.jsx(Cn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Reload Config"}),s.jsx("p",{children:"Reload the configuration of this agent, syncing it with the current version of the Agent resource on the Medplum server."}),s.jsx(Pe,{onClick:F,loading:o,disabled:E&&!o,"aria-label":"Reload config",children:"Reload Config"}),s.jsx(Cn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Upgrade Agent"}),s.jsx("p",{children:"Upgrade the version of this agent, to either the latest (default) or a specified version."}),s.jsx(Pe,{onClick:k,loading:u,disabled:E&&!u,"aria-label":"Upgrade agent",children:"Upgrade"}),s.jsx(Cn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Ping from Agent"}),s.jsx("p",{children:"Send a ping command from the agent to a valid IP address or hostname. Use this tool to troubleshoot local network connectivity."}),s.jsx(mt,{onSubmit:z,children:s.jsxs(je,{children:[s.jsx($e,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:s.jsx(An,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:T,disabled:E&&!T,children:s.jsx(aq,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),s.jsx($p,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!T&&j&&s.jsxs(s.Fragment,{children:[s.jsx(Ie,{order:5,mt:"sm",mb:0,children:"Last Ping"}),s.jsx("pre",{children:j})]})]})}function Ene(){return s.jsx(nJ,{children:s.jsxs(Ve,{errorElement:s.jsx(Iee,{}),children:[s.jsx(Ve,{path:"/signin",element:s.jsx(nte,{})}),s.jsx(Ve,{path:"/oauth",element:s.jsx(Kee,{})}),s.jsx(Ve,{path:"/resetpassword",element:s.jsx(Jee,{})}),s.jsx(Ve,{path:"/setpassword/:id/:secret",element:s.jsx(tte,{})}),s.jsx(Ve,{path:"/register",element:s.jsx(Zee,{})}),s.jsx(Ve,{path:"/changepassword",element:s.jsx(Oee,{})}),s.jsx(Ve,{path:"/security",element:s.jsx(ete,{})}),s.jsx(Ve,{path:"/mfa",element:s.jsx(Yee,{})}),s.jsx(Ve,{path:"/batch",element:s.jsx(Pee,{})}),s.jsx(Ve,{path:"/bulk/:resourceType",element:s.jsx(Nee,{})}),s.jsx(Ve,{path:"/smart",element:s.jsx(rte,{})}),s.jsx(Ve,{path:"/forms/:id",element:s.jsx(zee,{})}),s.jsx(Ve,{path:"/admin/super",element:s.jsx(wte,{})}),s.jsx(Ve,{path:"/admin/super/asyncjob",element:s.jsx(gte,{})}),s.jsx(Ve,{path:"/admin/config",element:s.jsx(fte,{})}),s.jsxs(Ve,{path:"/admin",element:s.jsx(hte,{}),children:[s.jsx(Ve,{path:"patients",element:s.jsx(dte,{})}),s.jsx(Ve,{path:"bots/new",element:s.jsx(ote,{})}),s.jsx(Ve,{path:"bots",element:s.jsx(ite,{})}),s.jsx(Ve,{path:"clients/new",element:s.jsx(ste,{})}),s.jsx(Ve,{path:"clients",element:s.jsx(ate,{})}),s.jsx(Ve,{path:"details",element:s.jsx(XT,{})}),s.jsx(Ve,{path:"invite",element:s.jsx(ute,{})}),s.jsx(Ve,{path:"users",element:s.jsx(Cte,{})}),s.jsx(Ve,{path:"project",element:s.jsx(XT,{})}),s.jsx(Ve,{path:"secrets",element:s.jsx(pte,{})}),s.jsx(Ve,{path:"sites",element:s.jsx(mte,{})}),s.jsx(Ve,{path:"members/:membershipId",element:s.jsx(cte,{})})]}),s.jsx(Ve,{path:"/lab/assays",element:s.jsx(Ete,{})}),s.jsx(Ve,{path:"/lab/panels",element:s.jsx(Tte,{})}),s.jsx(Ve,{path:"/:resourceType/:id/_history/:versionId/:tab",element:s.jsx(nR,{})}),s.jsx(Ve,{path:"/:resourceType/:id/_history/:versionId",element:s.jsx(nR,{})}),s.jsxs(Ve,{path:"/:resourceType/new",element:s.jsx(Lee,{}),children:[s.jsx(Ve,{index:!0,element:s.jsx(yy,{})}),s.jsx(Ve,{path:"form",element:s.jsx(yy,{})}),s.jsx(Ve,{path:"json",element:s.jsx(Xte,{})}),s.jsx(Ve,{path:"profiles",element:s.jsx(yy,{})})]}),s.jsxs(Ve,{path:"/:resourceType/:id",element:s.jsx(bne,{}),children:[s.jsx(Ve,{index:!0,element:s.jsx(rR,{})}),s.jsx(Ve,{path:"apply",element:s.jsx(_te,{})}),s.jsx(Ve,{path:"apps",element:s.jsx(Dte,{})}),s.jsx(Ve,{path:"event",element:s.jsx(kte,{})}),s.jsx(Ve,{path:"blame",element:s.jsx(Pte,{})}),s.jsx(Ve,{path:"bots",element:s.jsx(nne,{})}),s.jsx(Ve,{path:"builder",element:s.jsx(Bte,{})}),s.jsx(Ve,{path:"checklist",element:s.jsx(Vte,{})}),s.jsx(Ve,{path:"delete",element:s.jsx(Fte,{})}),s.jsx(Ve,{path:"details",element:s.jsx(Gte,{})}),s.jsx(Ve,{path:"edit",element:s.jsx(Wte,{})}),s.jsx(Ve,{path:"editor",element:s.jsx(zte,{})}),s.jsx(Ve,{path:"history",element:s.jsx(Yte,{})}),s.jsx(Ve,{path:"json",element:s.jsx(Kte,{})}),s.jsx(Ve,{path:"preview",element:s.jsx(Zte,{})}),s.jsx(Ve,{path:"responses",element:s.jsx(ine,{})}),s.jsx(Ve,{path:"report",element:s.jsx(one,{})}),s.jsx(Ve,{path:"ranges",element:s.jsx(ane,{})}),s.jsx(Ve,{path:"subscriptions",element:s.jsx(Sne,{})}),s.jsx(Ve,{path:"timeline",element:s.jsx(rR,{})}),s.jsx(Ve,{path:"tools",element:s.jsx(Cne,{})}),s.jsx(Ve,{path:"profiles",element:s.jsx(Jte,{})}),s.jsx(Ve,{path:"export",element:s.jsx(Qte,{})})]}),s.jsx(Ve,{path:"/:resourceType",element:s.jsx(YT,{})}),s.jsx(Ve,{path:"/",element:s.jsx(YT,{})})]})})}function Tne(){const e=Ae(),t=e.getUserConfiguration(),n=Or(),[r]=n1();return e.isLoading()?s.jsx(gi,{}):s.jsx(xG,{logo:s.jsx(zi,{size:24}),pathname:n.pathname,searchParams:r,version:YD,menus:Rne(t),displayAddBookmark:!!(t!=null&&t.id),children:s.jsx(v.Suspense,{fallback:s.jsx(gi,{}),children:s.jsx(Ene,{})})})}function Rne(e){var n;const t=((n=e==null?void 0:e.menu)==null?void 0:n.map(r=>{var i;return{title:r.title,links:((i=r.link)==null?void 0:i.map(o=>({label:o.name,href:o.target,icon:_ne(o.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:s.jsx(kH,{})}]}),t}const iR={Patient:pq,Practitioner:TH,Organization:YF,ServiceRequest:ZH,DiagnosticReport:rq,Questionnaire:CH,admin:FF,AccessPolicy:DH,Subscription:Cq,batch:FH,Observation:zH};function _ne(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in iR){const n=iR[t];return s.jsx(n,{})}}catch{}return s.jsx(Gp,{w:30})}async function Dne(){const e=$d(),t=new XD({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=TJ([{path:"*",element:s.jsx(Tne,{})}]),i=c=>r.navigate(c);DK.createRoot(document.getElementById("root")).render(s.jsx(v.StrictMode,{children:s.jsx(WV,{medplum:t,navigate:i,children:s.jsxs(DR,{theme:n,children:[s.jsx(to,{position:"bottom-right"}),s.jsx(ZZ,{router:r})]})})}))}Dne().catch(console.error);
589
+ //# sourceMappingURL=index-KnDVVxAb.js.map