@medplum/app 4.3.3 → 4.3.5

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.
@@ -1,586 +0,0 @@
1
- function p3(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 s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{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 s of i)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function sx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vv={exports:{}},Nu={};/**
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 Mj;function m3(){if(Mj)return Nu;Mj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,s){var c=null;if(s!==void 0&&(c=""+s),i.key!==void 0&&(c=""+i.key),"key"in i){s={};for(var u in i)u!=="key"&&(s[u]=i[u])}else s=i;return i=s.ref,{$$typeof:e,type:r,key:c,ref:i!==void 0?i:null,props:s}}return Nu.Fragment=t,Nu.jsx=n,Nu.jsxs=n,Nu}var Ij;function g3(){return Ij||(Ij=1,vv.exports=m3()),vv.exports}var o=g3(),Ji=function(){return Ji=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Ji.apply(this,arguments)};function rR(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 v3(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var yv={exports:{}},xt={};/**
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 Lj;function y3(){if(Lj)return xt;Lj=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"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=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,X){this.props=O,this.context=U,this.refs=j,this.updater=X||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 D(O,U,X){this.props=O,this.context=U,this.refs=j,this.updater=X||b}var E=D.prototype=new T;E.constructor=D,S(E,C.prototype),E.isPureReactComponent=!0;var R=Array.isArray,A={H:null,A:null,T:null,S:null,V:null},k=Object.prototype.hasOwnProperty;function M(O,U,X,ee,Se,be){return X=be.ref,{$$typeof:e,type:O,key:U,ref:X!==void 0?X:null,props:be}}function I(O,U){return M(O.type,U,void 0,void 0,void 0,O.props)}function $(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function V(O){var U={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(X){return U[X]})}var Y=/\/+/g;function Q(O,U){return typeof O=="object"&&O!==null&&O.key!=null?V(""+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 K(O,U,X,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,K(xe(O._payload),U,X,ee,Se)}}if(xe)return Se=Se(O),xe=ee===""?"."+Q(O,0):ee,R(Se)?(X="",xe!=null&&(X=xe.replace(Y,"$&/")+"/"),K(Se,U,X,"",function(tt){return tt})):Se!=null&&($(Se)&&(Se=I(Se,X+(Se.key==null||O&&O.key===Se.key?"":(""+Se.key).replace(Y,"$&/")+"/")+xe)),U.push(Se)),1;xe=0;var qe=ee===""?".":ee+":";if(R(O))for(var Me=0;Me<O.length;Me++)ee=O[Me],be=qe+Q(ee,Me),xe+=K(ee,U,X,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=qe+Q(ee,Me++),xe+=K(ee,U,X,be,Se);else if(be==="object"){if(typeof O.then=="function")return K(G(O),U,X,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,X){if(O==null)return O;var ee=[],Se=0;return K(O,ee,"","",function(be){return U.call(X,be,Se++)}),ee}function L(O){if(O._status===-1){var U=O._result;U=U(),U.then(function(X){(O._status===0||O._status===-1)&&(O._status=1,O._result=X)},function(X){(O._status===0||O._status===-1)&&(O._status=2,O._result=X)}),O._status===-1&&(O._status=0,O._result=U)}if(O._status===1)return O._result.default;throw O._result}var z=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 xt.Children={map:P,forEach:function(O,U,X){P(O,function(){U.apply(this,arguments)},X)},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(!$(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},xt.Component=C,xt.Fragment=n,xt.Profiler=i,xt.PureComponent=D,xt.StrictMode=r,xt.Suspense=f,xt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,xt.__COMPILER_RUNTIME={__proto__:null,c:function(O){return A.H.useMemoCache(O)}},xt.cache=function(O){return function(){return O.apply(null,arguments)}},xt.cloneElement=function(O,U,X){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=X;else if(1<xe){for(var qe=Array(xe),Me=0;Me<xe;Me++)qe[Me]=arguments[Me+2];ee.children=qe}return M(O.type,Se,void 0,void 0,be,ee)},xt.createContext=function(O){return O={$$typeof:c,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:s,_context:O},O},xt.createElement=function(O,U,X){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=X;else if(1<xe){for(var qe=Array(xe),Me=0;Me<xe;Me++)qe[Me]=arguments[Me+2];Se.children=qe}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)},xt.createRef=function(){return{current:null}},xt.forwardRef=function(O){return{$$typeof:u,render:O}},xt.isValidElement=$,xt.lazy=function(O){return{$$typeof:m,_payload:{_status:-1,_result:O},_init:L}},xt.memo=function(O,U){return{$$typeof:p,type:O,compare:U===void 0?null:U}},xt.startTransition=function(O){var U=A.T,X={};A.T=X;try{var ee=O(),Se=A.S;Se!==null&&Se(X,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(H,z)}catch(be){z(be)}finally{A.T=U}},xt.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},xt.use=function(O){return A.H.use(O)},xt.useActionState=function(O,U,X){return A.H.useActionState(O,U,X)},xt.useCallback=function(O,U){return A.H.useCallback(O,U)},xt.useContext=function(O){return A.H.useContext(O)},xt.useDebugValue=function(){},xt.useDeferredValue=function(O,U){return A.H.useDeferredValue(O,U)},xt.useEffect=function(O,U,X){var ee=A.H;if(typeof X=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ee.useEffect(O,U)},xt.useId=function(){return A.H.useId()},xt.useImperativeHandle=function(O,U,X){return A.H.useImperativeHandle(O,U,X)},xt.useInsertionEffect=function(O,U){return A.H.useInsertionEffect(O,U)},xt.useLayoutEffect=function(O,U){return A.H.useLayoutEffect(O,U)},xt.useMemo=function(O,U){return A.H.useMemo(O,U)},xt.useOptimistic=function(O,U){return A.H.useOptimistic(O,U)},xt.useReducer=function(O,U,X){return A.H.useReducer(O,U,X)},xt.useRef=function(O){return A.H.useRef(O)},xt.useState=function(O){return A.H.useState(O)},xt.useSyncExternalStore=function(O,U,X){return A.H.useSyncExternalStore(O,U,X)},xt.useTransition=function(){return A.H.useTransition()},xt.version="19.1.0",xt}var zj;function lx(){return zj||(zj=1,yv.exports=y3()),yv.exports}var v=lx();const En=sx(v),x3=p3({__proto__:null,default:En},[v]);var hh="right-scroll-bar-position",ph="width-before-scroll-bar",b3="with-scroll-bars-hidden",S3="--removed-body-scroll-bar-size";function xv(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function w3(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 j3=typeof window<"u"?v.useLayoutEffect:v.useEffect,$j=new WeakMap;function C3(e,t){var n=w3(null,function(r){return e.forEach(function(i){return xv(i,r)})});return j3(function(){var r=$j.get(n);if(r){var i=new Set(r),s=new Set(e),c=n.current;i.forEach(function(u){s.has(u)||xv(u,null)}),s.forEach(function(u){i.has(u)||xv(u,c)})}$j.set(n,e)},[e]),n}function E3(e){return e}function T3(e,t){t===void 0&&(t=E3);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(s){var c=t(s,r);return n.push(c),function(){n=n.filter(function(u){return u!==c})}},assignSyncMedium:function(s){for(r=!0;n.length;){var c=n;n=[],c.forEach(s)}n={push:function(u){return s(u)},filter:function(){return n}}},assignMedium:function(s){r=!0;var c=[];if(n.length){var u=n;n=[],u.forEach(s),c=n}var f=function(){var m=c;c=[],m.forEach(s)},p=function(){return Promise.resolve().then(f)};p(),n={push:function(m){c.push(m),p()},filter:function(m){return c=c.filter(m),n}}}};return i}function R3(e){e===void 0&&(e={});var t=T3(null);return t.options=Ji({async:!0,ssr:!1},e),t}var iR=function(e){var t=e.sideCar,n=rR(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))};iR.isSideCarExport=!0;function D3(e,t){return e.useMedium(t),iR}var aR=R3(),bv=function(){},ip=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:bv,onWheelCapture:bv,onTouchMoveCapture:bv}),i=r[0],s=r[1],c=e.forwardProps,u=e.children,f=e.className,p=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,D=T===void 0?"div":T,E=e.gapMode,R=rR(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=y,k=C3([n,t]),M=Ji(Ji({},R),i);return v.createElement(v.Fragment,null,m&&v.createElement(A,{sideCar:aR,removeScrollBar:p,shards:g,noRelative:b,noIsolation:S,inert:j,setCallbacks:s,allowPinchZoom:!!C,lockRef:n,gapMode:E}),c?v.cloneElement(v.Children.only(u),Ji(Ji({},M),{ref:k})):v.createElement(D,Ji({},M,{className:f,ref:k}),u))});ip.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ip.classNames={fullWidth:ph,zeroRight:hh};var A3=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function _3(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=A3();return t&&e.setAttribute("nonce",t),e}function k3(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function P3(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var N3=function(){var e=0,t=null;return{add:function(n){e==0&&(t=_3())&&(k3(t,n),P3(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},O3=function(){var e=N3();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},oR=function(){var e=O3(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},M3={left:0,top:0,right:0,gap:0},Sv=function(e){return parseInt(e||"",10)||0},I3=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[Sv(n),Sv(r),Sv(i)]},L3=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return M3;var t=I3(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])}},z3=oR(),nc="data-scroll-locked",$3=function(e,t,n,r){var i=e.left,s=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
18
- .`.concat(b3,` {
19
- overflow: hidden `).concat(r,`;
20
- padding-right: `).concat(u,"px ").concat(r,`;
21
- }
22
- body[`).concat(nc,`] {
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(s,`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(nc,`] {
52
- `).concat(S3,": ").concat(u,`px;
53
- }
54
- `)},Uj=function(){var e=parseInt(document.body.getAttribute(nc)||"0",10);return isFinite(e)?e:0},U3=function(){v.useEffect(function(){return document.body.setAttribute(nc,(Uj()+1).toString()),function(){var e=Uj()-1;e<=0?document.body.removeAttribute(nc):document.body.setAttribute(nc,e.toString())}},[])},B3=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;U3();var s=v.useMemo(function(){return L3(i)},[i]);return v.createElement(z3,{styles:$3(s,!t,i,n?"":"!important")})},my=!1;if(typeof window<"u")try{var Xf=Object.defineProperty({},"passive",{get:function(){return my=!0,!0}});window.addEventListener("test",Xf,Xf),window.removeEventListener("test",Xf,Xf)}catch{my=!1}var Vl=my?{passive:!1}:!1,V3=function(e){return e.tagName==="TEXTAREA"},sR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!V3(e)&&n[t]==="visible")},F3=function(e){return sR(e,"overflowY")},H3=function(e){return sR(e,"overflowX")},Bj=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=lR(e,r);if(i){var s=cR(e,r),c=s[1],u=s[2];if(c>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},q3=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},G3=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},lR=function(e,t){return e==="v"?F3(t):H3(t)},cR=function(e,t){return e==="v"?q3(t):G3(t)},Q3=function(e,t){return e==="h"&&t==="rtl"?-1:1},W3=function(e,t,n,r,i){var s=Q3(e,window.getComputedStyle(t).direction),c=s*r,u=n.target,f=t.contains(u),p=!1,m=c>0,g=0,y=0;do{if(!u)break;var b=cR(e,u),S=b[0],j=b[1],C=b[2],T=j-C-s*S;(S||T)&&lR(e,u)&&(g+=T,y+=S);var D=u.parentNode;u=D&&D.nodeType===Node.DOCUMENT_FRAGMENT_NODE?D.host:D}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(m&&Math.abs(g)<1||!m&&Math.abs(y)<1)&&(p=!0),p},Zf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Vj=function(e){return[e.deltaX,e.deltaY]},Fj=function(e){return e&&"current"in e?e.current:e},Y3=function(e,t){return e[0]===t[0]&&e[1]===t[1]},K3=function(e){return`
55
- .block-interactivity-`.concat(e,` {pointer-events: none;}
56
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
57
- `)},X3=0,Fl=[];function Z3(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(X3++)[0],s=v.useState(oR)[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=v3([e.lockRef.current],(e.shards||[]).map(Fj),!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=Zf(j),D=n.current,E="deltaX"in j?j.deltaX:D[0]-T[0],R="deltaY"in j?j.deltaY:D[1]-T[1],A,k=j.target,M=Math.abs(E)>Math.abs(R)?"h":"v";if("touches"in j&&M==="h"&&k.type==="range")return!1;var I=Bj(M,k);if(!I)return!0;if(I?A=M:(A=M==="v"?"h":"v",I=Bj(M,k)),!I)return!1;if(!r.current&&"changedTouches"in j&&(E||R)&&(r.current=A),!A)return!0;var $=r.current||A;return W3($,C,j,$==="h"?E:R)},[]),f=v.useCallback(function(j){var C=j;if(!(!Fl.length||Fl[Fl.length-1]!==s)){var T="deltaY"in C?Vj(C):Zf(C),D=t.current.filter(function(A){return A.name===C.type&&(A.target===C.target||C.target===A.shadowParent)&&Y3(A.delta,T)})[0];if(D&&D.should){C.cancelable&&C.preventDefault();return}if(!D){var E=(c.current.shards||[]).map(Fj).filter(Boolean).filter(function(A){return A.contains(C.target)}),R=E.length>0?u(C,E[0]):!c.current.noIsolation;R&&C.cancelable&&C.preventDefault()}}},[]),p=v.useCallback(function(j,C,T,D){var E={name:j,delta:C,target:T,should:D,shadowParent:J3(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=Zf(j),r.current=void 0},[]),g=v.useCallback(function(j){p(j.type,Vj(j),j.target,u(j,e.lockRef.current))},[]),y=v.useCallback(function(j){p(j.type,Zf(j),j.target,u(j,e.lockRef.current))},[]);v.useEffect(function(){return Fl.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",f,Vl),document.addEventListener("touchmove",f,Vl),document.addEventListener("touchstart",m,Vl),function(){Fl=Fl.filter(function(j){return j!==s}),document.removeEventListener("wheel",f,Vl),document.removeEventListener("touchmove",f,Vl),document.removeEventListener("touchstart",m,Vl)}},[]);var b=e.removeScrollBar,S=e.inert;return v.createElement(v.Fragment,null,S?v.createElement(s,{styles:K3(i)}):null,b?v.createElement(B3,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function J3(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const eN=D3(aR,Z3);var lc=v.forwardRef(function(e,t){return v.createElement(ip,Ji({},e,{ref:t,sideCar:eN}))});lc.classNames=ip.classNames;function sn(e){return Object.keys(e)}function wv(e){return e&&typeof e=="object"&&!Array.isArray(e)}function cx(e,t){const n={...e},r=t;return wv(e)&&wv(t)&&Object.keys(t).forEach(i=>{wv(r[i])&&i in e?n[i]=cx(n[i],r[i]):n[i]=r[i]}),n}function tN(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function nN(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 Ku(e){const t=nN(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 jv(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function uR(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?jv(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(s=>n(s)).join(",");if(r.includes(" "))return r.split(" ").map(s=>n(s)).join(" ");if(r.includes(e))return t?jv(r):r;const i=r.replace("px","");if(!Number.isNaN(Number(i))){const s=`${Number(i)/16}${e}`;return t?jv(s):s}}return r}return n}const le=uR("rem",{shouldScale:!0}),Ch=uR("em");function qo(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function dR(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 Fa(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:s})=>o.jsx(t.Provider,{value:s,children:i}),()=>{const i=v.useContext(t);if(i===null)throw new Error(e);return i}]}function Ha(e=null){const t=v.createContext(e);return[({children:i,value:s})=>o.jsx(t.Provider,{value:s,children:i}),()=>v.useContext(t)]}function Hj(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function Eh(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function rN(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 iN(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 aN(e,t,n){return Eh(e,n)===Eh(t,n)}function fR({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:i=!1,dir:s="rtl",orientation:c}){return u=>{var S;n==null||n(u);const f=Array.from(((S=Eh(u.currentTarget,e))==null?void 0:S.querySelectorAll(t))||[]).filter(j=>aN(u.currentTarget,j,e)),p=f.findIndex(j=>u.currentTarget===j),m=iN(p,f,r),g=rN(p,f,r),y=s==="rtl"?g:m,b=s==="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 oN={app:100,modal:200,popover:300,overlay:400,max:9999};function Wr(e){return oN[e]}const Th=()=>{};function sN(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||Th: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 dR(e)?n?le(e):e:`var(--${t}-${e})`}function Nn(e){return rt(e,"mantine-spacing")}function Vt(e){return e===void 0?"var(--mantine-radius-default)":rt(e,"mantine-radius")}function On(e){return rt(e,"mantine-font-size")}function hR(e){return rt(e,"mantine-line-height",!1)}function ux(e){if(e)return rt(e,"mantine-shadow",!1)}function Rr(e,t){return n=>{e==null||e(n),t==null||t(n)}}function dx(e,t){return e in t?Ku(t[e]):Ku(e)}function Xu(e,t){const n=e.map(r=>({value:r,px:dx(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 lN(e,t,n){var r;return n?Array.from(((r=Eh(n,t))==null?void 0:r.querySelectorAll(e))||[]).findIndex(i=>i===n):null}function cN(){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 Rh(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function uN(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 s=n[i];if(!(s in t)||e[s]!==t[s]&&!(Number.isNaN(e[s])&&Number.isNaN(t[s])))return!1}return!0}function qj(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Cs(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 ap(e,t){const n=typeof t=="number"?t:t.delay,r=typeof t=="number"?!1:t.flushOnUnmount,i=Cs(e),s=v.useRef(0),c=v.useRef(()=>{}),u=Object.assign(v.useCallback((...f)=>{window.clearTimeout(s.current);const p=()=>{s.current!==0&&(s.current=0,i(...f))};c.current=p,u.flush=p,s.current=window.setTimeout(p,n)},[i,n]),{flush:c.current});return v.useEffect(()=>()=>{window.clearTimeout(s.current),r&&u.flush()},[u,r]),u}const Gj=["mousedown","touchstart"];function dN(e,t,n){const r=v.useRef(null);return v.useEffect(()=>{const i=s=>{const{target:c}=s??{};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(p=>!!p&&!s.composedPath().includes(p))&&!u&&e()}else r.current&&!r.current.contains(c)&&e()};return(t||Gj).forEach(s=>document.addEventListener(s,i)),()=>{(t||Gj).forEach(s=>document.removeEventListener(s,i))}},[r,e,n]),r}function pR({timeout:e=2e3}={}){const[t,n]=v.useState(null),[r,i]=v.useState(!1),[s,c]=v.useState(null),u=m=>{window.clearTimeout(s),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(s)},error:t,copied:r}}function fN(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function hN(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function mR(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,i]=v.useState(n?t:hN(e)),s=v.useRef(null);return v.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),i(s.current.matches),fN(s.current,c=>i(c.matches))},[e]),r}function pN(e,t){return mR("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const Sc=typeof document<"u"?v.useLayoutEffect:v.useEffect;function za(e,t){const n=v.useRef(!1);v.useEffect(()=>()=>{n.current=!1},[]),v.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function gR({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 za(()=>{let i=-1;const s=c=>{c.key==="Tab"&&window.clearTimeout(i)};return document.addEventListener("keydown",s),e?n.current=document.activeElement:t&&(i=window.setTimeout(r,10)),()=>{window.clearTimeout(i),document.removeEventListener("keydown",s)}},[e,t]),r}const mN=/input|select|textarea|button|object/,vR="a, input, select, textarea, button, object, [tabindex]";function gN(e){return e.style.display==="none"}function vN(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(gN(n))return!1;n=n.parentNode}return!0}function yR(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function gy(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(yR(e));return(mN.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&vN(e)}function xR(e){const t=yR(e);return(Number.isNaN(t)||t>=0)&&gy(e)}function yN(e){return Array.from(e.querySelectorAll(vR)).filter(xR)}function xN(e,t){const n=yN(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],i=e.getRootNode();let s=r===i.activeElement||e===i.activeElement;const c=i.activeElement;if(c.tagName==="INPUT"&&c.getAttribute("type")==="radio"&&(s=n.filter(m=>m.getAttribute("type")==="radio"&&m.getAttribute("name")===c.getAttribute("name")).includes(r)),!s)return;t.preventDefault();const f=n[t.shiftKey?n.length-1:0];f&&f.focus()}function bN(e=!0){const t=v.useRef(null),n=i=>{let s=i.querySelector("[data-autofocus]");if(!s){const c=Array.from(i.querySelectorAll(vR));s=c.find(xR)||c.find(gy)||null,!s&&gy(i)&&(s=i)}s&&s.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=s=>{s.key==="Tab"&&t.current&&xN(t.current,s)};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[e]),r}const SN=e=>(e+1)%1e6;function wN(){const[,e]=v.useReducer(SN,0);return e}const jN=En.useId||(()=>{});function CN(){const e=jN();return e?`mantine-${e.replace(/:/g,"")}`:""}function yr(e){const t=CN(),[n,r]=v.useState(t);return Sc(()=>{r(Rh())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function bR(e,t,n){v.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function Zu(e,t){if(typeof e=="function")return e(t);typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function EN(...e){const t=new Map;return n=>{if(e.forEach(r=>{const i=Zu(r,n);i&&t.set(r,i)}),t.size>0)return()=>{e.forEach(r=>{const i=t.get(r);i?i():Zu(r,null)}),t.clear()}}}function $n(...e){return v.useCallback(EN(...e),e)}function Yn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[i,s]=v.useState(t!==void 0?t:n),c=(u,...f)=>{s(u),r==null||r(u,...f)};return e!==void 0?[e,r,!0]:[i,c,!1]}function ko(e,t){const n=t-e+1;return Array.from({length:n},(r,i)=>i+e)}const Jf="dots";function TN({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:i=1,onChange:s}){const c=Math.max(Math.trunc(e),0),[u,f]=Yn({value:r,onChange:s,defaultValue:i,finalValue:i}),p=j=>{j<=0?f(1):j>c?f(c):f(j)},m=()=>p(u+1),g=()=>p(u-1),y=()=>p(1),b=()=>p(c);return{range:v.useMemo(()=>{if(t*2+3+n*2>=c)return ko(1,c);const C=Math.max(u-t,n),T=Math.min(u+t,c-n),D=C>n+2,E=T<c-(n+1);if(!D&&E){const R=t*2+n+2;return[...ko(1,R),Jf,...ko(c-(n-1),c)]}if(D&&!E){const R=n+1+2*t;return[...ko(1,n),Jf,...ko(c-R,c)]}return[...ko(1,n),Jf,...ko(C,T),Jf,...ko(c-n+1,c)]},[c,t,u]),active:u,setPage:p,next:m,previous:g,first:y,last:b}}function fx(e,t){return mR("(prefers-reduced-motion: reduce)",e,t)}function RN(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(!uN(e[n],t[n]))return!1;return!0}function DN(e){const t=v.useRef([]),n=v.useRef(0);return RN(t.current,e)||(t.current=e,n.current+=1),[n.current]}function AN(e,t){v.useEffect(e,DN(t))}function op(e=!1,t){const{onOpen:n,onClose:r}={},[i,s]=v.useState(e),c=v.useCallback(()=>{s(p=>p||(n==null||n(),!0))},[n]),u=v.useCallback(()=>{s(p=>p&&(r==null||r(),!1))},[r]),f=v.useCallback(()=>{i?u():c()},[u,c,i]);return[i,{open:c,close:u,toggle:f}]}function _N(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]),s=v.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return v.useEffect(()=>(n.autoInvoke&&i(),s),[s,i]),{start:i,clear:s}}function kN(e,t,n){const r=v.useRef(null),i=v.useRef(null);return v.useEffect(()=>{const s=typeof n=="function"?n():n;return(s||i.current)&&(r.current=new MutationObserver(e),r.current.observe(s||i.current,t)),()=>{var c;(c=r.current)==null||c.disconnect()}},[e,t]),i}function PN(){const[e,t]=v.useState(!1);return v.useEffect(()=>t(!0),[]),e}var NN={};function SR(){return typeof process<"u"&&NN?"production":"development"}function sp(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 wR(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=wR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ut(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=wR(e))&&(r&&(r+=" "),r+=t);return r}const ON={};function MN(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,i])=>{t[r]?t[r]=Ut(t[r],i):t[r]=i})}),t}function lp({theme:e,classNames:t,props:n,stylesCtx:r}){const s=(Array.isArray(t)?t:[t]).map(c=>typeof c=="function"?c(e,n,r):c||ON);return MN(s)}function Dh({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((s,c)=>typeof c=="function"?{...s,...c(e,n,r)}:{...s,...c},{})}const hx=v.createContext(null);function qa(){const e=v.useContext(hx);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function IN(){return qa().cssVariablesResolver}function LN(){return qa().classNamesPrefix}function cp(){return qa().getStyleNonce}function zN(){return qa().withStaticClasses}function $N(){return qa().headless}function UN(){var e;return(e=qa().stylesTransform)==null?void 0:e.sx}function BN(){var e;return(e=qa().stylesTransform)==null?void 0:e.styles}function jR(){return qa().env||"default"}function VN(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function FN(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,s=n&255;return{r,g:i,b:s,a:1}}function HN(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 qN(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,s=parseInt(n[3],10)/100,c=n[5]?parseFloat(n[5]):void 0,u=(1-Math.abs(2*s-1))*i,f=r/60,p=u*(1-Math.abs(f%2-1)),m=s-u/2;let g,y,b;return f>=0&&f<1?(g=u,y=p,b=0):f>=1&&f<2?(g=p,y=u,b=0):f>=2&&f<3?(g=0,y=u,b=p):f>=3&&f<4?(g=0,y=p,b=u):f>=4&&f<5?(g=p,y=0,b=u):(g=u,y=0,b=p),{r:Math.round((g+m)*255),g:Math.round((y+m)*255),b:Math.round((b+m)*255),a:c||1}}function px(e){return VN(e)?FN(e):e.startsWith("rgb")?HN(e):e.startsWith("hsl")?qN(e):{r:0,g:0,b:0,a:1}}function eh(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:i,a:s}=px(e),c=1-t,u=f=>Math.round(f*c);return`rgba(${u(n)}, ${u(r)}, ${u(i)}, ${s})`}function Ju(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function Cv(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function GN(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function QN(e){if(e.startsWith("oklch("))return(GN(e)||0)/100;const{r:t,g:n,b:r}=px(e),i=t/255,s=n/255,c=r/255,u=Cv(i),f=Cv(s),p=Cv(c);return .2126*u+.7152*f+.0722*p}function Ou(e,t=.179){return e.startsWith("var(")?!1:QN(e)>t}function hi({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:Ou(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:Ou(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:Ou(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,i]=e.split("."),s=i?Number(i):void 0,c=r in t.colors;if(c){const u=s!==void 0?t.colors[r][s]:t.colors[r][Ju(t,n||"light")];return{color:r,value:u,shade:s,isThemeColor:c,isLight:Ou(u,t.luminanceThreshold),variable:i?`--mantine-color-${r}-${s}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:c,isLight:Ou(e,t.luminanceThreshold),shade:s,variable:void 0}}function Ht(e,t){const n=hi({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function vy(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=Ht(n.from,t),i=Ht(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${i} 100%)`}function ci(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const s=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${s}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:i}=px(e);return`rgba(${n}, ${r}, ${i}, ${t})`}const Hl=ci,WN=({color:e,theme:t,variant:n,gradient:r,autoContrast:i})=>{const s=hi({color:e,theme:t}),c=typeof i=="boolean"?i:t.autoContrast;if(n==="filled"){const u=c&&s.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return s.isThemeColor?s.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:u,border:`${le(1)} solid transparent`}:{background:`var(--mantine-color-${s.color}-${s.shade})`,hover:`var(--mantine-color-${s.color}-${s.shade===9?8:s.shade+1})`,color:u,border:`${le(1)} solid transparent`}:{background:e,hover:eh(e,.1),color:u,border:`${le(1)} solid transparent`}}if(n==="light"){if(s.isThemeColor){if(s.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`};const u=t.colors[s.color][s.shade];return{background:ci(u,.1),hover:ci(u,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:ci(e,.1),hover:ci(e,.12),color:e,border:`${le(1)} solid transparent`}}if(n==="outline")return s.isThemeColor?s.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${le(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:ci(t.colors[s.color][s.shade],.05),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${le(1)} solid var(--mantine-color-${s.color}-${s.shade})`}:{background:"transparent",hover:ci(e,.05),color:e,border:`${le(1)} solid ${e}`};if(n==="subtle"){if(s.isThemeColor){if(s.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`};const u=t.colors[s.color][s.shade];return{background:"transparent",hover:ci(u,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:"transparent",hover:ci(e,.12),color:e,border:`${le(1)} solid transparent`}}return n==="transparent"?s.isThemeColor?s.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-${s.color}-${Math.min(s.shade,6)})`,border:`${le(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${le(1)} solid transparent`}:n==="white"?s.isThemeColor?s.shade===void 0?{background:"var(--mantine-color-white)",hover:eh(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:eh(t.white,.01),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:eh(t.white,.01),color:e,border:`${le(1)} solid transparent`}:n==="gradient"?{background:vy(r,t),hover:vy(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)`}:{}},YN={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"]},Qj="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",mx={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:YN,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:WN,autoContrast:!1,luminanceThreshold:.3,fontFamily:Qj,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:Qj,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 Wj(e){return e==="auto"||e==="dark"||e==="light"}function KN({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 Wj(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&&Wj(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const XN="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",Yj="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function Ev(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function Kj(e){if(!(e.primaryColor in e.colors))throw new Error(XN);if(typeof e.primaryShade=="object"&&(!Ev(e.primaryShade.dark)||!Ev(e.primaryShade.light)))throw new Error(Yj);if(typeof e.primaryShade=="number"&&!Ev(e.primaryShade))throw new Error(Yj)}function ZN(e,t){var r;if(!t)return Kj(e),e;const n=cx(e,t);return t.fontFamily&&!((r=t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),Kj(n),n}const gx=v.createContext(null),JN=()=>v.useContext(gx)||mx;function Sn(){const e=v.useContext(gx);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 CR({theme:e,children:t,inherit:n=!0}){const r=JN(),i=v.useMemo(()=>ZN(n?r:mx,e),[e,r,n]);return o.jsx(gx.Provider,{value:i,children:t})}CR.displayName="@mantine/core/MantineThemeProvider";function eO(){const e=Sn(),t=cp(),n=sn(e.breakpoints).reduce((r,i)=>{const s=e.breakpoints[i].includes("px"),c=Ku(e.breakpoints[i]),u=s?`${c-.1}px`:Ch(c-.1),f=s?`${c}px`:Ch(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 o.jsx("style",{"data-mantine-styles":"classes",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:n}})}function Tv(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function Mu(e,t){return(Array.isArray(e)?e:[e]).reduce((r,i)=>`${i}{${r}}`,t)}function tO(e,t){const n=Tv(e.variables),r=n?Mu(t,n):"",i=Tv(e.dark),s=Tv(e.light),c=i?Mu(t===":host"?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,i):"",u=s?Mu(t===":host"?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,s):"";return`${r}${c}${u}`}function Ga({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&hi({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function Xj(e,t){return Ga({color:e.colors[e.primaryColor][Ju(e,t)],theme:e,autoContrast:null})}function th({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n==="light"){const u=Ju(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`]:Hl(e.colors[t][u],.1),[`--mantine-color-${r}-light-hover`]:Hl(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`]:Hl(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 s=Ju(e,"dark"),c={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${s})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${s===9?8:s+1})`,[`--mantine-color-${r}-light`]:Hl(e.colors[t][Math.max(0,s-2)],.15),[`--mantine-color-${r}-light-hover`]:Hl(e.colors[t][Math.max(0,s-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(s-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(s-4,0)})`,[`--mantine-color-${r}-outline-hover`]:Hl(e.colors[t][Math.max(s-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 nO(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function ql(e,t,n){sn(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const ER=e=>{const t=Ju(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":Xj(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":Xj(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((s,c)=>{r.variables[`--mantine-primary-color-${c}`]=`var(--mantine-color-${e.primaryColor}-${c})`}),sn(e.colors).forEach(s=>{const c=e.colors[s];if(nO(c)){Object.assign(r.light,th({theme:e,name:c.name,color:c.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,th({theme:e,name:c.name,color:c.dark,colorScheme:"dark",withColorValues:!0}));return}c.forEach((u,f)=>{r.variables[`--mantine-color-${s}-${f}`]=u}),Object.assign(r.light,th({theme:e,color:s,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,th({theme:e,color:s,colorScheme:"dark",withColorValues:!1}))});const i=e.headings.sizes;return sn(i).forEach(s=>{r.variables[`--mantine-${s}-font-size`]=i[s].fontSize,r.variables[`--mantine-${s}-line-height`]=i[s].lineHeight,r.variables[`--mantine-${s}-font-weight`]=i[s].fontWeight||e.headings.fontWeight}),r};function rO({theme:e,generator:t}){const n=ER(e),r=t==null?void 0:t(e);return r?cx(n,r):n}const Rv=ER(mx);function iO(e){const t={variables:{},light:{},dark:{}};return sn(e.variables).forEach(n=>{Rv.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),sn(e.light).forEach(n=>{Rv.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),sn(e.dark).forEach(n=>{Rv.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function aO(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 TR({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=Sn(),r=cp(),i=IN(),s=rO({theme:n,generator:i}),c=e===":root"&&t,u=c?iO(s):s,f=tO(u,e);return f?o.jsx("style",{"data-mantine-styles":!0,nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:`${f}${c?"":aO(e)}`}}):null}TR.displayName="@mantine/CssVariables";function oO(){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 Gl(e,t){var i,s;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";(s=t())==null||s.setAttribute("data-mantine-color-scheme",r)}function sO({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const i=v.useRef(null),[s,c]=v.useState(()=>e.get(t)),u=r||s,f=v.useCallback(m=>{r||(Gl(m,n),c(m),e.set(m))},[e.set,u,r]),p=v.useCallback(()=>{c(t),Gl(t,n),e.clear()},[e.clear,t]);return v.useEffect(()=>(e.subscribe(f),e.unsubscribe),[e.subscribe,e.unsubscribe]),Sc(()=>{Gl(e.get(t),n)},[]),v.useEffect(()=>{var g;if(r)return Gl(r,n),()=>{};r===void 0&&Gl(s,n),typeof window<"u"&&"matchMedia"in window&&(i.current=window.matchMedia("(prefers-color-scheme: dark)"));const m=y=>{s==="auto"&&Gl(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)}},[s,r]),{colorScheme:u,setColorScheme:f,clearColorScheme:p}}function lO({respectReducedMotion:e,getRootElement:t}){Sc(()=>{var n;e&&((n=t())==null||n.setAttribute("data-respect-reduced-motion","true"))},[e])}oO();function RR({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:i=!0,deduplicateCssVariables:s=!0,withCssVariables:c=!0,cssVariablesSelector:u=":root",classNamesPrefix:f="mantine",colorSchemeManager:p=KN(),defaultColorScheme:m="light",getRootElement:g=()=>document.documentElement,cssVariablesResolver:y,forceColorScheme:b,stylesTransform:S,env:j}){const{colorScheme:C,setColorScheme:T,clearColorScheme:D}=sO({defaultColorScheme:m,forceColorScheme:b,manager:p,getRootElement:g});return lO({respectReducedMotion:(e==null?void 0:e.respectReducedMotion)||!1,getRootElement:g}),o.jsx(hx.Provider,{value:{colorScheme:C,setColorScheme:T,clearColorScheme:D,getRootElement:g,classNamesPrefix:f,getStyleNonce:n,cssVariablesResolver:y,cssVariablesSelector:u,withStaticClasses:r,stylesTransform:S,env:j},children:o.jsxs(CR,{theme:e,children:[c&&o.jsx(TR,{cssVariablesSelector:u,deduplicateCssVariables:s}),i&&o.jsx(eO,{}),t]})})}RR.displayName="@mantine/core/MantineProvider";function Ys({classNames:e,styles:t,props:n,stylesCtx:r}){const i=Sn();return{resolvedClassNames:lp({theme:i,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:Dh({theme:i,styles:t,props:n,stylesCtx:r||void 0})}}const cO={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function uO({theme:e,options:t,unstyled:n}){return Ut((t==null?void 0:t.focusable)&&!n&&(e.focusClassName||cO[e.focusRing]),(t==null?void 0:t.active)&&!n&&e.activeClassName)}function dO({selector:e,stylesCtx:t,options:n,props:r,theme:i}){return lp({theme:i,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||r,stylesCtx:t})[e]}function Zj({selector:e,stylesCtx:t,theme:n,classNames:r,props:i}){return lp({theme:n,classNames:r,props:i,stylesCtx:t})[e]}function fO({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function hO({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function pO({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(i=>`${t}-${i}-${n}`)}function mO({themeName:e,theme:t,selector:n,props:r,stylesCtx:i}){return e.map(s=>{var c,u;return(u=lp({theme:t,classNames:(c=t.components[s])==null?void 0:c.classNames,props:r,stylesCtx:i}))==null?void 0:u[n]})}function gO({options:e,classes:t,selector:n,unstyled:r}){return e!=null&&e.variant&&!r?t[`${n}--${e.variant}`]:void 0}function vO({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:i,classNames:s,classes:c,unstyled:u,className:f,rootSelector:p,props:m,stylesCtx:g,withStaticClasses:y,headless:b,transformedStyles:S}){return Ut(uO({theme:e,options:t,unstyled:u||b}),mO({theme:e,themeName:n,selector:r,props:m,stylesCtx:g}),gO({options:t,classes:c,selector:r,unstyled:u}),Zj({selector:r,stylesCtx:g,theme:e,classNames:s,props:m}),Zj({selector:r,stylesCtx:g,theme:e,classNames:S,props:m}),dO({selector:r,stylesCtx:g,options:t,props:m,theme:e}),fO({rootSelector:p,selector:r,className:f}),hO({selector:r,classes:c,unstyled:u||b}),y&&!b&&pO({themeName:n,classNamesPrefix:i,selector:r,withStaticClass:t==null?void 0:t.withStaticClass}),t==null?void 0:t.className)}function yO({theme:e,themeName:t,props:n,stylesCtx:r,selector:i}){return t.map(s=>{var c;return Dh({theme:e,styles:(c=e.components[s])==null?void 0:c.styles,props:n,stylesCtx:r})[i]}).reduce((s,c)=>({...s,...c}),{})}function yy({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...yy({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function xO(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...qo(n[r])}}),t),{})}function bO({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:i,selector:s,themeName:c,headless:u}){var f;return(f=xO([u?{}:t==null?void 0:t(n,r,i),...c.map(p=>{var m,g,y;return(y=(g=(m=n.components)==null?void 0:m[p])==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[s]}function SO({theme:e,themeName:t,selector:n,options:r,props:i,stylesCtx:s,rootSelector:c,styles:u,style:f,vars:p,varsResolver:m,headless:g,withStylesTransform:y}){return{...!y&&yO({theme:e,themeName:t,props:i,stylesCtx:s,selector:n}),...!y&&Dh({theme:e,styles:u,props:i,stylesCtx:s})[n],...!y&&Dh({theme:e,styles:r==null?void 0:r.styles,props:(r==null?void 0:r.props)||i,stylesCtx:s})[n],...bO({theme:e,props:i,stylesCtx:s,vars:p,varsResolver:m,selector:n,themeName:t,headless:g}),...c===n?yy({style:f,theme:e}):null,...yy({style:r==null?void 0:r.style,theme:e})}}function wO({props:e,stylesCtx:t,themeName:n}){var c;const r=Sn(),i=(c=BN())==null?void 0:c();return{getTransformedStyles:u=>i?[...u.map(p=>i(p,{props:e,theme:r,ctx:t})),...n.map(p=>{var m;return i((m=r.components[p])==null?void 0:m.styles,{props:e,theme:r,ctx:t})})].filter(Boolean):[],withStylesTransform:!!i}}function Ie({name:e,classes:t,props:n,stylesCtx:r,className:i,style:s,rootSelector:c="root",unstyled:u,classNames:f,styles:p,vars:m,varsResolver:g}){const y=Sn(),b=LN(),S=zN(),j=$N(),C=(Array.isArray(e)?e:[e]).filter(E=>E),{withStylesTransform:T,getTransformedStyles:D}=wO({props:n,stylesCtx:r,themeName:C});return(E,R)=>({className:vO({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:D([R==null?void 0:R.styles,p])}),style:SO({theme:y,themeName:C,selector:E,options:R,props:n,stylesCtx:r,rootSelector:c,styles:p,style:s,vars:m,varsResolver:g,headless:j,withStylesTransform:T})})}function Ks(e,t){return typeof e=="boolean"?e:t.autoContrast}function Jj(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 jO({keepTransitions:e}={}){const t=v.useRef(Th),n=v.useRef(-1),r=v.useContext(hx),i=cp(),s=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?()=>{}:Jj(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var y;(y=t.current)==null||y.call(t)},10)},u=()=>{r.clearColorScheme(),t.current=e?()=>{}:Jj(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var g;(g=t.current)==null||g.call(t)},10)},f=pN("light",{getInitialValueInEffect:!1}),p=r.colorScheme==="auto"?f:r.colorScheme,m=v.useCallback(()=>c(p==="light"?"dark":"light"),[c,p]);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=Sn(),i=(c=r.components[e])==null?void 0:c.defaultProps,s=typeof i=="function"?i(r):i;return{...t,...s,...qo(n)}}function Dv(e){return sn(e).reduce((t,n)=>e[n]!==void 0?`${t}${tN(n)}:${e[n]};`:t,"").trim()}function CO({selector:e,styles:t,media:n,container:r}){const i=t?Dv(t):"",s=Array.isArray(n)?n.map(u=>`@media${u.query}{${e}{${Dv(u.styles)}}}`):[],c=Array.isArray(r)?r.map(u=>`@container ${u.query}{${e}{${Dv(u.styles)}}}`):[];return`${i?`${e}{${i}}`:""}${s.join("")}${c.join("")}`.trim()}function Xs(e){const t=cp();return o.jsx("style",{"data-mantine-styles":"inline",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:CO(e)}})}function Qa(e){const{m:t,mx:n,my:r,mt:i,mb:s,ml:c,mr:u,me:f,ms:p,p:m,px:g,py:y,pt:b,pb:S,pl:j,pr:C,pe:T,ps:D,bd:E,bg:R,c:A,opacity:k,ff:M,fz:I,fw:$,lts:V,ta:Y,lh:Q,fs:J,tt:G,td:K,w:P,miw:L,maw:z,h:H,mih:O,mah:U,bgsz:X,bgp:ee,bgr:Se,bga:be,pos:xe,top:qe,left:Me,bottom:tt,right:ke,inset:vt,display:It,flex:Lt,hiddenFrom:gt,visibleFrom:At,lightHidden:nn,darkHidden:Ee,sx:De,...Qe}=e;return{styleProps:qo({m:t,mx:n,my:r,mt:i,mb:s,ml:c,mr:u,me:f,ms:p,p:m,px:g,py:y,pt:b,pb:S,pl:j,pr:C,pe:T,ps:D,bd:E,bg:R,c:A,opacity:k,ff:M,fz:I,fw:$,lts:V,ta:Y,lh:Q,fs:J,tt:G,td:K,w:P,miw:L,maw:z,h:H,mih:O,mah:U,bgsz:X,bgp:ee,bgr:Se,bga:be,pos:xe,top:qe,left:Me,bottom:tt,right:ke,inset:vt,display:It,flex:Lt,hiddenFrom:gt,visibleFrom:At,lightHidden:nn,darkHidden:Ee,sx:De}),rest:Qe}}const EO={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 vx(e,t){const n=hi({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 TO(e,t){const n=hi({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:vx(e,t)}function RO(e,t){if(typeof e=="number")return le(e);if(typeof e=="string"){const[n,r,...i]=e.split(" ").filter(c=>c.trim()!=="");let s=`${le(n)}`;return r&&(s+=` ${r}`),i.length>0&&(s+=` ${vx(i.join(" "),t)}`),s.trim()}return e}const eC={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 DO(e){return typeof e=="string"&&e in eC?eC[e]:e}const AO=["h1","h2","h3","h4","h5","h6"];function _O(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&AO.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?le(e):e}function kO(e){return e}const PO=["h1","h2","h3","h4","h5","h6"];function NO(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&PO.includes(e)?`var(--mantine-${e}-line-height)`:e}function OO(e){return typeof e=="number"?le(e):e}function MO(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 Av={color:vx,textColor:TO,fontSize:_O,spacing:MO,identity:kO,size:OO,lineHeight:NO,fontFamily:DO,border:RO};function tC(e){return e.replace("(min-width: ","").replace("em)","")}function IO({media:e,...t}){const r=Object.keys(e).sort((i,s)=>Number(tC(i))-Number(tC(s))).map(i=>({query:i,styles:e[i]}));return{...t,media:r}}function LO(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function zO(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function $O(e){return typeof e=="object"&&e!==null?sn(e).filter(t=>t!=="base"):[]}function UO(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function DR({styleProps:e,data:t,theme:n}){return IO(sn(e).reduce((r,i)=>{if(i==="hiddenFrom"||i==="visibleFrom"||i==="sx")return r;const s=t[i],c=Array.isArray(s.property)?s.property:[s.property],u=zO(e[i]);if(!LO(e[i]))return c.forEach(p=>{r.inlineStyles[p]=Av[s.type](u,n)}),r;r.hasResponsiveStyles=!0;const f=$O(e[i]);return c.forEach(p=>{u&&(r.styles[p]=Av[s.type](u,n)),f.forEach(m=>{const g=`(min-width: ${n.breakpoints[m]})`;r.media[g]={...r.media[g],[p]:Av[s.type](UO(e[i],m),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function fd(){return`__m__-${v.useId().replace(/:/g,"")}`}function AR(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...AR(r,t)}),{}):typeof e=="function"?e(t):e??{}}function _R(e){return e.startsWith("data-")?e:`data-${e}`}function BO(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[_R(n)]=e[n]),t},{})}function kR(e){return e?typeof e=="string"?{[_R(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...kR(n)}),{}):BO(e):null}function xy(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...xy(r,t)}),{}):typeof e=="function"?e(t):e??{}}function VO({theme:e,style:t,vars:n,styleProps:r}){const i=xy(t,e),s=xy(n,e);return{...i,...s,...r}}const PR=v.forwardRef(({component:e,style:t,__vars:n,className:r,variant:i,mod:s,size:c,hiddenFrom:u,visibleFrom:f,lightHidden:p,darkHidden:m,renderRoot:g,__size:y,...b},S)=>{var I;const j=Sn(),C=e||"div",{styleProps:T,rest:D}=Qa(b),E=UN(),R=(I=E==null?void 0:E())==null?void 0:I(T.sx),A=fd(),k=DR({styleProps:T,theme:j,data:EO}),M={ref:S,style:VO({theme:j,style:t,vars:n,styleProps:k.inlineStyles}),className:Ut(r,R,{[A]:k.hasResponsiveStyles,"mantine-light-hidden":p,"mantine-dark-hidden":m,[`mantine-hidden-from-${u}`]:u,[`mantine-visible-from-${f}`]:f}),"data-variant":i,"data-size":dR(c)?void 0:c||void 0,size:y,...kR(s),...D};return o.jsxs(o.Fragment,{children:[k.hasResponsiveStyles&&o.jsx(Xs,{selector:`.${A}`,styles:k.styles,media:k.media}),typeof g=="function"?g(M):o.jsx(C,{...M})]})});PR.displayName="@mantine/core/Box";const ce=PR;function NR(e){return e}function FO(e){const t=e;return n=>{const r=v.forwardRef((i,s)=>o.jsx(t,{...n,...i,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r}}function ve(e){const t=v.forwardRef(e);return t.extend=NR,t.withProps=n=>{const r=v.forwardRef((i,s)=>o.jsx(t,{...n,...i,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t}function lr(e){const t=v.forwardRef(e);return t.withProps=n=>{const r=v.forwardRef((i,s)=>o.jsx(t,{...n,...i,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t.extend=NR,t}const HO=v.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function Zs(){return v.useContext(HO)}var _v={exports:{}},ir={};/**
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 nC;function qO(){if(nC)return ir;nC=1;var e=lx();function t(f){var p="https://react.dev/errors/"+f;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)p+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(f,p,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:g==null?null:""+g,children:f,containerInfo:p,implementation:m}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,p){if(f==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return ir.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,ir.createPortal=function(f,p){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return s(f,p,null,m)},ir.flushSync=function(f){var p=c.T,m=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=p,r.p=m,r.d.f()}},ir.preconnect=function(f,p){typeof f=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,r.d.C(f,p))},ir.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},ir.preinit=function(f,p){if(typeof f=="string"&&p&&typeof p.as=="string"){var m=p.as,g=u(m,p.crossOrigin),y=typeof p.integrity=="string"?p.integrity:void 0,b=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;m==="style"?r.d.S(f,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:b}):m==="script"&&r.d.X(f,{crossOrigin:g,integrity:y,fetchPriority:b,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},ir.preinitModule=function(f,p){if(typeof f=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var m=u(p.as,p.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&r.d.M(f)},ir.preload=function(f,p){if(typeof f=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var m=p.as,g=u(m,p.crossOrigin);r.d.L(f,m,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},ir.preloadModule=function(f,p){if(typeof f=="string")if(p){var m=u(p.as,p.crossOrigin);r.d.m(f,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else r.d.m(f)},ir.requestFormReset=function(f){r.d.r(f)},ir.unstable_batchedUpdates=function(f,p){return f(p)},ir.useFormState=function(f,p,m){return c.H.useFormState(f,p,m)},ir.useFormStatus=function(){return c.H.useHostTransitionStatus()},ir.version="19.1.0",ir}var rC;function OR(){if(rC)return _v.exports;rC=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(),_v.exports=qO(),_v.exports}var yx=OR();const Hu=sx(yx);function up(){return typeof window<"u"}function wc(e){return MR(e)?(e.nodeName||"").toLowerCase():"#document"}function Dr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ua(e){var t;return(t=(MR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function MR(e){return up()?e instanceof Node||e instanceof Dr(e).Node:!1}function vn(e){return up()?e instanceof Element||e instanceof Dr(e).Element:!1}function Gr(e){return up()?e instanceof HTMLElement||e instanceof Dr(e).HTMLElement:!1}function by(e){return!up()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Dr(e).ShadowRoot}const GO=new Set(["inline","contents"]);function hd(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=pi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!GO.has(i)}const QO=new Set(["table","td","th"]);function WO(e){return QO.has(wc(e))}const YO=[":popover-open",":modal"];function dp(e){return YO.some(t=>{try{return e.matches(t)}catch{return!1}})}const KO=["transform","translate","scale","rotate","perspective"],XO=["transform","translate","scale","rotate","perspective","filter"],ZO=["paint","layout","strict","content"];function xx(e){const t=fp(),n=vn(e)?pi(e):e;return KO.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)||XO.some(r=>(n.willChange||"").includes(r))||ZO.some(r=>(n.contain||"").includes(r))}function JO(e){let t=$a(e);for(;Gr(t)&&!Bo(t);){if(xx(t))return t;if(dp(t))return null;t=$a(t)}return null}function fp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const eM=new Set(["html","body","#document"]);function Bo(e){return eM.has(wc(e))}function pi(e){return Dr(e).getComputedStyle(e)}function hp(e){return vn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $a(e){if(wc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||by(e)&&e.host||ua(e);return by(t)?t.host:t}function IR(e){const t=$a(e);return Bo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Gr(t)&&hd(t)?t:IR(t)}function Ia(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=IR(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),c=Dr(i);if(s){const u=Sy(c);return t.concat(c,c.visualViewport||[],hd(i)?i:[],u&&n?Ia(u):[])}return t.concat(i,Ia(i,[],n))}function Sy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function iC(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 ed(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&by(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function LR(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function zR(){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 tM(e){return iM()?!1:!aC()&&e.width===0&&e.height===0||aC()&&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 nM(){return/apple/i.test(navigator.vendor)}function aC(){const e=/android/i;return e.test(LR())||e.test(zR())}function rM(){return LR().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function iM(){return zR().includes("jsdom/")}function wy(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function aM(e){return"nativeEvent"in e}function oM(e){return e.matches("html,body")}function Ds(e){return(e==null?void 0:e.ownerDocument)||document}function kv(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 Jl(e){return"composedPath"in e?e.composedPath()[0]:e.target}const sM="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function lM(e){return Gr(e)&&e.matches(sM)}const Oi=Math.min,ar=Math.max,Ah=Math.round,nh=Math.floor,ta=e=>({x:e,y:e}),cM={left:"right",right:"left",bottom:"top",top:"bottom"},uM={start:"end",end:"start"};function jy(e,t,n){return ar(e,Oi(t,n))}function Ua(e,t){return typeof e=="function"?e(t):e}function Mi(e){return e.split("-")[0]}function jc(e){return e.split("-")[1]}function bx(e){return e==="x"?"y":"x"}function Sx(e){return e==="y"?"height":"width"}const dM=new Set(["top","bottom"]);function ki(e){return dM.has(Mi(e))?"y":"x"}function wx(e){return bx(ki(e))}function fM(e,t,n){n===void 0&&(n=!1);const r=jc(e),i=wx(e),s=Sx(i);let c=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=_h(c)),[c,_h(c)]}function hM(e){const t=_h(e);return[Cy(e),t,Cy(t)]}function Cy(e){return e.replace(/start|end/g,t=>uM[t])}const oC=["left","right"],sC=["right","left"],pM=["top","bottom"],mM=["bottom","top"];function gM(e,t,n){switch(e){case"top":case"bottom":return n?t?sC:oC:t?oC:sC;case"left":case"right":return t?pM:mM;default:return[]}}function vM(e,t,n,r){const i=jc(e);let s=gM(Mi(e),n==="start",r);return i&&(s=s.map(c=>c+"-"+i),t&&(s=s.concat(s.map(Cy)))),s}function _h(e){return e.replace(/left|right|bottom|top/g,t=>cM[t])}function yM(e){return{top:0,right:0,bottom:0,left:0,...e}}function jx(e){return typeof e!="number"?yM(e):{top:e,right:e,bottom:e,left:e}}function cc(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 lC(e,t,n){let{reference:r,floating:i}=e;const s=ki(t),c=wx(t),u=Sx(c),f=Mi(t),p=s==="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(jc(t)){case"start":b[c]-=y*(n&&p?-1:1);break;case"end":b[c]+=y*(n&&p?-1:1);break}return b}const xM=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:c}=n,u=s.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let p=await c.getElementRects({reference:e,floating:t,strategy:i}),{x:m,y:g}=lC(p,r,f),y=r,b={},S=0;for(let j=0;j<u.length;j++){const{name:C,fn:T}=u[j],{x:D,y:E,data:R,reset:A}=await T({x:m,y:g,initialPlacement:r,placement:y,strategy:i,middlewareData:b,rects:p,platform:c,elements:{reference:e,floating:t}});m=D??m,g=E??g,b={...b,[C]:{...b[C],...R}},A&&S<=50&&(S++,typeof A=="object"&&(A.placement&&(y=A.placement),A.rects&&(p=A.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:m,y:g}=lC(p,y,f)),j=-1)}return{x:m,y:g,placement:y,strategy:i,middlewareData:b}};async function Cx(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:c,elements:u,strategy:f}=e,{boundary:p="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:y=!1,padding:b=0}=Ua(t,e),S=jx(b),C=u[y?g==="floating"?"reference":"floating":g],T=cc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(C)))==null||n?C:C.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(u.floating)),boundary:p,rootBoundary:m,strategy:f})),D=g==="floating"?{x:r,y:i,width:c.floating.width,height:c.floating.height}:c.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u.floating)),R=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},A=cc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:D,offsetParent:E,strategy:f}):D);return{top:(T.top-A.top+S.top)/R.y,bottom:(A.bottom-T.bottom+S.bottom)/R.y,left:(T.left-A.left+S.left)/R.x,right:(A.right-T.right+S.right)/R.x}}const bM=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:c,elements:u,middlewareData:f}=t,{element:p,padding:m=0}=Ua(e,t)||{};if(p==null)return{};const g=jx(m),y={x:n,y:r},b=wx(i),S=Sx(b),j=await c.getDimensions(p),C=b==="y",T=C?"top":"left",D=C?"bottom":"right",E=C?"clientHeight":"clientWidth",R=s.reference[S]+s.reference[b]-y[b]-s.floating[S],A=y[b]-s.reference[b],k=await(c.getOffsetParent==null?void 0:c.getOffsetParent(p));let M=k?k[E]:0;(!M||!await(c.isElement==null?void 0:c.isElement(k)))&&(M=u.floating[E]||s.floating[S]);const I=R/2-A/2,$=M/2-j[S]/2-1,V=Oi(g[T],$),Y=Oi(g[D],$),Q=V,J=M-j[S]-Y,G=M/2-j[S]/2+I,K=jy(Q,G,J),P=!f.arrow&&jc(i)!=null&&G!==K&&s.reference[S]/2-(G<Q?V:Y)-j[S]/2<0,L=P?G<Q?G-Q:G-J:0;return{[b]:y[b]+L,data:{[b]:K,centerOffset:G-K-L,...P&&{alignmentOffset:L}},reset:P}}}),SM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:c,initialPlacement:u,platform:f,elements:p}=t,{mainAxis:m=!0,crossAxis:g=!0,fallbackPlacements:y,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:j=!0,...C}=Ua(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const T=Mi(i),D=ki(u),E=Mi(u)===u,R=await(f.isRTL==null?void 0:f.isRTL(p.floating)),A=y||(E||!j?[_h(u)]:hM(u)),k=S!=="none";!y&&k&&A.push(...vM(u,j,S,R));const M=[u,...A],I=await Cx(t,C),$=[];let V=((r=s.flip)==null?void 0:r.overflows)||[];if(m&&$.push(I[T]),g){const G=fM(i,c,R);$.push(I[G[0]],I[G[1]])}if(V=[...V,{placement:i,overflows:$}],!$.every(G=>G<=0)){var Y,Q;const G=(((Y=s.flip)==null?void 0:Y.index)||0)+1,K=M[G];if(K&&(!(g==="alignment"?D!==ki(K):!1)||V.every(z=>z.overflows[0]>0&&ki(z.placement)===D)))return{data:{index:G,overflows:V},reset:{placement:K}};let P=(Q=V.filter(L=>L.overflows[0]<=0).sort((L,z)=>L.overflows[1]-z.overflows[1])[0])==null?void 0:Q.placement;if(!P)switch(b){case"bestFit":{var J;const L=(J=V.filter(z=>{if(k){const H=ki(z.placement);return H===D||H==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(H=>H>0).reduce((H,O)=>H+O,0)]).sort((z,H)=>z[1]-H[1])[0])==null?void 0:J[0];L&&(P=L);break}case"initialPlacement":P=u;break}if(i!==P)return{reset:{placement:P}}}return{}}}};function $R(e){const t=Oi(...e.map(s=>s.left)),n=Oi(...e.map(s=>s.top)),r=ar(...e.map(s=>s.right)),i=ar(...e.map(s=>s.bottom));return{x:t,y:n,width:r-t,height:i-n}}function wM(e){const t=e.slice().sort((i,s)=>i.y-s.y),n=[];let r=null;for(let i=0;i<t.length;i++){const s=t[i];!r||s.y-r.y>r.height/2?n.push([s]):n[n.length-1].push(s),r=s}return n.map(i=>cc($R(i)))}const jM=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:i,platform:s,strategy:c}=t,{padding:u=2,x:f,y:p}=Ua(e,t),m=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),g=wM(m),y=cc($R(m)),b=jx(u);function S(){if(g.length===2&&g[0].left>g[1].right&&f!=null&&p!=null)return g.find(C=>f>C.left-b.left&&f<C.right+b.right&&p>C.top-b.top&&p<C.bottom+b.bottom)||y;if(g.length>=2){if(ki(n)==="y"){const V=g[0],Y=g[g.length-1],Q=Mi(n)==="top",J=V.top,G=Y.bottom,K=Q?V.left:Y.left,P=Q?V.right:Y.right,L=P-K,z=G-J;return{top:J,bottom:G,left:K,right:P,width:L,height:z,x:K,y:J}}const C=Mi(n)==="left",T=ar(...g.map(V=>V.right)),D=Oi(...g.map(V=>V.left)),E=g.filter(V=>C?V.left===D:V.right===T),R=E[0].top,A=E[E.length-1].bottom,k=D,M=T,I=M-k,$=A-R;return{top:R,bottom:A,left:k,right:M,width:I,height:$,x:k,y:R}}return y}const j=await s.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}}:{}}}},UR=new Set(["left","top"]);async function CM(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),c=Mi(n),u=jc(n),f=ki(n)==="y",p=UR.has(c)?-1:1,m=s&&f?-1:1,g=Ua(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*p}:{x:y*p,y:b*m}}const EM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:c,middlewareData:u}=t,f=await CM(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+f.x,y:s+f.y,data:{...f,placement:c}}}}},TM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:u={fn:C=>{let{x:T,y:D}=C;return{x:T,y:D}}},...f}=Ua(e,t),p={x:n,y:r},m=await Cx(t,f),g=ki(Mi(i)),y=bx(g);let b=p[y],S=p[g];if(s){const C=y==="y"?"top":"left",T=y==="y"?"bottom":"right",D=b+m[C],E=b-m[T];b=jy(D,b,E)}if(c){const C=g==="y"?"top":"left",T=g==="y"?"bottom":"right",D=S+m[C],E=S-m[T];S=jy(D,S,E)}const j=u.fn({...t,[y]:b,[g]:S});return{...j,data:{x:j.x-n,y:j.y-r,enabled:{[y]:s,[g]:c}}}}}},RM=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:c}=t,{offset:u=0,mainAxis:f=!0,crossAxis:p=!0}=Ua(e,t),m={x:n,y:r},g=ki(i),y=bx(g);let b=m[y],S=m[g];const j=Ua(u,t),C=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(f){const E=y==="y"?"height":"width",R=s.reference[y]-s.floating[E]+C.mainAxis,A=s.reference[y]+s.reference[E]-C.mainAxis;b<R?b=R:b>A&&(b=A)}if(p){var T,D;const E=y==="y"?"width":"height",R=UR.has(Mi(i)),A=s.reference[g]-s.floating[E]+(R&&((T=c.offset)==null?void 0:T[g])||0)+(R?0:C.crossAxis),k=s.reference[g]+s.reference[E]+(R?0:((D=c.offset)==null?void 0:D[g])||0)-(R?C.crossAxis:0);S<A?S=A:S>k&&(S=k)}return{[y]:b,[g]:S}}}},DM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:c,elements:u}=t,{apply:f=()=>{},...p}=Ua(e,t),m=await Cx(t,p),g=Mi(i),y=jc(i),b=ki(i)==="y",{width:S,height:j}=s.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 D=j-m.top-m.bottom,E=S-m.left-m.right,R=Oi(j-m[C],D),A=Oi(S-m[T],E),k=!t.middlewareData.shift;let M=R,I=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=D),k&&!y){const V=ar(m.left,0),Y=ar(m.right,0),Q=ar(m.top,0),J=ar(m.bottom,0);b?I=S-2*(V!==0||Y!==0?V+Y:ar(m.left,m.right)):M=j-2*(Q!==0||J!==0?Q+J:ar(m.top,m.bottom))}await f({...t,availableWidth:I,availableHeight:M});const $=await c.getDimensions(u.floating);return S!==$.width||j!==$.height?{reset:{rects:!0}}:{}}}};function BR(e){const t=pi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Gr(e),s=i?e.offsetWidth:n,c=i?e.offsetHeight:r,u=Ah(n)!==s||Ah(r)!==c;return u&&(n=s,r=c),{width:n,height:r,$:u}}function Ex(e){return vn(e)?e:e.contextElement}function rc(e){const t=Ex(e);if(!Gr(t))return ta(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=BR(t);let c=(s?Ah(n.width):n.width)/r,u=(s?Ah(n.height):n.height)/i;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const AM=ta(0);function VR(e){const t=Dr(e);return!fp()||!t.visualViewport?AM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _M(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Dr(e)?!1:t}function Ls(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Ex(e);let c=ta(1);t&&(r?vn(r)&&(c=rc(r)):c=rc(e));const u=_M(s,n,r)?VR(s):ta(0);let f=(i.left+u.x)/c.x,p=(i.top+u.y)/c.y,m=i.width/c.x,g=i.height/c.y;if(s){const y=Dr(s),b=r&&vn(r)?Dr(r):r;let S=y,j=Sy(S);for(;j&&r&&b!==S;){const C=rc(j),T=j.getBoundingClientRect(),D=pi(j),E=T.left+(j.clientLeft+parseFloat(D.paddingLeft))*C.x,R=T.top+(j.clientTop+parseFloat(D.paddingTop))*C.y;f*=C.x,p*=C.y,m*=C.x,g*=C.y,f+=E,p+=R,S=Dr(j),j=Sy(S)}}return cc({width:m,height:g,x:f,y:p})}function Tx(e,t){const n=hp(e).scrollLeft;return t?t.left+n:Ls(ua(e)).left+n}function FR(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:Tx(e,r)),s=r.top+t.scrollTop;return{x:i,y:s}}function kM(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",c=ua(r),u=t?dp(t.floating):!1;if(r===c||u&&s)return n;let f={scrollLeft:0,scrollTop:0},p=ta(1);const m=ta(0),g=Gr(r);if((g||!g&&!s)&&((wc(r)!=="body"||hd(c))&&(f=hp(r)),Gr(r))){const b=Ls(r);p=rc(r),m.x=b.x+r.clientLeft,m.y=b.y+r.clientTop}const y=c&&!g&&!s?FR(c,f,!0):ta(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-f.scrollLeft*p.x+m.x+y.x,y:n.y*p.y-f.scrollTop*p.y+m.y+y.y}}function PM(e){return Array.from(e.getClientRects())}function NM(e){const t=ua(e),n=hp(e),r=e.ownerDocument.body,i=ar(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ar(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+Tx(e);const u=-n.scrollTop;return pi(r).direction==="rtl"&&(c+=ar(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:c,y:u}}function OM(e,t){const n=Dr(e),r=ua(e),i=n.visualViewport;let s=r.clientWidth,c=r.clientHeight,u=0,f=0;if(i){s=i.width,c=i.height;const p=fp();(!p||p&&t==="fixed")&&(u=i.offsetLeft,f=i.offsetTop)}return{width:s,height:c,x:u,y:f}}const MM=new Set(["absolute","fixed"]);function IM(e,t){const n=Ls(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Gr(e)?rc(e):ta(1),c=e.clientWidth*s.x,u=e.clientHeight*s.y,f=i*s.x,p=r*s.y;return{width:c,height:u,x:f,y:p}}function cC(e,t,n){let r;if(t==="viewport")r=OM(e,n);else if(t==="document")r=NM(ua(e));else if(vn(t))r=IM(t,n);else{const i=VR(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return cc(r)}function HR(e,t){const n=$a(e);return n===t||!vn(n)||Bo(n)?!1:pi(n).position==="fixed"||HR(n,t)}function LM(e,t){const n=t.get(e);if(n)return n;let r=Ia(e,[],!1).filter(u=>vn(u)&&wc(u)!=="body"),i=null;const s=pi(e).position==="fixed";let c=s?$a(e):e;for(;vn(c)&&!Bo(c);){const u=pi(c),f=xx(c);!f&&u.position==="fixed"&&(i=null),(s?!f&&!i:!f&&u.position==="static"&&!!i&&MM.has(i.position)||hd(c)&&!f&&HR(e,c))?r=r.filter(m=>m!==c):i=u,c=$a(c)}return t.set(e,r),r}function zM(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const c=[...n==="clippingAncestors"?dp(t)?[]:LM(t,this._c):[].concat(n),r],u=c[0],f=c.reduce((p,m)=>{const g=cC(t,m,i);return p.top=ar(g.top,p.top),p.right=Oi(g.right,p.right),p.bottom=Oi(g.bottom,p.bottom),p.left=ar(g.left,p.left),p},cC(t,u,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function $M(e){const{width:t,height:n}=BR(e);return{width:t,height:n}}function UM(e,t,n){const r=Gr(t),i=ua(t),s=n==="fixed",c=Ls(e,!0,s,t);let u={scrollLeft:0,scrollTop:0};const f=ta(0);function p(){f.x=Tx(i)}if(r||!r&&!s)if((wc(t)!=="body"||hd(i))&&(u=hp(t)),r){const b=Ls(t,!0,s,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}else i&&p();s&&!r&&i&&p();const m=i&&!r&&!s?FR(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 Pv(e){return pi(e).position==="static"}function uC(e,t){if(!Gr(e)||pi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ua(e)===n&&(n=n.ownerDocument.body),n}function qR(e,t){const n=Dr(e);if(dp(e))return n;if(!Gr(e)){let i=$a(e);for(;i&&!Bo(i);){if(vn(i)&&!Pv(i))return i;i=$a(i)}return n}let r=uC(e,t);for(;r&&WO(r)&&Pv(r);)r=uC(r,t);return r&&Bo(r)&&Pv(r)&&!xx(r)?n:r||JO(e)||n}const BM=async function(e){const t=this.getOffsetParent||qR,n=this.getDimensions,r=await n(e.floating);return{reference:UM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function VM(e){return pi(e).direction==="rtl"}const FM={convertOffsetParentRelativeRectToViewportRelativeRect:kM,getDocumentElement:ua,getClippingRect:zM,getOffsetParent:qR,getElementRects:BM,getClientRects:PM,getDimensions:$M,getScale:rc,isElement:vn,isRTL:VM};function GR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function HM(e,t){let n=null,r;const i=ua(e);function s(){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),s();const p=e.getBoundingClientRect(),{left:m,top:g,width:y,height:b}=p;if(u||t(),!y||!b)return;const S=nh(g),j=nh(i.clientWidth-(m+y)),C=nh(i.clientHeight-(g+b)),T=nh(m),E={rootMargin:-S+"px "+-j+"px "+-C+"px "+-T+"px",threshold:ar(0,Oi(1,f))||1};let R=!0;function A(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&&!GR(p,e.getBoundingClientRect())&&c(),R=!1}try{n=new IntersectionObserver(A,{...E,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,E)}n.observe(e)}return c(!0),s}function qM(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,p=Ex(e),m=i||s?[...p?Ia(p):[],...Ia(t)]:[];m.forEach(T=>{i&&T.addEventListener("scroll",n,{passive:!0}),s&&T.addEventListener("resize",n)});const g=p&&u?HM(p,n):null;let y=-1,b=null;c&&(b=new ResizeObserver(T=>{let[D]=T;D&&D.target===p&&b&&(b.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var E;(E=b)==null||E.observe(t)})),n()}),p&&!f&&b.observe(p),b.observe(t));let S,j=f?Ls(e):null;f&&C();function C(){const T=Ls(e);j&&!GR(j,T)&&n(),j=T,S=requestAnimationFrame(C)}return n(),()=>{var T;m.forEach(D=>{i&&D.removeEventListener("scroll",n),s&&D.removeEventListener("resize",n)}),g==null||g(),(T=b)==null||T.disconnect(),b=null,f&&cancelAnimationFrame(S)}}const GM=EM,QM=TM,WM=SM,YM=DM,dC=bM,KM=jM,XM=RM,ZM=(e,t,n)=>{const r=new Map,i={platform:FM,...n},s={...i.platform,_c:r};return xM(e,t,{...i,platform:s})};var JM=typeof document<"u",e9=function(){},gh=JM?v.useLayoutEffect:e9;function kh(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(!kh(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 s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!kh(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function QR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fC(e,t){const n=QR(e);return Math.round(t*n)/n}function Nv(e){const t=v.useRef(e);return gh(()=>{t.current=e}),t}function t9(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:c}={},transform:u=!0,whileElementsMounted:f,open:p}=e,[m,g]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,b]=v.useState(r);kh(y,r)||b(r);const[S,j]=v.useState(null),[C,T]=v.useState(null),D=v.useCallback(z=>{z!==k.current&&(k.current=z,j(z))},[]),E=v.useCallback(z=>{z!==M.current&&(M.current=z,T(z))},[]),R=s||S,A=c||C,k=v.useRef(null),M=v.useRef(null),I=v.useRef(m),$=f!=null,V=Nv(f),Y=Nv(i),Q=Nv(p),J=v.useCallback(()=>{if(!k.current||!M.current)return;const z={placement:t,strategy:n,middleware:y};Y.current&&(z.platform=Y.current),ZM(k.current,M.current,z).then(H=>{const O={...H,isPositioned:Q.current!==!1};G.current&&!kh(I.current,O)&&(I.current=O,yx.flushSync(()=>{g(O)}))})},[y,t,n,Y,Q]);gh(()=>{p===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,g(z=>({...z,isPositioned:!1})))},[p]);const G=v.useRef(!1);gh(()=>(G.current=!0,()=>{G.current=!1}),[]),gh(()=>{if(R&&(k.current=R),A&&(M.current=A),R&&A){if(V.current)return V.current(R,A,J);J()}},[R,A,J,V,$]);const K=v.useMemo(()=>({reference:k,floating:M,setReference:D,setFloating:E}),[D,E]),P=v.useMemo(()=>({reference:R,floating:A}),[R,A]),L=v.useMemo(()=>{const z={position:n,left:0,top:0};if(!P.floating)return z;const H=fC(P.floating,m.x),O=fC(P.floating,m.y);return u?{...z,transform:"translate("+H+"px, "+O+"px)",...QR(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:K,elements:P,floatingStyles:L}),[m,J,K,P,L])}const n9=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?dC({element:r.current,padding:i}).fn(n):{}:r?dC({element:r,padding:i}).fn(n):{}}}},WR=(e,t)=>({...GM(e),options:[e,t]}),Rx=(e,t)=>({...QM(e),options:[e,t]}),hC=(e,t)=>({...XM(e),options:[e,t]}),Ph=(e,t)=>({...WM(e),options:[e,t]}),r9=(e,t)=>({...YM(e),options:[e,t]}),Wu=(e,t)=>({...KM(e),options:[e,t]}),YR=(e,t)=>({...n9(e),options:[e,t]});function i9(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 KR={...x3},a9=KR.useInsertionEffect,o9=a9||(e=>e());function Ma(e){const t=v.useRef(()=>{});return o9(()=>{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 pC=!1,s9=0;const mC=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+s9++;function l9(){const[e,t]=v.useState(()=>pC?mC():void 0);return na(()=>{e==null&&t(mC())},[]),v.useEffect(()=>{pC=!0},[]),e}const c9=KR.useId,XR=c9||l9;function u9(){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 d9=v.createContext(null),f9=v.createContext(null),Dx=()=>{var e;return((e=v.useContext(d9))==null?void 0:e.id)||null},Ax=()=>v.useContext(f9);function _x(e){return"data-floating-ui-"+e}function Ov(e){const t=v.useRef(e);return na(()=>{t.current=e}),t}const gC=_x("safe-polygon");function vh(e,t,n){return n&&!wy(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function h9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,events:s,elements:c}=e,{enabled:u=!0,delay:f=0,handleClose:p=null,mouseOnly:m=!1,restMs:g=0,move:y=!0}=t,b=Ax(),S=Dx(),j=Ov(p),C=Ov(f),T=Ov(n),D=v.useRef(),E=v.useRef(-1),R=v.useRef(),A=v.useRef(-1),k=v.useRef(!0),M=v.useRef(!1),I=v.useRef(()=>{}),$=v.useRef(!1),V=v.useCallback(()=>{var L;const z=(L=i.current.openEvent)==null?void 0:L.type;return(z==null?void 0:z.includes("mouse"))&&z!=="mousedown"},[i]);v.useEffect(()=>{if(!u)return;function L(z){let{open:H}=z;H||(clearTimeout(E.current),clearTimeout(A.current),k.current=!0,$.current=!1)}return s.on("openchange",L),()=>{s.off("openchange",L)}},[u,s]),v.useEffect(()=>{if(!u||!j.current||!n)return;function L(H){V()&&r(!1,H,"hover")}const z=Ds(c.floating).documentElement;return z.addEventListener("mouseleave",L),()=>{z.removeEventListener("mouseleave",L)}},[c.floating,n,r,u,j,V]);const Y=v.useCallback(function(L,z,H){z===void 0&&(z=!0),H===void 0&&(H="hover");const O=vh(C.current,"close",D.current);O&&!R.current?(clearTimeout(E.current),E.current=window.setTimeout(()=>r(!1,L,H),O)):z&&(clearTimeout(E.current),r(!1,L,H))},[C,r]),Q=Ma(()=>{I.current(),R.current=void 0}),J=Ma(()=>{if(M.current){const L=Ds(c.floating).body;L.style.pointerEvents="",L.removeAttribute(gC),M.current=!1}}),G=Ma(()=>i.current.openEvent?["click","mousedown"].includes(i.current.openEvent.type):!1);v.useEffect(()=>{if(!u)return;function L(U){if(clearTimeout(E.current),k.current=!1,m&&!wy(D.current)||g>0&&!vh(C.current,"open"))return;const X=vh(C.current,"open",D.current);X?E.current=window.setTimeout(()=>{T.current||r(!0,U,"hover")},X):n||r(!0,U,"hover")}function z(U){if(G())return;I.current();const X=Ds(c.floating);if(clearTimeout(A.current),$.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(),Q(),G()||Y(U,!0,"safe-polygon")}});const Se=R.current;X.addEventListener("mousemove",Se),I.current=()=>{X.removeEventListener("mousemove",Se)};return}(D.current==="touch"?!ed(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(),Q(),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",L,{once:!0}),U.addEventListener("mouseenter",L),U.addEventListener("mouseleave",z),()=>{var X;n&&U.removeEventListener("mouseleave",H),(X=c.floating)==null||X.removeEventListener("mouseleave",H),y&&U.removeEventListener("mousemove",L),U.removeEventListener("mouseenter",L),U.removeEventListener("mouseleave",z)}}},[c,u,e,m,g,y,Y,Q,J,r,n,T,b,C,j,i,G]),na(()=>{var L;if(u&&n&&(L=j.current)!=null&&L.__options.blockPointerEvents&&V()){M.current=!0;const H=c.floating;if(vn(c.domReference)&&H){var z;const O=Ds(c.floating).body;O.setAttribute(gC,"");const U=c.domReference,X=b==null||(z=b.nodesRef.current.find(ee=>ee.id===S))==null||(z=z.context)==null?void 0:z.elements.floating;return X&&(X.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,V]),na(()=>{n||(D.current=void 0,$.current=!1,Q(),J())},[n,Q,J]),v.useEffect(()=>()=>{Q(),clearTimeout(E.current),clearTimeout(A.current),J()},[u,c.domReference,Q,J]);const K=v.useMemo(()=>{function L(z){D.current=z.pointerType}return{onPointerDown:L,onPointerEnter:L,onMouseMove(z){const{nativeEvent:H}=z;function O(){!k.current&&!T.current&&r(!0,H,"hover")}m&&!wy(D.current)||n||g===0||$.current&&z.movementX**2+z.movementY**2<2||(clearTimeout(A.current),D.current==="touch"?O():($.current=!0,A.current=window.setTimeout(O,g)))}}},[m,r,n,T,g]),P=v.useMemo(()=>({onMouseEnter(){clearTimeout(E.current)},onMouseLeave(L){G()||Y(L.nativeEvent,!1)}}),[Y,G]);return v.useMemo(()=>u?{reference:K,floating:P}:{},[u,K,P])}const Ey=()=>{},ZR=v.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Ey,setState:Ey,isInstantPhase:!1}),p9=()=>v.useContext(ZR);function m9(e){const{children:t,delay:n,timeoutMs:r=0}=e,[i,s]=v.useReducer((f,p)=>({...f,...p}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=v.useRef(null),u=v.useCallback(f=>{s({currentId:f})},[]);return na(()=>{i.currentId?c.current===null?c.current=i.currentId:i.isInstantPhase||s({isInstantPhase:!0}):(i.isInstantPhase&&s({isInstantPhase:!1}),c.current=null)},[i.currentId,i.isInstantPhase]),v.createElement(ZR.Provider,{value:v.useMemo(()=>({...i,setState:s,setCurrentId:u}),[i,u])},t)}function g9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:i}=e,{id:s,enabled:c=!0}=t,u=s??i,f=p9(),{currentId:p,setCurrentId:m,initialDelay:g,setState:y,timeoutMs:b}=f;return na(()=>{c&&p&&(y({delay:{open:1,close:vh(g,"close")}}),p!==u&&r(!1))},[c,u,r,y,p,g]),na(()=>{function S(){r(!1),y({delay:g,currentId:null})}if(c&&p&&!n&&p===u){if(b){const j=window.setTimeout(S,b);return()=>{clearTimeout(j)}}S()}},[c,n,y,p,u,r,g,b]),na(()=>{c&&(m===Ey||!n||m(u))},[c,n,m,u]),f}function Mv(e,t){let n=e.filter(i=>{var s;return i.parentId===t&&((s=i.context)==null?void 0:s.open)}),r=n;for(;r.length;)r=e.filter(i=>{var s;return(s=r)==null?void 0:s.some(c=>{var u;return i.parentId===c.id&&((u=i.context)==null?void 0:u.open)})}),n=n.concat(r);return n}const v9="data-floating-ui-focusable",y9={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},x9={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},vC=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 b9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:s}=e,{enabled:c=!0,escapeKey:u=!0,outsidePress:f=!0,outsidePressEvent:p="pointerdown",referencePress:m=!1,referencePressEvent:g="pointerdown",ancestorScroll:y=!1,bubbles:b,capture:S}=t,j=Ax(),C=Ma(typeof f=="function"?f:()=>!1),T=typeof f=="function"?C:f,D=v.useRef(!1),E=v.useRef(!1),{escapeKey:R,outsidePress:A}=vC(b),{escapeKey:k,outsidePress:M}=vC(S),I=v.useRef(!1),$=Ma(K=>{var P;if(!n||!c||!u||K.key!=="Escape"||I.current)return;const L=(P=s.current.floatingContext)==null?void 0:P.nodeId,z=j?Mv(j.nodesRef.current,L):[];if(!R&&(K.stopPropagation(),z.length>0)){let H=!0;if(z.forEach(O=>{var U;if((U=O.context)!=null&&U.open&&!O.context.dataRef.current.__escapeKeyBubbles){H=!1;return}}),!H)return}r(!1,aM(K)?K.nativeEvent:K,"escape-key")}),V=Ma(K=>{var P;const L=()=>{var z;$(K),(z=Jl(K))==null||z.removeEventListener("keydown",L)};(P=Jl(K))==null||P.addEventListener("keydown",L)}),Y=Ma(K=>{var P;const L=D.current;D.current=!1;const z=E.current;if(E.current=!1,p==="click"&&z||L||typeof T=="function"&&!T(K))return;const H=Jl(K),O="["+_x("inert")+"]",U=Ds(i.floating).querySelectorAll(O);let X=vn(H)?H:null;for(;X&&!Bo(X);){const xe=$a(X);if(Bo(xe)||!vn(xe))break;X=xe}if(U.length&&vn(H)&&!oM(H)&&!ed(H,i.floating)&&Array.from(U).every(xe=>!ed(X,xe)))return;if(Gr(H)&&G){const xe=H.clientWidth>0&&H.scrollWidth>H.clientWidth,qe=H.clientHeight>0&&H.scrollHeight>H.clientHeight;let Me=qe&&K.offsetX>H.clientWidth;if(qe&&pi(H).direction==="rtl"&&(Me=K.offsetX<=H.offsetWidth-H.clientWidth),Me||xe&&K.offsetY>H.clientHeight)return}const ee=(P=s.current.floatingContext)==null?void 0:P.nodeId,Se=j&&Mv(j.nodesRef.current,ee).some(xe=>{var qe;return kv(K,(qe=xe.context)==null?void 0:qe.elements.floating)});if(kv(K,i.floating)||kv(K,i.domReference)||Se)return;const be=j?Mv(j.nodesRef.current,ee):[];if(be.length>0){let xe=!0;if(be.forEach(qe=>{var Me;if((Me=qe.context)!=null&&Me.open&&!qe.context.dataRef.current.__outsidePressBubbles){xe=!1;return}}),!xe)return}r(!1,K,"outside-press")}),Q=Ma(K=>{var P;const L=()=>{var z;Y(K),(z=Jl(K))==null||z.removeEventListener(p,L)};(P=Jl(K))==null||P.addEventListener(p,L)});v.useEffect(()=>{if(!n||!c)return;s.current.__escapeKeyBubbles=R,s.current.__outsidePressBubbles=A;let K=-1;function P(U){r(!1,U,"ancestor-scroll")}function L(){window.clearTimeout(K),I.current=!0}function z(){K=window.setTimeout(()=>{I.current=!1},fp()?5:0)}const H=Ds(i.floating);u&&(H.addEventListener("keydown",k?V:$,k),H.addEventListener("compositionstart",L),H.addEventListener("compositionend",z)),T&&H.addEventListener(p,M?Q:Y,M);let O=[];return y&&(vn(i.domReference)&&(O=Ia(i.domReference)),vn(i.floating)&&(O=O.concat(Ia(i.floating))),!vn(i.reference)&&i.reference&&i.reference.contextElement&&(O=O.concat(Ia(i.reference.contextElement)))),O=O.filter(U=>{var X;return U!==((X=H.defaultView)==null?void 0:X.visualViewport)}),O.forEach(U=>{U.addEventListener("scroll",P,{passive:!0})}),()=>{u&&(H.removeEventListener("keydown",k?V:$,k),H.removeEventListener("compositionstart",L),H.removeEventListener("compositionend",z)),T&&H.removeEventListener(p,M?Q:Y,M),O.forEach(U=>{U.removeEventListener("scroll",P)}),window.clearTimeout(K)}},[s,i,u,T,p,n,r,y,c,R,A,$,k,V,Y,M,Q]),v.useEffect(()=>{D.current=!1},[T,p]);const J=v.useMemo(()=>({onKeyDown:$,[y9[g]]:K=>{m&&r(!1,K.nativeEvent,"reference-press")}}),[$,r,m,g]),G=v.useMemo(()=>({onKeyDown:$,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[x9[p]]:()=>{D.current=!0}}),[$,p]);return v.useMemo(()=>c?{reference:J,floating:G}:{},[c,J,G])}function S9(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=XR(),s=v.useRef({}),[c]=v.useState(()=>u9()),u=Dx()!=null,[f,p]=v.useState(r.reference),m=Ma((b,S,j)=>{s.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:p}),[]),y=v.useMemo(()=>({reference:f||r.reference||null,floating:r.floating||null,domReference:r.reference}),[f,r.reference,r.floating]);return v.useMemo(()=>({dataRef:s,open:t,onOpenChange:m,elements:y,events:c,floatingId:i,refs:g}),[t,m,y,c,i,g])}function kx(e){e===void 0&&(e={});const{nodeId:t}=e,n=S9({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[s,c]=v.useState(null),[u,f]=v.useState(null),m=(i==null?void 0:i.domReference)||s,g=v.useRef(null),y=Ax();na(()=>{m&&(g.current=m)},[m]);const b=t9({...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]),D=v.useMemo(()=>({...b,...r,refs:C,elements:T,nodeId:t}),[b,C,T,t,r]);return na(()=>{r.dataRef.current.floatingContext=D;const E=y==null?void 0:y.nodesRef.current.find(R=>R.id===t);E&&(E.context=D)}),v.useMemo(()=>({...b,context:D,refs:C,elements:T}),[b,C,T,D])}function w9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,dataRef:s,elements:c}=e,{enabled:u=!0,visibleOnly:f=!0}=t,p=v.useRef(!1),m=v.useRef(),g=v.useRef(!0);v.useEffect(()=>{if(!u)return;const b=Dr(c.domReference);function S(){!n&&Gr(c.domReference)&&c.domReference===iC(Ds(c.domReference))&&(p.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")&&(p.current=!0)}return i.on("openchange",b),()=>{i.off("openchange",b)}},[i,u]),v.useEffect(()=>()=>{clearTimeout(m.current)},[]);const y=v.useMemo(()=>({onPointerDown(b){tM(b.nativeEvent)||(g.current=!1)},onMouseLeave(){p.current=!1},onFocus(b){if(p.current)return;const S=Jl(b.nativeEvent);if(f&&vn(S))try{if(nM()&&rM())throw Error();if(!S.matches(":focus-visible"))return}catch{if(!g.current&&!lM(S))return}r(!0,b.nativeEvent,"focus")},onBlur(b){p.current=!1;const S=b.relatedTarget,j=b.nativeEvent,C=vn(S)&&S.hasAttribute(_x("focus-guard"))&&S.getAttribute("data-type")==="outside";m.current=window.setTimeout(()=>{var T;const D=iC(c.domReference?c.domReference.ownerDocument:document);!S&&D===c.domReference||ed((T=s.current.floatingContext)==null?void 0:T.refs.floating.current,D)||ed(c.domReference,D)||C||r(!1,j,"focus")})}}),[s,c.domReference,r,f]);return v.useMemo(()=>u?{reference:y}:{},[u,y])}const yC="active",xC="selected";function Iv(e,t,n){const r=new Map,i=n==="item";let s=e;if(i&&e){const{[yC]:c,[xC]:u,...f}=e;s=f}return{...n==="floating"&&{tabIndex:-1,[v9]:""},...s,...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[p,m]=f;if(!(i&&[yC,xC].includes(p)))if(p.indexOf("on")===0){if(r.has(p)||r.set(p,[]),typeof m=="function"){var g;(g=r.get(p))==null||g.push(m),c[p]=function(){for(var y,b=arguments.length,S=new Array(b),j=0;j<b;j++)S[j]=arguments[j];return(y=r.get(p))==null?void 0:y.map(C=>C(...S)).find(C=>C!==void 0)}}}else c[p]=m}),c),{})}}function j9(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=>Iv(u,e,"reference"),t),s=v.useCallback(u=>Iv(u,e,"floating"),n),c=v.useCallback(u=>Iv(u,e,"item"),r);return v.useMemo(()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:c}),[i,s,c])}const C9=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function E9(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:i}=e,{enabled:s=!0,role:c="dialog"}=t,u=(n=C9.get(c))!=null?n:c,f=XR(),m=Dx()!=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(()=>s?{reference:g,floating:y,item:b}:{},[s,g,y,b])}const[T9,yi]=vr("ScrollArea.Root component was not found in tree");function uc(e,t){const n=Cs(t);Sc(()=>{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 R9=v.forwardRef((e,t)=>{const{style:n,...r}=e,i=yi(),[s,c]=v.useState(0),[u,f]=v.useState(0),p=!!(s&&u);return uc(i.scrollbarX,()=>{var g;const m=((g=i.scrollbarX)==null?void 0:g.offsetHeight)||0;i.onCornerHeightChange(m),f(m)}),uc(i.scrollbarY,()=>{var g;const m=((g=i.scrollbarY)==null?void 0:g.offsetWidth)||0;i.onCornerWidthChange(m),c(m)}),p?o.jsx("div",{...r,ref:t,style:{...n,width:s,height:u}}):null}),D9=v.forwardRef((e,t)=>{const n=yi(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?o.jsx(R9,{...e,ref:t}):null}),A9={scrollHideDelay:1e3,type:"hover"},JR=v.forwardRef((e,t)=>{const n=se("ScrollAreaRoot",A9,e),{type:r,scrollHideDelay:i,scrollbars:s,...c}=n,[u,f]=v.useState(null),[p,m]=v.useState(null),[g,y]=v.useState(null),[b,S]=v.useState(null),[j,C]=v.useState(null),[T,D]=v.useState(0),[E,R]=v.useState(0),[A,k]=v.useState(!1),[M,I]=v.useState(!1),$=$n(t,V=>f(V));return o.jsx(T9,{value:{type:r,scrollHideDelay:i,scrollArea:u,viewport:p,onViewportChange:m,content:g,onContentChange:y,scrollbarX:b,onScrollbarXChange:S,scrollbarXEnabled:A,onScrollbarXEnabledChange:k,scrollbarY:j,onScrollbarYChange:C,scrollbarYEnabled:M,onScrollbarYEnabledChange:I,onCornerWidthChange:D,onCornerHeightChange:R},children:o.jsx(ce,{...c,ref:$,__vars:{"--sa-corner-width":s!=="xy"?"0px":`${T}px`,"--sa-corner-height":s!=="xy"?"0px":`${E}px`}})})});JR.displayName="@mantine/core/ScrollAreaRoot";function e2(e,t){const n=e/t;return Number.isNaN(n)?0:n}function pp(e){const t=e2(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function t2(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 _9(e,[t,n]){return Math.min(n,Math.max(t,e))}function bC(e,t,n="ltr"){const r=pp(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-i,c=t.content-t.viewport,u=s-r,f=n==="ltr"?[0,c]:[c*-1,0],p=_9(e,f);return t2([0,c],[0,u])(p)}function k9(e,t,n,r="ltr"){const i=pp(n),s=i/2,c=t||s,u=i-c,f=n.scrollbar.paddingStart+c,p=n.scrollbar.size-n.scrollbar.paddingEnd-u,m=n.content-n.viewport,g=r==="ltr"?[0,m]:[m*-1,0];return t2([f,p],g)(e)}function n2(e,t){return e>0&&e<t}function $o(e){return e?parseInt(e,10):0}function Ms(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e==null||e(r),(n===!1||!r.defaultPrevented)&&(t==null||t(r))}}const[P9,r2]=vr("ScrollAreaScrollbar was not found in tree"),i2=v.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:f,onWheelScroll:p,onResize:m,...g}=e,y=yi(),[b,S]=v.useState(null),j=$n(t,I=>S(I)),C=v.useRef(null),T=v.useRef(""),{viewport:D}=y,E=n.content-n.viewport,R=Cs(p),A=Cs(u),k=ap(m,10),M=I=>{if(C.current){const $=I.clientX-C.current.left,V=I.clientY-C.current.top;f({x:$,y:V})}};return v.useEffect(()=>{const I=$=>{const V=$.target;(b==null?void 0:b.contains(V))&&R($,E)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[D,b,E,R]),v.useEffect(A,[n,A]),uc(b,k),uc(y.content,k),o.jsx(P9,{value:{scrollbar:b,hasThumb:r,onThumbChange:Cs(i),onThumbPointerUp:Cs(s),onThumbPositionChange:A,onThumbPointerDown:Cs(c)},children:o.jsx("div",{...g,ref:j,"data-mantine-scrollbar":!0,style:{position:"absolute",...g.style},onPointerDown:Ms(e.onPointerDown,I=>{I.preventDefault(),I.button===0&&(I.target.setPointerCapture(I.pointerId),C.current=b.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",M(I))}),onPointerMove:Ms(e.onPointerMove,M),onPointerUp:Ms(e.onPointerUp,I=>{const $=I.target;$.hasPointerCapture(I.pointerId)&&(I.preventDefault(),$.releasePointerCapture(I.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=T.current,C.current=null}})})}),a2=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:i,...s}=e,c=yi(),[u,f]=v.useState(),p=v.useRef(null),m=$n(t,p,c.onScrollbarXChange);return v.useEffect(()=>{p.current&&f(getComputedStyle(p.current))},[p]),o.jsx(i2,{"data-orientation":"horizontal",...s,ref:m,sizes:n,style:{...i,"--sa-thumb-width":`${pp(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),n2(b,y)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&u&&r({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:$o(u.paddingLeft),paddingEnd:$o(u.paddingRight)}})}})});a2.displayName="@mantine/core/ScrollAreaScrollbarX";const o2=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:i,...s}=e,c=yi(),[u,f]=v.useState(),p=v.useRef(null),m=$n(t,p,c.onScrollbarYChange);return v.useEffect(()=>{p.current&&f(window.getComputedStyle(p.current))},[]),o.jsx(i2,{...s,"data-orientation":"vertical",ref:m,sizes:n,style:{"--sa-thumb-height":`${pp(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),n2(b,y)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&u&&r({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:$o(u.paddingTop),paddingEnd:$o(u.paddingBottom)}})}})});o2.displayName="@mantine/core/ScrollAreaScrollbarY";const mp=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:i}=Zs(),s=yi(),c=v.useRef(null),u=v.useRef(0),[f,p]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=e2(f.viewport,f.content),g={...r,sizes:f,onSizesChange:p,hasThumb:m>0&&m<1,onThumbChange:b=>{c.current=b},onThumbPointerUp:()=>{u.current=0},onThumbPointerDown:b=>{u.current=b}},y=(b,S)=>k9(b,u.current,f,S);return n==="horizontal"?o.jsx(a2,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&c.current){const b=s.viewport.scrollLeft,S=bC(b,f,i);c.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:b=>{s.viewport&&(s.viewport.scrollLeft=b)},onDragScroll:b=>{s.viewport&&(s.viewport.scrollLeft=y(b,i))}}):n==="vertical"?o.jsx(o2,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&c.current){const b=s.viewport.scrollTop,S=bC(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=>{s.viewport&&(s.viewport.scrollTop=b)},onDragScroll:b=>{s.viewport&&(s.viewport.scrollTop=y(b))}}):null});mp.displayName="@mantine/core/ScrollAreaScrollbarVisible";const Px=v.forwardRef((e,t)=>{const n=yi(),{forceMount:r,...i}=e,[s,c]=v.useState(!1),u=e.orientation==="horizontal",f=ap(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;c(u?p:m)}},10);return uc(n.viewport,f),uc(n.content,f),r||s?o.jsx(mp,{"data-state":s?"visible":"hidden",...i,ref:t}):null});Px.displayName="@mantine/core/ScrollAreaScrollbarAuto";const s2=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=yi(),[s,c]=v.useState(!1);return v.useEffect(()=>{const{scrollArea:u}=i;let f=0;if(u){const p=()=>{window.clearTimeout(f),c(!0)},m=()=>{f=window.setTimeout(()=>c(!1),i.scrollHideDelay)};return u.addEventListener("pointerenter",p),u.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",p),u.removeEventListener("pointerleave",m)}}},[i.scrollArea,i.scrollHideDelay]),n||s?o.jsx(Px,{"data-state":s?"visible":"hidden",...r,ref:t}):null});s2.displayName="@mantine/core/ScrollAreaScrollbarHover";const N9=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=yi(),s=e.orientation==="horizontal",[c,u]=v.useState("hidden"),f=ap(()=>u("idle"),100);return v.useEffect(()=>{if(c==="idle"){const p=window.setTimeout(()=>u("hidden"),i.scrollHideDelay);return()=>window.clearTimeout(p)}},[c,i.scrollHideDelay]),v.useEffect(()=>{const{viewport:p}=i,m=s?"scrollLeft":"scrollTop";if(p){let g=p[m];const y=()=>{const b=p[m];g!==b&&(u("scrolling"),f()),g=b};return p.addEventListener("scroll",y),()=>p.removeEventListener("scroll",y)}},[i.viewport,s,f]),n||c!=="hidden"?o.jsx(mp,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ms(e.onPointerEnter,()=>u("interacting")),onPointerLeave:Ms(e.onPointerLeave,()=>u("idle"))}):null}),Ty=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=yi(),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:c}=i,u=e.orientation==="horizontal";return v.useEffect(()=>(u?s(!0):c(!0),()=>{u?s(!1):c(!1)}),[u,s,c]),i.type==="hover"?o.jsx(s2,{...r,ref:t,forceMount:n}):i.type==="scroll"?o.jsx(N9,{...r,ref:t,forceMount:n}):i.type==="auto"?o.jsx(Px,{...r,ref:t,forceMount:n}):i.type==="always"?o.jsx(mp,{...r,ref:t}):null});Ty.displayName="@mantine/core/ScrollAreaScrollbar";function O9(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const s={left:e.scrollLeft,top:e.scrollTop},c=n.left!==s.left,u=n.top!==s.top;(c||u)&&t(),n=s,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)}const l2=v.forwardRef((e,t)=>{const{style:n,...r}=e,i=yi(),s=r2(),{onThumbPositionChange:c}=s,u=$n(t,m=>s.onThumbChange(m)),f=v.useRef(void 0),p=ap(()=>{f.current&&(f.current(),f.current=void 0)},100);return v.useEffect(()=>{const{viewport:m}=i;if(m){const g=()=>{if(p(),!f.current){const y=O9(m,c);f.current=y,c()}};return c(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[i.viewport,p,c]),o.jsx("div",{"data-state":s.hasThumb?"visible":"hidden",...r,ref:u,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:Ms(e.onPointerDownCapture,m=>{const y=m.target.getBoundingClientRect(),b=m.clientX-y.left,S=m.clientY-y.top;s.onThumbPointerDown({x:b,y:S})}),onPointerUp:Ms(e.onPointerUp,s.onThumbPointerUp)})});l2.displayName="@mantine/core/ScrollAreaThumb";const Ry=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=r2();return n||i.hasThumb?o.jsx(l2,{ref:t,...r}):null});Ry.displayName="@mantine/core/ScrollAreaThumb";const c2=v.forwardRef(({children:e,style:t,...n},r)=>{const i=yi(),s=$n(r,i.onViewportChange);return o.jsx(ce,{...n,ref:s,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...t},children:o.jsx("div",{style:{minWidth:"100%"},ref:i.onContentChange,children:e})})});c2.displayName="@mantine/core/ScrollAreaViewport";var Nx={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const u2={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},M9=(e,{scrollbarSize:t,overscrollBehavior:n})=>({root:{"--scrollarea-scrollbar-size":le(t),"--scrollarea-over-scroll-behavior":n}}),Yr=ve((e,t)=>{const n=se("ScrollArea",u2,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,scrollbarSize:f,vars:p,type:m,scrollHideDelay:g,viewportProps:y,viewportRef:b,onScrollPositionChange:S,children:j,offsetScrollbars:C,scrollbars:T,onBottomReached:D,onTopReached:E,overscrollBehavior:R,...A}=n,[k,M]=v.useState(!1),[I,$]=v.useState(!1),[V,Y]=v.useState(!1),Q=Ie({name:"ScrollArea",props:n,classes:Nx,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:p,varsResolver:M9}),J=v.useRef(null),G=i9([b,J]);return v.useEffect(()=>{if(!J.current||C!=="present")return;const K=J.current,P=new ResizeObserver(()=>{const{scrollHeight:L,clientHeight:z,scrollWidth:H,clientWidth:O}=K;$(L>z),Y(H>O)});return P.observe(K),()=>P.disconnect()},[J,C]),o.jsxs(JR,{type:m==="never"?"always":m,scrollHideDelay:g,ref:t,scrollbars:T,...Q("root"),...A,children:[o.jsx(c2,{...y,...Q("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"&&!V?"true":void 0,"data-vertical-hidden":C==="present"&&!I?"true":void 0,onScroll:K=>{var H;(H=y==null?void 0:y.onScroll)==null||H.call(y,K),S==null||S({x:K.currentTarget.scrollLeft,y:K.currentTarget.scrollTop});const{scrollTop:P,scrollHeight:L,clientHeight:z}=K.currentTarget;P-(L-z)>=-.6&&(D==null||D()),P===0&&(E==null||E())},children:j}),(T==="xy"||T==="x")&&o.jsx(Ty,{...Q("scrollbar"),orientation:"horizontal","data-hidden":m==="never"||C==="present"&&!V?!0:void 0,forceMount:!0,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:o.jsx(Ry,{...Q("thumb")})}),(T==="xy"||T==="y")&&o.jsx(Ty,{...Q("scrollbar"),orientation:"vertical","data-hidden":m==="never"||C==="present"&&!I?!0:void 0,forceMount:!0,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:o.jsx(Ry,{...Q("thumb")})}),o.jsx(D9,{...Q("corner"),"data-hovered":k||void 0,"data-hidden":m==="never"||void 0})]})});Yr.displayName="@mantine/core/ScrollArea";const gp=ve((e,t)=>{const{children:n,classNames:r,styles:i,scrollbarSize:s,scrollHideDelay:c,type:u,dir:f,offsetScrollbars:p,viewportRef:m,onScrollPositionChange:g,unstyled:y,variant:b,viewportProps:S,scrollbars:j,style:C,vars:T,onBottomReached:D,onTopReached:E,...R}=se("ScrollAreaAutosize",u2,e);return o.jsx(ce,{...R,ref:t,style:[{display:"flex",overflow:"auto"},C],children:o.jsx(ce,{style:{display:"flex",flexDirection:"column",flex:1},children:o.jsx(Yr,{classNames:r,styles:i,scrollHideDelay:c,scrollbarSize:s,type:u,dir:f,offsetScrollbars:p,viewportRef:m,onScrollPositionChange:g,unstyled:y,variant:b,viewportProps:S,vars:T,scrollbars:j,onBottomReached:D,onTopReached:E,children:n})})})});Yr.classes=Nx;gp.displayName="@mantine/core/ScrollAreaAutosize";gp.classes=Nx;Yr.Autosize=gp;var d2={root:"m_87cf2631"};const I9={__staticSelector:"UnstyledButton"},tr=lr((e,t)=>{const n=se("UnstyledButton",I9,e),{className:r,component:i="button",__staticSelector:s,unstyled:c,classNames:u,styles:f,style:p,...m}=n,g=Ie({name:s,props:n,classes:d2,className:r,style:p,classNames:u,styles:f,unstyled:c});return o.jsx(ce,{...g("root",{focusable:!0}),component:i,ref:t,type:i==="button"?"button":void 0,...m})});tr.classes=d2;tr.displayName="@mantine/core/UnstyledButton";var f2={root:"m_515a97f8"};const L9={},Ox=ve((e,t)=>{const n=se("VisuallyHidden",L9,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,...p}=n,m=Ie({name:"VisuallyHidden",classes:f2,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u});return o.jsx(ce,{component:"span",ref:t,...m("root"),...p})});Ox.classes=f2;Ox.displayName="@mantine/core/VisuallyHidden";var h2={root:"m_1b7284a3"};const z9={},$9=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:Vt(t),"--paper-shadow":ux(n)}}),mr=lr((e,t)=>{const n=se("Paper",z9,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,withBorder:f,vars:p,radius:m,shadow:g,variant:y,mod:b,...S}=n,j=Ie({name:"Paper",props:n,classes:h2,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:p,varsResolver:$9});return o.jsx(ce,{ref:t,mod:[{"data-with-border":f},b],...j("root"),variant:y,...S})});mr.classes=h2;mr.displayName="@mantine/core/Paper";function p2(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 SC(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function wC(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 U9={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function B9({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,arrowX:s,arrowY:c,dir:u}){const[f,p="center"]=e.split("-"),m={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[U9[f]]:r},g=-t/2;return f==="left"?{...m,...SC(p,c,n,i),right:g,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:f==="right"?{...m,...SC(p,c,n,i),left:g,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:f==="top"?{...m,...wC(p,s,n,i,u),bottom:g,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:f==="bottom"?{...m,...wC(p,s,n,i,u),top:g,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const Mx=v.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,visible:s,arrowX:c,arrowY:u,style:f,...p},m)=>{const{dir:g}=Zs();return s?o.jsx("div",{...p,ref:m,style:{...f,...B9({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,dir:g,arrowX:c,arrowY:u})}}):null});Mx.displayName="@mantine/core/FloatingArrow";var m2={root:"m_9814e45f"};const V9={zIndex:Wr("modal")},F9=(e,{gradient:t,color:n,backgroundOpacity:r,blur:i,radius:s,zIndex:c})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&ci(n||"#000",r??.6)||void 0,"--overlay-filter":i?`blur(${le(i)})`:void 0,"--overlay-radius":s===void 0?void 0:Vt(s),"--overlay-z-index":c==null?void 0:c.toString()}}),dc=lr((e,t)=>{const n=se("Overlay",V9,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,fixed:p,center:m,children:g,radius:y,zIndex:b,gradient:S,blur:j,color:C,backgroundOpacity:T,mod:D,...E}=n,R=Ie({name:"Overlay",props:n,classes:m2,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:F9});return o.jsx(ce,{ref:t,...R("root"),mod:[{center:m,fixed:p},D],...E,children:g})});dc.classes=m2;dc.displayName="@mantine/core/Overlay";function Lv(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 H9({target:e,reuseTargetNode:t,...n}){if(e)return typeof e=="string"?document.querySelector(e)||Lv(n):e;if(t){const r=document.querySelector("[data-mantine-shared-portal-node]");if(r)return r;const i=Lv(n);return i.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(i),i}return Lv(n)}const q9={},g2=ve((e,t)=>{const{children:n,target:r,reuseTargetNode:i,...s}=se("Portal",q9,e),[c,u]=v.useState(!1),f=v.useRef(null);return Sc(()=>(u(!0),f.current=H9({target:r,reuseTargetNode:i,...s}),Zu(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:yx.createPortal(o.jsx(o.Fragment,{children:n}),f.current)});g2.displayName="@mantine/core/Portal";const Go=ve(({withinPortal:e=!0,children:t,...n},r)=>jR()==="test"||!e?o.jsx(o.Fragment,{children:t}):o.jsx(g2,{ref:r,...n,children:t}));Go.displayName="@mantine/core/OptionalPortal";const Iu=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),rh={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:{...Iu("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...Iu("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...Iu("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...Iu("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...Iu("top"),common:{transformOrigin:"top right"}}},jC={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function G9({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 rh?{transitionProperty:rh[e].transitionProperty,...i,...rh[e].common,...rh[e][jC[t]]}:{}:{transitionProperty:e.transitionProperty,...i,...e.common,...e[jC[t]]}}function Q9({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:i,onExit:s,onEntered:c,onExited:u,enterDelay:f,exitDelay:p}){const m=Sn(),g=fx(),y=m.respectReducedMotion?g:!1,[b,S]=v.useState(y?0:e),[j,C]=v.useState(r?"entered":"exited"),T=v.useRef(-1),D=v.useRef(-1),E=v.useRef(-1);function R(){window.clearTimeout(T.current),window.clearTimeout(D.current),cancelAnimationFrame(E.current)}const A=M=>{R();const I=M?i:s,$=M?c:u,V=y?0:M?e:t;S(V),V===0?(typeof I=="function"&&I(),typeof $=="function"&&$(),C(M?"entered":"exited")):E.current=requestAnimationFrame(()=>{Hu.flushSync(()=>{C(M?"pre-entering":"pre-exiting")}),E.current=requestAnimationFrame(()=>{typeof I=="function"&&I(),C(M?"entering":"exiting"),T.current=window.setTimeout(()=>{typeof $=="function"&&$(),C(M?"entered":"exited")},V)})})},k=M=>{if(R(),typeof(M?f:p)!="number"){A(M);return}D.current=window.setTimeout(()=>{A(M)},M?f:p)};return za(()=>{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:s,timingFunction:c="ease",onExit:u,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:y}){const b=jR(),{transitionDuration:S,transitionStatus:j,transitionTimingFunction:C}=Q9({mounted:i,exitDuration:r,duration:n,timingFunction:c,onExit:u,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:y});return S===0||b==="test"?i?o.jsx(o.Fragment,{children:s({})}):e?s({display:"none"}):null:j==="exited"?e?s({display:"none"}):null:o.jsx(o.Fragment,{children:s(G9({transition:t,duration:S,state:j,timingFunction:C}))})}da.displayName="@mantine/core/Transition";const[W9,v2]=vr("Popover component was not found in the tree");function vp({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const i=bN(t),s=$n(i,r);return Fa(e)?v.cloneElement(e,{[n]:s}):e}function y2(e){return o.jsx(Ox,{tabIndex:-1,"data-autofocus":!0,...e})}vp.displayName="@mantine/core/FocusTrap";y2.displayName="@mantine/core/FocusTrapInitialFocus";vp.InitialFocus=y2;var x2={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const Y9={},Ix=ve((e,t)=>{var C,T,D,E;const n=se("PopoverDropdown",Y9,e),{className:r,style:i,vars:s,children:c,onKeyDownCapture:u,variant:f,classNames:p,styles:m,...g}=n,y=v2(),b=gR({opened:y.opened,shouldReturnFocus:y.returnFocus}),S=y.withRoles?{"aria-labelledby":y.getTargetId(),id:y.getDropdownId(),role:"dialog",tabIndex:-1}:{},j=$n(t,y.floating);return y.disabled?null:o.jsx(Go,{...y.portalProps,withinPortal:y.withinPortal,children:o.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((D=y.transitionProps)==null?void 0:D.exitDuration)=="number"?y.transitionProps.exitDuration:(E=y.transitionProps)==null?void 0:E.duration,children:R=>o.jsx(vp,{active:y.trapFocus&&y.opened,innerRef:j,children:o.jsxs(ce,{...S,...g,variant:f,onKeyDownCapture:sN(()=>{var A,k;(A=y.onClose)==null||A.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:p,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,o.jsx(Mx,{ref:y.arrowRef,arrowX:y.arrowX,arrowY:y.arrowY,visible:y.withArrow,position:y.placement,arrowSize:y.arrowSize,arrowRadius:y.arrowRadius,arrowOffset:y.arrowOffset,arrowPosition:y.arrowPosition,...y.getStyles("arrow",{props:n,classNames:p,styles:m})})]})})})})});Ix.classes=x2;Ix.displayName="@mantine/core/PopoverDropdown";const K9={refProp:"ref",popupType:"dialog"},b2=ve((e,t)=>{const{children:n,refProp:r,popupType:i,...s}=se("PopoverTarget",K9,e);if(!Fa(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=s,u=v2(),f=$n(u.reference,sp(n),t),p=u.withRoles?{"aria-haspopup":i,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:u.getTargetId()}:{};return v.cloneElement(n,{...c,...p,...u.targetProps,className:Ut(u.targetProps.className,c.className,n.props.className),[r]:f,...u.controlled?null:{onClick:u.onToggle}})});b2.displayName="@mantine/core/PopoverTarget";function S2({opened:e,floating:t,position:n,positionDependencies:r}){const[i,s]=v.useState(0);v.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current&&e)return qM(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,i,n]),za(()=>{t.update()},r),za(()=>{s(c=>c+1)},[e])}function X9(e){if(e===void 0)return{shift:!0,flip:!0};const t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function Z9(e,t){const n=X9(e.middlewares),r=[WR(e.offset)];return n.shift&&r.push(Rx(typeof n.shift=="boolean"?{limiter:hC(),padding:5}:{limiter:hC(),padding:5,...n.shift})),n.flip&&r.push(typeof n.flip=="boolean"?Ph():Ph(n.flip)),n.inline&&r.push(typeof n.inline=="boolean"?Wu():Wu(n.inline)),r.push(YR({element:e.arrowRef,padding:e.arrowOffset})),(n.size||e.width==="target")&&r.push(r9({...typeof n.size=="boolean"?{}:n.size,apply({rects:i,availableWidth:s,availableHeight:c,...u}){var m;const p=((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:s,availableHeight:c,...u}):Object.assign(p,{maxWidth:`${s}px`,maxHeight:`${c}px`})),e.width==="target"&&Object.assign(p,{width:`${i.reference.width}px`})}})),r}function J9(e){const[t,n]=Yn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=v.useRef(t),i=()=>{t&&!e.disabled&&n(!1)},s=()=>!e.disabled&&n(!t),c=kx({strategy:e.strategy,placement:e.position,middleware:Z9(e,()=>c)});return S2({opened:t,position:e.position,positionDependencies:e.positionDependencies||[],floating:c}),za(()=>{var u;(u=e.onPositionChange)==null||u.call(e,c.placement)},[c.placement]),za(()=>{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:s}}const e5={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:Wr("popover"),__staticSelector:"Popover",width:"max-content"},t5=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:Vt(t),"--popover-shadow":ux(n)}});function zi(e){var $e,yt,ft,Gt,kt,un;const t=se("Popover",e5,e),{children:n,position:r,offset:i,onPositionChange:s,positionDependencies:c,opened:u,transitionProps:f,onExitTransitionEnd:p,onEnterTransitionEnd:m,width:g,middlewares:y,withArrow:b,arrowSize:S,arrowOffset:j,arrowRadius:C,arrowPosition:T,unstyled:D,classNames:E,styles:R,closeOnClickOutside:A,withinPortal:k,portalProps:M,closeOnEscape:I,clickOutsideEvents:$,trapFocus:V,onClose:Y,onDismiss:Q,onOpen:J,onChange:G,zIndex:K,radius:P,shadow:L,id:z,defaultOpened:H,__staticSelector:O,withRoles:U,disabled:X,returnFocus:ee,variant:Se,keepMounted:be,vars:xe,floatingStrategy:qe,withOverlay:Me,overlayProps:tt,...ke}=t,vt=Ie({name:O,props:t,classes:x2,classNames:E,styles:R,unstyled:D,rootSelector:"dropdown",vars:xe,varsResolver:t5}),{resolvedStyles:It}=Ys({classNames:E,styles:R,props:t}),Lt=v.useRef(null),[gt,At]=v.useState(null),[nn,Ee]=v.useState(null),{dir:De}=Zs(),Qe=yr(z),Re=J9({middlewares:y,width:g,position:p2(De,r),offset:typeof i=="number"?i+(b?S/2:0):i,arrowRef:Lt,arrowOffset:j,onPositionChange:s,positionDependencies:c,opened:u,defaultOpened:H,onChange:G,onOpen:J,onClose:Y,onDismiss:Q,strategy:qe,disabled:X});dN(()=>{A&&(Re.onClose(),Q==null||Q())},$,[gt,nn]);const me=v.useCallback(wt=>{At(wt),Re.floating.refs.setReference(wt)},[Re.floating.refs.setReference]),ge=v.useCallback(wt=>{Ee(wt),Re.floating.refs.setFloating(wt)},[Re.floating.refs.setFloating]),Pe=v.useCallback(()=>{var wt;(wt=f==null?void 0:f.onExited)==null||wt.call(f),p==null||p()},[f==null?void 0:f.onExited,p]),we=v.useCallback(()=>{var wt;(wt=f==null?void 0:f.onEntered)==null||wt.call(f),m==null||m()},[f==null?void 0:f.onEntered,m]);return o.jsxs(W9,{value:{returnFocus:ee,disabled:X,controlled:Re.controlled,reference:me,floating:ge,x:Re.floating.x,y:Re.floating.y,arrowX:(ft=(yt=($e=Re.floating)==null?void 0:$e.middlewareData)==null?void 0:yt.arrow)==null?void 0:ft.x,arrowY:(un=(kt=(Gt=Re.floating)==null?void 0:Gt.middlewareData)==null?void 0:kt.arrow)==null?void 0:un.y,opened:Re.opened,arrowRef:Lt,transitionProps:{...f,onExited:Pe,onEntered:we},width:g,withArrow:b,arrowSize:S,arrowOffset:j,arrowRadius:C,arrowPosition:T,placement:Re.floating.placement,trapFocus:V,withinPortal:k,portalProps:M,zIndex:K,radius:P,shadow:L,closeOnEscape:I,onDismiss:Q,onClose:Re.onClose,onToggle:Re.onToggle,getTargetId:()=>`${Qe}-target`,getDropdownId:()=>`${Qe}-dropdown`,withRoles:U,targetProps:ke,__staticSelector:O,classNames:E,styles:R,unstyled:D,variant:Se,keepMounted:be,getStyles:vt,resolvedStyles:It,floatingStrategy:qe},children:[n,Me&&o.jsx(da,{transition:"fade",mounted:Re.opened,duration:(f==null?void 0:f.duration)||250,exitDuration:(f==null?void 0:f.exitDuration)||250,children:wt=>o.jsx(Go,{withinPortal:k,children:o.jsx(dc,{...tt,...vt("overlay",{className:tt==null?void 0:tt.className,style:[wt,tt==null?void 0:tt.style]})})})})]})}zi.Target=b2;zi.Dropdown=Ix;zi.displayName="@mantine/core/Popover";zi.extend=e=>e;var Pi={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 w2=v.forwardRef(({className:e,...t},n)=>o.jsxs(ce,{component:"span",className:Ut(Pi.barsLoader,e),...t,ref:n,children:[o.jsx("span",{className:Pi.bar}),o.jsx("span",{className:Pi.bar}),o.jsx("span",{className:Pi.bar})]}));w2.displayName="@mantine/core/Bars";const j2=v.forwardRef(({className:e,...t},n)=>o.jsxs(ce,{component:"span",className:Ut(Pi.dotsLoader,e),...t,ref:n,children:[o.jsx("span",{className:Pi.dot}),o.jsx("span",{className:Pi.dot}),o.jsx("span",{className:Pi.dot})]}));j2.displayName="@mantine/core/Dots";const C2=v.forwardRef(({className:e,...t},n)=>o.jsx(ce,{component:"span",className:Ut(Pi.ovalLoader,e),...t,ref:n}));C2.displayName="@mantine/core/Oval";const E2={bars:w2,oval:C2,dots:j2},n5={loaders:E2,type:"oval"},r5=(e,{size:t,color:n})=>({root:{"--loader-size":rt(t,"loader-size"),"--loader-color":n?Ht(n,e):void 0}}),_r=ve((e,t)=>{const n=se("Loader",n5,e),{size:r,color:i,type:s,vars:c,className:u,style:f,classNames:p,styles:m,unstyled:g,loaders:y,variant:b,children:S,...j}=n,C=Ie({name:"Loader",props:n,classes:Pi,className:u,style:f,classNames:p,styles:m,unstyled:g,vars:c,varsResolver:r5});return S?o.jsx(ce,{...C("root"),ref:t,...j,children:S}):o.jsx(ce,{...C("root"),ref:t,component:y[s],variant:b,size:r,...j})});_r.defaultLoaders=E2;_r.classes=Pi;_r.displayName="@mantine/core/Loader";var Cc={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const CC={orientation:"horizontal"},i5=(e,{borderWidth:t})=>({group:{"--ai-border-width":le(t)}}),Lx=ve((e,t)=>{const n=se("ActionIconGroup",CC,e),{className:r,style:i,classNames:s,styles:c,unstyled:u,orientation:f,vars:p,borderWidth:m,variant:g,mod:y,...b}=se("ActionIconGroup",CC,e),S=Ie({name:"ActionIconGroup",props:n,classes:Cc,className:r,style:i,classNames:s,styles:c,unstyled:u,vars:p,varsResolver:i5,rootSelector:"group"});return o.jsx(ce,{...S("group"),ref:t,variant:g,mod:[{"data-orientation":f},y],role:"group",...b})});Lx.classes=Cc;Lx.displayName="@mantine/core/ActionIconGroup";const EC={},a5=(e,{radius:t,color:n,gradient:r,variant:i,autoContrast:s,size:c})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:s});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:Vt(t),"--section-bg":n||i?u.background:void 0,"--section-color":u.color,"--section-bd":n||i?u.border:void 0}}},zx=ve((e,t)=>{const n=se("ActionIconGroupSection",EC,e),{className:r,style:i,classNames:s,styles:c,unstyled:u,vars:f,variant:p,gradient:m,radius:g,autoContrast:y,...b}=se("ActionIconGroupSection",EC,e),S=Ie({name:"ActionIconGroupSection",props:n,classes:Cc,className:r,style:i,classNames:s,styles:c,unstyled:u,vars:f,varsResolver:a5,rootSelector:"groupSection"});return o.jsx(ce,{...S("groupSection"),ref:t,variant:p,...b})});zx.classes=Cc;zx.displayName="@mantine/core/ActionIconGroupSection";const o5={},s5=(e,{size:t,radius:n,variant:r,gradient:i,color:s,autoContrast:c})=>{const u=e.variantColorResolver({color:s||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:Vt(n),"--ai-bg":s||r?u.background:void 0,"--ai-hover":s||r?u.hover:void 0,"--ai-hover-color":s||r?u.hoverColor:void 0,"--ai-color":u.color,"--ai-bd":s||r?u.border:void 0}}},_n=lr((e,t)=>{const n=se("ActionIcon",o5,e),{className:r,unstyled:i,variant:s,classNames:c,styles:u,style:f,loading:p,loaderProps:m,size:g,color:y,radius:b,__staticSelector:S,gradient:j,vars:C,children:T,disabled:D,"data-disabled":E,autoContrast:R,mod:A,...k}=n,M=Ie({name:["ActionIcon",S],props:n,className:r,style:f,classes:Cc,classNames:c,styles:u,unstyled:i,vars:C,varsResolver:s5});return o.jsxs(tr,{...M("root",{active:!D&&!p&&!E}),...k,unstyled:i,variant:s,size:g,disabled:D||p,ref:t,mod:[{loading:p,disabled:D||E},A],children:[o.jsx(da,{mounted:!!p,transition:"slide-down",duration:150,children:I=>o.jsx(ce,{component:"span",...M("loader",{style:I}),"aria-hidden":!0,children:o.jsx(_r,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...m})})}),o.jsx(ce,{component:"span",mod:{loading:p},...M("icon"),children:T})]})});_n.classes=Cc;_n.displayName="@mantine/core/ActionIcon";_n.Group=Lx;_n.GroupSection=zx;const T2=v.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...n},r)=>o.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:o.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"})}));T2.displayName="@mantine/core/CloseIcon";var R2={root:"m_86a44da5","root--subtle":"m_220c80f2"};const l5={variant:"subtle"},c5=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":rt(t,"cb-size"),"--cb-radius":n===void 0?void 0:Vt(n),"--cb-icon-size":le(r)}}),Qo=lr((e,t)=>{const n=se("CloseButton",l5,e),{iconSize:r,children:i,vars:s,radius:c,className:u,classNames:f,style:p,styles:m,unstyled:g,"data-disabled":y,disabled:b,variant:S,icon:j,mod:C,__staticSelector:T,...D}=n,E=Ie({name:T||"CloseButton",props:n,className:u,style:p,classes:R2,classNames:f,styles:m,unstyled:g,vars:s,varsResolver:c5});return o.jsxs(tr,{ref:t,...D,unstyled:g,variant:S,disabled:b,mod:[{disabled:b||y},C],...E("root",{variant:S,active:!b&&!y}),children:[j||o.jsx(T2,{}),i]})});Qo.classes=R2;Qo.displayName="@mantine/core/CloseButton";function u5(e){return v.Children.toArray(e).filter(Boolean)}var D2={root:"m_4081bf90"};const d5={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},f5=(e,{grow:t,preventGrowOverflow:n,gap:r,align:i,justify:s,wrap:c},{childWidth:u})=>({root:{"--group-child-width":t&&n?u:void 0,"--group-gap":Nn(r),"--group-align":i,"--group-justify":s,"--group-wrap":c}}),je=ve((e,t)=>{const n=se("Group",d5,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,children:f,gap:p,align:m,justify:g,wrap:y,grow:b,preventGrowOverflow:S,vars:j,variant:C,__size:T,mod:D,...E}=n,R=u5(f),A=R.length,k=Nn(p??"md"),I={childWidth:`calc(${100/A}% - (${k} - ${k} / ${A}))`},$=Ie({name:"Group",props:n,stylesCtx:I,className:i,style:s,classes:D2,classNames:r,styles:c,unstyled:u,vars:j,varsResolver:f5});return o.jsx(ce,{...$("root"),ref:t,variant:C,mod:[{grow:b},D],size:T,...E,children:R})});je.classes=D2;je.displayName="@mantine/core/Group";const[h5,Wa]=vr("ModalBase component was not found in tree");function p5({opened:e,transitionDuration:t}){const[n,r]=v.useState(e),i=v.useRef(-1),c=fx()?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 m5({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:i,onClose:s,returnFocus:c}){const u=yr(e),[f,p]=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=p5({opened:n,transitionDuration:y});return bR("keydown",S=>{var j;S.key==="Escape"&&i&&!S.isComposing&&n&&((j=S.target)==null?void 0:j.getAttribute("data-mantine-stop-propagation"))!=="true"&&s()},{capture:!0}),gR({opened:n,shouldReturnFocus:r&&c}),{_id:u,titleMounted:f,bodyMounted:m,shouldLockScroll:b,setTitleMounted:p,setBodyMounted:g}}const A2=v.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:i,onExitTransitionEnd:s,onEnterTransitionEnd:c,trapFocus:u,closeOnEscape:f,returnFocus:p,closeOnClickOutside:m,withinPortal:g,portalProps:y,lockScroll:b,children:S,zIndex:j,shadow:C,padding:T,__vars:D,unstyled:E,removeScrollProps:R,...A},k)=>{const{_id:M,titleMounted:I,bodyMounted:$,shouldLockScroll:V,setTitleMounted:Y,setBodyMounted:Q}=m5({id:r,transitionProps:i,opened:t,trapFocus:u,closeOnEscape:f,onClose:n,returnFocus:p}),{key:J,...G}=R||{};return o.jsx(Go,{...y,withinPortal:g,children:o.jsx(h5,{value:{opened:t,onClose:n,closeOnClickOutside:m,onExitTransitionEnd:s,onEnterTransitionEnd:c,transitionProps:{...i,keepMounted:e},getTitleId:()=>`${M}-title`,getBodyId:()=>`${M}-body`,titleMounted:I,bodyMounted:$,setTitleMounted:Y,setBodyMounted:Q,trapFocus:u,closeOnEscape:f,zIndex:j,unstyled:E},children:o.jsx(lc,{enabled:V&&b,...G,children:o.jsx(ce,{ref:k,...A,__vars:{...D,"--mb-z-index":(j||Wr("modal")).toString(),"--mb-shadow":ux(C),"--mb-padding":Nn(T)},children:S})},J)})})});A2.displayName="@mantine/core/ModalBase";function g5(){const e=Wa();return v.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var fc={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const _2=v.forwardRef(({className:e,...t},n)=>{const r=g5(),i=Wa();return o.jsx(ce,{ref:n,...t,id:r,className:Ut({[fc.body]:!i.unstyled},e)})});_2.displayName="@mantine/core/ModalBaseBody";const k2=v.forwardRef(({className:e,onClick:t,...n},r)=>{const i=Wa();return o.jsx(Qo,{ref:r,...n,onClick:s=>{i.onClose(),t==null||t(s)},className:Ut({[fc.close]:!i.unstyled},e),unstyled:i.unstyled})});k2.displayName="@mantine/core/ModalBaseCloseButton";const P2=v.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:i,...s},c)=>{const u=Wa();return o.jsx(da,{mounted:u.opened,transition:"pop",...u.transitionProps,onExited:()=>{var f,p,m;(f=u.onExitTransitionEnd)==null||f.call(u),(m=(p=u.transitionProps)==null?void 0:p.onExited)==null||m.call(p)},onEntered:()=>{var f,p,m;(f=u.onEnterTransitionEnd)==null||f.call(u),(m=(p=u.transitionProps)==null?void 0:p.onEntered)==null||m.call(p)},...e,children:f=>o.jsx("div",{...n,className:Ut({[fc.inner]:!u.unstyled},n.className),children:o.jsx(vp,{active:u.opened&&u.trapFocus,innerRef:c,children:o.jsx(mr,{...s,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":u.bodyMounted?u.getBodyId():void 0,"aria-labelledby":u.titleMounted?u.getTitleId():void 0,style:[i,f],className:Ut({[fc.content]:!u.unstyled},t),unstyled:u.unstyled,children:s.children})})})})});P2.displayName="@mantine/core/ModalBaseContent";const N2=v.forwardRef(({className:e,...t},n)=>{const r=Wa();return o.jsx(ce,{component:"header",ref:n,className:Ut({[fc.header]:!r.unstyled},e),...t})});N2.displayName="@mantine/core/ModalBaseHeader";const v5={duration:200,timingFunction:"ease",transition:"fade"};function y5(e){const t=Wa();return{...v5,...t.transitionProps,...e}}const O2=v.forwardRef(({onClick:e,transitionProps:t,style:n,visible:r,...i},s)=>{const c=Wa(),u=y5(t);return o.jsx(da,{mounted:r!==void 0?r:c.opened,...u,transition:"fade",children:f=>o.jsx(dc,{ref:s,fixed:!0,style:[n,f],zIndex:c.zIndex,unstyled:c.unstyled,onClick:p=>{e==null||e(p),c.closeOnClickOutside&&c.onClose()},...i})})});O2.displayName="@mantine/core/ModalBaseOverlay";function x5(){const e=Wa();return v.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const M2=v.forwardRef(({className:e,...t},n)=>{const r=x5(),i=Wa();return o.jsx(ce,{component:"h2",ref:n,className:Ut({[fc.title]:!i.unstyled},e),...t,id:r})});M2.displayName="@mantine/core/ModalBaseTitle";function b5({children:e}){return o.jsx(o.Fragment,{children:e})}const[S5,w5]=Ha({size:"sm"}),j5={},I2=ve((e,t)=>{const n=se("InputClearButton",j5,e),{size:r,variant:i,vars:s,classNames:c,styles:u,...f}=n,p=w5(),{resolvedClassNames:m,resolvedStyles:g}=Ys({classNames:c,styles:u,props:n});return o.jsx(Qo,{variant:i||"transparent",ref:t,size:r||(p==null?void 0:p.size)||"sm",classNames:m,styles:g,__staticSelector:"InputClearButton",...f})});I2.displayName="@mantine/core/InputClearButton";const[C5,Ec]=Ha({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 TC={},E5=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${On(t)} - ${le(2)})`}}),yp=ve((e,t)=>{const n=se("InputDescription",TC,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,size:p,__staticSelector:m,__inheritStyles:g=!0,variant:y,...b}=se("InputDescription",TC,n),S=Ec(),j=Ie({name:["InputWrapper",m],props:n,classes:xi,className:i,style:s,classNames:r,styles:c,unstyled:u,rootSelector:"description",vars:f,varsResolver:E5}),C=g&&(S==null?void 0:S.getStyles)||j;return o.jsx(ce,{component:"p",ref:t,variant:y,size:p,...C("description",S!=null&&S.getStyles?{className:i,style:s}:void 0),...b})});yp.classes=xi;yp.displayName="@mantine/core/InputDescription";const T5={},R5=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${On(t)} - ${le(2)})`}}),xp=ve((e,t)=>{const n=se("InputError",T5,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,size:p,__staticSelector:m,__inheritStyles:g=!0,variant:y,...b}=n,S=Ie({name:["InputWrapper",m],props:n,classes:xi,className:i,style:s,classNames:r,styles:c,unstyled:u,rootSelector:"error",vars:f,varsResolver:R5}),j=Ec(),C=g&&(j==null?void 0:j.getStyles)||S;return o.jsx(ce,{component:"p",ref:t,variant:y,size:p,...C("error",j!=null&&j.getStyles?{className:i,style:s}:void 0),...b})});xp.classes=xi;xp.displayName="@mantine/core/InputError";const RC={labelElement:"label"},D5=(e,{size:t})=>({label:{"--input-label-size":On(t),"--input-asterisk-color":void 0}}),pd=ve((e,t)=>{const n=se("InputLabel",RC,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,labelElement:p,size:m,required:g,htmlFor:y,onMouseDown:b,children:S,__staticSelector:j,variant:C,mod:T,...D}=se("InputLabel",RC,n),E=Ie({name:["InputWrapper",j],props:n,classes:xi,className:i,style:s,classNames:r,styles:c,unstyled:u,rootSelector:"label",vars:f,varsResolver:D5}),R=Ec(),A=(R==null?void 0:R.getStyles)||E;return o.jsxs(ce,{...A("label",R!=null&&R.getStyles?{className:i,style:s}:void 0),component:p,variant:C,size:m,ref:t,htmlFor:p==="label"?y:void 0,mod:[{required:g},T],onMouseDown:k=>{b==null||b(k),!k.defaultPrevented&&k.detail>1&&k.preventDefault()},...D,children:[S,g&&o.jsx("span",{...A("required"),"aria-hidden":!0,children:" *"})]})});pd.classes=xi;pd.displayName="@mantine/core/InputLabel";const DC={},$x=ve((e,t)=>{const n=se("InputPlaceholder",DC,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,__staticSelector:p,variant:m,error:g,mod:y,...b}=se("InputPlaceholder",DC,n),S=Ie({name:["InputPlaceholder",p],props:n,classes:xi,className:i,style:s,classNames:r,styles:c,unstyled:u,rootSelector:"placeholder"});return o.jsx(ce,{...S("placeholder"),mod:[{error:!!g},y],component:"span",variant:m,ref:t,...b})});$x.classes=xi;$x.displayName="@mantine/core/InputPlaceholder";function A5(e,{hasDescription:t,hasError:n}){const r=e.findIndex(f=>f==="input"),i=e.slice(0,r),s=e.slice(r+1),c=t&&i.includes("description")||n&&i.includes("error");return{offsetBottom:t&&s.includes("description")||n&&s.includes("error"),offsetTop:c}}const _5={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},k5=(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)})`}}),Ux=ve((e,t)=>{const n=se("InputWrapper",_5,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,size:p,variant:m,__staticSelector:g,inputContainer:y,inputWrapperOrder:b,label:S,error:j,description:C,labelProps:T,descriptionProps:D,errorProps:E,labelElement:R,children:A,withAsterisk:k,id:M,required:I,__stylesApiProps:$,mod:V,...Y}=n,Q=Ie({name:["InputWrapper",g],props:$||n,classes:xi,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:k5}),J={size:p,variant:m,__staticSelector:g},G=yr(M),K=typeof k=="boolean"?k:I,P=(E==null?void 0:E.id)||`${G}-error`,L=(D==null?void 0:D.id)||`${G}-description`,z=G,H=!!j&&typeof j!="boolean",O=!!C,U=`${H?P:""} ${O?L:""}`,X=U.trim().length>0?U.trim():void 0,ee=(T==null?void 0:T.id)||`${G}-label`,Se=S&&o.jsx(pd,{labelElement:R,id:ee,htmlFor:z,required:K,...J,...T,children:S},"label"),be=O&&o.jsx(yp,{...D,...J,size:(D==null?void 0:D.size)||J.size,id:(D==null?void 0:D.id)||L,children:C},"description"),xe=o.jsx(v.Fragment,{children:y(A)},"input"),qe=H&&v.createElement(xp,{...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(tt=>{switch(tt){case"label":return Se;case"input":return xe;case"description":return be;case"error":return qe;default:return null}});return o.jsx(C5,{value:{getStyles:Q,describedBy:X,inputId:z,labelId:ee,...A5(b,{hasDescription:O,hasError:H})},children:o.jsx(ce,{ref:t,variant:m,size:p,mod:[{error:!!j},V],...Q("root"),...Y,children:Me})})});Ux.classes=xi;Ux.displayName="@mantine/core/InputWrapper";const P5={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},N5=(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:Vt(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?le(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?le(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?rt(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),mn=lr((e,t)=>{const n=se("Input",P5,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,required:f,__staticSelector:p,__stylesApiProps:m,size:g,wrapperProps:y,error:b,disabled:S,leftSection:j,leftSectionProps:C,leftSectionWidth:T,rightSection:D,rightSectionProps:E,rightSectionWidth:R,rightSectionPointerEvents:A,leftSectionPointerEvents:k,variant:M,vars:I,pointer:$,multiline:V,radius:Y,id:Q,withAria:J,withErrorStyles:G,mod:K,inputSize:P,__clearSection:L,__clearable:z,__defaultRightSection:H,...O}=n,{styleProps:U,rest:X}=Qa(O),ee=Ec(),Se={offsetBottom:ee==null?void 0:ee.offsetBottom,offsetTop:ee==null?void 0:ee.offsetTop},be=Ie({name:["Input",p],props:m||n,classes:xi,className:i,style:s,classNames:r,styles:c,unstyled:u,stylesCtx:Se,rootSelector:"wrapper",vars:I,varsResolver:N5}),xe=J?{required:f,disabled:S,"aria-invalid":!!b,"aria-describedby":ee==null?void 0:ee.describedBy,id:(ee==null?void 0:ee.inputId)||Q}:{},qe=D||z&&L||H;return o.jsx(S5,{value:{size:g||"sm"},children:o.jsxs(ce,{...be("wrapper"),...U,...y,mod:[{error:!!b&&G,pointer:$,disabled:S,multiline:V,"data-with-right-section":!!qe,"data-with-left-section":!!j},K],variant:M,size:g,children:[j&&o.jsx("div",{...C,"data-position":"left",...be("section",{className:C==null?void 0:C.className,style:C==null?void 0:C.style}),children:j}),o.jsx(ce,{component:"input",...X,...xe,ref:t,required:f,mod:{disabled:S,error:!!b&&G},variant:M,__size:P,...be("input")}),qe&&o.jsx("div",{...E,"data-position":"right",...be("section",{className:E==null?void 0:E.className,style:E==null?void 0:E.style}),children:qe})]})})});mn.classes=xi;mn.Wrapper=Ux;mn.Label=pd;mn.Error=xp;mn.Description=yp;mn.Placeholder=$x;mn.ClearButton=I2;mn.displayName="@mantine/core/Input";function O5(e,t,n){const r=se(e,t,n),{label:i,description:s,error:c,required:u,classNames:f,styles:p,className:m,unstyled:g,__staticSelector:y,__stylesApiProps:b,errorProps:S,labelProps:j,descriptionProps:C,wrapperProps:T,id:D,size:E,style:R,inputContainer:A,inputWrapperOrder:k,withAsterisk:M,variant:I,vars:$,mod:V,...Y}=r,{styleProps:Q,rest:J}=Qa(Y),G={label:i,description:s,error:c,required:u,classNames:f,className:m,__staticSelector:y,__stylesApiProps:b||r,errorProps:S,labelProps:j,descriptionProps:C,unstyled:g,styles:p,size:E,style:R,inputContainer:A,inputWrapperOrder:k,withAsterisk:M,variant:I,id:D,mod:V,...T};return{...J,classNames:f,styles:p,unstyled:g,wrapperProps:{...G,...Q},inputProps:{required:u,classNames:f,styles:p,unstyled:g,size:E,__staticSelector:y,__stylesApiProps:b||r,error:c,variant:I,id:D}}}const M5={__staticSelector:"InputBase",withAria:!0},Pr=lr((e,t)=>{const{inputProps:n,wrapperProps:r,...i}=O5("InputBase",M5,e);return o.jsx(mn.Wrapper,{...r,children:o.jsx(mn,{...n,...i,ref:t})})});Pr.classes={...mn.classes,...mn.Wrapper.classes};Pr.displayName="@mantine/core/InputBase";const I5={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 L2={root:"m_8bffd616"};const L5={},Vo=lr((e,t)=>{const n=se("Flex",L5,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,gap:p,rowGap:m,columnGap:g,align:y,justify:b,wrap:S,direction:j,...C}=n,T=Ie({name:"Flex",classes:L2,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f}),D=Sn(),E=fd(),R=DR({styleProps:{gap:p,rowGap:m,columnGap:g,align:y,justify:b,wrap:S,direction:j},theme:D,data:I5});return o.jsxs(o.Fragment,{children:[R.hasResponsiveStyles&&o.jsx(Xs,{selector:`.${E}`,styles:R.styles,media:R.media}),o.jsx(ce,{ref:t,...T("root",{className:E,style:qo(R.inlineStyles)}),...C})]})});Vo.classes=L2;Vo.displayName="@mantine/core/Flex";function z5(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 $5({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const i=v.useRef(-1),[s,c]=v.useState(!1),[u,f]=v.useState(typeof r=="boolean"?r:!1),p=()=>{if(!e||!t||!n.current)return;const b=e.getBoundingClientRect(),S=t.getBoundingClientRect(),j=window.getComputedStyle(e),C=window.getComputedStyle(t),T=$o(j.borderTopWidth)+$o(C.borderTopWidth),D=$o(j.borderLeftWidth)+$o(C.borderLeftWidth),E={top:b.top-S.top-T,left:b.left-S.left-D,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"),p(),i.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},g=v.useRef(null),y=v.useRef(null);return v.useEffect(()=>{if(p(),e)return g.current=new ResizeObserver(m),g.current.observe(e),t&&(y.current=new ResizeObserver(m),y.current.observe(t)),()=>{var b,S;(b=g.current)==null||b.disconnect(),(S=y.current)==null||S.disconnect()}},[t,e]),v.useEffect(()=>{if(t){const b=S=>{z5(S.target,t)&&(m(),f(!1))};return t.addEventListener("transitionend",b),()=>{t.removeEventListener("transitionend",b)}}},[t]),_N(()=>{SR()!=="test"&&c(!0)},20,{autoInvoke:!0}),kN(b=>{b.forEach(S=>{S.type==="attributes"&&S.attributeName==="dir"&&m()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:s,hidden:u}}var z2={root:"m_96b553a6"};const U5={},B5=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),Bx=ve((e,t)=>{const n=se("FloatingIndicator",U5,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,target:p,parent:m,transitionDuration:g,mod:y,displayAfterTransitionEnd:b,...S}=n,j=Ie({name:"FloatingIndicator",classes:z2,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:B5}),C=v.useRef(null),{initialized:T,hidden:D}=$5({target:p,parent:m,ref:C,displayAfterTransitionEnd:b}),E=$n(t,C);return!p||!m?null:o.jsx(ce,{ref:E,mod:[{initialized:T,hidden:D},y],...j("root"),...S})});Bx.displayName="@mantine/core/FloatingIndicator";Bx.classes=z2;var $2={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 V5={},F5=(e,{radius:t,color:n,variant:r,autoContrast:i})=>{const s=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||"light",autoContrast:i});return{root:{"--alert-radius":t===void 0?void 0:Vt(t),"--alert-bg":n||r?s.background:void 0,"--alert-color":s.color,"--alert-bd":n||r?s.border:void 0}}},Ya=ve((e,t)=>{const n=se("Alert",V5,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,radius:p,color:m,title:g,children:y,id:b,icon:S,withCloseButton:j,onClose:C,closeButtonLabel:T,variant:D,autoContrast:E,...R}=n,A=Ie({name:"Alert",classes:$2,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:F5}),k=yr(b),M=g&&`${k}-title`||void 0,I=`${k}-body`;return o.jsx(ce,{id:k,...A("root",{variant:D}),variant:D,ref:t,...R,role:"alert","aria-describedby":I,"aria-labelledby":M,children:o.jsxs("div",{...A("wrapper"),children:[S&&o.jsx("div",{...A("icon"),children:S}),o.jsxs("div",{...A("body"),children:[g&&o.jsx("div",{...A("title"),"data-with-close-button":j||void 0,children:o.jsx("span",{id:M,...A("label"),children:g})}),y&&o.jsx("div",{id:I,...A("message"),"data-variant":D,children:y})]}),j&&o.jsx(Qo,{...A("closeButton"),onClick:C,variant:"transparent",size:16,iconSize:16,"aria-label":T,unstyled:u})]})})});Ya.classes=$2;Ya.displayName="@mantine/core/Alert";var U2={root:"m_b6d8b162"};function H5(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const q5={inherit:!1},G5=(e,{variant:t,lineClamp:n,gradient:r,size:i,color:s})=>({root:{"--text-fz":On(i),"--text-lh":hR(i),"--text-gradient":t==="gradient"?vy(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":s?Ht(s,e):void 0}}),Ae=lr((e,t)=>{const n=se("Text",q5,e),{lineClamp:r,truncate:i,inline:s,inherit:c,gradient:u,span:f,__staticSelector:p,vars:m,className:g,style:y,classNames:b,styles:S,unstyled:j,variant:C,mod:T,size:D,...E}=n,R=Ie({name:["Text",p],props:n,classes:U2,className:g,style:y,classNames:b,styles:S,unstyled:j,vars:m,varsResolver:G5});return o.jsx(ce,{...R("root",{focusable:!0}),ref:t,component:f?"span":"p",variant:C,mod:[{"data-truncate":H5(i),"data-line-clamp":typeof r=="number","data-inline":s,"data-inherit":c},T],size:D,...E})});Ae.classes=U2;Ae.displayName="@mantine/core/Text";var B2={root:"m_849cf0da"};const Q5={underline:"hover"},Nt=lr((e,t)=>{const{underline:n,className:r,unstyled:i,mod:s,...c}=se("Anchor",Q5,e);return o.jsx(Ae,{component:"a",ref:t,className:Ut({[B2.root]:!i},r),...c,mod:[{underline:n},s],__staticSelector:"Anchor",unstyled:i})});Nt.classes=B2;Nt.displayName="@mantine/core/Anchor";const[W5,Tc]=vr("AppShell was not found in tree");var Wo={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const Y5={},Vx=ve((e,t)=>{const n=se("AppShellAside",Y5,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,withBorder:p,zIndex:m,mod:g,...y}=n,b=Tc();return b.disabled?null:o.jsx(ce,{component:"aside",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("aside",{className:i,classNames:r,styles:c,style:s}),...y,__vars:{"--app-shell-aside-z-index":`calc(${m??b.zIndex} + 1)`}})});Vx.classes=Wo;Vx.displayName="@mantine/core/AppShellAside";const K5={},Fx=ve((e,t)=>{var S;const n=se("AppShellFooter",K5,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,withBorder:p,zIndex:m,mod:g,...y}=n,b=Tc();return b.disabled?null:o.jsx(ce,{component:"footer",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("footer",{className:Ut({[lc.classNames.zeroRight]:b.offsetScrollbars},i),classNames:r,styles:c,style:s}),...y,__vars:{"--app-shell-footer-z-index":(S=m??b.zIndex)==null?void 0:S.toString()}})});Fx.classes=Wo;Fx.displayName="@mantine/core/AppShellFooter";const X5={},Hx=ve((e,t)=>{var S;const n=se("AppShellHeader",X5,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,withBorder:p,zIndex:m,mod:g,...y}=n,b=Tc();return b.disabled?null:o.jsx(ce,{component:"header",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("header",{className:Ut({[lc.classNames.zeroRight]:b.offsetScrollbars},i),classNames:r,styles:c,style:s}),...y,__vars:{"--app-shell-header-z-index":(S=m??b.zIndex)==null?void 0:S.toString()}})});Hx.classes=Wo;Hx.displayName="@mantine/core/AppShellHeader";const Z5={},qx=ve((e,t)=>{const n=se("AppShellMain",Z5,e),{classNames:r,className:i,style:s,styles:c,vars:u,...f}=n,p=Tc();return o.jsx(ce,{component:"main",ref:t,...p.getStyles("main",{className:i,style:s,classNames:r,styles:c}),...f})});qx.classes=Wo;qx.displayName="@mantine/core/AppShellMain";function md(e){return typeof e=="object"?e.base:e}function gd(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 vd(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function J5({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:i}){var f,p,m;const s=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"),gd(s)){const g=le(md(s));e["--app-shell-aside-width"]=g,e["--app-shell-aside-offset"]=g}if(vd(s)&&(typeof s.base<"u"&&(e["--app-shell-aside-width"]=le(s.base),e["--app-shell-aside-offset"]=le(s.base)),sn(s).forEach(g=>{g!=="base"&&(t[g]=t[g]||{},t[g]["--app-shell-aside-width"]=le(s[g]),t[g]["--app-shell-aside-offset"]=le(s[g]))})),(p=r==null?void 0:r.collapsed)!=null&&p.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=dx(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 e7({baseStyles:e,minMediaStyles:t,footer:n}){const r=n==null?void 0:n.height,i="translateY(var(--app-shell-footer-height))",s=(n==null?void 0:n.offset)??!0;if(gd(r)){const c=le(md(r));e["--app-shell-footer-height"]=c,s&&(e["--app-shell-footer-offset"]=c)}vd(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=le(r.base),s&&(e["--app-shell-footer-offset"]=le(r.base))),sn(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-footer-height"]=le(r[c]),s&&(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 t7({baseStyles:e,minMediaStyles:t,header:n}){const r=n==null?void 0:n.height,i="translateY(calc(var(--app-shell-header-height) * -1))",s=(n==null?void 0:n.offset)??!0;if(gd(r)){const c=le(md(r));e["--app-shell-header-height"]=c,s&&(e["--app-shell-header-offset"]=c)}vd(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=le(r.base),s&&(e["--app-shell-header-offset"]=le(r.base))),sn(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-header-height"]=le(r[c]),s&&(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 n7({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:i}){var f,p,m;const s=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"),gd(s)){const g=le(md(s));e["--app-shell-navbar-width"]=g,e["--app-shell-navbar-offset"]=g}if(vd(s)&&(typeof s.base<"u"&&(e["--app-shell-navbar-width"]=le(s.base),e["--app-shell-navbar-offset"]=le(s.base)),sn(s).forEach(g=>{g!=="base"&&(t[g]=t[g]||{},t[g]["--app-shell-navbar-width"]=le(s[g]),t[g]["--app-shell-navbar-offset"]=le(s[g]))})),(p=r==null?void 0:r.collapsed)!=null&&p.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=dx(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 zv(e){return Number(e)===0?"0px":Nn(e)}function r7({padding:e,baseStyles:t,minMediaStyles:n}){gd(e)&&(t["--app-shell-padding"]=zv(md(e))),vd(e)&&(e.base&&(t["--app-shell-padding"]=zv(e.base)),sn(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=zv(e[r]))}))}function i7({navbar:e,header:t,footer:n,aside:r,padding:i,theme:s}){const c={},u={},f={};n7({baseStyles:f,minMediaStyles:c,maxMediaStyles:u,navbar:e,theme:s}),J5({baseStyles:f,minMediaStyles:c,maxMediaStyles:u,aside:r,theme:s}),t7({baseStyles:f,minMediaStyles:c,header:t}),e7({baseStyles:f,minMediaStyles:c,footer:n}),r7({baseStyles:f,minMediaStyles:c,padding:i});const p=Xu(sn(c),s.breakpoints).map(y=>({query:`(min-width: ${Ch(y.px)})`,styles:c[y.value]})),m=Xu(sn(u),s.breakpoints).map(y=>({query:`(max-width: ${Ch(y.px)})`,styles:u[y.value]})),g=[...p,...m];return{baseStyles:f,media:g}}function a7({navbar:e,header:t,aside:n,footer:r,padding:i}){const s=Sn(),c=qa(),{media:u,baseStyles:f}=i7({navbar:e,header:t,footer:r,aside:n,padding:i,theme:s});return o.jsx(Xs,{media:u,styles:f,selector:c.cssVariablesSelector})}const o7={},Gx=ve((e,t)=>{const n=se("AppShellNavbar",o7,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,withBorder:p,zIndex:m,mod:g,...y}=n,b=Tc();return b.disabled?null:o.jsx(ce,{component:"nav",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("navbar",{className:i,classNames:r,styles:c,style:s}),...y,__vars:{"--app-shell-navbar-z-index":`calc(${m??b.zIndex} + 1)`}})});Gx.classes=Wo;Gx.displayName="@mantine/core/AppShellNavbar";const s7={},Qx=lr((e,t)=>{const n=se("AppShellSection",s7,e),{classNames:r,className:i,style:s,styles:c,vars:u,grow:f,mod:p,...m}=n,g=Tc();return o.jsx(ce,{ref:t,mod:[{grow:f},p],...g.getStyles("section",{className:i,style:s,classNames:r,styles:c}),...m})});Qx.classes=Wo;Qx.displayName="@mantine/core/AppShellSection";function l7({transitionDuration:e,disabled:t}){const[n,r]=v.useState(!0),i=v.useRef(-1),s=v.useRef(-1);return bR("resize",()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),200)}),Sc(()=>{r(!0),clearTimeout(s.current),s.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),e||0)},[t,e]),n}const c7={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Wr("app")},u7=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),Ar=ve((e,t)=>{const n=se("AppShell",c7,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,navbar:p,withBorder:m,padding:g,transitionDuration:y,transitionTimingFunction:b,header:S,zIndex:j,layout:C,disabled:T,aside:D,footer:E,offsetScrollbars:R=C!=="alt",mod:A,...k}=n,M=Ie({name:"AppShell",classes:Wo,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:u7}),I=l7({disabled:T,transitionDuration:y});return o.jsxs(W5,{value:{getStyles:M,withBorder:m,zIndex:j,disabled:T,offsetScrollbars:R},children:[o.jsx(a7,{navbar:p,header:S,aside:D,footer:E,padding:g}),o.jsx(ce,{ref:t,...M("root"),mod:[{resizing:I,layout:C,disabled:T},A],...k})]})});Ar.classes=Wo;Ar.displayName="@mantine/core/AppShell";Ar.Navbar=Gx;Ar.Header=Hx;Ar.Main=qx;Ar.Aside=Vx;Ar.Footer=Fx;Ar.Section=Qx;function V2(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=>V2(t))}:e}function F2(e){return e?e.map(t=>V2(t)):[]}function H2(e){return e.reduce((t,n)=>"group"in n?{...t,...H2(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 d7={error:null},f7=(e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":rt(t,"combobox-chevron-size"),"--combobox-chevron-color":n?Ht(n,e):void 0}}),bp=ve((e,t)=>{const n=se("ComboboxChevron",d7,e),{size:r,error:i,style:s,className:c,classNames:u,styles:f,unstyled:p,vars:m,mod:g,...y}=n,b=Ie({name:"ComboboxChevron",classes:kr,props:n,style:s,className:c,classNames:u,styles:f,unstyled:p,vars:m,varsResolver:f7,rootSelector:"chevron"});return o.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:o.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"})})});bp.classes=kr;bp.displayName="@mantine/core/ComboboxChevron";const[h7,bi]=vr("Combobox component was not found in tree"),q2=v.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...i},s)=>o.jsx(mn.ClearButton,{ref:s,tabIndex:-1,"aria-hidden":!0,...i,onMouseDown:c=>{c.preventDefault(),t==null||t(c)},onClick:c=>{r(),n==null||n(c)}}));q2.displayName="@mantine/core/ComboboxClearButton";const p7={},Wx=ve((e,t)=>{const{classNames:n,styles:r,className:i,style:s,hidden:c,...u}=se("ComboboxDropdown",p7,e),f=bi();return o.jsx(zi.Dropdown,{...u,ref:t,role:"presentation","data-hidden":c||void 0,...f.getStyles("dropdown",{className:i,style:s,classNames:n,styles:r})})});Wx.classes=kr;Wx.displayName="@mantine/core/ComboboxDropdown";const m7={refProp:"ref"},G2=ve((e,t)=>{const{children:n,refProp:r}=se("ComboboxDropdownTarget",m7,e);if(bi(),!Fa(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 o.jsx(zi.Target,{ref:t,refProp:r,children:n})});G2.displayName="@mantine/core/ComboboxDropdownTarget";const g7={},Yx=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,...u}=se("ComboboxEmpty",g7,e),f=bi();return o.jsx(ce,{ref:t,...f.getStyles("empty",{className:r,classNames:n,styles:s,style:i}),...u})});Yx.classes=kr;Yx.displayName="@mantine/core/ComboboxEmpty";function Kx({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:i,autoComplete:s}){const c=bi(),[u,f]=v.useState(null),p=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:s,"data-expanded":c.store.dropdownOpened||void 0,"data-mantine-stop-propagation":c.store.dropdownOpened||void 0}:{},onKeyDown:p}}const v7={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},Q2=ve((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:i,withAriaAttributes:s,withExpandedAttribute:c,targetType:u,autoComplete:f,...p}=se("ComboboxEventsTarget",v7,e);if(!Fa(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=Kx({targetType:u,withAriaAttributes:s,withKeyboardNavigation:i,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f});return v.cloneElement(n,{...g,...p,[r]:$n(t,m.store.targetRef,sp(n))})});Q2.displayName="@mantine/core/ComboboxEventsTarget";const y7={},Xx=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,...u}=se("ComboboxFooter",y7,e),f=bi();return o.jsx(ce,{ref:t,...f.getStyles("footer",{className:r,classNames:n,style:i,styles:s}),...u,onMouseDown:p=>{p.preventDefault()}})});Xx.classes=kr;Xx.displayName="@mantine/core/ComboboxFooter";const x7={},Zx=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,children:u,label:f,...p}=se("ComboboxGroup",x7,e),m=bi();return o.jsxs(ce,{ref:t,...m.getStyles("group",{className:r,classNames:n,style:i,styles:s}),...p,children:[f&&o.jsx("div",{...m.getStyles("groupLabel",{classNames:n,styles:s}),children:f}),u]})});Zx.classes=kr;Zx.displayName="@mantine/core/ComboboxGroup";const b7={},Jx=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,...u}=se("ComboboxHeader",b7,e),f=bi();return o.jsx(ce,{ref:t,...f.getStyles("header",{className:r,classNames:n,style:i,styles:s}),...u,onMouseDown:p=>{p.preventDefault()}})});Jx.classes=kr;Jx.displayName="@mantine/core/ComboboxHeader";function W2({value:e,valuesDivider:t=",",...n}){return o.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}W2.displayName="@mantine/core/ComboboxHiddenInput";const S7={},e0=ve((e,t)=>{const n=se("ComboboxOption",S7,e),{classNames:r,className:i,style:s,styles:c,vars:u,onClick:f,id:p,active:m,onMouseDown:g,onMouseOver:y,disabled:b,selected:S,mod:j,...C}=n,T=bi(),D=v.useId(),E=p||D;return o.jsx(ce,{...T.getStyles("option",{className:i,classNames:r,styles:c,style:s}),...C,ref:t,id:E,mod:["combobox-option",{"combobox-active":m,"combobox-disabled":b,"combobox-selected":S},j],role:"option",onClick:R=>{var A;b?R.preventDefault():((A=T.onOptionSubmit)==null||A.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)}})});e0.classes=kr;e0.displayName="@mantine/core/ComboboxOption";const w7={},t0=ve((e,t)=>{const n=se("ComboboxOptions",w7,e),{classNames:r,className:i,style:s,styles:c,id:u,onMouseDown:f,labelledBy:p,...m}=n,g=bi(),y=yr(u);return v.useEffect(()=>{g.store.setListId(y)},[y]),o.jsx(ce,{ref:t,...g.getStyles("options",{className:i,style:s,classNames:r,styles:c}),...m,id:y,role:"listbox","aria-labelledby":p,onMouseDown:b=>{b.preventDefault(),f==null||f(b)}})});t0.classes=kr;t0.displayName="@mantine/core/ComboboxOptions";const j7={withAriaAttributes:!0,withKeyboardNavigation:!0},n0=ve((e,t)=>{const n=se("ComboboxSearch",j7,e),{classNames:r,styles:i,unstyled:s,vars:c,withAriaAttributes:u,onKeyDown:f,withKeyboardNavigation:p,size:m,...g}=n,y=bi(),b=y.getStyles("search"),S=Kx({targetType:"input",withAriaAttributes:u,withKeyboardNavigation:p,withExpandedAttribute:!1,onKeyDown:f,autoComplete:"off"});return o.jsx(mn,{ref:$n(t,y.store.searchRef),classNames:[{input:b.className},r],styles:[{input:b.style},i],size:m||y.size,...S,...g,__staticSelector:"Combobox"})});n0.classes=kr;n0.displayName="@mantine/core/ComboboxSearch";const C7={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},Y2=ve((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:i,withAriaAttributes:s,withExpandedAttribute:c,targetType:u,autoComplete:f,...p}=se("ComboboxTarget",C7,e);if(!Fa(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=Kx({targetType:u,withAriaAttributes:s,withKeyboardNavigation:i,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f}),y=v.cloneElement(n,{...g,...p});return o.jsx(zi.Target,{ref:$n(t,m.store.targetRef),children:y})});Y2.displayName="@mantine/core/ComboboxTarget";function E7(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 T7(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 R7(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function yd({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:i,loop:s=!0,scrollBehavior:c="instant"}={}){const[u,f]=Yn({value:t,defaultValue:e,finalValue:!1,onChange:n}),p=v.useRef(null),m=v.useRef(-1),g=v.useRef(null),y=v.useRef(null),b=v.useRef(-1),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]),D=v.useCallback((P="unknown")=>{u?T(P):C(P)},[T,C,u]),E=v.useCallback(()=>{const P=document.querySelector(`#${p.current} [data-combobox-selected]`);P==null||P.removeAttribute("data-combobox-selected"),P==null||P.removeAttribute("aria-selected")},[]),R=v.useCallback(P=>{const L=document.getElementById(p.current),z=L==null?void 0:L.querySelectorAll("[data-combobox-option]");if(!z)return null;const H=P>=z.length?0:P<0?z.length-1:P;return m.current=H,z!=null&&z[H]&&!z[H].hasAttribute("data-combobox-disabled")?(E(),z[H].setAttribute("data-combobox-selected","true"),z[H].setAttribute("aria-selected","true"),z[H].scrollIntoView({block:"nearest",behavior:c}),z[H].id):null},[c,E]),A=v.useCallback(()=>{const P=document.querySelector(`#${p.current} [data-combobox-active]`);if(P){const L=document.querySelectorAll(`#${p.current} [data-combobox-option]`),z=Array.from(L).findIndex(H=>H===P);return R(z)}return R(0)},[R]),k=v.useCallback(()=>R(T7(m.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),s)),[R,s]),M=v.useCallback(()=>R(E7(m.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),s)),[R,s]),I=v.useCallback(()=>R(R7(document.querySelectorAll(`#${p.current} [data-combobox-option]`))),[R]),$=v.useCallback((P="selected",L)=>{j.current=window.setTimeout(()=>{var O;const z=document.querySelectorAll(`#${p.current} [data-combobox-option]`),H=Array.from(z).findIndex(U=>U.hasAttribute(`data-combobox-${P}`));m.current=H,L!=null&&L.scrollIntoView&&((O=z[H])==null||O.scrollIntoView({block:"nearest",behavior:c}))},0)},[]),V=v.useCallback(()=>{m.current=-1,E()},[E]),Y=v.useCallback(()=>{const P=document.querySelectorAll(`#${p.current} [data-combobox-option]`),L=P==null?void 0:P[m.current];L==null||L.click()},[]),Q=v.useCallback(P=>{p.current=P},[]),J=v.useCallback(()=>{b.current=window.setTimeout(()=>g.current.focus(),0)},[]),G=v.useCallback(()=>{S.current=window.setTimeout(()=>y.current.focus(),0)},[]),K=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:D,selectedOptionIndex:m.current,getSelectedOptionIndex:K,selectOption:R,selectFirstOption:I,selectActiveOption:A,selectNextOption:k,selectPreviousOption:M,resetSelectedOption:V,updateSelectedOptionIndex:$,listId:p.current,setListId:Q,clickSelectedOption:Y,searchRef:g,focusSearchInput:J,targetRef:y,focusTarget:G}}const D7={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},A7=(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",D7,e),{classNames:n,styles:r,unstyled:i,children:s,store:c,vars:u,onOptionSubmit:f,onClose:p,size:m,dropdownPadding:g,resetSelectionOnOptionHover:y,__staticSelector:b,readOnly:S,...j}=t,C=yd(),T=c||C,D=Ie({name:b||"Combobox",classes:kr,props:t,classNames:n,styles:r,unstyled:i,vars:u,varsResolver:A7}),E=()=>{p==null||p(),T.closeDropdown()};return o.jsx(h7,{value:{getStyles:D,store:T,onOptionSubmit:f,size:m,resetSelectionOnOptionHover:y,readOnly:S},children:o.jsx(zi,{opened:T.dropdownOpened,...j,onChange:R=>!R&&E(),withRoles:!1,unstyled:i,children:s})})}const _7=e=>e;ct.extend=_7;ct.classes=kr;ct.displayName="@mantine/core/Combobox";ct.Target=Y2;ct.Dropdown=Wx;ct.Options=t0;ct.Option=e0;ct.Search=n0;ct.Empty=Yx;ct.Chevron=bp;ct.Footer=Xx;ct.Header=Jx;ct.EventsTarget=Q2;ct.DropdownTarget=G2;ct.Group=Zx;ct.ClearButton=q2;ct.HiddenInput=W2;var K2={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const X2=K2,Sp=v.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:i,unstyled:s,children:c,label:u,description:f,id:p,disabled:m,error:g,size:y,labelPosition:b="left",bodyElement:S="div",labelElement:j="label",variant:C,style:T,vars:D,mod:E,...R},A)=>{const k=Ie({name:e,props:t,className:n,style:T,classes:K2,classNames:r,styles:i,unstyled:s});return o.jsx(ce,{...k("root"),ref:A,__vars:{"--label-fz":On(y),"--label-lh":rt(y,"label-lh")},mod:[{"label-position":b},E],variant:C,size:y,...R,children:o.jsxs(ce,{component:S,htmlFor:S==="label"?p:void 0,...k("body"),children:[c,o.jsxs("div",{...k("labelWrapper"),"data-disabled":m||void 0,children:[u&&o.jsx(ce,{component:j,htmlFor:j==="label"?p:void 0,...k("label"),"data-disabled":m||void 0,children:u}),f&&o.jsx(mn.Description,{size:y,__inheritStyles:!1,...k("description"),children:f}),g&&typeof g!="boolean"&&o.jsx(mn.Error,{size:y,__inheritStyles:!1,...k("error"),children:g})]})]})})});Sp.displayName="@mantine/core/InlineInput";const Z2=v.createContext(null),k7=Z2.Provider,J2=()=>v.useContext(Z2),[P7,N7]=Ha();var eD={card:"m_26775b0a"};const O7={withBorder:!0},M7=(e,{radius:t})=>({card:{"--card-radius":Vt(t)}}),r0=ve((e,t)=>{const n=se("CheckboxCard",O7,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,checked:p,mod:m,withBorder:g,value:y,onClick:b,defaultChecked:S,onChange:j,...C}=n,T=Ie({name:"CheckboxCard",classes:eD,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:M7,rootSelector:"card"}),D=J2(),E=typeof p=="boolean"?p:D?D.value.includes(y||""):void 0,[R,A]=Yn({value:E,defaultValue:S,finalValue:!1,onChange:j});return o.jsx(P7,{value:{checked:R},children:o.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),D==null||D.onChange(y||""),A(!R)}})})});r0.displayName="@mantine/core/CheckboxCard";r0.classes=eD;function i0({children:e,role:t}){const n=Ec();return n?o.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):o.jsx(o.Fragment,{children:e})}const I7={},a0=ve((e,t)=>{const{value:n,defaultValue:r,onChange:i,size:s,wrapperProps:c,children:u,readOnly:f,...p}=se("CheckboxGroup",I7,e),[m,g]=Yn({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 o.jsx(k7,{value:{value:m,onChange:y,size:s},children:o.jsx(mn.Wrapper,{size:s,ref:t,...c,...p,labelElement:"div",__staticSelector:"CheckboxGroup",children:o.jsx(i0,{role:"group",children:u})})})});a0.classes=mn.Wrapper.classes;a0.displayName="@mantine/core/CheckboxGroup";function wp({size:e,style:t,...n}){const r=e!==void 0?{width:le(e),height:le(e),...t}:t;return o.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n,children:o.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 tD({indeterminate:e,...t}){return e?o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t,children:o.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):o.jsx(wp,{...t})}var nD={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const L7={icon:tD},z7=(e,{radius:t,color:n,size:r,iconColor:i,variant:s,autoContrast:c})=>{const u=hi({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:Vt(t),"--checkbox-color":s==="outline"?f:Ht(n,e),"--checkbox-icon-color":i?Ht(i,e):Ks(c,e)?Ga({color:n,theme:e,autoContrast:c}):void 0}}},o0=ve((e,t)=>{const n=se("CheckboxIndicator",L7,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,icon:p,indeterminate:m,radius:g,color:y,iconColor:b,autoContrast:S,checked:j,mod:C,variant:T,disabled:D,...E}=n,R=p,A=Ie({name:"CheckboxIndicator",classes:nD,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:z7,rootSelector:"indicator"}),k=N7(),M=typeof j=="boolean"||typeof m=="boolean"?j||m:(k==null?void 0:k.checked)||!1;return o.jsx(ce,{ref:t,...A("indicator",{variant:T}),variant:T,mod:[{checked:M,disabled:D},C],...E,children:o.jsx(R,{indeterminate:m,...A("icon")})})});o0.displayName="@mantine/core/CheckboxIndicator";o0.classes=nD;var rD={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const $7={labelPosition:"right",icon:tD},U7=(e,{radius:t,color:n,size:r,iconColor:i,variant:s,autoContrast:c})=>{const u=hi({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:Vt(t),"--checkbox-color":s==="outline"?f:Ht(n,e),"--checkbox-icon-color":i?Ht(i,e):Ks(c,e)?Ga({color:n,theme:e,autoContrast:c}):void 0}}},zn=ve((e,t)=>{const n=se("Checkbox",$7,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,color:p,label:m,id:g,size:y,radius:b,wrapperProps:S,checked:j,labelPosition:C,description:T,error:D,disabled:E,variant:R,indeterminate:A,icon:k,rootRef:M,iconColor:I,onChange:$,autoContrast:V,mod:Y,...Q}=n,J=J2(),G=y||(J==null?void 0:J.size),K=k,P=Ie({name:"Checkbox",props:n,classes:rD,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:U7}),{styleProps:L,rest:z}=Qa(Q),H=yr(g),O=J?{checked:J.value.includes(z.value),onChange:ee=>{J.onChange(ee),$==null||$(ee)}}:{},U=v.useRef(null),X=t||U;return v.useEffect(()=>{X&&"current"in X&&X.current&&(X.current.indeterminate=A||!1)},[A,X]),o.jsx(Sp,{...P("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:H,size:G,labelPosition:C,label:m,description:T,error:D,disabled:E,classNames:r,styles:c,unstyled:u,"data-checked":O.checked||j||void 0,variant:R,ref:M,mod:Y,...L,...S,children:o.jsxs(ce,{...P("inner"),mod:{"data-label-position":C},children:[o.jsx(ce,{component:"input",id:H,ref:X,checked:j,disabled:E,mod:{error:!!D,indeterminate:A},...P("input",{focusable:!0,variant:R}),onChange:$,...z,...O,type:"checkbox"}),o.jsx(K,{indeterminate:A,...P("icon")})]})})});zn.classes={...rD,...X2};zn.displayName="@mantine/core/Checkbox";zn.Group=a0;zn.Indicator=o0;zn.Card=r0;function hc(e){return"group"in e}function iD({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),i=[];for(let s=0;s<e.length;s+=1){const c=e[s];if(i.length===n)return i;hc(c)&&i.push({group:c.group,items:iD({options:c.items,search:t,limit:n-i.length})}),hc(c)||c.label.toLowerCase().includes(r)&&i.push(c)}return i}function B7(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 aD(e,t=new Set){if(Array.isArray(e))for(const n of e)if(hc(n))aD(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 V7(e,t){return Array.isArray(e)?e.includes(t):e===t}function oD({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:i,renderOption:s}){if(!hc(e)){const u=V7(n,e.value),f=t&&u&&o.jsx(wp,{className:kr.optionsDropdownCheckIcon}),p=o.jsxs(o.Fragment,{children:[r==="left"&&f,o.jsx("span",{children:e.label}),r==="right"&&f]});return o.jsx(ct.Option,{value:e.value,disabled:e.disabled,className:Ut({[kr.optionsDropdownOption]:!i}),"data-reverse":r==="right"||void 0,"data-checked":u||void 0,"aria-selected":u,active:u,children:typeof s=="function"?s({option:e,checked:u}):p})}const c=e.items.map(u=>o.jsx(oD,{data:u,value:n,unstyled:i,withCheckIcon:t,checkIconPosition:r,renderOption:s},u.value));return o.jsx(ct.Group,{label:e.group,children:c})}function F7({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:s,maxDropdownHeight:c,withScrollArea:u=!0,filterOptions:f=!0,withCheckIcon:p=!1,value:m,checkIconPosition:g,nothingFoundMessage:y,unstyled:b,labelId:S,renderOption:j,scrollAreaProps:C,"aria-label":T}){aD(e);const E=typeof i=="string"?(r||iD)({options:e,search:f?i:"",limit:s??1/0}):e,R=B7(E),A=E.map(k=>o.jsx(oD,{data:k,withCheckIcon:p,value:m,checkIconPosition:g,unstyled:b,renderOption:j},hc(k)?k.group:k.value));return o.jsx(ct.Dropdown,{hidden:t||n&&R,"data-composed":!0,children:o.jsxs(ct.Options,{labelledBy:S,"aria-label":T,children:[u?o.jsx(Yr.Autosize,{mah:c??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...C,children:A}):A,R&&y&&o.jsx(ct.Empty,{children:y})]})})}const sD=v.createContext(null),H7=sD.Provider;function q7(){return{withinGroup:!!v.useContext(sD)}}var jp={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const G7={},Q7=(e,{spacing:t})=>({group:{"--ag-spacing":Nn(t)}}),s0=ve((e,t)=>{const n=se("AvatarGroup",G7,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,spacing:p,...m}=n,g=Ie({name:"AvatarGroup",classes:jp,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:Q7,rootSelector:"group"});return o.jsx(H7,{value:!0,children:o.jsx(ce,{ref:t,...g("group"),...m})})});s0.classes=jp;s0.displayName="@mantine/core/AvatarGroup";function W7(e){return o.jsx("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.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 Y7(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 K7=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function X7(e,t=K7){const n=Y7(e),r=Math.abs(n)%t.length;return t[r]}function Z7(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 J7={},eI=(e,{size:t,radius:n,variant:r,gradient:i,color:s,autoContrast:c,name:u,allowedInitialsColors:f})=>{const p=s==="initials"&&typeof u=="string"?X7(u,f):s,m=e.variantColorResolver({color:p||"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:Vt(n),"--avatar-bg":p||r?m.background:void 0,"--avatar-color":p||r?m.color:void 0,"--avatar-bd":p||r?m.border:void 0}}},zs=lr((e,t)=>{const n=se("Avatar",J7,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,src:p,alt:m,radius:g,color:y,gradient:b,imageProps:S,children:j,autoContrast:C,mod:T,name:D,allowedInitialsColors:E,...R}=n,A=q7(),[k,M]=v.useState(!p),I=Ie({name:"Avatar",props:n,classes:jp,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:eI});return v.useEffect(()=>M(!p),[p]),o.jsx(ce,{...I("root"),mod:[{"within-group":A.withinGroup},T],ref:t,...R,children:k?o.jsx("span",{...I("placeholder"),title:m,children:j||typeof D=="string"&&Z7(D)||o.jsx(W7,{})}):o.jsx("img",{...S,...I("image"),src:p,alt:m,onError:$=>{var V;M(!0),(V=S==null?void 0:S.onError)==null||V.call(S,$)}})})});zs.classes=jp;zs.displayName="@mantine/core/Avatar";zs.Group=s0;var lD={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const tI={},nI=(e,{radius:t,color:n,gradient:r,variant:i,size:s,autoContrast:c})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:c});return{root:{"--badge-height":rt(s,"badge-height"),"--badge-padding-x":rt(s,"badge-padding-x"),"--badge-fz":rt(s,"badge-fz"),"--badge-radius":t===void 0?void 0:Vt(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"?Ht(n,e):void 0}}},Cp=lr((e,t)=>{const n=se("Badge",tI,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,radius:p,color:m,gradient:g,leftSection:y,rightSection:b,children:S,variant:j,fullWidth:C,autoContrast:T,circle:D,mod:E,...R}=n,A=Ie({name:"Badge",props:n,classes:lD,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:nI});return o.jsxs(ce,{variant:j,mod:[{block:C,circle:D,"with-right-section":!!b,"with-left-section":!!y},E],...A("root",{variant:j}),ref:t,...R,children:[y&&o.jsx("span",{...A("section"),"data-position":"left",children:y}),o.jsx("span",{...A("label"),children:S}),b&&o.jsx("span",{...A("section"),"data-position":"right",children:b})]})});Cp.classes=lD;Cp.displayName="@mantine/core/Badge";var cD={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const rI={iconSize:48},iI=(e,{color:t,iconSize:n,radius:r})=>{const i=hi({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),s=hi({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":ci(s.value,.07),"--bq-bg-dark":ci(i.value,.06),"--bq-bd":Ht(t,e),"--bq-icon-size":le(n),"--bq-radius":Vt(r)}}},l0=ve((e,t)=>{const n=se("Blockquote",rI,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,children:p,icon:m,iconSize:g,cite:y,...b}=n,S=Ie({name:"Blockquote",classes:cD,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:iI});return o.jsxs(ce,{component:"blockquote",ref:t,...S("root"),...b,children:[m&&o.jsx("span",{...S("icon"),children:m}),p,y&&o.jsx("cite",{...S("cite"),children:y})]})});l0.classes=cD;l0.displayName="@mantine/core/Blockquote";var Rc={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const AC={orientation:"horizontal"},aI=(e,{borderWidth:t})=>({group:{"--button-border-width":le(t)}}),c0=ve((e,t)=>{const n=se("ButtonGroup",AC,e),{className:r,style:i,classNames:s,styles:c,unstyled:u,orientation:f,vars:p,borderWidth:m,variant:g,mod:y,...b}=se("ButtonGroup",AC,e),S=Ie({name:"ButtonGroup",props:n,classes:Rc,className:r,style:i,classNames:s,styles:c,unstyled:u,vars:p,varsResolver:aI,rootSelector:"group"});return o.jsx(ce,{...S("group"),ref:t,variant:g,mod:[{"data-orientation":f},y],role:"group",...b})});c0.classes=Rc;c0.displayName="@mantine/core/ButtonGroup";const _C={},oI=(e,{radius:t,color:n,gradient:r,variant:i,autoContrast:s,size:c})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:s});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:Vt(t),"--section-bg":n||i?u.background:void 0,"--section-color":u.color,"--section-bd":n||i?u.border:void 0}}},u0=ve((e,t)=>{const n=se("ButtonGroupSection",_C,e),{className:r,style:i,classNames:s,styles:c,unstyled:u,vars:f,variant:p,gradient:m,radius:g,autoContrast:y,...b}=se("ButtonGroupSection",_C,e),S=Ie({name:"ButtonGroupSection",props:n,classes:Rc,className:r,style:i,classNames:s,styles:c,unstyled:u,vars:f,varsResolver:oI,rootSelector:"groupSection"});return o.jsx(ce,{...S("groupSection"),ref:t,variant:p,...b})});u0.classes=Rc;u0.displayName="@mantine/core/ButtonGroupSection";const sI={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${le(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},lI={},cI=(e,{radius:t,color:n,gradient:r,variant:i,size:s,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(s,"button-height"),"--button-padding-x":rt(s,"button-padding-x"),"--button-fz":s!=null&&s.includes("compact")?On(s.replace("compact-","")):On(s),"--button-radius":t===void 0?void 0:Vt(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}}},Ne=lr((e,t)=>{const n=se("Button",lI,e),{style:r,vars:i,className:s,color:c,disabled:u,children:f,leftSection:p,rightSection:m,fullWidth:g,variant:y,radius:b,loading:S,loaderProps:j,gradient:C,classNames:T,styles:D,unstyled:E,"data-disabled":R,autoContrast:A,mod:k,...M}=n,I=Ie({name:"Button",props:n,classes:Rc,className:s,style:r,classNames:T,styles:D,unstyled:E,vars:i,varsResolver:cI}),$=!!p,V=!!m;return o.jsxs(tr,{ref:t,...I("root",{active:!u&&!S&&!R}),unstyled:E,variant:y,disabled:u||S,mod:[{disabled:u||R,loading:S,block:g,"with-left-section":$,"with-right-section":V},k],...M,children:[o.jsx(da,{mounted:!!S,transition:sI,duration:150,children:Y=>o.jsx(ce,{component:"span",...I("loader",{style:Y}),"aria-hidden":!0,children:o.jsx(_r,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...j})})}),o.jsxs("span",{...I("inner"),children:[p&&o.jsx(ce,{component:"span",...I("section"),mod:{position:"left"},children:p}),o.jsx(ce,{component:"span",mod:{loading:S},...I("label"),children:f}),m&&o.jsx(ce,{component:"span",...I("section"),mod:{position:"right"},children:m})]})]})});Ne.classes=Rc;Ne.displayName="@mantine/core/Button";Ne.Group=c0;Ne.GroupSection=u0;var uD={root:"m_4451eb3a"};const uI={},er=lr((e,t)=>{const n=se("Center",uI,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,inline:p,mod:m,...g}=n,y=Ie({name:"Center",props:n,classes:uD,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f});return o.jsx(ce,{ref:t,mod:[{inline:p},m],...y("root"),...g})});er.classes=uD;er.displayName="@mantine/core/Center";const[dI,fI]=Ha(),hI={};function dD(e){const{value:t,defaultValue:n,onChange:r,multiple:i,children:s}=se("ChipGroup",hI,e),[c,u]=Yn({value:t,defaultValue:n,finalValue:i?[]:null,onChange:r}),f=m=>Array.isArray(c)?c.includes(m):m===c,p=m=>{const g=m.currentTarget.value;Array.isArray(c)?u(c.includes(g)?c.filter(y=>y!==g):[...c,g]):u(g)};return o.jsx(dI,{value:{isChipSelected:f,onChange:p,multiple:i},children:s})}dD.displayName="@mantine/core/ChipGroup";var fD={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 pI={type:"checkbox"},mI=(e,{size:t,radius:n,variant:r,color:i,autoContrast:s})=>{const c=e.variantColorResolver({color:i||e.primaryColor,theme:e,variant:r||"filled",autoContrast:s});return{root:{"--chip-fz":On(t),"--chip-size":rt(t,"chip-size"),"--chip-radius":n===void 0?void 0:Vt(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")}}},td=ve((e,t)=>{const n=se("Chip",pI,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,id:p,checked:m,defaultChecked:g,onChange:y,value:b,wrapperProps:S,type:j,disabled:C,children:T,size:D,variant:E,icon:R,rootRef:A,autoContrast:k,mod:M,...I}=n,$=Ie({name:"Chip",classes:fD,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:mI}),V=fI(),Y=yr(p),{styleProps:Q,rest:J}=Qa(I),[G,K]=Yn({value:m,defaultValue:g,finalValue:!1,onChange:y}),P=V?{checked:V.isChipSelected(b),onChange:z=>{V.onChange(z),y==null||y(z.currentTarget.checked)},type:V.multiple?"checkbox":"radio"}:{},L=P.checked||G;return o.jsxs(ce,{size:D,variant:E,ref:A,mod:M,...$("root"),...Q,...S,children:[o.jsx("input",{type:j,...$("input"),checked:L,onChange:z=>K(z.currentTarget.checked),id:Y,disabled:C,ref:t,value:b,...P,...J}),o.jsxs("label",{htmlFor:Y,"data-checked":L||void 0,"data-disabled":C||void 0,...$("label",{variant:E||"filled"}),children:[L&&o.jsx("span",{...$("iconWrapper"),children:R||o.jsx(wp,{...$("checkIcon")})}),o.jsx("span",{children:T})]})]})});td.classes=fD;td.displayName="@mantine/core/Chip";td.Group=dD;var hD={root:"m_b183c0a2"};const gI={},vI=(e,{color:t})=>({root:{"--code-bg":t?Ht(t,e):void 0}}),d0=ve((e,t)=>{const n=se("Code",gI,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,color:p,block:m,variant:g,mod:y,...b}=n,S=Ie({name:"Code",props:n,classes:hD,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:vI});return o.jsx(ce,{component:m?"pre":"code",variant:g,ref:t,mod:[{block:m},y],...S("root"),...b,dir:"ltr"})});d0.classes=hD;d0.displayName="@mantine/core/Code";var pD={root:"m_7485cace"};const yI={},xI=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:rt(t,"container-size")}}),f0=ve((e,t)=>{const n=se("Container",yI,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,fluid:p,mod:m,...g}=n,y=Ie({name:"Container",classes:pD,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:xI});return o.jsx(ce,{ref:t,mod:[{fluid:p},m],...y("root"),...g})});f0.classes=pD;f0.displayName="@mantine/core/Container";const bI={timeout:1e3};function mD(e){const{children:t,timeout:n,value:r,...i}=se("CopyButton",bI,e),s=pR({timeout:n}),c=()=>s.copy(r);return o.jsx(o.Fragment,{children:t({copy:c,copied:s.copied,...i})})}mD.displayName="@mantine/core/CopyButton";var gD={root:"m_3eebeb36",label:"m_9e365f20"};const SI={orientation:"horizontal"},wI=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?Ht(t,e):void 0,"--divider-border-style":n,"--divider-size":rt(r,"divider-size")}}),Cn=ve((e,t)=>{const n=se("Divider",SI,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,color:p,orientation:m,label:g,labelPosition:y,mod:b,...S}=n,j=Ie({name:"Divider",classes:gD,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:wI});return o.jsx(ce,{ref:t,mod:[{orientation:m,"with-label":!!g},b],...j("root"),...S,role:"separator",children:g&&o.jsx(ce,{component:"span",mod:{position:y},...j("label"),children:g})})});Cn.classes=gD;Cn.displayName="@mantine/core/Divider";function jI({open:e,close:t,openDelay:n,closeDelay:r}){const i=v.useRef(-1),s=v.useRef(-1),c=()=>{window.clearTimeout(i.current),window.clearTimeout(s.current)},u=()=>{c(),n===0||n===void 0?e():i.current=window.setTimeout(e,n)},f=()=>{c(),r===0||r===void 0?t():s.current=window.setTimeout(t,r)};return v.useEffect(()=>c,[]),{openDropdown:u,closeDropdown:f}}const[kC,vD]=vr("Grid component was not found in tree"),Dy=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,PC=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":Dy(e,t),NC=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},OC=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function CI({span:e,order:t,offset:n,selector:r}){var b;const i=Sn(),s=vD(),c=s.breakpoints||i.breakpoints,f=_i(e)===void 0?12:_i(e),p=qo({"--col-order":(b=_i(t))==null?void 0:b.toString(),"--col-flex-grow":NC(f,s.grow),"--col-flex-basis":Dy(f,s.columns),"--col-width":f==="content"?"auto":void 0,"--col-max-width":PC(f,s.columns,s.grow),"--col-offset":OC(_i(n),s.columns)}),m=sn(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"]=NC(e[j],s.grow),S[j]["--col-flex-basis"]=Dy(e[j],s.columns),S[j]["--col-width"]=e[j]==="content"?"auto":void 0,S[j]["--col-max-width"]=PC(e[j],s.columns,s.grow)),typeof n=="object"&&n[j]!==void 0&&(S[j]["--col-offset"]=OC(n[j],s.columns)),S},{}),y=Xu(sn(m),c).filter(S=>sn(m[S.value]).length>0).map(S=>({query:s.type==="container"?`mantine-grid (min-width: ${c[S.value]})`:`(min-width: ${c[S.value]})`,styles:m[S.value]}));return o.jsx(Xs,{styles:p,media:s.type==="container"?void 0:y,container:s.type==="container"?y:void 0,selector:r})}var h0={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const EI={span:12},p0=ve((e,t)=>{const n=se("GridCol",EI,e),{classNames:r,className:i,style:s,styles:c,vars:u,span:f,order:p,offset:m,...g}=n,y=vD(),b=fd();return o.jsxs(o.Fragment,{children:[o.jsx(CI,{selector:`.${b}`,span:f,order:p,offset:m}),o.jsx(ce,{ref:t,...y.getStyles("col",{className:Ut(i,b),style:s,classNames:r,styles:c}),...g})]})});p0.classes=h0;p0.displayName="@mantine/core/GridCol";function MC({gutter:e,selector:t,breakpoints:n,type:r}){const i=Sn(),s=n||i.breakpoints,c=qo({"--grid-gutter":Nn(_i(e))}),u=sn(s).reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--grid-gutter"]=Nn(e[g])),m),{}),p=Xu(sn(u),s).filter(m=>sn(u[m.value]).length>0).map(m=>({query:r==="container"?`mantine-grid (min-width: ${s[m.value]})`:`(min-width: ${s[m.value]})`,styles:u[m.value]}));return o.jsx(Xs,{styles:c,media:r==="container"?void 0:p,container:r==="container"?p:void 0,selector:t})}const TI={gutter:"md",grow:!1,columns:12},RI=(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",TI,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,grow:p,gutter:m,columns:g,align:y,justify:b,children:S,breakpoints:j,type:C,...T}=n,D=Ie({name:"Grid",classes:h0,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:RI}),E=fd();return C==="container"&&j?o.jsxs(kC,{value:{getStyles:D,grow:p,columns:g||12,breakpoints:j,type:C},children:[o.jsx(MC,{selector:`.${E}`,...n}),o.jsx("div",{...D("container"),children:o.jsx(ce,{ref:t,...D("root",{className:E}),...T,children:o.jsx("div",{...D("inner"),children:S})})})]}):o.jsxs(kC,{value:{getStyles:D,grow:p,columns:g||12,breakpoints:j,type:C},children:[o.jsx(MC,{selector:`.${E}`,...n}),o.jsx(ce,{ref:t,...D("root",{className:E}),...T,children:o.jsx("div",{...D("inner"),children:S})})]})});or.classes=h0;or.displayName="@mantine/core/Grid";or.Col=p0;function Nh(){return Nh=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},Nh.apply(null,arguments)}function m0(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 DI=v.useLayoutEffect,AI=function(t){var n=En.useRef(t);return DI(function(){n.current=t}),n},IC=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},_I=function(t,n){var r=En.useRef();return En.useCallback(function(i){t.current=i,r.current&&IC(r.current,null),r.current=n,n&&IC(n,i)},[n])},LC={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},kI=function(t){Object.keys(LC).forEach(function(n){t.style.setProperty(n,LC[n],"important")})},zC=kI,dr=null,$C=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function PI(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),dr||(dr=document.createElement("textarea"),dr.setAttribute("tabindex","-1"),dr.setAttribute("aria-hidden","true"),zC(dr)),dr.parentNode===null&&document.body.appendChild(dr);var i=e.paddingSize,s=e.borderSize,c=e.sizingStyle,u=c.boxSizing;Object.keys(c).forEach(function(y){var b=y;dr.style[b]=c[b]}),zC(dr),dr.value=t;var f=$C(dr,e);dr.value=t,f=$C(dr,e),dr.value="x";var p=dr.scrollHeight-i,m=p*n;u==="border-box"&&(m=m+i+s),f=Math.max(m,f);var g=p*r;return u==="border-box"&&(g=g+i+s),f=Math.min(g,f),[f,p]}var UC=function(){},NI=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},OI=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],MI=!!document.documentElement.currentStyle,II=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=NI(OI,n),i=r.boxSizing;if(i==="")return null;MI&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var s=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),c=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:s,borderSize:c}},LI=II;function g0(e,t,n){var r=AI(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 zI=function(t,n){g0(document.body,"reset",function(r){t.current.form===r.target&&n(r)})},$I=function(t){g0(window,"resize",t)},UI=function(t){g0(document.fonts,"loadingdone",t)},BI=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],VI=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,s=t.minRows,c=t.onChange,u=c===void 0?UC:c,f=t.onHeightChange,p=f===void 0?UC:f,m=m0(t,BI),g=m.value!==void 0,y=v.useRef(null),b=_I(y,n),S=v.useRef(0),j=v.useRef(),C=function(){var E=y.current,R=r&&j.current?j.current:LI(E);if(R){j.current=R;var A=PI(R,E.value||E.placeholder||"x",s,i),k=A[0],M=A[1];S.current!==k&&(S.current=k,E.style.setProperty("height",k+"px","important"),p(k,{rowHeight:M}))}},T=function(E){g||C(),u(E)};return v.useLayoutEffect(C),zI(y,function(){if(!g){var D=y.current.value;requestAnimationFrame(function(){var E=y.current;E&&D!==E.value&&C()})}}),$I(C),UI(C),v.createElement("textarea",Nh({},m,{onChange:T,ref:b}))},FI=v.forwardRef(VI);const HI={},Js=ve((e,t)=>{const{autosize:n,maxRows:r,minRows:i,__staticSelector:s,resize:c,...u}=se("Textarea",HI,e),f=n&&SR()!=="test",p=f?{maxRows:r,minRows:i}:{};return o.jsx(Pr,{component:f?FI:"textarea",ref:t,...u,__staticSelector:s||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":c},...p})});Js.classes=Pr.classes;Js.displayName="@mantine/core/Textarea";function BC(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const qI={serialize:JSON.stringify,deserialize:JSON.parse},Dc=ve((e,t)=>{const{value:n,defaultValue:r,onChange:i,formatOnBlur:s,validationError:c,serialize:u,deserialize:f,onFocus:p,onBlur:m,readOnly:g,error:y,...b}=se("JsonInput",qI,e),[S,j]=Yn({value:n,defaultValue:r,finalValue:"",onChange:i}),[C,T]=v.useState(BC(S,f)),D=R=>{p==null||p(R),T(!0)},E=R=>{typeof m=="function"&&m(R);const A=BC(R.currentTarget.value,f);s&&!g&&A&&R.currentTarget.value.trim()!==""&&j(u(f(R.currentTarget.value),null,2)),T(A)};return o.jsx(Js,{value:S,onChange:R=>j(R.currentTarget.value),onFocus:D,onBlur:E,ref:t,readOnly:g,...b,autoComplete:"off",__staticSelector:"JsonInput",error:C?y:c||!0,"data-monospace":!0})});Dc.classes=Pr.classes;Dc.displayName="@mantine/core/JsonInput";const[GI,QI]=vr("List component was not found in tree");var v0={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const WI={},y0=ve((e,t)=>{const n=se("ListItem",WI,e),{classNames:r,className:i,style:s,styles:c,vars:u,icon:f,children:p,mod:m,...g}=n,y=QI(),b=f||y.icon,S={classNames:r,styles:c};return o.jsx(ce,{...y.getStyles("item",{...S,className:i,style:s}),component:"li",mod:[{"with-icon":!!b,centered:y.center},m],ref:t,...g,children:o.jsxs("div",{...y.getStyles("itemWrapper",S),children:[b&&o.jsx("span",{...y.getStyles("itemIcon",S),children:b}),o.jsx("span",{...y.getStyles("itemLabel",S),children:p})]})})});y0.classes=v0;y0.displayName="@mantine/core/ListItem";const YI={type:"unordered"},KI=(e,{size:t,spacing:n})=>({root:{"--list-fz":On(t),"--list-lh":hR(t),"--list-spacing":Nn(n)}}),pr=ve((e,t)=>{const n=se("List",YI,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,children:p,type:m,withPadding:g,icon:y,spacing:b,center:S,listStyleType:j,mod:C,...T}=n,D=Ie({name:"List",classes:v0,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:KI});return o.jsx(GI,{value:{center:S,icon:y,getStyles:D},children:o.jsx(ce,{...D("root",{style:{listStyleType:j}}),component:m==="unordered"?"ul":"ol",mod:[{"with-padding":g},C],ref:t,...T,children:p})})});pr.classes=v0;pr.displayName="@mantine/core/List";pr.Item=y0;var yD={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const VC={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Wr("overlay")},XI=(e,{zIndex:t})=>({root:{"--lo-z-index":t==null?void 0:t.toString()}}),Ep=ve((e,t)=>{const n=se("LoadingOverlay",VC,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,transitionProps:p,loaderProps:m,overlayProps:g,visible:y,zIndex:b,...S}=n,j=Sn(),C=Ie({name:"LoadingOverlay",classes:yD,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:XI}),T={...VC.overlayProps,...g};return o.jsx(da,{transition:"fade",...p,mounted:!!y,children:D=>o.jsxs(ce,{...C("root",{style:D}),ref:t,...S,children:[o.jsx(_r,{...C("loader"),unstyled:u,...m}),o.jsx(dc,{...T,...C("overlay"),darkHidden:!0,unstyled:u,color:(g==null?void 0:g.color)||j.white}),o.jsx(dc,{...T,...C("overlay"),lightHidden:!0,unstyled:u,color:(g==null?void 0:g.color)||j.colors.dark[5]})]})})});Ep.classes=yD;Ep.displayName="@mantine/core/LoadingOverlay";const[ZI,xd]=vr("Menu component was not found in the tree");var Ac={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504"};const JI={},x0=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,...u}=se("MenuDivider",JI,e),f=xd();return o.jsx(ce,{ref:t,...f.getStyles("divider",{className:r,style:i,styles:s,classNames:n}),...u})});x0.classes=Ac;x0.displayName="@mantine/core/MenuDivider";const eL={},b0=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,onMouseEnter:u,onMouseLeave:f,onKeyDown:p,children:m,...g}=se("MenuDropdown",eL,e),y=v.useRef(null),b=xd(),S=Rr(p,T=>{var D,E;(T.key==="ArrowUp"||T.key==="ArrowDown")&&(T.preventDefault(),(E=(D=y.current)==null?void 0:D.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 o.jsxs(zi.Dropdown,{...g,onMouseEnter:j,onMouseLeave:C,role:"menu","aria-orientation":"vertical",ref:$n(t,y),...b.getStyles("dropdown",{className:r,style:i,styles:s,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:S,children:[b.withInitialFocusPlaceholder&&o.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),m]})});b0.classes=Ac;b0.displayName="@mantine/core/MenuDropdown";const tL={},S0=lr((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,color:u,closeMenuOnClick:f,leftSection:p,rightSection:m,children:g,disabled:y,"data-disabled":b,...S}=se("MenuItem",tL,e),j=xd(),C=Sn(),{dir:T}=Zs(),D=v.useRef(null),E=j.getItemIndex(D.current),R=S,A=Rr(R.onMouseLeave,()=>j.setHovered(-1)),k=Rr(R.onMouseEnter,()=>j.setHovered(j.getItemIndex(D.current))),M=Rr(R.onClick,()=>{b||(typeof f=="boolean"?f&&j.closeDropdownImmediately():j.closeOnItemClick&&j.closeDropdownImmediately())}),I=Rr(R.onFocus,()=>j.setHovered(j.getItemIndex(D.current))),$=u?C.variantColorResolver({color:u,theme:C,variant:"light"}):void 0,V=u?hi({color:u,theme:C}):null;return o.jsxs(tr,{...S,unstyled:j.unstyled,tabIndex:j.menuItemTabIndex,onFocus:I,...j.getStyles("item",{className:r,style:i,styles:s,classNames:n}),ref:$n(D,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:A,onClick:M,onKeyDown:fR({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":V!=null&&V.isThemeColor&&(V==null?void 0:V.shade)===void 0?`var(--mantine-color-${V.color}-6)`:$==null?void 0:$.color,"--menu-item-hover":$==null?void 0:$.hover},children:[p&&o.jsx("div",{...j.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"left",children:p}),g&&o.jsx("div",{...j.getStyles("itemLabel",{styles:s,classNames:n}),children:g}),m&&o.jsx("div",{...j.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"right",children:m})]})});S0.classes=Ac;S0.displayName="@mantine/core/MenuItem";const nL={},w0=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,...u}=se("MenuLabel",nL,e),f=xd();return o.jsx(ce,{ref:t,...f.getStyles("label",{className:r,style:i,styles:s,classNames:n}),...u})});w0.classes=Ac;w0.displayName="@mantine/core/MenuLabel";const rL={refProp:"ref"},xD=v.forwardRef((e,t)=>{const{children:n,refProp:r,...i}=se("MenuTarget",rL,e);if(!Fa(n))throw new Error("Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const s=xd(),c=n.props,u=Rr(c.onClick,()=>{s.trigger==="click"?s.toggleDropdown():s.trigger==="click-hover"&&(s.setOpenedViaClick(!0),s.opened||s.openDropdown())}),f=Rr(c.onMouseEnter,()=>(s.trigger==="hover"||s.trigger==="click-hover")&&s.openDropdown()),p=Rr(c.onMouseLeave,()=>{(s.trigger==="hover"||s.trigger==="click-hover"&&!s.openedViaClick)&&s.closeDropdown()});return o.jsx(zi.Target,{refProp:r,popupType:"menu",ref:t,...i,children:v.cloneElement(n,{onClick:u,onMouseEnter:f,onMouseLeave:p,"data-expanded":s.opened?!0:void 0})})});xD.displayName="@mantine/core/MenuTarget";const iL={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",iL,e),{children:n,onOpen:r,onClose:i,opened:s,defaultOpened:c,trapFocus:u,onChange:f,closeOnItemClick:p,loop:m,closeOnEscape:g,trigger:y,openDelay:b,closeDelay:S,classNames:j,styles:C,unstyled:T,variant:D,vars:E,menuItemTabIndex:R,keepMounted:A,withInitialFocusPlaceholder:k,...M}=t,I=Ie({name:"Menu",classes:Ac,props:t,classNames:j,styles:C,unstyled:T}),[$,{setHovered:V,resetHovered:Y}]=cN(),[Q,J]=Yn({value:s,defaultValue:c,finalValue:!1,onChange:f}),[G,K]=v.useState(!1),P=()=>{J(!1),K(!1),Q&&(i==null||i())},L=()=>{J(!0),!Q&&(r==null||r())},z=()=>{Q?P():L()},{openDropdown:H,closeDropdown:O}=jI({open:L,close:P,closeDelay:S,openDelay:b}),U=Se=>lN("[data-menu-item]","[data-menu-dropdown]",Se),{resolvedClassNames:X,resolvedStyles:ee}=Ys({classNames:j,styles:C,props:t});return za(()=>{Y()},[Q]),o.jsx(ZI,{value:{getStyles:I,opened:Q,toggleDropdown:z,getItemIndex:U,hovered:$,setHovered:V,openedViaClick:G,setOpenedViaClick:K,closeOnItemClick:p,closeDropdown:y==="click"?P:O,openDropdown:y==="click"?L:H,closeDropdownImmediately:P,loop:m,trigger:y,unstyled:T,menuItemTabIndex:R,withInitialFocusPlaceholder:k},children:o.jsx(zi,{...M,opened:Q,onChange:z,defaultOpened:c,trapFocus:A?!1:u,closeOnEscape:g,__staticSelector:"Menu",classNames:X,styles:ee,unstyled:T,variant:D,keepMounted:A,children:n})})}Ce.extend=e=>e;Ce.withProps=FO(Ce);Ce.classes=Ac;Ce.displayName="@mantine/core/Menu";Ce.Item=S0;Ce.Label=w0;Ce.Dropdown=b0;Ce.Target=xD;Ce.Divider=x0;const[aL,_c]=vr("Modal component was not found in tree");var Ka={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const oL={},Tp=ve((e,t)=>{const n=se("ModalBody",oL,e),{classNames:r,className:i,style:s,styles:c,vars:u,...f}=n,p=_c();return o.jsx(_2,{ref:t,...p.getStyles("body",{classNames:r,style:s,styles:c,className:i}),...f})});Tp.classes=Ka;Tp.displayName="@mantine/core/ModalBody";const sL={},Rp=ve((e,t)=>{const n=se("ModalCloseButton",sL,e),{classNames:r,className:i,style:s,styles:c,vars:u,...f}=n,p=_c();return o.jsx(k2,{ref:t,...p.getStyles("close",{classNames:r,style:s,styles:c,className:i}),...f})});Rp.classes=Ka;Rp.displayName="@mantine/core/ModalCloseButton";const lL={},Dp=ve((e,t)=>{const n=se("ModalContent",lL,e),{classNames:r,className:i,style:s,styles:c,vars:u,children:f,__hidden:p,...m}=n,g=_c(),y=g.scrollAreaComponent||b5;return o.jsx(P2,{...g.getStyles("content",{className:i,style:s,styles:c,classNames:r}),innerProps:g.getStyles("inner",{className:i,style:s,styles:c,classNames:r}),"data-full-screen":g.fullScreen||void 0,"data-modal-content":!0,"data-hidden":p||void 0,ref:t,...m,children:o.jsx(y,{style:{maxHeight:g.fullScreen?"100dvh":`calc(100dvh - (${le(g.yOffset)} * 2))`},children:f})})});Dp.classes=Ka;Dp.displayName="@mantine/core/ModalContent";const cL={},Ap=ve((e,t)=>{const n=se("ModalHeader",cL,e),{classNames:r,className:i,style:s,styles:c,vars:u,...f}=n,p=_c();return o.jsx(N2,{ref:t,...p.getStyles("header",{classNames:r,style:s,styles:c,className:i}),...f})});Ap.classes=Ka;Ap.displayName="@mantine/core/ModalHeader";const uL={},_p=ve((e,t)=>{const n=se("ModalOverlay",uL,e),{classNames:r,className:i,style:s,styles:c,vars:u,...f}=n,p=_c();return o.jsx(O2,{ref:t,...p.getStyles("overlay",{classNames:r,style:s,styles:c,className:i}),...f})});_p.classes=Ka;_p.displayName="@mantine/core/ModalOverlay";const dL={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Wr("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},fL=(e,{radius:t,size:n,yOffset:r,xOffset:i})=>({root:{"--modal-radius":t===void 0?void 0:Vt(t),"--modal-size":rt(n,"modal-size"),"--modal-y-offset":le(r),"--modal-x-offset":le(i)}}),kp=ve((e,t)=>{const n=se("ModalRoot",dL,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,yOffset:p,scrollAreaComponent:m,radius:g,fullScreen:y,centered:b,xOffset:S,__staticSelector:j,...C}=n,T=Ie({name:j,classes:Ka,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:fL});return o.jsx(aL,{value:{yOffset:p,scrollAreaComponent:m,getStyles:T,fullScreen:y},children:o.jsx(A2,{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})})});kp.classes=Ka;kp.displayName="@mantine/core/ModalRoot";const[hL,pL]=Ha();function bD({children:e}){const[t,n]=v.useState([]),[r,i]=v.useState(Wr("modal"));return o.jsx(hL,{value:{stack:t,addModal:(s,c)=>{n(u=>[...new Set([...u,s])]),i(u=>typeof c=="number"&&typeof u=="number"?Math.max(u,c):u)},removeModal:s=>n(c=>c.filter(u=>u!==s)),getZIndex:s=>`calc(${r} + ${t.indexOf(s)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}bD.displayName="@mantine/core/ModalStack";const mL={},Pp=ve((e,t)=>{const n=se("ModalTitle",mL,e),{classNames:r,className:i,style:s,styles:c,vars:u,...f}=n,p=_c();return o.jsx(M2,{ref:t,...p.getStyles("title",{classNames:r,style:s,styles:c,className:i}),...f})});Pp.classes=Ka;Pp.displayName="@mantine/core/ModalTitle";const gL={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Wr("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Un=ve((e,t)=>{const{title:n,withOverlay:r,overlayProps:i,withCloseButton:s,closeButtonProps:c,children:u,radius:f,opened:p,stackId:m,zIndex:g,...y}=se("Modal",gL,e),b=pL(),S=!!n||s,j=b&&m?{closeOnEscape:b.currentId===m,trapFocus:b.currentId===m,zIndex:b.getZIndex(m)}:{},C=r===!1?!1:m&&b?b.currentId===m:p;return v.useEffect(()=>{b&&m&&(p?b.addModal(m,g||Wr("modal")):b.removeModal(m))},[p,m,g]),o.jsxs(kp,{ref:t,radius:f,opened:p,zIndex:b&&m?b.getZIndex(m):g,...y,...j,children:[r&&o.jsx(_p,{visible:C,transitionProps:b&&m?{duration:0}:void 0,...i}),o.jsxs(Dp,{radius:f,__hidden:b&&m&&p?m!==b.currentId:!1,children:[S&&o.jsxs(Ap,{children:[n&&o.jsx(Pp,{children:n}),s&&o.jsx(Rp,{...c})]}),o.jsx(Tp,{children:u})]})]})});Un.classes=Ka;Un.displayName="@mantine/core/Modal";Un.Root=kp;Un.Overlay=_p;Un.Content=Dp;Un.Body=Tp;Un.Header=Ap;Un.Title=Pp;Un.CloseButton=Rp;Un.Stack=bD;const[vL,j0]=Ha(),[yL,xL]=Ha();var Np={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const bL={},SL=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?rt(t):rt(n,"pg-gap")}}),C0=ve((e,t)=>{const n=se("PillGroup",bL,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,size:p,disabled:m,...g}=n,y=j0(),b=(y==null?void 0:y.size)||p||void 0,S=Ie({name:"PillGroup",classes:Np,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:SL,stylesCtx:{size:b},rootSelector:"group"});return o.jsx(yL,{value:{size:b,disabled:m},children:o.jsx(ce,{ref:t,size:b,...S("group"),...g})})});C0.classes=Np;C0.displayName="@mantine/core/PillGroup";const wL={variant:"default"},jL=(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:Vt(t)}}),$s=ve((e,t)=>{const n=se("Pill",wL,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,variant:p,children:m,withRemoveButton:g,onRemove:y,removeButtonProps:b,radius:S,size:j,disabled:C,mod:T,...D}=n,E=xL(),R=j0(),A=j||(E==null?void 0:E.size)||void 0,k=(R==null?void 0:R.variant)==="filled"?"contrast":p||"default",M=Ie({name:"Pill",classes:Np,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:jL,stylesCtx:{size:A}});return o.jsxs(ce,{component:"span",ref:t,variant:k,size:A,...M("root",{variant:k}),mod:[{"with-remove":g&&!C,disabled:C||(E==null?void 0:E.disabled)},T],...D,children:[o.jsx("span",{...M("label"),children:m}),g&&o.jsx(Qo,{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:I=>{var $;I.preventDefault(),I.stopPropagation(),($=b==null?void 0:b.onMouseDown)==null||$.call(b,I)},onClick:I=>{var $;I.stopPropagation(),y==null||y(),($=b==null?void 0:b.onClick)==null||$.call(b,I)}})]})});$s.classes=Np;$s.displayName="@mantine/core/Pill";$s.Group=C0;var SD={field:"m_45c4369d"};const CL={type:"visible"},E0=ve((e,t)=>{const n=se("PillsInputField",CL,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,type:p,disabled:m,id:g,pointer:y,mod:b,...S}=n,j=j0(),C=Ec(),T=Ie({name:"PillsInputField",classes:SD,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,rootSelector:"field"}),D=m||(j==null?void 0:j.disabled);return o.jsx(ce,{component:"input",ref:$n(t,j==null?void 0:j.fieldRef),"data-type":p,disabled:D,mod:[{disabled:D,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()})});E0.classes=SD;E0.displayName="@mantine/core/PillsInputField";const EL={},pc=ve((e,t)=>{const n=se("PillsInput",EL,e),{children:r,onMouseDown:i,onClick:s,size:c,disabled:u,__staticSelector:f,error:p,variant:m,...g}=n,y=v.useRef(null);return o.jsx(vL,{value:{fieldRef:y,size:c,disabled:u,hasError:!!p,variant:m},children:o.jsx(Pr,{size:c,error:p,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(),s==null||s(b))},...g,multiline:!0,disabled:u,__staticSelector:f||"PillsInput",withAria:!1,children:r})})});pc.displayName="@mantine/core/PillsInput";pc.Field=E0;function TL({data:e,value:t}){const n=t.map(i=>i.trim().toLowerCase());return e.reduce((i,s)=>(hc(s)?i.push({group:s.group,items:s.items.filter(c=>n.indexOf(c.value.toLowerCase().trim())===-1)}):n.indexOf(s.value.toLowerCase().trim())===-1&&i.push(s),i),[])}const RL={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},Op=ve((e,t)=>{const n=se("MultiSelect",RL,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,size:p,value:m,defaultValue:g,onChange:y,onKeyDown:b,variant:S,data:j,dropdownOpened:C,defaultDropdownOpened:T,onDropdownOpen:D,onDropdownClose:E,selectFirstOptionOnChange:R,onOptionSubmit:A,comboboxProps:k,filter:M,limit:I,withScrollArea:$,maxDropdownHeight:V,searchValue:Y,defaultSearchValue:Q,onSearchChange:J,readOnly:G,disabled:K,onFocus:P,onBlur:L,radius:z,rightSection:H,rightSectionWidth:O,rightSectionPointerEvents:U,rightSectionProps:X,leftSection:ee,leftSectionWidth:Se,leftSectionPointerEvents:be,leftSectionProps:xe,inputContainer:qe,inputWrapperOrder:Me,withAsterisk:tt,labelProps:ke,descriptionProps:vt,errorProps:It,wrapperProps:Lt,description:gt,label:At,error:nn,maxValues:Ee,searchable:De,nothingFoundMessage:Qe,withCheckIcon:Re,checkIconPosition:me,hidePickedOptions:ge,withErrorStyles:Pe,name:we,form:$e,id:yt,clearable:ft,clearButtonProps:Gt,hiddenInputProps:kt,placeholder:un,hiddenInputValuesDivider:wt,required:Vi,mod:Si,renderOption:pa,onRemove:Bn,onClear:wi,scrollAreaProps:Xr,chevronColor:ll,...ma}=n,no=yr(yt),Fi=F2(j),xr=H2(Fi),qn=yd({opened:C,defaultOpened:T,onDropdownOpen:D,onDropdownClose:()=>{E==null||E(),qn.resetSelectedOption()}}),{styleProps:ga,rest:{type:ro,autoComplete:es,...ts}}=Qa(ma),[F,Z]=Yn({value:m,defaultValue:g,finalValue:[],onChange:y}),[re,he]=Yn({value:Y,defaultValue:Q,finalValue:"",onChange:J}),Te=Xe=>{he(Xe),qn.resetSelectedOption()},Be=Ie({name:"MultiSelect",classes:{},props:n,classNames:r,styles:c,unstyled:u}),{resolvedClassNames:nt,resolvedStyles:Ue}=Ys({props:n,styles:c,classNames:r}),Ze=Xe=>{b==null||b(Xe),Xe.key===" "&&!De&&(Xe.preventDefault(),qn.toggleDropdown()),Xe.key==="Backspace"&&re.length===0&&F.length>0&&(Bn==null||Bn(F[F.length-1]),Z(F.slice(0,F.length-1)))},Je=F.map((Xe,Wt)=>{var dn,Pt;return o.jsx($s,{withRemoveButton:!G&&!((dn=xr[Xe])!=null&&dn.disabled),onRemove:()=>{Z(F.filter(Tt=>Xe!==Tt)),Bn==null||Bn(Xe)},unstyled:u,disabled:K,...Be("pill"),children:((Pt=xr[Xe])==null?void 0:Pt.label)||Xe},`${Xe}-${Wt}`)});v.useEffect(()=>{R&&qn.selectFirstOption()},[R,re]);const it=o.jsx(ct.ClearButton,{...Gt,onClear:()=>{wi==null||wi(),Z([]),Te("")}}),Ke=TL({data:Fi,value:F}),st=ft&&F.length>0&&!K&&!G;return o.jsxs(o.Fragment,{children:[o.jsxs(ct,{store:qn,classNames:nt,styles:Ue,unstyled:u,size:p,readOnly:G,__staticSelector:"MultiSelect",onOptionSubmit:Xe=>{A==null||A(Xe),Te(""),qn.updateSelectedOptionIndex("selected"),F.includes(xr[Xe].value)?(Z(F.filter(Wt=>Wt!==xr[Xe].value)),Bn==null||Bn(xr[Xe].value)):F.length<Ee&&Z([...F,xr[Xe].value])},...k,children:[o.jsx(ct.DropdownTarget,{children:o.jsx(pc,{...ga,__staticSelector:"MultiSelect",classNames:nt,styles:Ue,unstyled:u,size:p,className:i,style:s,variant:S,disabled:K,radius:z,__defaultRightSection:o.jsx(ct.Chevron,{size:p,error:nn,unstyled:u,color:ll}),__clearSection:it,__clearable:st,rightSection:H,rightSectionPointerEvents:U||(it?"all":"none"),rightSectionWidth:O,rightSectionProps:X,leftSection:ee,leftSectionWidth:Se,leftSectionPointerEvents:be,leftSectionProps:xe,inputContainer:qe,inputWrapperOrder:Me,withAsterisk:tt,labelProps:ke,descriptionProps:vt,errorProps:It,wrapperProps:Lt,description:gt,label:At,error:nn,withErrorStyles:Pe,__stylesApiProps:{...n,rightSectionPointerEvents:U||(st?"all":"none"),multiline:!0},pointer:!De,onClick:()=>De?qn.openDropdown():qn.toggleDropdown(),"data-expanded":qn.dropdownOpened||void 0,id:no,required:Vi,mod:Si,children:o.jsxs($s.Group,{disabled:K,unstyled:u,...Be("pillsList"),children:[Je,o.jsx(ct.EventsTarget,{autoComplete:es,children:o.jsx(pc.Field,{...ts,ref:t,id:no,placeholder:un,type:!De&&!un?"hidden":"visible",...Be("inputField"),unstyled:u,onFocus:Xe=>{P==null||P(Xe),De&&qn.openDropdown()},onBlur:Xe=>{L==null||L(Xe),qn.closeDropdown(),Te("")},onKeyDown:Ze,value:re,onChange:Xe=>{Te(Xe.currentTarget.value),De&&qn.openDropdown(),R&&qn.selectFirstOption()},disabled:K,readOnly:G||!De,pointer:!De})})]})})}),o.jsx(F7,{data:ge?Ke:Fi,hidden:G||K,filter:M,search:re,limit:I,hiddenWhenEmpty:!Qe,withScrollArea:$,maxDropdownHeight:V,filterOptions:De,value:F,checkIconPosition:me,withCheckIcon:Re,nothingFoundMessage:Qe,unstyled:u,labelId:At?`${no}-label`:void 0,"aria-label":At?void 0:ma["aria-label"],renderOption:pa,scrollAreaProps:Xr})]}),o.jsx(ct.HiddenInput,{name:we,valuesDivider:wt,value:F,form:$e,disabled:K,...kt})]})});Op.classes={...Pr.classes,...ct.classes};Op.displayName="@mantine/core/MultiSelect";function DL(e){return"group"in e}function T0({data:e}){if(DL(e)){const i=e.items.map(s=>o.jsx(T0,{data:s},s.value));return o.jsx("optgroup",{label:e.group,children:i})}const{value:t,label:n,...r}=e;return o.jsx("option",{value:e.value,...r,children:e.label},e.value)}T0.displayName="@mantine/core/NativeSelectOption";const AL={rightSectionPointerEvents:"none"},ln=ve((e,t)=>{const{data:n,children:r,size:i,error:s,rightSection:c,unstyled:u,...f}=se("NativeSelect",AL,e),p=F2(n).map((m,g)=>o.jsx(T0,{data:m},g));return o.jsx(Pr,{component:"select",ref:t,...f,__staticSelector:"NativeSelect",size:i,pointer:!0,error:s,unstyled:u,rightSection:c||o.jsx(bp,{size:i,error:s,unstyled:u}),children:r||p})});ln.classes=Pr.classes;ln.displayName="@mantine/core/NativeSelect";var wD={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const _L={withCloseButton:!0},kL=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:Vt(t),"--notification-color":n?Ht(n,e):void 0}}),R0=ve((e,t)=>{const n=se("Notification",_L,e),{className:r,color:i,radius:s,loading:c,withCloseButton:u,withBorder:f,title:p,icon:m,children:g,onClose:y,closeButtonProps:b,classNames:S,style:j,styles:C,unstyled:T,variant:D,vars:E,mod:R,loaderProps:A,role:k,...M}=n,I=Ie({name:"Notification",classes:wD,props:n,className:r,style:j,classNames:S,styles:C,unstyled:T,vars:E,varsResolver:kL});return o.jsxs(ce,{...I("root"),mod:[{"data-with-icon":!!m||c,"data-with-border":f},R],ref:t,variant:D,role:k||"alert",...M,children:[m&&!c&&o.jsx("div",{...I("icon"),children:m}),c&&o.jsx(_r,{size:28,color:i,...A,...I("loader")}),o.jsxs("div",{...I("body"),children:[p&&o.jsx("div",{...I("title"),children:p}),o.jsx(ce,{...I("description"),mod:{"data-with-title":!!p},children:g})]}),u&&o.jsx(Qo,{iconSize:16,color:"gray",...b,unstyled:T,onClick:y,...I("closeButton")})]})});R0.classes=wD;R0.displayName="@mantine/core/Notification";function jD(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 nd;(function(e){e.event="event",e.props="prop"})(nd||(nd={}));function Lo(){}function PL(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(s,c){return s===t[c]})||(t=r,n=e.apply(void 0,r)),n}}function rd(e){return!!(e||"").match(/\d/)}function ic(e){return e==null}function NL(e){return typeof e=="number"&&isNaN(e)}function CD(e){return ic(e)||NL(e)||typeof e=="number"&&!isFinite(e)}function ED(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function OL(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 ML(e,t,n){var r=OL(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 IL(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 D0(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var i=e.split("."),s=i[0],c=i[1]||"";return{beforeDecimal:s,afterDecimal:c,hasNegation:n,addNegation:r}}function LL(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 TD(e,t,n){for(var r="",i=n?"0":"",s=0;s<=t-1;s++)r+=e[s]||i;return r}function FC(e,t){return Array(t+1).join(e)}function RD(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),i=r[0],s=r[1];if(s=Number(s),!s)return n+i;i=i.replace(".","");var c=1+s,u=i.length;return c<0?i="0."+FC("0",Math.abs(c))+i:c>=u?i=i+FC("0",c-u):i=(i.substring(0,c)||"0")+"."+i.substring(c),n+i}function HC(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=D0(e),s=i.beforeDecimal,c=i.afterDecimal,u=i.hasNegation,f=parseFloat("0."+(c||"0")),p=c.length<=t?"0."+c:f.toFixed(t),m=p.split("."),g=s;s&&Number(m[0])&&(g=s.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=TD(m[1]||"",t,n),b=u?"-":"",S=r?".":"";return""+b+g+S+y}function Es(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 DD=PL(function(e,t){for(var n=0,r=0,i=e.length,s=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[s-1-r]&&s-r>n&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:s-r}}}),zL=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function $L(e,t,n){return Math.min(Math.max(e,t),n)}function $v(e){return Math.max(e.selectionStart,e.selectionEnd)}function UL(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function BL(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function VL(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function FL(e,t,n,r,i,s,c){c===void 0&&(c=VL);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 p=n.length,m=e.length,g={},y=new Array(p),b=0;b<p;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<p&&(y[T]===-1||!s(n[T]));)T++;var D=T===p||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>D?D:r-E<D-r?E:D}function qC(e,t,n,r){var i=e.length;if(t=$L(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 HL(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(rd(e[n])||rd(e[n-1]));return t}function AD(e,t,n,r,i,s){s===void 0&&(s=Lo);var c=IL(function(S,j){var C,T;return CD(S)?(T="",C=""):typeof S=="number"||j?(T=typeof S=="number"?RD(S):S,C=r(T)):(T=i(S,void 0),C=r(T)),{formattedValue:C,numAsString:T}}),u=v.useState(function(){return c(ic(e)?t:e,n)}),f=u[0],p=u[1],m=function(S,j){S.formattedValue!==f.formattedValue&&p({formattedValue:S.formattedValue,numAsString:S.value}),s(S,j)},g=e,y=n;ic(e)&&(g=f.numAsString,y=!0);var b=c(g,y);return v.useMemo(function(){p(b)},[b.formattedValue]),[f,m]}function qL(e){return e.replace(/[^0-9]/g,"")}function GL(e){return e}function QL(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,s=e.getInputRef,c=e.format;c===void 0&&(c=GL);var u=e.removeFormatting;u===void 0&&(u=qL);var f=e.defaultValue,p=e.valueIsNumericString,m=e.onValueChange,g=e.isAllowed,y=e.onChange;y===void 0&&(y=Lo);var b=e.onKeyDown;b===void 0&&(b=Lo);var S=e.onMouseUp;S===void 0&&(S=Lo);var j=e.onFocus;j===void 0&&(j=Lo);var C=e.onBlur;C===void 0&&(C=Lo);var T=e.value,D=e.getCaretBoundary;D===void 0&&(D=HL);var E=e.isValidInputCharacter;E===void 0&&(E=rd);var R=e.isCharacterSame,A=jD(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),k=AD(T,f,!!p,c,u,m),M=k[0],I=M.formattedValue,$=M.numAsString,V=k[1],Y=v.useRef(),Q=v.useRef({formattedValue:I,numAsString:$}),J=function(Ee,De){Q.current={formattedValue:Ee.formattedValue,numAsString:Ee.value},V(Ee,De)},G=v.useState(!1),K=G[0],P=G[1],L=v.useRef(null),z=v.useRef({setCaretTimeout:null,focusTimeout:null});v.useEffect(function(){return P(!0),function(){clearTimeout(z.current.setCaretTimeout),clearTimeout(z.current.focusTimeout)}},[]);var H=c,O=function(Ee,De){var Qe=parseFloat(De);return{formattedValue:Ee,value:De,floatValue:isNaN(Qe)?void 0:Qe}},U=function(Ee,De,Qe){Ee.selectionStart===0&&Ee.selectionEnd===Ee.value.length||(Es(Ee,De),z.current.setCaretTimeout=setTimeout(function(){Ee.value===Qe&&Ee.selectionStart!==De&&Es(Ee,De)},0))},X=function(Ee,De,Qe){return qC(Ee,De,D(Ee),Qe)},ee=function(Ee,De,Qe){var Re=D(De),me=FL(De,I,Ee,Qe,Re,E,R);return me=qC(De,me,Re),me},Se=function(Ee){var De=Ee.formattedValue;De===void 0&&(De="");var Qe=Ee.input,Re=Ee.source,me=Ee.event,ge=Ee.numAsString,Pe;if(Qe){var we=Ee.inputValue||Qe.value,$e=$v(Qe);Qe.value=De,Pe=ee(we,De,$e),Pe!==void 0&&U(Qe,Pe,De)}De!==I&&J(O(De,ge),{event:me,source:Re})};v.useEffect(function(){var Ee=Q.current,De=Ee.formattedValue,Qe=Ee.numAsString;(I!==De||$!==Qe)&&J(O(I,$),{event:void 0,source:nd.props})},[I,$]);var be=L.current?$v(L.current):void 0,xe=typeof window<"u"?v.useLayoutEffect:v.useEffect;xe(function(){var Ee=L.current;if(I!==Q.current.formattedValue&&Ee){var De=ee(Q.current.formattedValue,I,be);Ee.value=I,U(Ee,De,I)}},[I]);var qe=function(Ee,De,Qe){var Re=De.target,me=Y.current?zL(Y.current,Re.selectionEnd):DD(I,Ee),ge=Object.assign(Object.assign({},me),{lastValue:I}),Pe=u(Ee,ge),we=H(Pe);if(Pe=u(we,void 0),g&&!g(O(we,Pe))){var $e=De.target,yt=$v($e),ft=ee(Ee,I,yt);return $e.value=I,U($e,ft,I),!1}return Se({formattedValue:we,numAsString:Pe,inputValue:Ee,event:De,source:Qe,input:De.target}),!0},Me=function(Ee,De){De===void 0&&(De=0);var Qe=Ee.selectionStart,Re=Ee.selectionEnd;Y.current={selectionStart:Qe,selectionEnd:Re+De}},tt=function(Ee){var De=Ee.target,Qe=De.value,Re=qe(Qe,Ee,nd.event);Re&&y(Ee),Y.current=void 0},ke=function(Ee){var De=Ee.target,Qe=Ee.key,Re=De.selectionStart,me=De.selectionEnd,ge=De.value;ge===void 0&&(ge="");var Pe;Qe==="ArrowLeft"||Qe==="Backspace"?Pe=Math.max(Re-1,0):Qe==="ArrowRight"?Pe=Math.min(Re+1,ge.length):Qe==="Delete"&&(Pe=Re);var we=0;Qe==="Delete"&&Re===me&&(we=1);var $e=Qe==="ArrowLeft"||Qe==="ArrowRight";if(Pe===void 0||Re!==me&&!$e){b(Ee),Me(De,we);return}var yt=Pe;if($e){var ft=Qe==="ArrowLeft"?"left":"right";yt=X(ge,Pe,ft),yt!==Pe&&Ee.preventDefault()}else Qe==="Delete"&&!E(ge[Pe])?yt=X(ge,Pe,"right"):Qe==="Backspace"&&!E(ge[Pe])&&(yt=X(ge,Pe,"left"));yt!==Pe&&U(De,yt,ge),b(Ee),Me(De,we)},vt=function(Ee){var De=Ee.target,Qe=function(){var Re=De.selectionStart,me=De.selectionEnd,ge=De.value;if(ge===void 0&&(ge=""),Re===me){var Pe=X(ge,Re);Pe!==Re&&U(De,Pe,ge)}};Qe(),requestAnimationFrame(function(){Qe()}),S(Ee),Me(De)},It=function(Ee){Ee.persist&&Ee.persist();var De=Ee.target,Qe=Ee.currentTarget;L.current=De,z.current.focusTimeout=setTimeout(function(){var Re=De.selectionStart,me=De.selectionEnd,ge=De.value;ge===void 0&&(ge="");var Pe=X(ge,Re);Pe!==Re&&!(Re===0&&me===ge.length)&&U(De,Pe,ge),j(Object.assign(Object.assign({},Ee),{currentTarget:Qe}))},0)},Lt=function(Ee){L.current=null,clearTimeout(z.current.focusTimeout),clearTimeout(z.current.setCaretTimeout),C(Ee)},gt=K&&UL()?"numeric":void 0,At=Object.assign({inputMode:gt},A,{type:t,value:I,onChange:tt,onKeyDown:ke,onMouseUp:vt,onFocus:It,onBlur:Lt});if(n==="text")return i?En.createElement(En.Fragment,null,i(I,A)||null):En.createElement("span",Object.assign({},A,{ref:s}),I);if(r){var nn=r;return En.createElement(nn,Object.assign({},At,{ref:s}))}return En.createElement("input",Object.assign({},At,{ref:s}))}function GC(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i="");var s=t.suffix;s===void 0&&(s="");var c=t.allowNegative,u=t.thousandsGroupStyle;if(u===void 0&&(u="thousand"),e===""||e==="-")return e;var f=Mp(t),p=f.thousandSeparator,m=f.decimalSeparator,g=n!==0&&e.indexOf(".")!==-1||n&&r,y=D0(e,c),b=y.beforeDecimal,S=y.afterDecimal,j=y.addNegation;return n!==void 0&&(S=TD(S,n,!!r)),p&&(b=ML(b,p,u)),i&&(b=i+b),s&&(S=S+s),j&&(b="-"+b),e=b+(g&&m||"")+S,e}function Mp(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 WL(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),i=n.test(e),s=r.test(e);return e=e.replace(/-/g,""),i&&!s&&t&&(e="-"+e),e}function YL(e,t){return new RegExp("(^-)|[0-9]|"+ED(e),"g")}function KL(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function XL(e,t,n){var r;t===void 0&&(t=BL(e));var i=n.allowNegative,s=n.prefix;s===void 0&&(s="");var c=n.suffix;c===void 0&&(c="");var u=n.decimalScale,f=t.from,p=t.to,m=p.start,g=p.end,y=Mp(n),b=y.allowedDecimalSeparators,S=y.decimalSeparator,j=e[g]===S;if(rd(e)&&(e===s||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(L,z,H){var O=!1,U=!1;s.startsWith("-")?O=!1:L.startsWith("--")?(O=!1,U=!0):c.startsWith("-")&&L.length===c.length?O=!1:L[0]==="-"&&(O=!0);var X=O?1:0;return U&&(X=2),X&&(L=L.substring(X),z-=X,H-=X),{value:L,start:z,end:H,hasNegation:O}},D=T(e,m,g),E=D.hasNegation;r=D,e=r.value,m=r.start,g=r.end;var R=T(t.lastValue,f.start,f.end),A=R.start,k=R.end,M=R.value,I=e.substring(m,g);e.length&&M.length&&(A>M.length-c.length||k<s.length)&&!(I&&c.startsWith(I))&&(e=M);var $=0;e.startsWith(s)?$+=s.length:m<s.length&&($=m),e=e.substring($),g-=$;var V=e.length,Y=e.length-c.length;e.endsWith(c)?V=Y:(g>Y||g>e.length-c.length)&&(V=g),e=e.substring(0,V),e=WL(E?"-"+e:e,i),e=(e.match(YL(S))||[]).join("");var Q=e.indexOf(S);e=e.replace(new RegExp(ED(S),"g"),function(L,z){return z===Q?".":""});var J=D0(e,i),G=J.beforeDecimal,K=J.afterDecimal,P=J.addNegation;return p.end-p.start<f.end-f.start&&G===""&&j&&!parseFloat(K)&&(e=P?"-":""),e}function ZL(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}),s=e[0]==="-";i.fill(!1,0,n.length+(s?1:0));var c=e.length;return i.fill(!1,c-r.length+1,c+1),i}function JL(e){var t=Mp(e),n=t.thousandSeparator,r=t.decimalSeparator,i=e.prefix;i===void 0&&(i="");var s=e.allowNegative;if(s===void 0&&(s=!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("-")&&s&&(console.error(`
73
- Prefix can't start with '-' when allowNegative is true.
74
- prefix: `+i+`
75
- allowNegative: `+s+`
76
- `),s=!1),Object.assign(Object.assign({},e),{allowNegative:s})}function e6(e){e=JL(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=Lo);var s=e.onBlur;s===void 0&&(s=Lo);var c=e.thousandSeparator,u=e.decimalScale,f=e.fixedDecimalScale,p=e.prefix;p===void 0&&(p="");var m=e.defaultValue,g=e.value,y=e.valueIsNumericString,b=e.onValueChange,S=jD(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),j=Mp(e),C=j.decimalSeparator,T=j.allowedDecimalSeparators,D=function(P){return GC(P,e)},E=function(P,L){return XL(P,L,e)},R=ic(g)?m:g,A=y??KL(R,p,t);ic(g)?ic(m)||(A=A||typeof m=="number"):A=A||typeof g=="number";var k=function(P){return CD(P)?P:(typeof P=="number"&&(P=RD(P)),A&&typeof u=="number"?HC(P,u,!!f):P)},M=AD(k(g),k(m),!!A,D,E,b),I=M[0],$=I.numAsString,V=I.formattedValue,Y=M[1],Q=function(P){var L=P.target,z=P.key,H=L.selectionStart,O=L.selectionEnd,U=L.value;if(U===void 0&&(U=""),(z==="Backspace"||z==="Delete")&&O<p.length){P.preventDefault();return}if(H!==O){i(P);return}z==="Backspace"&&U[0]==="-"&&H===p.length+1&&n&&Es(L,1),u&&f&&(z==="Backspace"&&U[H-1]===C?(Es(L,H-1),P.preventDefault()):z==="Delete"&&U[H]===C&&P.preventDefault()),T!=null&&T.includes(z)&&U[H]===C&&Es(L,H+1);var X=c===!0?",":c;z==="Backspace"&&U[H-1]===X&&Es(L,H-1),z==="Delete"&&U[H]===X&&Es(L,H+1),i(P)},J=function(P){var L=$;if(L.match(/\d/g)||(L=""),r||(L=LL(L)),f&&u&&(L=HC(L,u,f)),L!==$){var z=GC(L,e);Y({formattedValue:z,value:L,floatValue:parseFloat(L)},{event:P,source:nd.event})}s(P)},G=function(P){return P===C?!0:rd(P)},K=function(P){var L=P.currentValue,z=P.lastValue,H=P.formattedValue,O=P.currentValueIndex,U=P.formattedValueIndex,X=L[O],ee=H[U],Se=DD(z,L),be=Se.to,xe=function(qe){return E(qe).indexOf(".")+p.length};return g===0&&f&&u&&L[be.start]===C&&xe(L)<O&&xe(H)>U?!1:O>=be.start&&O<be.end&&T&&T.includes(X)&&ee===C?!0:X===ee};return Object.assign(Object.assign({},S),{value:V,valueIsNumericString:!1,isValidInputCharacter:G,isCharacterSame:K,onValueChange:Y,format:D,removeFormatting:E,getCaretBoundary:function(P){return ZL(P,e)},onKeyDown:Q,onBlur:J})}function t6(e){var t=e6(e);return En.createElement(QL,Object.assign({},t))}function QC({direction:e,style:t,...n}){return o.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:o.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 Ay={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const n6=/^(0\.0*|-0(\.0*)?)$/,r6=/^-?0\d+(\.\d+)?\.?$/;function _y(e){return typeof e=="string"&&e!==""&&!Number.isNaN(Number(e))}function Uv(e){return typeof e=="number"?e<Number.MAX_SAFE_INTEGER:e===""||_y(e)&&Number(e)<Number.MAX_SAFE_INTEGER}function i6(e){return e.toString().replace(".","").length}function a6(e,t){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&i6(t)<14&&t!==""}function WC(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 o6={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},s6=(e,{size:t})=>({controls:{"--ni-chevron-size":rt(t,"ni-chevron-size")}});function l6(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 Ip=ve((e,t)=>{const n=se("NumberInput",o6,e),{className:r,classNames:i,styles:s,unstyled:c,vars:u,onChange:f,onValueChange:p,value:m,defaultValue:g,max:y,min:b,step:S,hideControls:j,rightSection:C,isAllowed:T,clampBehavior:D,onBlur:E,allowDecimal:R,decimalScale:A,onKeyDown:k,onKeyDownCapture:M,handlersRef:I,startValue:$,disabled:V,rightSectionPointerEvents:Y,allowNegative:Q,readOnly:J,size:G,rightSectionWidth:K,stepHoldInterval:P,stepHoldDelay:L,allowLeadingZeros:z,withKeyboardEvents:H,trimLeadingZeroesOnBlur:O,...U}=n,X=Ie({name:"NumberInput",classes:Ay,props:n,classNames:i,styles:s,unstyled:c,vars:u,varsResolver:s6}),{resolvedClassNames:ee,resolvedStyles:Se}=Ys({classNames:i,styles:s,props:n}),[be,xe]=Yn({value:m,defaultValue:g,finalValue:"",onChange:f}),qe=L!==void 0&&P!==void 0,Me=v.useRef(null),tt=v.useRef(null),ke=v.useRef(0),vt=(we,$e)=>{$e.source==="event"&&xe(a6(we.floatValue,we.value)&&!n6.test(we.value)&&!(z&&r6.test(we.value))?we.floatValue:we.value),p==null||p(we,$e)},It=we=>{const $e=String(we).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return $e?Math.max(0,($e[1]?$e[1].length:0)-($e[2]?+$e[2]:0)):0},Lt=we=>{Me.current&&typeof we<"u"&&Me.current.setSelectionRange(we,we)},gt=v.useRef(Th);gt.current=()=>{if(!Uv(be))return;let we;const $e=It(be),yt=It(S),ft=Math.max($e,yt),Gt=10**ft;if(!_y(be)&&(typeof be!="number"||Number.isNaN(be)))we=mh($,b,y);else if(y!==void 0){const un=(Math.round(Number(be)*Gt)+Math.round(S*Gt))/Gt;we=un<=y?un:y}else we=(Math.round(Number(be)*Gt)+Math.round(S*Gt))/Gt;const kt=we.toFixed(ft);xe(parseFloat(kt)),p==null||p({floatValue:parseFloat(kt),formattedValue:kt,value:kt},{source:"increment"}),setTimeout(()=>{var un;return Lt((un=Me.current)==null?void 0:un.value.length)},0)};const At=v.useRef(Th);At.current=()=>{if(!Uv(be))return;let we;const $e=b!==void 0?b:Q?Number.MIN_SAFE_INTEGER:0,yt=It(be),ft=It(S),Gt=Math.max(yt,ft),kt=10**Gt;if(!_y(be)&&typeof be!="number"||Number.isNaN(be))we=mh($,$e,y);else{const wt=(Math.round(Number(be)*kt)-Math.round(S*kt))/kt;we=$e!==void 0&&wt<$e?$e:wt}const un=we.toFixed(Gt);xe(parseFloat(un)),p==null||p({floatValue:parseFloat(un),formattedValue:un,value:un},{source:"decrement"}),setTimeout(()=>{var wt;return Lt((wt=Me.current)==null?void 0:wt.value.length)},0)};const nn=we=>{k==null||k(we),!(J||!H)&&(we.key==="ArrowUp"&&(we.preventDefault(),gt.current()),we.key==="ArrowDown"&&(we.preventDefault(),At.current()))},Ee=we=>{if(M==null||M(we),we.key==="Backspace"){const $e=Me.current;$e.selectionStart===0&&$e.selectionStart===$e.selectionEnd&&(we.preventDefault(),window.setTimeout(()=>Lt(0),0))}},De=we=>{let $e=be;D==="blur"&&typeof $e=="number"&&($e=mh($e,b,y)),O&&typeof $e=="string"&&It($e)<15&&($e=l6($e,y,b)),be!==$e&&xe($e),E==null||E(we)};Zu(I,{increment:gt.current,decrement:At.current});const Qe=we=>{we?gt.current():At.current(),ke.current+=1},Re=we=>{if(Qe(we),qe){const $e=typeof P=="number"?P:P(ke.current);tt.current=window.setTimeout(()=>Re(we),$e)}},me=(we,$e)=>{var yt;we.preventDefault(),(yt=Me.current)==null||yt.focus(),Qe($e),qe&&(tt.current=window.setTimeout(()=>Re($e),L))},ge=()=>{tt.current&&window.clearTimeout(tt.current),tt.current=null,ke.current=0},Pe=o.jsxs("div",{...X("controls"),children:[o.jsx(tr,{...X("control"),tabIndex:-1,"aria-hidden":!0,disabled:V||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:o.jsx(QC,{direction:"up"})}),o.jsx(tr,{...X("control"),tabIndex:-1,"aria-hidden":!0,disabled:V||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:o.jsx(QC,{direction:"down"})})]});return o.jsx(Pr,{component:t6,allowNegative:Q,className:Ut(Ay.root,r),size:G,...U,readOnly:J,disabled:V,value:be,getInputRef:$n(t,Me),onValueChange:vt,rightSection:j||J||!Uv(be)?C:C||Pe,classNames:ee,styles:Se,unstyled:c,__staticSelector:"NumberInput",decimalScale:R?A:0,onKeyDown:nn,onKeyDownCapture:Ee,rightSectionPointerEvents:Y??(V?"none":void 0),rightSectionWidth:K??`var(--ni-right-section-width-${G||"sm"})`,allowLeadingZeros:z,onBlur:De,isAllowed:we=>D==="strict"?T?T(we)&&WC(we.floatValue,b,y):WC(we.floatValue,b,y):T?T(we):!0})});Ip.classes={...Pr.classes,...Ay};Ip.displayName="@mantine/core/NumberInput";const[c6,Lp]=vr("Pagination.Root component was not found in tree");var bd={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const u6={withPadding:!0},Sd=ve((e,t)=>{const n=se("PaginationControl",u6,e),{classNames:r,className:i,style:s,styles:c,vars:u,active:f,disabled:p,withPadding:m,mod:g,...y}=n,b=Lp(),S=p||b.disabled;return o.jsx(tr,{ref:t,disabled:S,mod:[{active:f,disabled:S,"with-padding":m},g],...b.getStyles("control",{className:i,style:s,classNames:r,styles:c,active:!S}),...y})});Sd.classes=bd;Sd.displayName="@mantine/core/PaginationControl";function wd({style:e,children:t,path:n,...r}){return o.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:o.jsx("path",{d:n,fill:"currentColor"})})}const d6=e=>o.jsx(wd,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),f6=e=>o.jsx(wd,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),h6=e=>o.jsx(wd,{...e,path:"M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z"}),p6=e=>o.jsx(wd,{...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"}),m6=e=>o.jsx(wd,{...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"}),g6={icon:m6},zp=ve((e,t)=>{const n=se("PaginationDots",g6,e),{classNames:r,className:i,style:s,styles:c,vars:u,icon:f,...p}=n,m=Lp(),g=f;return o.jsx(ce,{ref:t,...m.getStyles("dots",{className:i,style:s,styles:c,classNames:r}),...p,children:o.jsx(g,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});zp.classes=bd;zp.displayName="@mantine/core/PaginationDots";function $p({icon:e,name:t,action:n,type:r}){const i={icon:e},s=v.forwardRef((c,u)=>{const{icon:f,...p}=se(t,i,c),m=f,g=Lp(),y=r==="next"?g.active===g.total:g.active===1;return o.jsx(Sd,{disabled:g.disabled||y,ref:u,onClick:g[n],withPadding:!1,...p,children:o.jsx(m,{className:"mantine-rotate-rtl",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});return s.displayName=`@mantine/core/${t}`,s}const _D=$p({icon:d6,name:"PaginationNext",action:"onNext",type:"next"}),kD=$p({icon:f6,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),PD=$p({icon:h6,name:"PaginationFirst",action:"onFirst",type:"previous"}),ND=$p({icon:p6,name:"PaginationLast",action:"onLast",type:"next"});function A0({dotsIcon:e}){const t=Lp(),n=t.range.map((r,i)=>{var s,c,u;return r==="dots"?o.jsx(zp,{icon:e},i):o.jsx(Sd,{active:r===t.active,"aria-current":r===t.active?"page":void 0,onClick:()=>t.onChange(r),disabled:t.disabled,...(s=t.getItemProps)==null?void 0:s.call(t,r),children:((u=(c=t.getItemProps)==null?void 0:c.call(t,r))==null?void 0:u.children)??r},i)});return o.jsx(o.Fragment,{children:n})}A0.displayName="@mantine/core/PaginationItems";const v6={siblings:1,boundaries:1},y6=(e,{size:t,radius:n,color:r,autoContrast:i})=>({root:{"--pagination-control-radius":n===void 0?void 0:Vt(n),"--pagination-control-size":rt(t,"pagination-control-size"),"--pagination-control-fz":On(t),"--pagination-active-bg":r?Ht(r,e):void 0,"--pagination-active-color":Ks(i,e)?Ga({color:r,theme:e,autoContrast:i}):void 0}}),Up=ve((e,t)=>{const n=se("PaginationRoot",v6,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,total:p,value:m,defaultValue:g,onChange:y,disabled:b,siblings:S,boundaries:j,color:C,radius:T,onNextPage:D,onPreviousPage:E,onFirstPage:R,onLastPage:A,getItemProps:k,autoContrast:M,...I}=n,$=Ie({name:"Pagination",classes:bd,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:y6}),{range:V,setPage:Y,next:Q,previous:J,active:G,first:K,last:P}=TN({page:m,initialPage:g,onChange:y,total:p,siblings:S,boundaries:j}),L=Rr(D,Q),z=Rr(E,J),H=Rr(R,K),O=Rr(A,P);return o.jsx(c6,{value:{total:p,range:V,active:G,disabled:b,getItemProps:k,onChange:Y,onNext:L,onPrevious:z,onFirst:H,onLast:O,getStyles:$},children:o.jsx(ce,{ref:t,...$("root"),...I})})});Up.classes=bd;Up.displayName="@mantine/core/PaginationRoot";const x6={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8},$i=ve((e,t)=>{const n=se("Pagination",x6,e),{withEdges:r,withControls:i,getControlProps:s,nextIcon:c,previousIcon:u,lastIcon:f,firstIcon:p,dotsIcon:m,total:g,gap:y,hideWithOnePage:b,withPages:S,...j}=n;return g<=0||b&&g===1?null:o.jsx(Up,{ref:t,total:g,...j,children:o.jsxs(je,{gap:y,children:[r&&o.jsx(PD,{icon:p,...s==null?void 0:s("first")}),i&&o.jsx(kD,{icon:u,...s==null?void 0:s("previous")}),S&&o.jsx(A0,{dotsIcon:m}),i&&o.jsx(_D,{icon:c,...s==null?void 0:s("next")}),r&&o.jsx(ND,{icon:f,...s==null?void 0:s("last")})]})})});$i.classes=bd;$i.displayName="@mantine/core/Pagination";$i.Root=Up;$i.Control=Sd;$i.Dots=zp;$i.First=PD;$i.Last=ND;$i.Next=_D;$i.Previous=kD;$i.Items=A0;const b6=({reveal:e})=>o.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:o.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 ky={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const S6={visibilityToggleIcon:b6},w6=(e,{size:t})=>({root:{"--psi-icon-size":rt(t,"psi-icon-size"),"--psi-button-size":rt(t,"psi-button-size")}}),Ni=ve((e,t)=>{const n=se("PasswordInput",S6,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,required:p,error:m,leftSection:g,disabled:y,id:b,variant:S,inputContainer:j,description:C,label:T,size:D,errorProps:E,descriptionProps:R,labelProps:A,withAsterisk:k,inputWrapperOrder:M,wrapperProps:I,radius:$,rightSection:V,rightSectionWidth:Y,rightSectionPointerEvents:Q,leftSectionWidth:J,visible:G,defaultVisible:K,onVisibilityChange:P,visibilityToggleIcon:L,visibilityToggleButtonProps:z,rightSectionProps:H,leftSectionProps:O,leftSectionPointerEvents:U,withErrorStyles:X,mod:ee,...Se}=n,be=yr(b),[xe,qe]=Yn({value:G,defaultValue:K,finalValue:!1,onChange:P}),Me=()=>qe(!xe),tt=Ie({name:"PasswordInput",classes:ky,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:w6}),{resolvedClassNames:ke,resolvedStyles:vt}=Ys({classNames:r,styles:c,props:n}),{styleProps:It,rest:Lt}=Qa(Se),gt=L,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=o.jsx(_n,{...tt("visibilityToggle"),disabled:y,radius:$,"aria-hidden":!z,tabIndex:-1,...z,variant:(z==null?void 0:z.variant)??"subtle",color:"gray",unstyled:u,onTouchEnd:ge=>{var Pe;ge.preventDefault(),(Pe=z==null?void 0:z.onTouchEnd)==null||Pe.call(z,ge),Me()},onMouseDown:ge=>{var Pe;ge.preventDefault(),(Pe=z==null?void 0:z.onMouseDown)==null||Pe.call(z,ge),Me()},onKeyDown:ge=>{var Pe;(Pe=z==null?void 0:z.onKeyDown)==null||Pe.call(z,ge),ge.key===" "&&(ge.preventDefault(),Me())},children:o.jsx(gt,{reveal:xe})});return o.jsx(mn.Wrapper,{required:p,id:be,label:T,error:m,description:C,size:D,classNames:ke,styles:vt,__staticSelector:"PasswordInput",unstyled:u,withAsterisk:k,inputWrapperOrder:M,inputContainer:j,variant:S,labelProps:{...A,htmlFor:be},descriptionProps:{...R,id:nn},errorProps:{...E,id:At},mod:ee,...tt("root"),...It,...I,children:o.jsx(mn,{component:"div",error:m,leftSection:g,size:D,classNames:{...ke,input:Ut(ky.input,ke.input)},styles:vt,radius:$,disabled:y,__staticSelector:"PasswordInput",rightSectionWidth:Y,rightSection:V??me,variant:S,unstyled:u,leftSectionWidth:J,rightSectionPointerEvents:Q||"all",rightSectionProps:H,leftSectionProps:O,leftSectionPointerEvents:U,withAria:!1,withErrorStyles:X,children:o.jsx("input",{required:p,"data-invalid":!!m||void 0,"data-with-left-section":!!g||void 0,...tt("innerInput"),disabled:y,id:be,ref:t,...Lt,"aria-describedby":Re,autoComplete:Lt.autoComplete||"off",type:xe?"text":"password"})})})});Ni.classes={...Pr.classes,...ky};Ni.displayName="@mantine/core/PasswordInput";const[j6,OD]=Ha(),[C6,E6]=Ha();var MD={card:"m_9dc8ae12"};const T6={withBorder:!0},R6=(e,{radius:t})=>({card:{"--card-radius":Vt(t)}}),_0=ve((e,t)=>{const n=se("RadioCard",T6,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,checked:p,mod:m,withBorder:g,value:y,onClick:b,name:S,onKeyDown:j,...C}=n,T=Ie({name:"RadioCard",classes:MD,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:R6,rootSelector:"card"}),{dir:D}=Zs(),E=OD(),R=typeof p=="boolean"?p:(E==null?void 0:E.value)===y||!1,A=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 I=Array.from(document.querySelectorAll(`[role="radio"][name="${A||"__mantine"}"]`)),$=I.findIndex(Q=>Q===M.target),V=$+1>=I.length?0:$+1,Y=$-1<0?I.length-1:$-1;M.nativeEvent.code==="ArrowDown"&&(I[V].focus(),I[V].click()),M.nativeEvent.code==="ArrowUp"&&(I[Y].focus(),I[Y].click()),M.nativeEvent.code==="ArrowLeft"&&(I[D==="ltr"?Y:V].focus(),I[D==="ltr"?Y:V].click()),M.nativeEvent.code==="ArrowRight"&&(I[D==="ltr"?V:Y].focus(),I[D==="ltr"?V:Y].click())}};return o.jsx(C6,{value:{checked:R},children:o.jsx(tr,{ref:t,mod:[{"with-border":g,checked:R},m],...T("card"),...C,role:"radio","aria-checked":R,name:A,onClick:M=>{b==null||b(M),E==null||E.onChange(y||"")},onKeyDown:k})})});_0.displayName="@mantine/core/RadioCard";_0.classes=MD;const D6={},k0=ve((e,t)=>{const{value:n,defaultValue:r,onChange:i,size:s,wrapperProps:c,children:u,name:f,readOnly:p,...m}=se("RadioGroup",D6,e),g=yr(f),[y,b]=Yn({value:n,defaultValue:r,finalValue:"",onChange:i}),S=j=>!p&&b(typeof j=="string"?j:j.currentTarget.value);return o.jsx(j6,{value:{value:y,onChange:S,size:s,name:g},children:o.jsx(mn.Wrapper,{size:s,ref:t,...c,...m,labelElement:"div",__staticSelector:"RadioGroup",children:o.jsx(i0,{role:"radiogroup",children:u})})})});k0.classes=mn.Wrapper.classes;k0.displayName="@mantine/core/RadioGroup";function ID({size:e,style:t,...n}){return o.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:o.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}var LD={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const A6={icon:ID},_6=(e,{radius:t,color:n,size:r,iconColor:i,variant:s,autoContrast:c})=>{const u=hi({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:Vt(t),"--radio-color":s==="outline"?f:Ht(n,e),"--radio-icon-size":rt(r,"radio-icon-size"),"--radio-icon-color":i?Ht(i,e):Ks(c,e)?Ga({color:n,theme:e,autoContrast:c}):void 0}}},P0=ve((e,t)=>{const n=se("RadioIndicator",A6,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,icon:p,radius:m,color:g,iconColor:y,autoContrast:b,checked:S,mod:j,variant:C,disabled:T,...D}=n,E=p,R=Ie({name:"RadioIndicator",classes:LD,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:_6,rootSelector:"indicator"}),A=E6(),k=typeof S=="boolean"?S:(A==null?void 0:A.checked)||!1;return o.jsx(ce,{ref:t,...R("indicator",{variant:C}),variant:C,mod:[{checked:k,disabled:T},j],...D,children:o.jsx(E,{...R("icon")})})});P0.displayName="@mantine/core/RadioIndicator";P0.classes=LD;var zD={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const k6={labelPosition:"right"},P6=(e,{size:t,radius:n,color:r,iconColor:i,variant:s,autoContrast:c})=>{const u=hi({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:Vt(n),"--radio-color":s==="outline"?f:Ht(r,e),"--radio-icon-color":i?Ht(i,e):Ks(c,e)?Ga({color:r,theme:e,autoContrast:c}):void 0,"--radio-icon-size":rt(t,"radio-icon-size")}}},Us=ve((e,t)=>{const n=se("Radio",k6,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,id:p,size:m,label:g,labelPosition:y,description:b,error:S,radius:j,color:C,variant:T,disabled:D,wrapperProps:E,icon:R=ID,rootRef:A,iconColor:k,onChange:M,mod:I,...$}=n,V=Ie({name:"Radio",classes:zD,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:P6}),Y=OD(),Q=(Y==null?void 0:Y.size)??m,J=n.size?m:Q,{styleProps:G,rest:K}=Qa($),P=yr(p),L=Y?{checked:Y.value===K.value,name:K.name??Y.name,onChange:z=>{Y.onChange(z),M==null||M(z)}}:{};return o.jsx(Sp,{...V("root"),__staticSelector:"Radio",__stylesApiProps:n,id:P,size:J,labelPosition:y,label:g,description:b,error:S,disabled:D,classNames:r,styles:c,unstyled:u,"data-checked":L.checked||void 0,variant:T,ref:A,mod:I,...G,...E,children:o.jsxs(ce,{...V("inner"),mod:{"label-position":y},children:[o.jsx(ce,{...V("radio",{focusable:!0,variant:T}),onChange:M,...K,...L,component:"input",mod:{error:!!S},ref:t,id:P,disabled:D,type:"radio"}),o.jsx(R,{...V("icon"),"aria-hidden":!0})]})})});Us.classes=zD;Us.displayName="@mantine/core/Radio";Us.Group=k0;Us.Card=_0;Us.Indicator=P0;const N6={duration:100,transition:"fade"};function O6(e,t){return{...N6,...t,...e}}function M6({offset:e,position:t,defaultOpened:n}){const[r,i]=v.useState(n),s=v.useRef(null),{x:c,y:u,elements:f,refs:p,update:m,placement:g}=kx({placement:t,middleware:[Rx({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})=>{p.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:j,y:C,left:j+y,top:C+b,right:j,bottom:C}}})},[f.reference]);return v.useEffect(()=>{if(p.floating.current){const j=s.current;j.addEventListener("mousemove",S);const C=Ia(p.floating.current);return C.forEach(T=>{T.addEventListener("scroll",m)}),()=>{j.removeEventListener("mousemove",S),C.forEach(T=>{T.removeEventListener("scroll",m)})}}},[f.reference,p.floating.current,m,S,r]),{handleMouseMove:S,x:c,y:u,opened:r,setOpened:i,boundaryRef:s,floating:p.setFloating}}var Bp={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const I6={refProp:"ref",withinPortal:!0,offset:10,defaultOpened:!1,position:"right",zIndex:Wr("popover")},L6=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Vt(t),"--tooltip-bg":n?Ht(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),N0=ve((e,t)=>{const n=se("TooltipFloating",I6,e),{children:r,refProp:i,withinPortal:s,style:c,className:u,classNames:f,styles:p,unstyled:m,radius:g,color:y,label:b,offset:S,position:j,multiline:C,zIndex:T,disabled:D,defaultOpened:E,variant:R,vars:A,portalProps:k,...M}=n,I=Sn(),$=Ie({name:"TooltipFloating",props:n,classes:Bp,className:u,style:c,classNames:f,styles:p,unstyled:m,rootSelector:"tooltip",vars:A,varsResolver:L6}),{handleMouseMove:V,x:Y,y:Q,opened:J,boundaryRef:G,floating:K,setOpened:P}=M6({offset:S,position:j,defaultOpened:E});if(!Fa(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 L=$n(G,sp(r),t),z=r.props,H=U=>{var X;(X=z.onMouseEnter)==null||X.call(z,U),V(U),P(!0)},O=U=>{var X;(X=z.onMouseLeave)==null||X.call(z,U),P(!1)};return o.jsxs(o.Fragment,{children:[o.jsx(Go,{...k,withinPortal:s,children:o.jsx(ce,{...M,...$("tooltip",{style:{...AR(c,I),zIndex:T,display:!D&&J?"block":"none",top:(Q&&Math.round(Q))??"",left:(Y&&Math.round(Y))??""}}),variant:R,ref:K,mod:{multiline:C},children:b})}),v.cloneElement(r,{...z,[i]:L,onMouseEnter:H,onMouseLeave:O})]})});N0.classes=Bp;N0.displayName="@mantine/core/TooltipFloating";const $D=v.createContext(!1),z6=$D.Provider,$6=()=>v.useContext($D),U6={openDelay:0,closeDelay:0};function O0(e){const{openDelay:t,closeDelay:n,children:r}=se("TooltipGroup",U6,e);return o.jsx(z6,{value:!0,children:o.jsx(m9,{delay:{open:t,close:n},children:r})})}O0.displayName="@mantine/core/TooltipGroup";O0.extend=e=>e;function B6(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 V6(e){const t=B6(e.middlewares),n=[WR(e.offset)];return t.shift&&n.push(Rx(typeof t.shift=="boolean"?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip=="boolean"?Ph():Ph(t.flip)),n.push(YR({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline=="boolean"?Wu():Wu(t.inline)):e.inline&&n.push(Wu()),n}function F6(e){var k,M,I;const[t,n]=v.useState(e.defaultOpened),i=typeof e.opened=="boolean"?e.opened:t,s=$6(),c=yr(),u=v.useCallback($=>{n($),$&&D(c)},[c]),{x:f,y:p,context:m,refs:g,update:y,placement:b,middlewareData:{arrow:{x:S,y:j}={}}}=kx({strategy:e.strategy,placement:e.position,open:i,onOpenChange:u,middleware:V6(e)}),{delay:C,currentId:T,setCurrentId:D}=g9(m,{id:c}),{getReferenceProps:E,getFloatingProps:R}=j9([h9(m,{enabled:(k=e.events)==null?void 0:k.hover,delay:s?C:{open:e.openDelay,close:e.closeDelay},mouseOnly:!((M=e.events)!=null&&M.touch)}),w9(m,{enabled:(I=e.events)==null?void 0:I.focus,visibleOnly:!0}),E9(m,{role:"tooltip"}),b9(m,{enabled:typeof e.opened>"u"})]);S2({opened:i,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:g,update:y}}),za(()=>{var $;($=e.onPositionChange)==null||$.call(e,b)},[b]);const A=i&&T&&T!==c;return{x:f,y:p,arrowX:S,arrowY:j,reference:g.setReference,floating:g.setFloating,getFloatingProps:R,getReferenceProps:E,isGroupPhase:A,opened:i,placement:b}}const YC={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:Wr("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},H6=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Vt(t),"--tooltip-bg":n?Ht(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),el=ve((e,t)=>{const n=se("Tooltip",YC,e),{children:r,position:i,refProp:s,label:c,openDelay:u,closeDelay:f,onPositionChange:p,opened:m,defaultOpened:g,withinPortal:y,radius:b,color:S,classNames:j,styles:C,unstyled:T,style:D,className:E,withArrow:R,arrowSize:A,arrowOffset:k,arrowRadius:M,arrowPosition:I,offset:$,transitionProps:V,multiline:Y,events:Q,zIndex:J,disabled:G,positionDependencies:K,onClick:P,onMouseEnter:L,onMouseLeave:z,inline:H,variant:O,keepMounted:U,vars:X,portalProps:ee,mod:Se,floatingStrategy:be,middlewares:xe,...qe}=se("Tooltip",YC,n),{dir:Me}=Zs(),tt=v.useRef(null),ke=F6({position:p2(Me,i),closeDelay:f,openDelay:u,onPositionChange:p,opened:m,defaultOpened:g,events:Q,arrowRef:tt,arrowOffset:k,offset:typeof $=="number"?$+(R?A/2:0):$,positionDependencies:[...K,r],inline:H,strategy:be,middlewares:xe}),vt=Ie({name:"Tooltip",props:n,classes:Bp,className:E,style:D,classNames:j,styles:C,unstyled:T,rootSelector:"tooltip",vars:X,varsResolver:H6});if(!Fa(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=$n(ke.reference,sp(r),t),Lt=O6(V,{duration:100,transition:"fade"}),gt=r.props;return o.jsxs(o.Fragment,{children:[o.jsx(Go,{...ee,withinPortal:y,children:o.jsx(da,{...Lt,keepMounted:U,mounted:!G&&!!ke.opened,duration:ke.isGroupPhase?10:Lt.duration,children:At=>o.jsxs(ce,{...qe,"data-fixed":be==="fixed"||void 0,variant:O,mod:[{multiline:Y},Se],...ke.getFloatingProps({ref:ke.floating,className:vt("tooltip").className,style:{...vt("tooltip").style,...At,zIndex:J,top:ke.y??0,left:ke.x??0}}),children:[c,o.jsx(Mx,{ref:tt,arrowX:ke.arrowX,arrowY:ke.arrowY,visible:R,position:ke.placement,arrowSize:A,arrowOffset:k,arrowRadius:M,arrowPosition:I,...vt("arrow")})]})})}),v.cloneElement(r,ke.getReferenceProps({onClick:P,onMouseEnter:L,onMouseLeave:z,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,className:Ut(E,gt.className),...gt,[s]:It}))]})});el.classes=Bp;el.displayName="@mantine/core/Tooltip";el.Floating=N0;el.Group=O0;function q6({size:e,thickness:t,sum:n,value:r,root:i,offset:s}){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:s||0}}function UD({size:e,value:t,offset:n,sum:r,thickness:i,root:s,color:c,lineRoundCaps:u,tooltip:f,getStyles:p,display:m,...g}){const y=Sn();return o.jsx(el.Floating,{disabled:!f,label:f,children:o.jsx(ce,{component:"circle",...g,...p("curve"),__vars:{"--curve-color":c?Ht(c,y):void 0},fill:"none",strokeLinecap:u?"round":"butt",...q6({sum:r,size:e,thickness:i,value:t,offset:n,root:s})})})}UD.displayName="@mantine/core/Curve";function G6({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:i}){const s=n.reduce((m,g)=>m+g.value,0),c=Math.PI*((e*.9-t*2)/2)*2;let u=c;const f=[],p=[];for(let m=0;m<n.length;m+=1)f.push({sum:s,offset:u,data:n[m],root:!1}),u-=n[m].value/100*c;if(f.push({sum:s,offset:u,data:{color:i},root:!0}),p.push({...f[f.length-1],lineRoundCaps:!1}),f.length>2){p.push({...f[0],lineRoundCaps:r}),p.push({...f[f.length-2],lineRoundCaps:r});for(let m=1;m<=f.length-3;m+=1)p.push({...f[m],lineRoundCaps:!1})}else p.push({...f[0],lineRoundCaps:r});return p}var BD={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function Q6(e,t){return Math.min(e||12,(t||120)/4)}const W6={size:120,thickness:12},Y6=(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}}),Vp=ve((e,t)=>{const n=se("RingProgress",W6,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,label:p,sections:m,size:g,thickness:y,roundCaps:b,rootColor:S,transitionDuration:j,...C}=n,T=Ie({name:"RingProgress",classes:BD,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:Y6}),D=Q6(y,g),E=G6({size:g,thickness:D,sections:m,renderRoundedLineCaps:b,rootColor:S}).map(({data:R,sum:A,root:k,lineRoundCaps:M,offset:I},$)=>v.createElement(UD,{...R,key:$,size:g,thickness:D,sum:A,offset:I,color:R==null?void 0:R.color,root:k,lineRoundCaps:M,getStyles:T}));return o.jsxs(ce,{...T("root"),size:g,ref:t,...C,children:[o.jsx("svg",{...T("svg"),children:E}),p&&o.jsx("div",{...T("label"),children:p})]})});Vp.classes=BD;Vp.displayName="@mantine/core/RingProgress";var VD={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const K6={withItemsBorders:!0},X6=(e,{radius:t,color:n,transitionDuration:r,size:i,transitionTimingFunction:s})=>({root:{"--sc-radius":t===void 0?void 0:Vt(t),"--sc-color":n?Ht(n,e):void 0,"--sc-shadow":n?void 0:"var(--mantine-shadow-xs)","--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":s,"--sc-padding":rt(i,"sc-padding"),"--sc-font-size":On(i)}}),Fp=ve((e,t)=>{var Me,tt;const n=se("SegmentedControl",K6,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,data:p,value:m,defaultValue:g,onChange:y,size:b,name:S,disabled:j,readOnly:C,fullWidth:T,orientation:D,radius:E,color:R,transitionDuration:A,transitionTimingFunction:k,variant:M,autoContrast:I,withItemsBorders:$,mod:V,...Y}=n,Q=Ie({name:"SegmentedControl",props:n,classes:VD,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:X6}),J=Sn(),G=p.map(ke=>typeof ke=="string"?{label:ke,value:ke}:ke),K=PN(),[P,L]=v.useState(Rh()),[z,H]=v.useState(null),[O,U]=v.useState({}),X=(ke,vt)=>{O[vt]=ke,U(O)},[ee,Se]=Yn({value:m,defaultValue:g,finalValue:Array.isArray(p)?((Me=G.find(ke=>!ke.disabled))==null?void 0:Me.value)??((tt=p[0])==null?void 0:tt.value)??null:null,onChange:y}),be=yr(S),xe=G.map(ke=>v.createElement(ce,{...Q("control"),mod:{active:ee===ke.value,orientation:D},key:ke.value},v.createElement("input",{...Q("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",...Q("label"),mod:{active:ee===ke.value&&!(j||ke.disabled),disabled:j||ke.disabled,"read-only":C},htmlFor:`${be}-${ke.value}`,ref:vt=>X(vt,ke.value),__vars:{"--sc-label-color":R!==void 0?Ga({color:R,theme:J,autoContrast:I}):void 0},key:`${ke.value}-label`},o.jsx("span",{...Q("innerLabel"),children:ke.label})))),qe=$n(t,ke=>H(ke));return AN(()=>{L(Rh())},[p.length]),p.length===0?null:o.jsxs(ce,{...Q("root"),variant:M,size:b,ref:qe,mod:[{"full-width":T,orientation:D,initialized:K,"with-items-borders":$},V],...Y,role:"radiogroup","data-disabled":j,children:[typeof ee=="string"&&o.jsx(Bx,{target:O[ee],parent:z,component:"span",transitionDuration:"var(--sc-transition-duration)",...Q("indicator")},P),xe]})});Fp.classes=VD;Fp.displayName="@mantine/core/SegmentedControl";function Z6({spacing:e,verticalSpacing:t,cols:n,selector:r}){var m;const i=Sn(),s=t===void 0?e:t,c=qo({"--sg-spacing-x":Nn(_i(e)),"--sg-spacing-y":Nn(_i(s)),"--sg-cols":(m=_i(n))==null?void 0:m.toString()}),u=sn(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 s=="object"&&s[y]!==void 0&&(g[y]["--sg-spacing-y"]=Nn(s[y])),typeof n=="object"&&n[y]!==void 0&&(g[y]["--sg-cols"]=n[y]),g),{}),p=Xu(sn(u),i.breakpoints).filter(g=>sn(u[g.value]).length>0).map(g=>({query:`(min-width: ${i.breakpoints[g.value]})`,styles:u[g.value]}));return o.jsx(Xs,{styles:c,media:p,selector:r})}function Bv(e){return typeof e=="object"&&e!==null?sn(e):[]}function J6(e){return e.sort((t,n)=>Ku(t)-Ku(n))}function ez({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...Bv(e),...Bv(t),...Bv(n)]));return J6(r)}function tz({spacing:e,verticalSpacing:t,cols:n,selector:r}){var p;const i=t===void 0?e:t,s=qo({"--sg-spacing-x":Nn(_i(e)),"--sg-spacing-y":Nn(_i(i)),"--sg-cols":(p=_i(n))==null?void 0:p.toString()}),c=ez({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 o.jsx(Xs,{styles:s,container:f,selector:r})}var FD={container:"m_925c2d2c",root:"m_2415a157"};const nz={cols:1,spacing:"md",type:"media"},M0=ve((e,t)=>{const n=se("SimpleGrid",nz,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,cols:p,verticalSpacing:m,spacing:g,type:y,...b}=n,S=Ie({name:"SimpleGrid",classes:FD,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f}),j=fd();return y==="container"?o.jsxs(o.Fragment,{children:[o.jsx(tz,{...n,selector:`.${j}`}),o.jsx("div",{...S("container"),children:o.jsx(ce,{ref:t,...S("root",{className:j}),...b})})]}):o.jsxs(o.Fragment,{children:[o.jsx(Z6,{...n,selector:`.${j}`}),o.jsx(ce,{ref:t,...S("root",{className:j}),...b})]})});M0.classes=FD;M0.displayName="@mantine/core/SimpleGrid";const rz={},Hp=ve((e,t)=>{const{w:n,h:r,miw:i,mih:s,...c}=se("Space",rz,e);return o.jsx(ce,{ref:t,...c,w:n,miw:i??n,h:r,mih:s??r})});Hp.displayName="@mantine/core/Space";var HD={root:"m_6d731127"};const iz={gap:"md",align:"stretch",justify:"flex-start"},az=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":Nn(t),"--stack-align":n,"--stack-justify":r}}),Ge=ve((e,t)=>{const n=se("Stack",iz,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,align:p,justify:m,gap:g,variant:y,...b}=n,S=Ie({name:"Stack",props:n,classes:HD,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:az});return o.jsx(ce,{ref:t,...S("root"),variant:y,...b})});Ge.classes=HD;Ge.displayName="@mantine/core/Stack";const[oz,sz]=vr("Stepper component was not found in tree"),Oh=()=>null;Oh.displayName="@mantine/core/StepperCompleted";var I0={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 ih=(e,t)=>typeof e=="function"?o.jsx(e,{step:t||0}):e,lz={withIcon:!0,allowStepClick:!0,iconPosition:"left"},L0=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,step:u,state:f,color:p,icon:m,completedIcon:g,progressIcon:y,label:b,description:S,withIcon:j,iconSize:C,loading:T,allowStepClick:D,allowStepSelect:E,iconPosition:R,orientation:A,mod:k,...M}=se("StepperStep",lz,e),I=sz(),$=Sn(),V={classNames:n,styles:s},Y=f==="stepCompleted"?null:f==="stepProgress"?y:m,Q={"data-progress":f==="stepProgress"||void 0,"data-completed":f==="stepCompleted"||void 0};return o.jsxs(tr,{...I.getStyles("step",{className:r,style:i,variant:I.orientation,...V}),mod:[{"icon-position":R||I.iconPosition,"allow-click":D},k],ref:t,...Q,...M,__vars:{"--step-color":p?Ht(p,$):void 0},tabIndex:D?0:-1,children:[j&&o.jsxs("span",{...I.getStyles("stepWrapper",V),children:[o.jsxs("span",{...I.getStyles("stepIcon",V),...Q,children:[o.jsx(da,{mounted:f==="stepCompleted",transition:"pop",duration:200,children:J=>o.jsx("span",{...I.getStyles("stepCompletedIcon",{style:J,...V}),children:T?o.jsx(_r,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...I.getStyles("stepLoader",V)}):ih(g,u)||o.jsx(wp,{size:"60%"})})}),f!=="stepCompleted"?T?o.jsx(_r,{...I.getStyles("stepLoader",V),size:"calc(var(--stepper-icon-size) / 2)",color:p}):ih(Y||m,u):null]}),A==="vertical"&&o.jsx("span",{...I.getStyles("verticalSeparator",V),"data-active":f==="stepCompleted"||void 0})]}),(b||S)&&o.jsxs("span",{...I.getStyles("stepBody",V),"data-orientation":I.orientation,"data-icon-position":R||I.iconPosition,children:[b&&o.jsx("span",{...I.getStyles("stepLabel",V),children:ih(b,u)}),S&&o.jsx("span",{...I.getStyles("stepDescription",V),children:ih(S,u)})]})]})});L0.classes=I0;L0.displayName="@mantine/core/StepperStep";const cz={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},uz=(e,{color:t,iconSize:n,size:r,contentPadding:i,radius:s,autoContrast:c})=>({root:{"--stepper-color":t?Ht(t,e):void 0,"--stepper-icon-color":Ks(c,e)?Ga({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":s===void 0?void 0:Vt(s),"--stepper-fz":On(r),"--stepper-spacing":Nn(r)}}),mc=ve((e,t)=>{var z,H,O;const n=se("Stepper",cz,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,children:p,onStepClick:m,active:g,icon:y,completedIcon:b,progressIcon:S,color:j,iconSize:C,contentPadding:T,orientation:D,iconPosition:E,size:R,radius:A,allowNextStepsSelect:k,wrap:M,autoContrast:I,...$}=n,V=Ie({name:"Stepper",classes:I0,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:uz}),Y=v.Children.toArray(p),Q=Y.filter(U=>U.type!==Oh),J=Y.find(U=>U.type===Oh),G=Q.reduce((U,X,ee)=>{const Se=g===ee?"stepProgress":g>ee?"stepCompleted":"stepInactive",xe=typeof m!="function"?!1:typeof X.props.allowStepSelect=="boolean"?X.props.allowStepSelect:Se==="stepCompleted"||k;return U.push(v.cloneElement(X,{icon:X.props.icon||y||ee+1,key:ee,step:ee,state:Se,onClick:()=>xe&&(m==null?void 0:m(ee)),allowStepClick:xe,completedIcon:X.props.completedIcon||b,progressIcon:X.props.progressIcon||S,color:X.props.color||j,iconSize:C,iconPosition:X.props.iconPosition||E,orientation:D})),D==="horizontal"&&ee!==Q.length-1&&U.push(v.createElement("div",{...V("separator"),"data-active":ee<g||void 0,"data-orientation":D,key:`separator-${ee}`})),U},[]),K=(H=(z=Q[g])==null?void 0:z.props)==null?void 0:H.children,P=(O=J==null?void 0:J.props)==null?void 0:O.children,L=g>Q.length-1?P:K;return o.jsx(oz,{value:{getStyles:V,orientation:D,iconPosition:E},children:o.jsxs(ce,{...V("root"),ref:t,size:R,...$,children:[o.jsx(ce,{...V("steps"),mod:{orientation:D,"icon-position":E,wrap:M&&D!=="vertical"},children:G}),L&&o.jsx("div",{...V("content"),children:L})]})})});mc.classes=I0;mc.displayName="@mantine/core/Stepper";mc.Completed=Oh;mc.Step=L0;const qD=v.createContext(null),dz=qD.Provider,fz=()=>v.useContext(qD),hz={},z0=ve((e,t)=>{const{value:n,defaultValue:r,onChange:i,size:s,wrapperProps:c,children:u,readOnly:f,...p}=se("SwitchGroup",hz,e),[m,g]=Yn({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 o.jsx(dz,{value:{value:m,onChange:y,size:s},children:o.jsx(mn.Wrapper,{size:s,ref:t,...c,...p,labelElement:"div",__staticSelector:"SwitchGroup",children:o.jsx(i0,{role:"group",children:u})})})});z0.classes=mn.Wrapper.classes;z0.displayName="@mantine/core/SwitchGroup";var GD={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const pz={labelPosition:"right"},mz=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:Vt(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?Ht(n,e):void 0}}),jd=ve((e,t)=>{const n=se("Switch",pz,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,color:p,label:m,offLabel:g,onLabel:y,id:b,size:S,radius:j,wrapperProps:C,thumbIcon:T,checked:D,defaultChecked:E,onChange:R,labelPosition:A,description:k,error:M,disabled:I,variant:$,rootRef:V,mod:Y,...Q}=n,J=fz(),G=S||(J==null?void 0:J.size),K=Ie({name:"Switch",props:n,classes:GD,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:mz}),{styleProps:P,rest:L}=Qa(Q),z=yr(b),H=J?{checked:J.value.includes(L.value),onChange:J.onChange}:{},[O,U]=Yn({value:H.checked??D,defaultValue:E,finalValue:!1});return o.jsxs(Sp,{...K("root"),__staticSelector:"Switch",__stylesApiProps:n,id:z,size:G,labelPosition:A,label:m,description:k,error:M,disabled:I,bodyElement:"label",labelElement:"span",classNames:r,styles:c,unstyled:u,"data-checked":H.checked||D||void 0,variant:$,ref:V,mod:Y,...P,...C,children:[o.jsx("input",{...L,disabled:I,checked:O,"data-checked":H.checked||D||void 0,onChange:X=>{var ee;J?(ee=H.onChange)==null||ee.call(H,X):R==null||R(X),U(X.currentTarget.checked)},id:z,ref:t,type:"checkbox",role:"switch",...K("input")}),o.jsxs(ce,{"aria-hidden":"true",component:"span",mod:{error:M,"label-position":A,"without-labels":!y&&!g},...K("track"),children:[o.jsx(ce,{component:"span",mod:"reduce-motion",...K("thumb"),children:T}),o.jsx("span",{...K("trackLabel"),children:O?y:g})]})]})});jd.classes={...GD,...X2};jd.displayName="@mantine/core/Switch";jd.Group=z0;const[gz,vz]=vr("Table component was not found in the tree");var Cd={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 yz(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 tl(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=ve((i,s)=>{const c=se(n,{},i),{classNames:u,className:f,style:p,styles:m,...g}=c,y=vz();return o.jsx(ce,{component:e,ref:s,...yz(y,t),...y.getStyles(e,{className:f,classNames:u,style:p,styles:m,props:c}),...g})});return r.displayName=`@mantine/core/${n}`,r.classes=Cd,r}const Py=tl("th",{columnBorder:!0}),QD=tl("td",{columnBorder:!0}),yh=tl("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),WD=tl("thead",{stickyHeader:!0}),YD=tl("tbody"),KD=tl("tfoot"),XD=tl("caption",{captionSide:!0});function $0({data:e}){return o.jsxs(o.Fragment,{children:[e.caption&&o.jsx(XD,{children:e.caption}),e.head&&o.jsx(WD,{children:o.jsx(yh,{children:e.head.map((t,n)=>o.jsx(Py,{children:t},n))})}),e.body&&o.jsx(YD,{children:e.body.map((t,n)=>o.jsx(yh,{children:t.map((r,i)=>o.jsx(QD,{children:r},i))},n))}),e.foot&&o.jsx(KD,{children:o.jsx(yh,{children:e.foot.map((t,n)=>o.jsx(Py,{children:t},n))})})]})}$0.displayName="@mantine/core/TableDataRenderer";const xz={type:"scrollarea"},bz=(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}}),U0=ve((e,t)=>{const n=se("TableScrollContainer",xz,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,children:p,minWidth:m,maxHeight:g,type:y,scrollAreaProps:b,...S}=n,j=Ie({name:"TableScrollContainer",classes:Cd,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:bz,rootSelector:"scrollContainer"});return o.jsx(ce,{component:y==="scrollarea"?Yr:"div",...y==="scrollarea"?g?{offsetScrollbars:"xy",...b}:{offsetScrollbars:"x",...b}:{},ref:t,...j("scrollContainer"),...S,children:o.jsx("div",{...j("scrollContainerInner"),children:p})})});U0.classes=Cd;U0.displayName="@mantine/core/TableScrollContainer";const Sz={withRowBorders:!0,verticalSpacing:7},wz=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:i,borderColor:s,stripedColor:c,highlightOnHoverColor:u,striped:f,highlightOnHover:p,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":s?Ht(s,e):void 0,"--table-striped-color":f&&c?Ht(c,e):void 0,"--table-highlight-on-hover-color":p&&u?Ht(u,e):void 0,"--table-sticky-header-offset":g?le(m):void 0}}),ye=ve((e,t)=>{const n=se("Table",Sz,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,horizontalSpacing:p,verticalSpacing:m,captionSide:g,stripedColor:y,highlightOnHoverColor:b,striped:S,highlightOnHover:j,withColumnBorders:C,withRowBorders:T,withTableBorder:D,borderColor:E,layout:R,variant:A,data:k,children:M,stickyHeader:I,stickyHeaderOffset:$,mod:V,tabularNums:Y,...Q}=n,J=Ie({name:"Table",props:n,className:i,style:s,classes:Cd,classNames:r,styles:c,unstyled:u,rootSelector:"table",vars:f,varsResolver:wz});return o.jsx(gz,{value:{getStyles:J,stickyHeader:I,striped:S===!0?"odd":S||void 0,highlightOnHover:j,withColumnBorders:C,withRowBorders:T,captionSide:g||"bottom"},children:o.jsx(ce,{component:"table",variant:A,ref:t,mod:[{"data-with-table-border":D,"data-tabular-nums":Y},V],...J("table"),...Q,children:M||!!k&&o.jsx($0,{data:k})})})});ye.classes=Cd;ye.displayName="@mantine/core/Table";ye.Td=QD;ye.Th=Py;ye.Tr=yh;ye.Thead=WD;ye.Tbody=YD;ye.Tfoot=KD;ye.Caption=XD;ye.ScrollContainer=U0;ye.DataRenderer=$0;const[jz,B0]=vr("Tabs component was not found in the tree");var Ed={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 Cz={},V0=ve((e,t)=>{const n=se("TabsList",Cz,e),{children:r,className:i,grow:s,justify:c,classNames:u,styles:f,style:p,mod:m,...g}=n,y=B0();return o.jsx(ce,{...g,...y.getStyles("list",{className:i,style:p,classNames:u,styles:f,props:n,variant:y.variant}),ref:t,role:"tablist",variant:y.variant,mod:[{grow:s,orientation:y.orientation,placement:y.orientation==="vertical"&&y.placement,inverted:y.inverted},m],"aria-orientation":y.orientation,__vars:{"--tabs-justify":c},children:r})});V0.classes=Ed;V0.displayName="@mantine/core/TabsList";const Ez={},F0=ve((e,t)=>{const n=se("TabsPanel",Ez,e),{children:r,className:i,value:s,classNames:c,styles:u,style:f,mod:p,keepMounted:m,...g}=n,y=B0(),b=y.value===s,S=y.keepMounted||m||b?r:null;return o.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},p],role:"tabpanel",id:y.getPanelId(s),"aria-labelledby":y.getTabId(s),children:S})});F0.classes=Ed;F0.displayName="@mantine/core/TabsPanel";const Tz={},H0=ve((e,t)=>{const n=se("TabsTab",Tz,e),{className:r,children:i,rightSection:s,leftSection:c,value:u,onClick:f,onKeyDown:p,disabled:m,color:g,style:y,classNames:b,styles:S,vars:j,mod:C,tabIndex:T,...D}=n,E=Sn(),{dir:R}=Zs(),A=B0(),k=u===A.value,M=$=>{A.onChange(A.allowTabDeactivation&&u===A.value?null:u),f==null||f($)},I={classNames:b,styles:S,props:n};return o.jsxs(tr,{...D,...A.getStyles("tab",{className:r,style:y,variant:A.variant,...I}),disabled:m,unstyled:A.unstyled,variant:A.variant,mod:[{active:k,disabled:m,orientation:A.orientation,inverted:A.inverted,placement:A.orientation==="vertical"&&A.placement},C],ref:t,role:"tab",id:A.getTabId(u),"aria-selected":k,tabIndex:T!==void 0?T:k||A.value===null?0:-1,"aria-controls":A.getPanelId(u),onClick:M,__vars:{"--tabs-color":g?Ht(g,E):void 0},onKeyDown:fR({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:A.activateTabWithKeyboard,loop:A.loop,orientation:A.orientation||"horizontal",dir:R,onKeyDown:p}),children:[c&&o.jsx("span",{...A.getStyles("tabSection",I),"data-position":"left",children:c}),i&&o.jsx("span",{...A.getStyles("tabLabel",I),children:i}),s&&o.jsx("span",{...A.getStyles("tabSection",I),"data-position":"right",children:s})]})});H0.classes=Ed;H0.displayName="@mantine/core/TabsTab";const KC="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",Rz={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},Dz=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":Vt(t),"--tabs-color":Ht(n,e),"--tabs-text-color":Ks(r,e)?Ga({color:n,theme:e,autoContrast:r}):void 0}}),Et=ve((e,t)=>{const n=se("Tabs",Rz,e),{defaultValue:r,value:i,onChange:s,orientation:c,children:u,loop:f,id:p,activateTabWithKeyboard:m,allowTabDeactivation:g,variant:y,color:b,radius:S,inverted:j,placement:C,keepMounted:T,classNames:D,styles:E,unstyled:R,className:A,style:k,vars:M,autoContrast:I,mod:$,...V}=n,Y=yr(p),[Q,J]=Yn({value:i,defaultValue:r,finalValue:null,onChange:s}),G=Ie({name:"Tabs",props:n,classes:Ed,className:A,style:k,classNames:D,styles:E,unstyled:R,vars:M,varsResolver:Dz});return o.jsx(jz,{value:{placement:C,value:Q,orientation:c,id:Y,loop:f,activateTabWithKeyboard:m,getTabId:Hj(`${Y}-tab`,KC),getPanelId:Hj(`${Y}-panel`,KC),onChange:J,allowTabDeactivation:g,variant:y,color:b,radius:S,inverted:j,keepMounted:T,unstyled:R,getStyles:G},children:o.jsx(ce,{ref:t,id:Y,variant:y,mod:[{orientation:c,inverted:c==="horizontal"&&j,placement:c==="vertical"&&C},$],...G("root"),...V,children:u})})});Et.classes=Ed;Et.displayName="@mantine/core/Tabs";Et.Tab=H0;Et.Panel=F0;Et.List=V0;const Az={},ze=ve((e,t)=>{const n=se("TextInput",Az,e);return o.jsx(Pr,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});ze.classes=Pr.classes;ze.displayName="@mantine/core/TextInput";var ZD={root:"m_7341320d"};const _z={},kz=(e,{size:t,radius:n,variant:r,gradient:i,color:s,autoContrast:c})=>{const u=e.variantColorResolver({color:s||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:Vt(n),"--ti-bg":s||r?u.background:void 0,"--ti-color":s||r?u.color:void 0,"--ti-bd":s||r?u.border:void 0}}},q0=ve((e,t)=>{const n=se("ThemeIcon",_z,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,autoContrast:p,...m}=n,g=Ie({name:"ThemeIcon",classes:ZD,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:kz});return o.jsx(ce,{ref:t,...g("root"),...m})});q0.classes=ZD;q0.displayName="@mantine/core/ThemeIcon";const Pz=["h1","h2","h3","h4","h5","h6"],Nz=["xs","sm","md","lg","xl"];function Oz(e,t){const n=t!==void 0?t:`h${e}`;return Pz.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:Nz.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 JD={root:"m_8a5d1357"};const Mz={order:1},Iz=(e,{order:t,size:n,lineClamp:r,textWrap:i})=>{const s=Oz(t,n);return{root:{"--title-fw":s.fontWeight,"--title-lh":s.lineHeight,"--title-fz":s.fontSize,"--title-line-clamp":typeof r=="number"?r.toString():void 0,"--title-text-wrap":i}}},Le=ve((e,t)=>{const n=se("Title",Mz,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,order:f,vars:p,size:m,variant:g,lineClamp:y,textWrap:b,mod:S,...j}=n,C=Ie({name:"Title",props:n,classes:JD,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:p,varsResolver:Iz});return[1,2,3,4,5,6].includes(f)?o.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});Le.classes=JD;Le.displayName="@mantine/core/Title";function Lz(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(s=>s(t))},initialize(i){n||(t=i,n=!0)},subscribe(i){return r.add(i),()=>r.delete(i)}}}function zz(e){return v.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function $z(e,t,n){const r=[],i=[],s={};for(const c of e){const u=c.position||t;s[u]=s[u]||0,s[u]+=1,s[u]<=n?i.push(c):r.push(c)}return{notifications:i,queue:r}}const Uz=()=>Lz({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),nl=Uz(),Bz=(e=nl)=>zz(e);function kc(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]),i=$z(r,n.defaultPosition,n.limit);e.setState({notifications:i.notifications,queue:i.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function Oe(e,t=nl){const n=e.id||Rh();return kc(t,r=>e.id&&r.some(i=>i.id===e.id)?r:[...r,{...e,id:n}]),n}function eA(e,t=nl){return kc(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=nl){return kc(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function Vz(e=nl){kc(e,()=>[])}function Fz(e=nl){kc(e,t=>t.slice(0,e.getState().limit))}const di={show:Oe,hide:eA,update:As,clean:Vz,cleanQueue:Fz,updateState:kc};function Ny(e,t){return Ny=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Ny(e,t)}function tA(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ny(e,t)}var Vv={exports:{}},Fv,XC;function Hz(){if(XC)return Fv;XC=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Fv=e,Fv}var Hv,ZC;function qz(){if(ZC)return Hv;ZC=1;var e=Hz();function t(){}function n(){}return n.resetWarningCache=t,Hv=function(){function r(c,u,f,p,m,g){if(g!==e){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}}r.isRequired=r;function i(){return r}var s={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 s.PropTypes=s,s},Hv}var JC;function Gz(){return JC||(JC=1,Vv.exports=qz()()),Vv.exports}var Qz=Gz();const an=sx(Qz),eE={disabled:!1},Mh=En.createContext(null);var Wz=function(t){return t.scrollTop},qu="unmounted",ws="exited",js="entering",ec="entered",Oy="exiting",Xa=function(e){tA(t,e);function t(r,i){var s;s=e.call(this,r,i)||this;var c=i,u=c&&!c.isMounting?r.enter:r.appear,f;return s.appearStatus=null,r.in?u?(f=ws,s.appearStatus=js):f=ec:r.unmountOnExit||r.mountOnEnter?f=qu:f=ws,s.state={status:f},s.nextCallback=null,s}t.getDerivedStateFromProps=function(i,s){var c=i.in;return c&&s.status===qu?{status:ws}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var s=null;if(i!==this.props){var c=this.state.status;this.props.in?c!==js&&c!==ec&&(s=js):(c===js||c===ec)&&(s=Oy)}this.updateStatus(!1,s)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,s,c,u;return s=c=u=i,i!=null&&typeof i!="number"&&(s=i.exit,c=i.enter,u=i.appear!==void 0?i.appear:c),{exit:s,enter:c,appear:u}},n.updateStatus=function(i,s){if(i===void 0&&(i=!1),s!==null)if(this.cancelNextCallback(),s===js){if(this.props.unmountOnExit||this.props.mountOnEnter){var c=this.props.nodeRef?this.props.nodeRef.current:Hu.findDOMNode(this);c&&Wz(c)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ws&&this.setState({status:qu})},n.performEnter=function(i){var s=this,c=this.props.enter,u=this.context?this.context.isMounting:i,f=this.props.nodeRef?[u]:[Hu.findDOMNode(this),u],p=f[0],m=f[1],g=this.getTimeouts(),y=u?g.appear:g.enter;if(!i&&!c||eE.disabled){this.safeSetState({status:ec},function(){s.props.onEntered(p)});return}this.props.onEnter(p,m),this.safeSetState({status:js},function(){s.props.onEntering(p,m),s.onTransitionEnd(y,function(){s.safeSetState({status:ec},function(){s.props.onEntered(p,m)})})})},n.performExit=function(){var i=this,s=this.props.exit,c=this.getTimeouts(),u=this.props.nodeRef?void 0:Hu.findDOMNode(this);if(!s||eE.disabled){this.safeSetState({status:ws},function(){i.props.onExited(u)});return}this.props.onExit(u),this.safeSetState({status:Oy},function(){i.props.onExiting(u),i.onTransitionEnd(c.exit,function(){i.safeSetState({status:ws},function(){i.props.onExited(u)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,s){s=this.setNextCallback(s),this.setState(i,s)},n.setNextCallback=function(i){var s=this,c=!0;return this.nextCallback=function(u){c&&(c=!1,s.nextCallback=null,i(u))},this.nextCallback.cancel=function(){c=!1},this.nextCallback},n.onTransitionEnd=function(i,s){this.setNextCallback(s);var c=this.props.nodeRef?this.props.nodeRef.current:Hu.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],p=f[0],m=f[1];this.props.addEndListener(p,m)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===qu)return null;var s=this.props,c=s.children;s.in,s.mountOnEnter,s.unmountOnExit,s.appear,s.enter,s.exit,s.timeout,s.addEndListener,s.onEnter,s.onEntering,s.onEntered,s.onExit,s.onExiting,s.onExited,s.nodeRef;var u=m0(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return En.createElement(Mh.Provider,{value:null},typeof c=="function"?c(i,u):En.cloneElement(En.Children.only(c),u))},t}(En.Component);Xa.contextType=Mh;Xa.propTypes={};function Ql(){}Xa.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ql,onEntering:Ql,onEntered:Ql,onExit:Ql,onExiting:Ql,onExited:Ql};Xa.UNMOUNTED=qu;Xa.EXITED=ws;Xa.ENTERING=js;Xa.ENTERED=ec;Xa.EXITING=Oy;function Yz(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G0(e,t){var n=function(s){return t&&v.isValidElement(s)?t(s):s},r=Object.create(null);return e&&v.Children.map(e,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function Kz(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 s in e)s in t?i.length&&(r[s]=i,i=[]):i.push(s);var c,u={};for(var f in t){if(r[f])for(c=0;c<r[f].length;c++){var p=r[f][c];u[r[f][c]]=n(p)}u[f]=n(f)}for(c=0;c<i.length;c++)u[i[c]]=n(i[c]);return u}function _s(e,t,n){return n[t]!=null?n[t]:e.props[t]}function Xz(e,t){return G0(e.children,function(n){return v.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:_s(n,"appear",e),enter:_s(n,"enter",e),exit:_s(n,"exit",e)})})}function Zz(e,t,n){var r=G0(e.children),i=Kz(t,r);return Object.keys(i).forEach(function(s){var c=i[s];if(v.isValidElement(c)){var u=s in t,f=s in r,p=t[s],m=v.isValidElement(p)&&!p.props.in;f&&(!u||m)?i[s]=v.cloneElement(c,{onExited:n.bind(null,c),in:!0,exit:_s(c,"exit",e),enter:_s(c,"enter",e)}):!f&&u&&!m?i[s]=v.cloneElement(c,{in:!1}):f&&u&&v.isValidElement(p)&&(i[s]=v.cloneElement(c,{onExited:n.bind(null,c),in:p.props.in,exit:_s(c,"exit",e),enter:_s(c,"enter",e)}))}}),i}var Jz=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},e8={component:"div",childFactory:function(t){return t}},Oo=function(e){tA(t,e);function t(r,i){var s;s=e.call(this,r,i)||this;var c=s.handleExited.bind(Yz(s));return s.state={contextValue:{isMounting:!0},handleExited:c,firstRender:!0},s}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(i,s){var c=s.children,u=s.handleExited,f=s.firstRender;return{children:f?Xz(i,u):Zz(i,c,u),firstRender:!1}},n.handleExited=function(i,s){var c=G0(this.props.children);i.key in c||(i.props.onExited&&i.props.onExited(s),this.mounted&&this.setState(function(u){var f=Nh({},u.children);return delete f[i.key],{children:f}}))},n.render=function(){var i=this.props,s=i.component,c=i.childFactory,u=m0(i,["component","childFactory"]),f=this.state.contextValue,p=Jz(this.state.children).map(c);return delete u.appear,delete u.enter,delete u.exit,s===null?En.createElement(Mh.Provider,{value:f},p):En.createElement(Mh.Provider,{value:f},En.createElement(s,u,p))},t}(En.Component);Oo.propTypes={};Oo.defaultProps=e8;const nA=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function t8(e,t){return e.reduce((n,r)=>(n[r.position||t].push(r),n),nA.reduce((n,r)=>(n[r]=[],n),{}))}const tE={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},n8={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function r8({state:e,maxHeight:t,position:n,transitionDuration:r}){const[i,s]=n.split("-"),c=s==="center"?`${i}-center`:s,u={opacity:0,maxHeight:t,transform:tE[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:n8[c]},p={opacity:0,maxHeight:0,transform:tE[c]};return{...u,...{entering:f,entered:f,exiting:p,exited:p}[e]}}function i8(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const rA=v.forwardRef(({data:e,onHide:t,autoClose:n,...r},i)=>{const{autoClose:s,message:c,...u}=e,f=i8(n,e.autoClose),p=v.useRef(-1),m=()=>window.clearTimeout(p.current),g=()=>{t(e.id),m()},y=()=>{typeof f=="number"&&(p.current=window.setTimeout(g,f))};return v.useEffect(()=>{var b;(b=e.onOpen)==null||b.call(e,e)},[]),v.useEffect(()=>(y(),m),[f]),o.jsx(R0,{...r,...u,onClose:g,ref:i,onMouseEnter:m,onMouseLeave:y,children:c})});rA.displayName="@mantine/notifications/NotificationContainer";var iA={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const a8=Xa,o8={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:Wr("overlay"),store:nl,withinPortal:!0},s8=(e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t==null?void 0:t.toString(),"--notifications-container-width":le(n)}}),Za=ve((e,t)=>{const n=se("Notifications",o8,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,position:p,autoClose:m,transitionDuration:g,containerWidth:y,notificationMaxHeight:b,limit:S,zIndex:j,store:C,portalProps:T,withinPortal:D,...E}=n,R=Sn(),A=Bz(C),k=wN(),M=fx(),I=v.useRef({}),$=v.useRef(0),Y=(R.respectReducedMotion?M:!1)?1:g,Q=Ie({name:"Notifications",classes:iA,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:s8});v.useEffect(()=>{C==null||C.updateState(K=>({...K,limit:S||5,defaultPosition:p}))},[S,p]),za(()=>{A.notifications.length>$.current&&setTimeout(()=>k(),0),$.current=A.notifications.length},[A.notifications]);const J=t8(A.notifications,p),G=nA.reduce((K,P)=>(K[P]=J[P].map(({style:L,...z})=>o.jsx(a8,{timeout:Y,onEnter:()=>I.current[z.id].offsetHeight,nodeRef:{current:I.current[z.id]},children:H=>o.jsx(rA,{ref:O=>{I.current[z.id]=O},data:z,onHide:O=>eA(O,C),autoClose:m,...Q("notification",{style:{...r8({state:H,position:P,transitionDuration:Y,maxHeight:b}),...L}})})},z.id)),K),{});return o.jsxs(Go,{withinPortal:D,...T,children:[o.jsx(ce,{...Q("root"),"data-position":"top-center",ref:t,...E,children:o.jsx(Oo,{children:G["top-center"]})}),o.jsx(ce,{...Q("root"),"data-position":"top-left",...E,children:o.jsx(Oo,{children:G["top-left"]})}),o.jsx(ce,{...Q("root",{className:lc.classNames.fullWidth}),"data-position":"top-right",...E,children:o.jsx(Oo,{children:G["top-right"]})}),o.jsx(ce,{...Q("root",{className:lc.classNames.fullWidth}),"data-position":"bottom-right",...E,children:o.jsx(Oo,{children:G["bottom-right"]})}),o.jsx(ce,{...Q("root"),"data-position":"bottom-left",...E,children:o.jsx(Oo,{children:G["bottom-left"]})}),o.jsx(ce,{...Q("root"),"data-position":"bottom-center",...E,children:o.jsx(Oo,{children:G["bottom-center"]})})]})});Za.classes=iA;Za.displayName="@mantine/notifications/Notifications";Za.show=di.show;Za.hide=di.hide;Za.update=di.update;Za.clean=di.clean;Za.cleanQueue=di.cleanQueue;Za.updateState=di.updateState;class l8{constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class Td{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`(${this.left.toString()} ${this.operator} ${this.right.toString()})`}}class c8{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,s){const c=i.consumeAndParse(n);return r(s,c)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(i,s,c){const u=i.consumeAndParse(n);return r(s,c,u)},precedence:n})}construct(t){return new u8(t,this.prefixParselets,this.infixParselets)}}class u8{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 s=this.consume();i=this.getInfixParselet(s).parse(this,i,s)}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 s=this.peek();throw Error(`Expected ${t} but got "${s.id}" (${s.value}) at line ${s.line} column ${s.column}.`)}if(n&&((i=this.peek())==null?void 0:i.value)!==n){const s=this.peek();throw Error(`Expected "${n}" but got "${s.value}" at line ${s.line} column ${s.column}.`)}return this.tokens.shift()}peek(){return this.tokens.length>0?this.tokens[0]:void 0}removeComments(){this.tokens=this.tokens.filter(t=>t.id!=="Comment")}getInfixParselet(t){return this.infixParselets[t.id==="Symbol"?t.value:t.id]}}class aA{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 Rd="http://hl7.org",oA="ok",d8="created",f8="gone",h8="not-modified",p8="not-found",m8="unauthorized",g8="forbidden",v8="accepted",y8={resourceType:"OperationOutcome",id:oA,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},x8={resourceType:"OperationOutcome",id:p8,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},id={resourceType:"OperationOutcome",id:m8,issue:[{severity:"error",code:"login",details:{text:"Unauthorized"}}]},b8={...id,issue:[...id.issue,{severity:"error",code:"expired",details:{text:"Token expired"}}]},nE={...id,issue:[...id.issue,{severity:"error",code:"invalid",details:{text:"Token not issued for this audience"}}]},Q0={resourceType:"OperationOutcome",id:g8,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 S8(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function w8(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 qp(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function sA(e){return e.id===oA||e.id===d8||e.id===h8||e.id===v8}function j8(e){return e.id===f8}class dt extends Error{constructor(t,n){super(lA(t)),this.outcome=t,this.cause=n}}function Zt(e){return e instanceof dt?e.outcome:qp(e)?e:ra(Ye(e))}function Ye(e){return e?typeof e=="string"?e:w8(e)?e.message:qp(e)?lA(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function lA(e){var n;const t=((n=e.issue)==null?void 0:n.map(cA))??[];return t.length>0?t.join("; "):"Unknown error"}function cA(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 C8(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 E8(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,s])=>[i,C8(i,s)])),constraints:[],innerTypes:[]};return t}const T8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},R8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},D8={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"}]}}},A8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},_8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},"author[x]":{type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Organization"]},{code:"string"}]},time:{type:[{code:"dateTime"}]},text:{min:1,type:[{code:"markdown"}]}}},k8={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"}]}}},P8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},N8={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"}]}}},O8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},M8={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"}]}}},I8={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"}]}}},L8={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"}]}}},z8={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"}]}}},$8={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"}]}}},U8={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"}]}}},B8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},direction:{min:1,type:[{code:"code"}]}}},V8={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"}]}}},F8={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"]}]}}},H8={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"]}]}}},q8={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"}]}}},G8={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"}]}}},Q8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},path:{min:1,type:[{code:"string"}]}}},W8={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"}]}}},Y8={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"}]}}},K8={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"}]}}},X8={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"}]}}},Z8={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"]}]}}},J8={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"]}]}}},e$={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"}]}}},t$={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"}]}}},n$={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"}]}}},r$={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"}]}}},i$={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"]}]}}},a$={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"}]}}},o$={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"}]}}},s$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},l$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},c$={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"]}]}}},u$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},d$={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"}]}}},f$={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"}]}}},h$={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"}]}}},p$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},m$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},low:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},high:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},g$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},v$={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"}]}}},y$={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"]}]}}},x$={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"}]}}},b$={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"}]}}},S$={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"}]}}},w$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},lowLimit:{type:[{code:"Quantity"}]},highLimit:{type:[{code:"Quantity"}]}}},j$={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"}]}}},C$={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"}]}}},E$={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"}]}}},T$={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"]}]}}},R$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},D$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{max:0,type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},A$={elements:{authorizeUrl:{min:1,type:[{code:"string"}]},tokenUrl:{min:1,type:[{code:"string"}]},tokenAuthMethod:{type:[{code:"code"}]},userInfoUrl:{min:1,type:[{code:"string"}]},clientId:{min:1,type:[{code:"string"}]},clientSecret:{min:1,type:[{code:"string"}]},usePkce:{type:[{code:"boolean"}]},useSubject:{type:[{code:"boolean"}]}}},_$={Element:T8,BackboneElement:R8,Address:D8,Age:A8,Annotation:_8,Attachment:k8,CodeableConcept:P8,Coding:N8,ContactDetail:O8,ContactPoint:M8,Contributor:I8,Count:L8,DataRequirement:z8,DataRequirementCodeFilter:$8,DataRequirementDateFilter:U8,DataRequirementSort:B8,Distance:V8,Dosage:F8,DosageDoseAndRate:H8,Duration:q8,ElementDefinition:G8,ElementDefinitionSlicingDiscriminator:Q8,ElementDefinitionSlicing:W8,ElementDefinitionBase:Y8,ElementDefinitionType:K8,ElementDefinitionExample:X8,ElementDefinitionConstraint:Z8,ElementDefinitionBinding:J8,ElementDefinitionMapping:e$,Expression:t$,Extension:n$,HumanName:r$,Identifier:i$,MarketingStatus:a$,Meta:o$,Money:s$,Narrative:l$,ParameterDefinition:c$,Period:u$,Population:d$,ProdCharacteristic:f$,ProductShelfLife:h$,Quantity:p$,Range:m$,Ratio:g$,Reference:v$,RelatedArtifact:y$,SampledData:x$,Signature:b$,SubstanceAmount:S$,SubstanceAmountReferenceRange:w$,Timing:j$,TimingRepeat:C$,TriggerDefinition:E$,UsageContext:T$,MoneyQuantity:R$,SimpleQuantity:D$,IdentityProvider:A$};function k$(e){return new N$(e).parse()}const Ih=E8(_$),W0=Object.create(null),rE=Object.create(null),P$={"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 uA(e){let t;return t=rE[e],t||(t=rE[e]=Object.create(null)),t}function iE(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)dA(i)}function dA(e){var s,c;if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=k$(e),n=P$[e.url];let r,i;n?(r=Ih,i=n):e.url===`http://hl7.org/fhir/StructureDefinition/${e.type}`||e.url===`https://medplum.com/fhir/StructureDefinition/${e.type}`||(s=e.type)!=null&&s.startsWith("http://")||(c=e.type)!=null&&c.startsWith("https://")?(r=Ih,i=e.type):(r=uA(e.url),i=e.type),r[i]=t;for(const u of t.innerTypes)u.parentType=t,r[u.name]=u;W0[e.url]=t}function fA(e){return!!Ih[e]}function Gp(e,t){if(t){const n=uA(t)[e];if(n)return n}return Ih[e]}function hA(e,t){const n=Gp(e,t);if(!n)throw new dt(ra("Unknown data type: "+e));return n}function Y0(e){return!!W0[e]}function Pc(e){return W0[e]}class N${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:I$(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){var n,r,i,s,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=qv(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[qv(t,f.path)]=u;break}f=f.parent}if(!f){const p=qv(t,this.root.path);t.isSummary&&((s=this.resourceSchema.summaryProperties)==null||s.add(p.replace("[x]",""))),u.min>0&&((c=this.resourceSchema.mandatoryProperties)==null||c.add(p.replace("[x]",""))),this.resourceSchema.elements[p]=u}this.checkFieldExit(t)}t=this.next()}return this.checkFieldExit(),this.innerTypes.length>0&&(this.resourceSchema.innerTypes=this.innerTypes),this.resourceSchema}checkFieldEnter(t,n){this.isInnerType(t)&&this.enterInnerType(t),this.slicingContext&&!Wl(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,s;for(;this.backboneContext&&!Wl((r=this.backboneContext)==null?void 0:r.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;const n=hE(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:Wl((i=this.backboneContext)==null?void 0:i.path,t.path)?this.backboneContext:(s=this.backboneContext)==null?void 0:s.parent}}enterSlice(t,n){var r,i,s,c;M$(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:((s=t.slicing)==null?void 0:s.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&&!Wl(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&&!Wl(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,s,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:((s=t.base)==null?void 0:s.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!!(Wl(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=hE(t)),r||(r=(i=Ja(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 s,c;const n=aE(t.max),r=(s=t.base)!=null&&s.max?aE(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:oE(gc(i,"fixed[x]")),pattern:oE(gc(i,"pattern[x]")),binding:t.binding}}}function aE(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function qv(e,t=""){return O$(e.path,t)}function O$(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function Wl(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function oE(e){return Array.isArray(e)&&e.length>0?e[0]:Rn(e)?void 0:e}function M$(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 I$(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 L$(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n!=null&&n.withPath?z$:gc,[i,...s]=t.split(".");let c=[r(e,i,n)];for(const u of s){const f=[];for(const p of c)if(Array.isArray(p))for(const m of p)f.push(r(m,u,n));else(n!=null&&n.withPath&&p&&p.value!==void 0||!(n!=null&&n.withPath)&&p!==void 0)&&f.push(r(p,u,n));c=f}return c}function z$(e,t,n){const r=e.path;return $$(gc(e,t,n),r,t)}function $$(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,s)=>({...i,path:`${r}${n}[${s}]`})):{...e,path:`${r}${n}`}}const pA={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 U$(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 s=n.type;switch(t.type){case"value":case"pattern":if(!e||!i)return!1;if(i.pattern)return Z0(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||!(s!=null&&s.length)?!1:s.some(u=>u.code===e.type)}return!1}function We(e){return[{type:oe.boolean,value:e}]}function mi(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:oe.integer,value:e}:typeof e=="number"?{type:oe.decimal,value:e}:typeof e=="boolean"?{type:oe.boolean,value:e}:typeof e=="string"?{type:oe.string,value:e}:fi(e)?{type:oe.Quantity,value:e}:fa(e)?{type:e.resourceType,value:e}:CA(e)?{type:oe.CodeableConcept,value:e}:jA(e)?{type:oe.Coding,value:e}:{type:oe.BackboneElement,value:e}}function ea(e){return e.length===0?!1:!!e[0].value}function Ba(e,t){if(e.length!==0){if(e.length===1&&(!t||e[0].type===t))return e[0];throw new Error(`Expected singleton of type ${t}, but found ${JSON.stringify(e)}`)}}function gc(e,t,n){if(!e.value)return;const r=Yo(e.type,t,n==null?void 0:n.profileUrl);return r?mA(e,t,r):Dd(e,t)}function mA(e,t,n){const r=e.value,i=n.type;if(!i||i.length===0)return;let s,c="undefined",u;const f=n.path.lastIndexOf("."),p=n.path.substring(f+1);for(const m of i){const g=p.replace("[x]",Hn(m.code));if(s=r[g],u=r["_"+g],s!==void 0||u!==void 0){c=m.code;break}}if(u)if(Array.isArray(s)){s=s.slice();for(let m=0;m<Math.max(s.length,u.length);m++)s[m]=uE(s[m],u[m])}else s=uE(s,u);if(!Rn(s))return(c==="Element"||c==="BackboneElement")&&(c=n.type[0].code),Array.isArray(s)?s.map(m=>sE(m,c)):sE(s,c)}function sE(e,t){return t==="Resource"&&fa(e)&&(t=e.resourceType),{type:t,value:e}}function Dd(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(mi):r=mi(i)}else{const i=t.endsWith("[x]")?t.substring(0,t.length-3):t;for(const s of Object.values(oe)){const c=i+Hn(s);if(c in n){const u=n[c];Array.isArray(u)?r=u.map(f=>({type:s,value:f})):r={type:s,value:u};break}}}if(Array.isArray(r)){if(r.length===0||Rn(r[0]))return}else if(Rn(r))return;return r}function gA(e){const t=[];for(const n of e){let r=!1;for(const i of t)if(ea(Qp(n,i))){r=!0;break}r||t.push(n)}return t}function B$(e){return We(!ea(e))}function V$(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?We(!1):We(e.every((n,r)=>ea(Qp(n,t[r]))))}function F$(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?We(!0):We(e.some((n,r)=>!ea(Qp(n,t[r]))))}function Qp(e,t){var i,s;const n=(i=e.value)==null?void 0:i.valueOf(),r=(s=t.value)==null?void 0:s.valueOf();return typeof n=="number"&&typeof r=="number"?We(Math.abs(n-r)<1e-8):fi(n)&&fi(r)?We(bA(n,r)):We(typeof n=="object"&&typeof r=="object"?K0(e,t):n===r)}function vA(e,t){return e.length===0&&t.length===0?We(!0):e.length!==t.length?We(!1):(e.sort(lE),t.sort(lE),We(e.every((n,r)=>ea(H$(n,t[r])))))}function H$(e,t){const{type:n,value:r}=e,{type:i,value:s}=t,c=r==null?void 0:r.valueOf(),u=s==null?void 0:s.valueOf();return typeof c=="number"&&typeof u=="number"?We(Math.abs(c-u)<.01):fi(c)&&fi(u)?We(bA(c,u)):We(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"?K0({...c,id:void 0},{...u,id:void 0}):typeof c=="string"&&typeof u=="string"?c.toLowerCase()===u.toLowerCase():c===u)}function lE(e,t){var i,s;const n=(i=e.value)==null?void 0:i.valueOf(),r=(s=t.value)==null?void 0:s.valueOf();return typeof n=="number"&&typeof r=="number"?n-r:typeof n=="string"&&typeof r=="string"?n.localeCompare(r):0}function yA(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 q$(n);case"DateTime":return Lh(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return xA(n);case"Quantity":return fi(n);default:return e.type===r||typeof n=="object"&&(n==null?void 0:n.resourceType)===r}}function q$(e){return typeof e=="string"&&!!pA.date.exec(e)}function Lh(e){return typeof e=="string"&&!!pA.dateTime.exec(e)}function xA(e){return!!(e&&typeof e=="object"&&("start"in e&&Lh(e.start)||"end"in e&&Lh(e.end)))}function fi(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function bA(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 K0(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const s=e[i],c=t[i];if(cE(s)&&cE(c)){if(!K0(s,c))return!1}else if(s!==c)return!1}return!0}function cE(e){return e!==null&&typeof e=="object"}function uE(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return G$(e??{},t)}return e}function G$(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function Q$(e,t){return fa(e,t)&&"id"in e&&typeof e.id=="string"}function on(e){const t=zt(e)??"undefined/undefined",n=Va(e);return n===t?{reference:t}:{reference:t,display:n}}function zt(e){if(Ko(e))return e.reference;if(Q$(e))return`${e.resourceType}/${e.id}`}function Bs(e){if(e)return Ko(e)?e.reference.split("/")[1]:e.id}function W$(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function Va(e){if(W$(e)){const t=Y$(e);if(t)return t}if(e.resourceType==="Device"){const t=K$(e);if(t)return t}if(e.resourceType==="MedicationRequest"&&e.medicationCodeableConcept)return Fo(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]),CA(t))return Fo(t);if(oU(t))return t.text}return zt(e)??""}function Y$(e){const t=e.name;if(t&&t.length>0)return Nc(t[0])}function K$(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function X$(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=dE(n);if(r)return r}else return dE(t)}function dE(e){var t;if(e.url&&((t=e.contentType)!=null&&t.startsWith("image/")))return e.url}function SA(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(),s=n.getUTCMonth(),c=n.getUTCDate(),u=r.getUTCFullYear(),f=r.getUTCMonth(),p=r.getUTCDate();let m=u-i;(f<s||f===s&&p<c)&&m--;let g=u*12+f-(i*12+s);p<c&&g--;const y=Math.floor((r.getTime()-n.getTime())/(1e3*60*60*24));return{years:m,months:g,days:y}}function Z$(e,t){const{years:n,months:r,days:i}=SA(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 Ja(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(s=>s.url===t[i]);return n}function Ii(e,t){const n=X0(e);return JSON.stringify(n,null,t?2:void 0)??""}function X0(e){if(!(e==null||e===""))return typeof e=="object"?Array.isArray(e)?J$(e):eU(e):e}function J$(e){const t=e.length;if(t===0)return;let n,r=0;for(let i=0;i<t;i++){const s=e[i],c=X0(s);c!==s&&!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],s=X0(i);s!==i&&!t&&(t={...e}),s===void 0?t&&delete t[r]:(t&&(t[r]=s),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 s=e[i],c=t[i];if(!sa(s,c,i))return!1}return!0}function Z0(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=>Z0(r,n)))}function iU(e,t){return Object.entries(t).every(([n,r])=>n in e&&Z0(e[n],r))}function Qr(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function wA(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 jA(e){return sr(e)&&"code"in e&&typeof e.code=="string"}function CA(e){return sr(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(jA)}function oU(e){return sr(e)&&"text"in e&&typeof e.text=="string"}const EA=[];for(let e=0;e<256;e++)EA.push(e.toString(16).padStart(2,"0"));function sU(e){const t=TA(e),n=new Uint8Array(t),r=new Array(n.length);for(let i=0;i<n.length;i++)r[i]=EA[n[i]];return r.join("")}function lU(e){const t=TA(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 TA(e){return ArrayBuffer.isView(e)?e.buffer:e}function Hn(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function J0(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function ks(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 fE=e=>new Promise(t=>{setTimeout(t,e)});function My(e,t,n){const r=[];for(let i=0;i<n-1;i++){const s=e.indexOf(t);if(s<0)break;r.push(e.slice(0,s)),e=e.slice(s+t.length)}return r.push(e),r}function dU(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function Lu(e,t){return e?(e.push(t),e):[t]}function ad(e){return e.sort((t,n)=>t.localeCompare(n))}function eb(e){return e.endsWith("/")?e:e+"/"}function fU(e){return e.startsWith("/")?e.slice(1):e}function Xi(e,t){return new URL(fU(t),eb(e.toString())).toString()}function hU(e,t){return Xi(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 RA(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 vc(e){if(!e)return"";switch(e.type){case"Address":return DA(e.value);case"CodeableConcept":return Fo(e.value);case"Coding":return Ad(e.value);case"ContactPoint":return e.value.value;case"HumanName":return Nc(e.value);case"Quantity":return Ps(e.value);case"Reference":return gU(e.value);default:return e.value.toString()}}function gU(e){return e?e.display??e.reference??Ii(e):""}function DA(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.push("["+e.use+"]"),n.join(", ").trim()}function Nc(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=sd(e.text);if(r)return r}return n.join(" ").trim()}function Wp(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 Wp(r)?r.toLocaleTimeString(t,n):""}function gr(e,t,n){if(!e)return"";const r=new Date(e);return Wp(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 AA(e){if(!e)return"";const t=[];return wU(t,e.repeat),e.event&&t.push(e.event.map(n=>gr(n)).join(", ")),Hn(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(Hn).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(s=>vU(s)).join(", "))}function od(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?`>= ${Ps(r)}`:(r==null?void 0:r.value)===void 0&&(i==null?void 0:i.value)!==void 0?`<= ${Ps(i)}`:((r==null?void 0:r.unit)===(i==null?void 0:i.unit)&&(r==null||delete r.unit),`${Ps(r)} - ${Ps(i)}`)}function Ps(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 Fo(e){if(!e)return"";const t=sd(e.text);return t||(e.coding?e.coding.map(n=>Ad(n)).join(", "):"")}function Ad(e,t){const n=sd(e==null?void 0:e.display);return n?`${n}`:sd(e==null?void 0:e.code)??""}function _A(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(Ps(e.valueQuantity));else if(e.valueCodeableConcept)t.push(Fo(e.valueCodeableConcept));else{const n=sd(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>_A(n)).join(" / ")),t.join(" / ").trim()}function sd(e){return typeof e=="string"?e:void 0}const oe={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"&&kA(r.type)}function kA(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=kA(t);n.searchParams||(n.searchParams={}),n.searchParams[e.code]=e}}function hE(e){var n,r,i,s;const t=(r=(n=e.type)==null?void 0:n[0])==null?void 0:r.code;return t==="BackboneElement"||t==="Element"?TU((s=((i=e.base)==null?void 0:i.path)??e.path)==null?void 0:s.split(".")):t}function TU(e){return e.length===1?e[0]:e.map(Hn).join("")}function tb(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 Vs(e){const t=e.replaceAll("[x]","").split(".").pop();return PA(t)}function PA(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(AU).join(" ").replace("_"," ").replace(/\s+/g," ")}const DU=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function AU(e){const t=e.toUpperCase();return e===t?e:DU.has(t)?t:t.charAt(0)+e.slice(1)}function Yo(e,t,n){const r=Gp(e,n);if(r)return _U(r.elements,t)}function _U(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 s=t.slice(0,r)+"[x]",c=e[s];if(c)return c}}}function fa(e,t){return!(!e||typeof e!="object"||!("resourceType"in e)||t&&e.resourceType!==t)}function Ko(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 Pa=()=>[],Tr={empty:(e,t)=>We(t.length===0||t.every(n=>Rn(n.value))),hasValue:(e,t)=>We(t.length!==0),exists:(e,t,n)=>We(n?t.filter(r=>ea(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!Rn(r.value))),all:(e,t,n)=>We(t.every(r=>ea(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return We(!1);return We(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return We(!0);return We(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return We(!1);return We(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return We(!0);return We(!1)},subsetOf:(e,t,n)=>{if(t.length===0)return We(!0);const r=n.eval(e,xs(e));return r.length===0?We(!1):We(t.every(i=>r.some(s=>s.value===i.value)))},supersetOf:(e,t,n)=>{const r=n.eval(e,xs(e));return r.length===0?We(!0):t.length===0?We(!1):We(r.every(i=>t.some(s=>s.value===i.value)))},count:(e,t)=>[{type:oe.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)=>We(t.length===Tr.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:Pa,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,xs(e)),i=[];for(const s of t)!i.some(c=>c.value===s.value)&&r.some(c=>c.value===s.value)&&i.push(s);return i},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,xs(e)),i=[];for(const s of t)r.some(c=>c.value===s.value)||i.push(s);return i},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,xs(e));return gA([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,xs(e));return[...t,...r]},htmlChecks:(e,t,n)=>[mi(!0)],iif:(e,t,n,r,i)=>{const s=n.eval(e,t);if(s.length>1||s.length===1&&typeof s[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return ea(s)?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:oe.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return We(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return We(!0);if(["false","f","no","n","0","0.0"].includes(r))return We(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:We(Tr.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zi(t,1);return typeof n=="number"?[{type:oe.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:oe.integer,value:parseInt(n,10)}]:typeof n=="boolean"?[{type:oe.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:We(Tr.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:oe.date,value:xh(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:We(Tr.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:oe.dateTime,value:xh(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:We(Tr.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zi(t,1);return typeof n=="number"?[{type:oe.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:oe.decimal,value:parseFloat(n)}]:typeof n=="boolean"?[{type:oe.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:We(Tr.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zi(t,1);return fi(n)?[{type:oe.Quantity,value:n}]:typeof n=="number"?[{type:oe.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:oe.Quantity,value:{value:parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:oe.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:We(Tr.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zi(t,1);return n==null?[]:fi(n)?[{type:oe.string,value:`${n.value} '${n.unit}'`}]:[{type:oe.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:We(Tr.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:oe.time,value:xh("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:We(Tr.toTime(e,t).length===1),indexOf:(e,t,n)=>li((r,i)=>r.indexOf(i),e,t,n),substring:(e,t,n,r)=>li((i,s,c)=>{const u=s,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)=>li((r,i)=>r.startsWith(i),e,t,n),endsWith:(e,t,n)=>li((r,i)=>r.endsWith(i),e,t,n),contains:(e,t,n)=>li((r,i)=>r.includes(i),e,t,n),upper:(e,t)=>li(n=>n.toUpperCase(),e,t),lower:(e,t)=>li(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>li((i,s,c)=>i.replaceAll(s,c),e,t,n,r),matches:(e,t,n)=>li((r,i)=>!!new RegExp(i).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>li((i,s,c)=>i.replaceAll(new RegExp(s,"g"),c),e,t,n,r),length:(e,t)=>li(n=>n.length,e,t),toChars:(e,t)=>li(n=>n?n.split(""):void 0,e,t),encode:Pa,decode:Pa,escape:Pa,unescape:Pa,trim:Pa,split:Pa,join:(e,t,n)=>{var i;const r=((i=n==null?void 0:n.eval(e,xs(e))[0])==null?void 0:i.value)??"";if(typeof r!="string")throw new Error("Separator must be a string.");return[{type:oe.string,value:t.map(s=>{var c;return((c=s.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:Pa,descendants:Pa,trace:(e,t,n)=>t,now:()=>[{type:oe.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:oe.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:oe.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,i)=>{var p;const s=Tr.toDateTime(e,n.eval(e,t));if(s.length===0)throw new Error("Invalid start date");const c=Tr.toDateTime(e,r.eval(e,t));if(c.length===0)throw new Error("Invalid end date");const u=(p=i.eval(e,t)[0])==null?void 0:p.value;if(u!=="years"&&u!=="months"&&u!=="days")throw new Error("Invalid units");const f=SA(s[0].value,c[0].value);return[{type:oe.Quantity,value:{value:f[u],unit:u}}]},is:(e,t,n)=>{let r="";return n instanceof zh?r=n.name:n instanceof nb&&(r=n.left.name+"."+n.right.name),r?t.map(i=>({type:oe.boolean,value:yA(i,r)})):[]},not:(e,t)=>Tr.toBoolean(e,t).map(n=>({type:oe.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 s=r;if(s.resource)return mi(s.resource);s.reference?i=s.reference:s.type&&s.identifier&&(i=`${s.type}?identifier=${s.identifier.system}|${s.identifier.value}`)}if(i!=null&&i.includes("?")){const[s]=i.split("?");return{type:s,value:{resourceType:s}}}if(i!=null&&i.includes("/")){const[s,c]=i.split("/");return{type:s,value:{resourceType:s,id:c}}}return{type:oe.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:oe.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:oe.BackboneElement,value:{namespace:"System",name:"Integer"}}:fa(n)?{type:oe.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:oe.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(s=>{var c;return{type:oe.boolean,value:((c=s.value)==null?void 0:c.resourceType)===i}})},getResourceKey:(e,t)=>{const n=t[0].value;return n!=null&&n.id?[{type:oe.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:oe.id,value:Bs(r)}]},extension:(e,t,n)=>{var s;const r=n.eval(e,t)[0].value,i=(s=t==null?void 0:t[0])==null?void 0:s.value;if(i){const c=Ja(i,r);if(c)return[{type:oe.Extension,value:c}]}return[]}};function li(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 s=e(i,...r.map(c=>{var u;return(u=c==null?void 0:c.eval(t,n)[0])==null?void 0:u.value}));return s===void 0?[]:Array.isArray(s)?s.map(mi):[mi(s)]}function Yi(e,t,n,...r){if(n.length===0)return[];const[{value:i}]=Zi(n,1),s=fi(i),c=s?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=s?oe.Quantity:n[0].type,p=s?{...i,value:u}:u;return[{type:f,value:p}]}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 xs(e){var n;let t=e;for(;(n=t.parent)!=null&&n.variables.$this;)t=t.parent;return[t.variables.$this]}class NA{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 Yl{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 fa(n,this.name)?t:gc(t,this.name)}toString(){return this.name}}class kU{eval(){return[]}toString(){return"{}"}}class PU extends l8{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 $h extends Td{constructor(t,n){super("as",t,n)}eval(t,n){return Tr.ofType(t,this.left.eval(t,n),this.right)}}class Nr extends Td{}class Di 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 s=r[0].value,c=i[0].value,u=fi(s)?s.value:s,f=fi(c)?c.value:c,p=this.impl(u,f);return typeof p=="boolean"?We(p):fi(s)?[{type:oe.Quantity,value:{...s,value:p}}]:[mi(p)]}}class NU extends Td{constructor(t,n){super("&",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n),s=[...r,...i];return s.length>0&&s.every(c=>typeof c.value=="string")?[{type:oe.string,value:s.map(c=>c.value).join("")}]:s}}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 We(r.some(s=>s.value===i[0].value))}}class MU extends Nr{constructor(t,n){super("in",t,n)}eval(t,n){const r=Ba(this.left.eval(t,n)),i=this.right.eval(t,n);return r?We(i.some(s=>Qp(r,s)[0].value)):[]}}class nb extends Td{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 rb extends Td{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return gA([...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 V$(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 F$(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 vA(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 B$(vA(r,i))}}class ib 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 We(yA(r[0],i))}}class UU extends Nr{constructor(t,n){super("and",t,n)}eval(t,n){const r=Ba(this.left.eval(t,n),"boolean"),i=Ba(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!0&&(i==null?void 0:i.value)===!0?We(!0):(r==null?void 0:r.value)===!1||(i==null?void 0:i.value)===!1?We(!1):[]}}class BU extends Nr{constructor(t,n){super("or",t,n)}eval(t,n){const r=Ba(this.left.eval(t,n),"boolean"),i=Ba(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!1&&(i==null?void 0:i.value)===!1?We(!1):r!=null&&r.value||i!=null&&i.value?We(!0):[]}}class VU extends Nr{constructor(t,n){super("xor",t,n)}eval(t,n){const r=Ba(this.left.eval(t,n),"boolean"),i=Ba(this.right.eval(t,n),"boolean");return!r||!i?[]:We(r.value!==i.value)}}class FU extends Nr{constructor(t,n){super("implies",t,n)}eval(t,n){const r=Ba(this.left.eval(t,n),"boolean"),i=Ba(this.right.eval(t,n),"boolean");return(i==null?void 0:i.value)===!0||(r==null?void 0:r.value)===!1?We(!0):!r||!i?[]:We(!1)}}class ab{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=Tr[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 ob{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 s=this.left.eval(t,n);return i in s?[s[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,(s,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 QU=["true","false"],WU=["!=","!~","<=",">=","{}","->"];function YU(e){return new qU(e,QU,WU).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},KU={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}},XU={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new ob(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 ab(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 c8().registerPrefix("String",{parse:(e,t)=>new Yl({type:oe.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new Yl({type:oe.dateTime,value:xh(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new Yl({type:oe.Quantity,value:JU(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new Yl({type:t.value.includes(".")?oe.decimal:oe.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new Yl({type:oe.boolean,value:!0})}).registerPrefix("false",{parse:()=>new Yl({type:oe.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new zh(t.value)}).registerPrefix("{}",{parse:()=>new kU}).registerPrefix("(",KU).registerInfix("[",XU).registerInfix("(",ZU).prefix("+",Xt.UnaryAdd,(e,t)=>new PU("+",t,n=>n)).prefix("-",Xt.UnarySubtract,(e,t)=>new Di("-",t,t,(n,r)=>-r)).infixLeft(".",Xt.Dot,(e,t,n)=>new nb(e,n)).infixLeft("/",Xt.Divide,(e,t,n)=>new Di("/",e,n,(r,i)=>r/i)).infixLeft("*",Xt.Multiply,(e,t,n)=>new Di("*",e,n,(r,i)=>r*i)).infixLeft("+",Xt.Add,(e,t,n)=>new Di("+",e,n,(r,i)=>r+i)).infixLeft("-",Xt.Subtract,(e,t,n)=>new Di("-",e,n,(r,i)=>r-i)).infixLeft("|",Xt.Union,(e,t,n)=>new rb(e,n)).infixLeft("=",Xt.Equals,(e,t,n)=>new IU(e,n)).infixLeft("!=",Xt.NotEquals,(e,t,n)=>new LU(e,n)).infixLeft("~",Xt.Equivalent,(e,t,n)=>new zU(e,n)).infixLeft("!~",Xt.NotEquivalent,(e,t,n)=>new $U(e,n)).infixLeft("<",Xt.LessThan,(e,t,n)=>new Di("<",e,n,(r,i)=>r<i)).infixLeft("<=",Xt.LessThanOrEquals,(e,t,n)=>new Di("<=",e,n,(r,i)=>r<=i)).infixLeft(">",Xt.GreaterThan,(e,t,n)=>new Di(">",e,n,(r,i)=>r>i)).infixLeft(">=",Xt.GreaterThanOrEquals,(e,t,n)=>new Di(">=",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 $h(e,n)).infixLeft("contains",Xt.Contains,(e,t,n)=>new OU(e,n)).infixLeft("div",Xt.Divide,(e,t,n)=>new Di("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 ib(e,n)).infixLeft("mod",Xt.Modulo,(e,t,n)=>new Di("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 sb(e){return new NA(e,tB.construct(YU(e)).consumeAndParse())}function Oc(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]=mi(n[r]))}return Fs(e,n).map(r=>r.value)}function Fs(e,t,n={},r=void 0){let i;if(typeof e=="string"){const s=r==null?void 0:r.get(e);i=s??sb(e),r&&!s&&r.set(e,i)}else i=e;return i.eval({variables:n},t).map(s=>{var c;return{type:s.type,value:(c=s.value)==null?void 0:c.valueOf()}})}const Jn={BOOLEAN:"BOOLEAN",NUMBER:"NUMBER",QUANTITY:"QUANTITY",TEXT:"TEXT",REFERENCE:"REFERENCE",CANONICAL:"CANONICAL",DATE:"DATE",DATETIME:"DATETIME"};function Mc(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=rB(e,t)),n}function nB(e,t,n){let r=la.types[e];r||(r={},la.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function rB(e,t){const n=t.code,r=sB(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.add("code")):OA(i,u,e,1),f().endsWith("extension.valueDateTime")&&(i.array=!1)}const s={type:oB(t,i.propertyTypes),elementDefinitions:i.elementDefinitions,parsedExpression:lB(e,t.expression),array:i.array};return nB(e,n,s),s}function OA(e,t,n,r){const i=t[r];if(i instanceof $h){e.propertyTypes.add(i.right.toString());return}if(i instanceof ab){iB(e,i);return}const s=i.toString(),c=Yo(n,s);if(!c)throw new Error(`Element definition not found for ${n} ${s}`);let u=!1,f=r+1;f<t.length&&t[f]instanceof ob&&(u=!0,f++);const p=t[f];if(c.isArray&&!u&&(e.array=!0),f===t.length-1&&p instanceof $h){e.elementDefinitions.push(c),e.propertyTypes.add(p.right.toString());return}if(f>=t.length){e.elementDefinitions.push(c);for(const m of c.type)e.propertyTypes.add(m.code);return}for(const m of c.type){let g=m.code;aB(g)&&(g=c.type[0].code),OA(e,t,g,f)}}function iB(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 ib){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function aB(e){return e==="Element"||e==="BackboneElement"}function oB(e,t){switch(e.type){case"date":return t.size===1&&t.has(oe.date)?Jn.DATE:Jn.DATETIME;case"number":return Jn.NUMBER;case"quantity":return Jn.QUANTITY;case"reference":return t.has(oe.canonical)?Jn.CANONICAL:Jn.REFERENCE;case"token":return t.size===1&&t.has(oe.boolean)?Jn.BOOLEAN:Jn.TEXT;default:return Jn.TEXT}}function sB(e,t){const n=[],r=sb(t);return Uh(e,r.child,n),n}function lB(e,t){const n=[],r=sb(t);if(Uh(e,r.child,n),n.length===0)return r;let i=n[0];for(let s=1;s<n.length;s++)i=new rb(i,n[s]);return new NA("<original-not-available>",i)}function Uh(e,t,n){t instanceof rb?(Uh(e,t.left,n),Uh(e,t.right,n)):t.toString().includes(e+".")&&n.push(t)}function bh(e){if(e instanceof $h||e instanceof ob)return[bh(e.left),e].flat();if(e instanceof Nr)return[e];if(e instanceof nb)return[bh(e.left),bh(e.right)].flat();if(e instanceof ab){if(e.name==="where"&&!(e.args[0]instanceof ib))return[];if(e.name==="last")return[]}return[e]}const Yp=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"},MA={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},lb={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 IA(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 s=[];return r&&s.push(...r.entries()),cB(i,s)}function cB(e,t){const n={resourceType:e};for(const[r,i]of t)uB(n,r,i);return n}function uB(e,t,n){var c,u;let r,i;const s=t.indexOf(":");if(s>=0?(r=t.substring(0,s),i=t.substring(s+1)):(r=t,i=""),r!=="_"){if(r==="_has"||t.includes(".")){e.filters=Lu(e.filters,{code:t,operator:ue.EQUALS,value:n});return}switch(r){case"_sort":dB(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=pE(n);i==="iterate"&&(f.modifier=ue.ITERATE),e.include=Lu(e.include,f);break}case"_revinclude":{const f=pE(n);i==="iterate"&&(f.modifier=ue.ITERATE),e.revInclude=Lu(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=Lu(e.filters,hB(f,i,n)):e.filters=Lu(e.filters,pB(r,i,n))}}}}function dB(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 fB=[ue.MISSING,ue.PRESENT];function hB(e,t,n){if(fB.includes(t))return{code:e.code,operator:t,value:n};switch(e.type){case"number":case"date":case"quantity":{const{operator:r,value:i}=mB(n);if(!mE(e,i))throw new dt(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(!mE(e,n))throw new dt(ra(`Invalid format for ${e.type} search parameter: ${n}`));return{code:e.code,operator:gB(t),value:n};default:throw new Error("Unrecognized search parameter type: "+e.type)}}function pB(e,t,n){var i;let r=ue.EQUALS;if(t)r=t;else if(n.length>=2){const s=n.substring(0,2);s in lb&&(n.length===2||(i=n.at(2))!=null&&i.match(/\d/))&&(r=s,n=n.substring(s.length))}return{code:e,operator:r,value:n}}function mB(e){const t=e.substring(0,2),n=lb[t];return n?{operator:n,value:e.substring(2)}:{operator:ue.EQUALS,value:e}}function gB(e){return MA[e]??ue.EQUALS}function pE(e){const t=e.split(":");if(t.includes("*"))throw new dt(ra("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new dt(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 dt(ra(`Invalid include value '${e}'`))}function mE(e,t){switch(e.type){case"date":return Lh(t);default:return!0}}function Uo(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(vB(n))),e.sortRules&&e.sortRules.length>0&&t.push(yB(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(gE("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(gE("_revinclude",n))),t.length===0?"":(ad(t),"?"+t.join("&"))}function vB(e){const t=e.operator in MA?":"+e.operator:"",n=e.operator!==ue.EQUALS&&e.operator in lb?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function yB(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function gE(e,t){return e+(t.modifier?":"+t.modifier:"")+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function cb(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 xB(e,t){if(t.resourceType!==e.resourceType)return!1;if(t.filters){for(const n of t.filters)if(!bB(e,t,n))return!1}return!0}function bB(e,t,n){var i,s;const r=(s=(i=la.types[t.resourceType])==null?void 0:i.searchParams)==null?void 0:s[n.code];if(!r)return!1;if(n.operator===ue.MISSING||n.operator===ue.PRESENT)return SB(e,n,r);switch(r.type){case"reference":return wB(e,n,r);case"string":case"uri":return LA(e,n,r);case"token":return jB(e,n,r);case"date":return RB(e,n,r);default:return!1}}function SB(e,t,n){const i=Oc(n.expression,e).length>0;return(t.operator===ue.MISSING&&t.value==="false"||t.operator===ue.PRESENT&&t.value==="true")===i}function wB(e,t,n){const r=Oc(n.expression,e),i=Kp(t.operator);if(t.value===""&&r.length===0)return t.operator===ue.EQUALS;const s=r.map(c=>typeof c=="string"?c:c.reference);for(const c of cb(t.value)){let u=s.includes(c);if(!u&&t.code==="_compartment"&&(u=s.some(f=>f==null?void 0:f.endsWith("/"+c))),u)return!i}return i}function jB(e,t,n){return Mc(e.resourceType,n).type===Jn.BOOLEAN?CB(e,t,n):LA(e,t,n,!0)}function CB(e,t,n){const r=Oc(n.expression,e),i=t.value==="true",s=r.includes(i);return Kp(t.operator)?!s:s}function LA(e,t,n,r){var p,m,g,y;const s=(y=(g=(m=(p=Mc(e.resourceType,n).elementDefinitions)==null?void 0:p[0])==null?void 0:m.type)==null?void 0:g[0])==null?void 0:y.code,c=Oc(n.expression,e),u=cb(t.value),f=Kp(t.operator);for(const b of c)for(const S of u){let j;if(s===oe.Identifier?j=EB(b,t.operator,S):s===oe.CodeableConcept?j=TB(b,t.operator,S):j=Iy(b,S,r),j)return!f}return f}function Iy(e,t,n){if(t==="")return!1;if(n&&typeof e=="string"&&e.includes("|")){const[i,s]=e.split("|"),c=Iy(i,t,!1),u=s?Iy(s,t,!1):!1;return c||u}let r="";return e&&(typeof e=="string"?r=e:typeof e=="object"&&(r=JSON.stringify(e))),r.toLowerCase().includes(t.toLowerCase())}function EB(e,t,n){var r,i,s,c;if(n.includes("|")){const[u,f]=n.split("|").map(p=>p.toLowerCase());return!u&&!f?!1:u?((i=e.system)==null?void 0:i.toLowerCase())===u&&(!f||((s=e.value)==null?void 0:s.toLowerCase())===f):!e.system&&((r=e.value)==null?void 0:r.toLowerCase())===f}return((c=e.value)==null?void 0:c.toLowerCase())===n.toLowerCase()}function TB(e,t,n){var r,i,s,c;if(n.includes("|")){const[u,f]=n.split("|").map(p=>p.toLowerCase());return!u&&!f?!1:u?((i=e.coding)==null?void 0:i.some(p=>{var m,g;return((m=p.system)==null?void 0:m.toLowerCase())===u&&(!f||((g=p.code)==null?void 0:g.toLowerCase())===f)}))??!1:((r=e.coding)==null?void 0:r.some(p=>{var m;return!p.system&&((m=p.code)==null?void 0:m.toLowerCase())===f}))??!1}return((s=e.text)==null?void 0:s.toLowerCase())===n.toLowerCase()||(((c=e.coding)==null?void 0:c.some(u=>{var f;return((f=u.code)==null?void 0:f.toLowerCase())===n.toLowerCase()}))??!1)}function RB(e,t,n){const r=Oc(n.expression,e),i=cb(t.value),s=Kp(t.operator);for(const c of r)for(const u of i)if(DB(Bh(c),t.operator,Bh(u)))return!s;return s}function DB(e,t,n){if(!e)return!1;switch(t){case ue.STARTS_AFTER:case ue.GREATER_THAN:return e>n;case ue.GREATER_THAN_OR_EQUALS:return e>=n;case ue.ENDS_BEFORE:case ue.LESS_THAN:return e<n;case ue.LESS_THAN_OR_EQUALS:return e<=n;case ue.EQUALS:case ue.NOT_EQUALS:return e===n;default:return!1}}function Bh(e){if(aU(e))try{return new Date(e).toISOString()}catch(t){console.debug("Failed to parse date",e,t)}else if(xA(e)){if("start"in e)return Bh(e.start);if("end"in e)return Bh(e.end)}}function Kp(e){return e===ue.NOT_EQUALS||e===ue.NOT}const AB={resourceType:"*"},_B=["DomainConfiguration","JsonWebKey","Login"],kB=["PasswordChangeRequest","UserSecurityRequest","Project","ProjectMembership","User"],Ns={READ:"read",VREAD:"vread",UPDATE:"update",HISTORY:"history",SEARCH:"search"},PB=[Ns.READ,Ns.VREAD,Ns.HISTORY,Ns.SEARCH];function NB(e,t){return _B.includes(t)?!1:OB(e,Ns.UPDATE,t)}function OB(e,t,n){var r;return!!((r=e.resource)!=null&&r.some(i=>$A(i,n,t)))}function zA(e,t,n){var r;return n?(r=n.resource)==null?void 0:r.find(i=>MB(e,t,i)):AB}function MB(e,t,n){var i,s;const r=e.resourceType;return $A(n,r,t)?r==="Binary"?!0:!(n.compartment&&!((s=(i=e.meta)==null?void 0:i.compartment)!=null&&s.some(c=>{var u;return c.reference===((u=n.compartment)==null?void 0:u.reference)}))||n.criteria&&!xB(e,IA(n.criteria))):!1}function $A(e,t,n){return e.resourceType!==t&&(e.resourceType!=="*"||kB.includes(t))?!1:e.interaction?e.interaction.includes(n):!e.readonly||PB.includes(n)}function IB(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 vE(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 LB(e){e=e.padEnd(e.length+(4-e.length%4)%4,"=");const t=e.replace(/-/g,"+").replace(/_/g,"/");return IB(t)}function yE(){const e=new Uint32Array(28);return crypto.getRandomValues(e),sU(e.buffer)}async function zB(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function UA(){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 BA(e){var i;const t={};e=Qr(e);for(const s of e.entry||[]){const c=s.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]=UA(),s.fullUrl="urn:uuid:"+t[u],(i=s.resource)==null||delete i.id)}const n=e.entry,r=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:n==null?void 0:n.map(s=>{var c;return{fullUrl:s.fullUrl,request:{method:"POST",url:(c=s.resource)==null?void 0:c.resourceType},resource:s.resource}})},(s,c)=>$B(s,c,t),2);return UB(JSON.parse(r))}function $B(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 UB(e){const t=VB(e),{sorted:n,cycles:r}=BB(t),i={};for(const c of e.entry??[])c.fullUrl&&(i[c.fullUrl]=c);const s=n.map(c=>i[c]);for(const c of r)for(const u of c){const f=i[u],p={...f,request:{...f.request,method:"PUT"}};s.push(p)}return{...e,entry:s}}const Kl={NotVisited:"NotVisited",Visiting:"Visiting",Visited:"Visited"};function BB(e){const t=[],n={},r=[];for(const s of Object.keys(e))n[s]=Kl.NotVisited;function i(s,c){if(n[s]===Kl.Visited)return!0;if(n[s]===Kl.Visiting){const f=c.lastIndexOf(s);return f!==-1&&r.push(c.slice(f)),!0}n[s]=Kl.Visiting,c.push(s);let u=!1;for(const f of e[s])i(f,c)||(u=!0);return n[s]=Kl.Visited,c.pop(),t.unshift(s),!u}for(const s in e)n[s]===Kl.NotVisited&&i(s,[]);return{sorted:t,cycles:r}}function VA(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(Ko(r)){const i=r.reference;i.startsWith("urn:uuid:")&&t(i)}else VA(r,t)}}function VB(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&&VA(n.resource,i=>{t[i]&&t[i].push(r)})}return t}const hn={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"};class FB{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 Xp{constructor(){this.emitter=new FB}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 Ly={"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"},HB=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],ub=["DiagnosticReport-update"];function qB(e){return ub.includes(e)}function GB(e){if(ub.includes(e))throw new dt(yn(`'context.version' is required for '${e}'.`))}const QB={"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 WB(e){return HB.includes(e)}function FA(e){return!!e.endpoint}function xE(e){if(!db(e))throw new dt(yn("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:n,topic:r,events:i}=e,s={"hub.channel.type":t,"hub.mode":n,"hub.topic":r,"hub.events":i.join(",")};return FA(e)&&(s.endpoint=e.endpoint),new URLSearchParams(s).toString()}function db(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 s of i)if(!Ly[s])return!1;return!(FA(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function YB(e,t,n,r){if(typeof t!="object")throw new dt(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 dt(yn(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new dt(yn(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const i=r.resourceType;if(i!=="*"){if(!WB(t.resourceType))throw new dt(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 dt(yn(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${i}.`))}}function KB(e,t,n,r,i){if(i.set(t.key,(i.get(t.key)??0)+1),r.reference){if(!Ko(t.reference))throw new dt(yn(`context[${n}] is invalid. Expected key '${t.key}' to be a reference.`))}else YB(e,t.resource,n,r)}function XB(e,t){const n=new Map,r=QB[e];for(let i=0;i<t.length;i++){const s=t[i].key;if(!r[s])throw new dt(yn(`Key '${s}' not found for event '${e}'. Make sure to add only valid keys.`));KB(e,t[i],i,r[s],n)}for(const[i,s]of Object.entries(r)){if(!(s.optional||n.has(i)))throw new dt(yn(`Missing required key '${i}' on context for '${e}' event.`));if(!s.manyAllowed&&(n.get(i)??0)>1)throw new dt(yn(`${n.get(i)} context entries with key '${i}' found for the '${e}' event when schema only allows for 1.`))}}function bE(e,t,n,r){if(!(e&&typeof e=="string"))throw new dt(yn("Must provide a topic."));if(!Ly[t])throw new dt(yn(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Ly).join(", ")}`));if(typeof n!="object")throw new dt(yn("context must be a context object or array of context objects."));if(ub.includes(t)&&!r)throw new dt(yn(`The '${t}' event must contain a 'context.versionId'.`));const i=Array.isArray(n)?n:[n];return XB(t,i),{timestamp:new Date().toISOString(),id:UA(),event:{"hub.topic":e,"hub.event":t,context:i,...r?{"context.versionId":r}:{}}}}class ZB extends Xp{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new dt(yn("Subscription request should contain an endpoint."));if(!db(t))throw new dt(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 s=i;s.event["hub.event"]!=="heartbeat"&&(this.dispatchEvent({type:"message",payload:s}),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 JB(e){return JSON.parse(LB(e))}function eV(e){return e.split(".").length===3}function fb(e){const[t,n,r]=e.split(".");return JB(n)}function tV(e){try{return typeof fb(e).login_id=="string"}catch{return!1}}function nV(e){try{const n=fb(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class rV{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,hn.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}var HA;HA=Symbol.toStringTag;class Ai{constructor(t){this[HA]="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 iV{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new aV)}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?Ii(n):void 0)}}class aV{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 ac={Event:typeof globalThis.Event<"u"?globalThis.Event:void 0,ErrorEvent:void 0,CloseEvent:void 0};let SE=!1;function oV(){if(typeof globalThis.Event>"u")throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");ac.Event=globalThis.Event,ac.ErrorEvent=class extends Event{constructor(t,n){super("error",n),this.message=t.message,this.error=t}},ac.CloseEvent=class extends Event{constructor(t=1e3,n="",r){super("close",r),this.wasClean=!0,this.code=t,this.reason=n}}}function sV(e,t){if(!e)throw new Error(t)}function ah(e){return new e.constructor(e.type,e)}const bs={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0};let wE=!1;class Mo extends Xp{constructor(t,n,r={}){SE||(oV(),SE=!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:s=bs.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),s),sV(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 Mo.CONNECTING}get OPEN(){return Mo.OPEN}get CLOSING(){return Mo.CLOSING}get CLOSED(){return Mo.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?Mo.CLOSED:Mo.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=bs.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=bs.reconnectionDelayGrowFactor,minReconnectionDelay:n=bs.minReconnectionDelay,maxReconnectionDelay:r=bs.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=bs.maxRetries,connectionTimeout:n=bs.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"&&!wE&&(console.error("‼️ No WebSocket implementation available. You should define options.WebSocket."),wE=!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 ac.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new ac.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new ac.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 lV=5e3;class zy extends Xp{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 cV{constructor(t,n){this.connecting=!1,this.criteria=t,this.emitter=new zy(t),this.refCount=1,this.subscriptionProps=n?{...n}:void 0}clearAttachedSubscription(){this.subscriptionId=void 0,this.token=void 0}}class uV{constructor(t,n,r){if(this.pingTimer=void 0,this.waitingForPong=!1,!(t instanceof GA))throw new dt(yn("First arg of constructor should be a `MedplumClient`"));let i;try{i=new URL(n).toString()}catch{throw new dt(yn("Not a valid URL"))}const s=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 Mo(i,void 0,{debug:r==null?void 0:r.debug,debugLogger:r==null?void 0:r.debugLogger});this.medplum=t,this.ws=s,this.masterSubEmitter=new zy,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.pingIntervalMs=(r==null?void 0:r.pingIntervalMs)??lV,this.currentProfile=t.getProfile(),this.setupListeners()}setupListeners(){const t=this.ws;t.addEventListener("message",n=>{var r,i,s,c,u,f;try{const p=JSON.parse(n.data);if(p.type==="pong"){this.waitingForPong=!1;return}const m=p,g=(i=(r=m==null?void 0:m.entry)==null?void 0:r[0])==null?void 0:i.resource;if(g.type==="heartbeat"){(s=this.masterSubEmitter)==null||s.dispatchEvent({type:"heartbeat",payload:m});return}if(g.type==="handshake"){const b=Bs(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(Bs(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(p){console.error(p);const m={type:"error",payload:p};(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 dt(S8(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 s of this.getAllCriteriaEmitters())s.dispatchEvent({...n});this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=void 0,this.waitingForPong=!1),this.wsClosed&&(this.criteriaEntries.clear(),this.criteriaEntriesBySubscriptionId.clear(),(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 ${zt(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,s=(u=r==null?void 0:r.find(f=>f.name==="websocket-url"))==null?void 0:u.valueUrl;if(!i)throw new dt(yn("Failed to get token"));if(!s)throw new dt(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:s}=t;if(!this.criteriaEntries.has(n))return;const c=this.criteriaEntries.get(n);r?c.criteriaWithProps=c.criteriaWithProps.filter(f=>{const p=f.subscriptionProps;return!sa(r,p)}):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),s&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"unbind-from-token",payload:{token:s}}))}async subscribeToCriteria(t){if(!(this.ws.readyState!==WebSocket.OPEN||t.connecting)){t.connecting=!0;try{const[n,r]=await this.getTokenForCriteria(t);t.subscriptionId=n,t.token=r,this.criteriaEntriesBySubscriptionId.set(n,t),this.ws.send(JSON.stringify({type:"bind-with-token",payload:{token:r}}))}catch(n){console.error(Ye(n)),this.emitError(t,n),this.removeCriteriaEntry(t)}}}async refreshAllSubscriptions(){this.criteriaEntriesBySubscriptionId.clear();for(const t of this.criteriaEntries.values())for(const n of[...t.bareCriteria?[t.bareCriteria]:[],...t.criteriaWithProps])n.clearAttachedSubscription(),await this.subscribeToCriteria(n)}addCriteria(t,n){this.masterSubEmitter&&this.masterSubEmitter._addCriteria(t);const r=this.maybeGetCriteriaEntry(t,n);if(r)return r.refCount+=1,r.emitter;const i=new cV(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 zy(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const qA="4.3.3-ded292ba7",dV=hn.FHIR_JSON+", */*; q=0.1",fV="https://api.medplum.com/",hV=1e3,pV=6e4,mV=0,gV=3e5,vV="Binary/",jE={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]},Xl={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"},yV={AccessToken:"urn:ietf:params:oauth:token-type:access_token"},xV={JwtBearer:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"};class GA extends Xp{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)??bV(),this.storage=(t==null?void 0:t.storage)??new iV,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=eb((t==null?void 0:t.baseUrl)??fV),this.fhirBaseUrl=Xi(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4"),this.authorizeUrl=Xi(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=Xi(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=Xi(this.baseUrl,(t==null?void 0:t.logoutUrl)??"oauth2/logout"),this.fhircastHubUrl=Xi(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)??gV,this.cacheTime=(t==null?void 0:t.cacheTime)??(typeof window>"u"?mV:pV),this.cacheTime>0?this.requestCache=new aA((t==null?void 0:t.resourceCacheSize)??hV):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=Xi(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 s=new Ai(i);return this.setCacheEntry(t,s),s}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,hn.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,s=!0){let c=i;s&&(c=await this.ensureCodeChallenge(i)),window.location.assign(this.getExternalAuthRedirectUri(t,n,r,c,s))}async exchangeExternalAccessToken(t,n){if(n=n??this.clientId,!n)throw new Error("MedplumClient is missing clientId");return this.fetchTokens({grant_type:Xl.TokenExchange,subject_token_type:yV.AccessToken,client_id:n,subject_token:t})}getExternalAuthRedirectUri(t,n,r,i,s=!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)),s){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(Xi(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),s="search-"+i.toString(),c=this.getCacheEntry(s,r);if(c)return c.value;const u=this.getBundle(i,r);return this.setCacheEntry(s,u),u}searchOne(t,n,r){const i=this.fhirSearchUrl(t,n);i.searchParams.set("_count","1"),i.searchParams.sort();const s="searchOne-"+i.toString(),c=this.getCacheEntry(s,r);if(c)return c.value;const u=new Ai(this.search(t,i.searchParams,r).then(f=>{var p,m;return(m=(p=f.entry)==null?void 0:p[0])==null?void 0:m.resource}));return this.setCacheEntry(s,u),u}searchResources(t,n,r){const s="searchResources-"+this.fhirSearchUrl(t,n).toString(),c=this.getCacheEntry(s,r);if(c)return c.value;const u=new Ai(this.search(t,n,r).then(TE));return this.setCacheEntry(s,u),u}async*searchResourcePages(t,n,r){var s,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),p=(s=f.link)==null?void 0:s.find(m=>m.relation==="next");if(!((c=f.entry)!=null&&c.length)&&!p)break;yield TE(f),i=p!=null&&p.url?new URL(p.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,s;const r=(s=(i=this.requestCache)==null?void 0:i.get(this.fhirUrl(t,n).toString()))==null?void 0:s.value;return r!=null&&r.isOk()?r.read():void 0}getCachedReference(t){const n=t.reference;if(!n)return;if(n==="system")return jE;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 Ai(Promise.reject(new Error("Missing reference")));if(r==="system")return new Ai(Promise.resolve(jE));const[i,s]=r.split("/");return!i||!s?new Ai(Promise.reject(new Error("Invalid reference"))):this.readResource(i,s,n)}requestSchema(t){if(fA(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const i=new Ai((async()=>{const s=`{
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(s);iE(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)&&Y0(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 s=new Ai((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(),{});iE(u)}else{const c=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});if(!c){console.warn(`No StructureDefinition found for ${t}!`);return}dA(c)}})());return this.setCacheEntry(r,s),s}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 s=await this.post(i,t,void 0,r);return this.cacheResource(s),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),s}async upsertResource(t,n,r){const i=this.fhirSearchUrl(t.resourceType,n);let s=await this.put(i,t,void 0,r);return s||(s=t),this.cacheResource(s),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),s}async createAttachment(t,n,r,i,s){let c=RE(t,n,r,i);if(c.contentType===hn.XML){const p=c.data;let m;p instanceof Blob?m=await new Promise((g,y)=>{const b=new FileReader;b.onload=()=>{if(!b.result){y(new Error("Failed to load file"));return}g(b.result)},b.readAsText(p,"utf-8")}):ArrayBuffer.isView(p)?m=new TextDecoder().decode(p):m=p,m.includes("<ClinicalDocument")&&m.includes("urn:hl7-org:v3")&&(c={...c,contentType:hn.CDA_XML})}const u=s??(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,s){const c=RE(t,n,r,i),u=s??(typeof n=="object"?n:{}),{data:f,contentType:p,filename:m,securityContext:g,onProgress:y}=c,b=this.fhirUrl("Binary");return m&&b.searchParams.set("_filename",m),g!=null&&g.reference&&this.setRequestHeader(u,"X-Security-Context",g.reference),y?this.uploadwithProgress(b,f,p,y,u):this.post(b,f,p,u)}uploadwithProgress(t,n,r,i,s){return new Promise((c,u)=>{var g;const f=new XMLHttpRequest,p=()=>f.abort();(g=s==null?void 0:s.signal)==null||g.addEventListener("abort",p);const m=y=>{var b;(b=s==null?void 0:s.signal)==null||b.removeEventListener("abort",p),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 dt(Zt(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"),s!=null&&s.headers){const y=s.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 s=jV(t,n,r,i),c=typeof n=="object"?n:{},{docDefinition:u,tableLayouts:f,fonts:p,...m}=s,g=await this.createPdfImpl(u,f,p),y={...m,data:g,contentType:"application/pdf"};return this.createBinary(y,c)}createComment(t,n,r){const i=this.getProfile();let s,c;return t.resourceType==="Encounter"&&(s=on(t),c=t.subject),t.resourceType==="ServiceRequest"&&(s=t.encounter,c=t.subject),t.resourceType==="Patient"&&(c=on(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[on(t)],encounter:s,subject:c,sender:i?on(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 s=await this.patch(this.fhirUrl(t,n),r,i);return this.cacheResource(s),this.invalidateUrl(this.fhirUrl(t,n,"_history")),this.invalidateSearches(t),s}deleteResource(t,n,r){return this.deleteCacheEntry(this.fhirUrl(t,n).toString()),this.invalidateSearches(t),this.delete(this.fhirUrl(t,n),r)}validateResource(t,n){return this.post(this.fhirUrl(t.resourceType,"$validate"),t,void 0,n)}executeBot(t,n,r,i){let s;if(typeof t=="string"){const c=t;s=this.fhirUrl("Bot",c,"$execute")}else{const c=t;s=this.fhirUrl("Bot","$execute"),s.searchParams.set("identifier",c.system+"|"+c.value)}return this.post(s,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,hn.JSON,n)}graphql(t,n,r,i){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},hn.JSON,i)}readResourceGraph(t,n,r,i){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,i)}pushToAgent(t,n,r,i,s,c){const{waitTimeout:u,...f}=c??{};return this.post(this.fhirUrl("Agent",Bs(t),"$push"),{destination:typeof n=="string"?n:zt(n),body:r,contentType:i,waitForResponse:s,...u!==void 0?{waitTimeout:u}:void 0},hn.FHIR_JSON,f)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){var n,r;(!((n=this.sessionDetails)!=null&&n.profile)||zt(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=nV(t),this.medplumServer=tV(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const n=this.getLogins().filter(r=>{var i,s;return((i=r.profile)==null?void 0:i.reference)!==((s=t.profile)==null?void 0:s.reference)});n.push(t),this.storage.setObject("logins",n)}async refreshProfile(){return this.medplumServer?(this.profilePromise=new Promise((t,n)=>{this.get("auth/me",{cache:"no-cache"}).then(r=>{var s,c;this.profilePromise=void 0;const i=((c=(s=this.sessionDetails)==null?void 0:s.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(vV)&&(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,s=await this.createResource({resourceType:"Media",status:"preparation",content:{contentType:t.contentType},...r});i.securityContext||(i.securityContext=on(s));const c=await this.createAttachment(i,n);return this.updateResource({...s,status:"completed",content:c})}async uploadMedia(t,n,r,i,s){return this.createMedia({data:t,contentType:n,filename:r,additionalFields:i},s)}async createDocumentReference(t,n){const{additionalFields:r,...i}=t,s=await this.createResource({resourceType:"DocumentReference",status:"current",content:[{attachment:{contentType:t.contentType}}],...r});i.securityContext||(i.securityContext=on(s));const c=await this.createAttachment(i,n);return this.updateResource({...s,content:[{attachment:c}]})}async bulkExport(t="",n,r,i){const s=t&&`${t}/`,c=this.fhirUrl(`${s}$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 rV(this)),this.keyValueClient}getBundle(t,n){return new Ai((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 Ai(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 s=await this.fetchWithRetry(n,r);if(s.status===401)return this.handleUnauthenticated(t,n,r);if(s.status===204||s.status===304)return;const c=s.headers.get("content-type"),u=c==null?void 0:c.includes("json");if(s.status===404&&!u)throw new dt(x8);const f=await this.parseBody(s,u);if(s.status===200&&r.followRedirectOnOk||s.status===201&&r.followRedirectOnCreated){const p=await EE(s,f);if(p)return this.request("GET",p,{...r,body:void 0})}if(s.status===202&&r.pollStatusOnAccepted){const m=await EE(s,f)??i.statusUrl;if(m)return this.pollStatus(m,r,i)}if(s.status>=400)throw new dt(Zt(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=Xi(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 s=await this.fetch(t,n);if(this.options.verbose&&this.logResponse(s),this.setCurrentRateLimit(s),i>=r||!CV(s))return s;const c=this.getRetryDelay(i),u=n.maxRetryTime??2e3;if(c>u)return s;await fE(c)}catch(s){if(s.message==="Failed to fetch"&&i===0&&this.dispatchEvent({type:"offline"}),s.name==="AbortError"||i===r)throw s}throw new Error("Unreachable")}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const i of ad(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),s=r.find(p=>p.startsWith("r=")),c=s?parseInt(s.substring(2),10):NaN,u=r.find(p=>p.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 s=n.pollStatusPeriod??1e3;await fE(s),r.pollCount++}return this.request("GET",t,i,r)}async executeAutoBatch(){var i,s;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,Xi(this.fhirBaseUrl,c.url),c.options))}catch(u){c.reject(new dt(Zt(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];(s=f==null?void 0:f.response)!=null&&s.outcome&&!sA(f.response.outcome)?u.reject(new dt(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",dV,!0),this.options.extendedMode!==!1&&this.setRequestHeader(t,"X-Medplum","extended"),t.body&&this.setRequestHeader(t,"Content-Type",hn.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 s=t.headers;i&&s[n]||(s[n]=r)}setRequestBody(t,n){typeof n=="string"||typeof Blob<"u"&&(n instanceof Blob||(n==null?void 0:n.constructor.name)==="Blob")||typeof File<"u"&&(n instanceof File||(n==null?void 0:n.constructor.name)==="File")||typeof Uint8Array<"u"&&(n instanceof Uint8Array||(n==null?void 0:n.constructor.name)==="Uint8Array")?t.body=n:n&&(t.body=JSON.stringify(n))}handleUnauthenticated(t,n,r){return this.refresh()?this.request(t,n,r):(this.clear(),this.onUnauthenticated&&this.onUnauthenticated(),Promise.reject(new dt(id)))}async startPkce(){const t=yE();sessionStorage.setItem("pkceState",t);const n=yE().slice(0,128);sessionStorage.setItem("codeVerifier",n);const r=await zB(n),i=lU(r).replaceAll("+","-").replaceAll("/","_").replaceAll("=","");return sessionStorage.setItem("codeChallenge",i),{codeChallengeMethod:"S256",codeChallenge:i}}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??CE()),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:Xl.AuthorizationCode,code:t,client_id:(n==null?void 0:n.clientId)??this.clientId??"",redirect_uri:(n==null?void 0:n.redirectUri)??CE()};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:Xl.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:Xl.ClientCredentials,client_id:t,client_secret:n})}async startJwtBearerLogin(t,n,r){return this.clientId=t,this.fetchTokens({grant_type:Xl.JwtBearer,client_id:t,assertion:n,scope:r})}async startJwtAssertionLogin(t){return this.fetchTokens({grant_type:Xl.ClientCredentials,client_assertion_type:xV.JwtBearer,client_assertion:t})}setBasicAuth(t,n){this.clientId=t,this.clientSecret=n,this.basicAuth=vE(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new dt(yn("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new dt(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},s=(await this.post(this.fhircastHubUrl,xE(r),hn.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!s)throw new Error("Invalid response!");return r.endpoint=s,r}async fhircastUnsubscribe(t){if(!db(t))throw new dt(yn("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new dt(yn("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post(this.fhircastHubUrl,xE(t),hn.FORM_URL_ENCODED)}fhircastConnect(t){return new ZB(t)}async fhircastPublish(t,n,r,i){return qB(n)?this.post(this.fhircastHubUrl,bE(t,n,r,i),hn.JSON):(GB(n),this.post(this.fhircastHubUrl,bE(t,n,r),hn.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":hn.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 ${vE(t.client_id+":"+t.client_secret)}`));const i={method:"POST",headers:r,body:n.toString(),credentials:"include"};let s;try{s=await this.fetchWithRetry(this.tokenUrl,i)}catch(u){throw this.refreshPromise=void 0,u}if(!s.ok){this.clearActiveLogin();try{const u=await s.json();throw new dt(ra(u.error_description))}catch(u){throw new dt(ra("Failed to fetch tokens"),u)}}const c=await s.json();return await this.verifyTokens(c),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(eV(n)){const r=fb(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new dt(b8);if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new dt(nE)}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new dt(nE)}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 uV(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 bV(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function CE(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}async function EE(e,t){var i,s;const n=e.headers.get("content-location");if(n)return n;const r=e.headers.get("location");if(r)return r;if(qp(t)&&((s=(i=t.issue)==null?void 0:i[0])!=null&&s.diagnostics))return t.issue[0].diagnostics}function TE(e){var n;const t=((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];return Object.assign(t,{bundle:e})}function SV(e){return sr(e)&&"data"in e&&"contentType"in e}function RE(e,t,n,r){return SV(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function wV(e){return sr(e)&&"docDefinition"in e}function jV(e,t,n,r){return wV(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function CV(e){return e.status===429||e.status>=500}function yc({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:i,accessPolicyResource:s}){if(t===(e==null?void 0:e.path))return;i??(i=(e==null?void 0:e.debugMode)??!1),s??(s=e==null?void 0:e.accessPolicyResource);let c=EV(t,n,e,!!i);const u=My(t,".",2)[1];c=TV(c,s,u),c=RV(c,s,u);const f=Object.create(null);for(const[m,g]of Object.entries(c))f[t+"."+m]=g;let p;if(e&&!e.isDefaultContext)p=e.getExtendedProps;else{const m=Object.create(null);p=g=>{const y=My(g,".",2)[1];if(y){if(!m[y]){const b=Vh(y,s==null?void 0:s.hiddenFields);m[y]={hidden:b,readonly:b||Vh(y,s==null?void 0:s.readonlyFields)}}return m[y]}}}return{path:t,elements:c,elementsByPath:f,profileUrl:r??(e==null?void 0:e.profileUrl),debugMode:i,getExtendedProps:p,accessPolicyResource:s}}function EV(e,t,n,r){const i=Object.create(null);if(n)for(const[c,u]of Object.entries(n.elementsByPath)){const f=ks(e,c);f!==void 0&&(i[f]=u)}let s=!1;if(t)for(const[c,u]of Object.entries(t))c in i||(i[c]=u,s=!0);return r&&console.assert(s,"Unnecessary ElementsContext; not using any newly provided elements"),i}function TV(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(([s])=>!Vh(r+s,t.hiddenFields)))}function RV(e,t,n){var s;if(!((s=t==null?void 0:t.readonlyFields)!=null&&s.length))return e;const r=Object.create(null),i=n?n+".":"";for(const[c,u]of Object.entries(e))Vh(i+c,t.readonlyFields)?r[c]={...u,readonly:!0}:r[c]=u;return r}function Vh(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 QA(e){return e.type!==void 0&&e.type.length>0}function DV(e,t,n,r){var s;const i=L$(e,t.path,{profileUrl:r});if(i){const c=((s=n.typeSchema)==null?void 0:s.elements)??n.elements;return i.some(u=>U$(u,t,n,c))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function WA(e,t,n,r){var i,s;if(e)for(const c of t){const u={value:e,type:((i=c.typeSchema)==null?void 0:i.type)??((s=c.type)==null?void 0:s[0].code)};if(n.every(f=>{var p;return DV(u,f,c,((p=c.typeSchema)==null?void 0:p.url)??r)}))return c.name}}class AV{constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const i=yc({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(([s])=>s.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=_V(t);for(const i of r)this.crawlElementNode(i,n)}crawlElementNode(t,n){var i,s;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((s=(i=t.element)==null?void 0:i.slicing)==null?void 0:s.slices)&&this.crawlSlicingImpl(t.element.slicing,r),this.visitor.onExitElement&&this.visitor.onExitElement(r,t.element,this.elementsContext)}prepareSlices(t,n){var s,c;const r=[];for(const u of t){if(!QA(u))continue;const f=(c=(s=u.type.find(p=>Tn(p.profile)))==null?void 0:s.profile)==null?void 0:c[0];if(Tn(f)){const p=Pc(f);p&&(u.typeSchema=p)}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 s;const c=(i==null?void 0:i.elements)??t.elements;Tn(c)&&(s=yc({path:n,parentContext:this.elementsContext,elements:c})),s&&this.elementsContextStack.push(s),this.crawlElementsImpl(c,n),s&&this.elementsContextStack.pop(),this.visitor.onExitSlice&&this.visitor.onExitSlice(n,t,r),i&&this.visitor.onExitSchema&&this.visitor.onExitSchema(i)}}function _V(e){const t=[];function n(s,c){return c.startsWith(s+".")}function r(s,c){for(const u of s.children)if(n(u.key,c.key)){r(u,c);return}s.children.push(c)}const i=Object.entries(e);i.sort((s,c)=>s[0].localeCompare(c[0]));for(const[s,c]of i){const u={key:s,element:c,children:[]};let f=!1;for(const p of t)if(n(p.key,s)){r(p,u),f=!0;break}f||t.push(u)}return t}const Gv="__sliceName";function kV(e,t){const n=new PV(e,e.resourceType,"resource");return new AV(t,n).crawlResource(),n.getDefaultValue()}function DE(e,t,n){for(const[r,i]of Object.entries(t)){if(n===void 0||n===r){Fh(e,r,i,t);continue}const s=ks(n,r);s!==void 0&&Fh(e,s,i,t)}return e}class PV{constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=Qr(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,s=this.value.path,c=ks(s,t);if(c===void 0)throw new Error(`Expected ${t} to be prefixed by ${s}`);const u=[];for(const f of i){if(f===void 0)continue;const p=ks(r.path,s),m=Array.isArray(f)?f:[f];for(const g of m){NV(g,c,n,r.elements,p),Fh(g,c,n,r.elements);const y=Uy(g,c,r.elements,p);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 s=ks(this.value.path,t);if(s===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);const c=ks(r.path,this.value.path);for(const u of this.value.values){const f=Uy(u,s,r.elements,c);if(Array.isArray(f))for(let p=f.length-1;p>=0;p--){const m=f[p];Tn(m)||f.splice(p,1)}Rn(f)&&$y(u,void 0,s,n)}}onEnterSlice(t,n,r){const i=this.value.values,s=[];for(const c of i)if(c!==void 0){const u=Array.isArray(c)?c:[c],f=this.getMatchingSliceValues(u,n,r);s.push(f)}this.valueStack.push({type:"slice",path:t,values:s})}getMatchingSliceValues(t,n,r){const i=[];for(const s of t)(s[Gv]??WA(s,[n],r.discriminator,this.schema.url))===n.name&&i.push(s);for(let s=i.length;s<n.min;s++)if(J0(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];Gv in i&&delete i[Gv]}}getDefaultValue(){return this.rootValue}}function NV(e,t,n,r,i){const s=Uy(e,t,r,i);n.min>0&&s===void 0&&J0(n.type[0].code)&&(n.isArray?$y(e,[Object.create(null)],t,n):$y(e,Object.create(null),t,n))}function $y(e,t,n,r){if(n.includes("."))throw new Error("key cannot be nested");let i=n;if(n.includes("[x]")){const s=r.type[0].code;i=n.replace("[x]",Hn(s))}t===void 0?delete e[i]:e[i]=t}function Uy(e,t,n,r){const i=t.split(".");let s=e,c;for(let u=0;u<i.length;u++){let f=i[u];if(f.includes("[x]")){const p=(r?r+".":"")+i.slice(0,u+1).join("."),g=n[p].type[0].code;f=f.replace("[x]",Hn(g))}if(u===i.length-1){Array.isArray(s)?c=s.map(p=>p[f]):c=s[f];continue}if(Array.isArray(s))s=s.map(p=>p[f]);else if(sr(s)){if(s[f]===void 0)return;s=s[f]}else return}return c}function Fh(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(u=>Fh(u,t,n,r));e==null&&(e=Object.create(null));const i=e,s=t.split(".");let c=i;for(let u=0;u<s.length;u++){let f=s[u];if(f.includes("[x]")){const m=r[s.slice(0,u+1).join(".")].type[0].code;f=f.replace("[x]",Hn(m))}if(u===s.length-1){const p=Array.isArray(c)?c:[c];for(const m of p)n.fixed?m[f]??(m[f]=n.fixed.value):n.pattern&&(m[f]=YA(m[f],n.pattern.value))}else{if(!(f in c)){const p=s.slice(0,u+1).join(".");c[f]=r[p].isArray?[Object.create(null)]:Object.create(null)}c=c[f]}}return i}function YA(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return((e==null?void 0:e.length)??0)>0?e:Qr(t);if(sr(t)&&(sr(e)&&!Array.isArray(e)||e===void 0)){const n=Qr(e)??Object.create(null);for(const r of Object.keys(t))n[r]=YA(n[r],t[r]);return n}return e}const OV="https://meta.medplum.com/releases",Qv=new Map;function MV(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 IV(e,t,n){let r=Qv.get("latest");if(!r){const i="latest",s=new URL(`${OV}/${i}.json`);s.searchParams.set("a",e),s.searchParams.set("c",qA);const c=await fetch(s.toString());if(c.status!==200){let f;try{f=(await c.json()).message}catch(p){console.error(`Failed to parse message from body: ${Ye(p)}`)}throw new Error(`Received status code ${c.status} while fetching manifest for version 'latest'. Message: ${f}`)}const u=await c.json();MV(u),r=u,Qv.set("latest",r),Qv.set(r.tag_name.slice(1),r)}return r}async function LV(e){const t=await IV(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 KA=v.createContext(void 0);function Zp(){return v.useContext(KA)}function _e(){return Zp().medplum}function Jp(){return Zp().navigate}function em(){return Zp().profile}const AE=["change","storageInitialized","storageInitFailed","profileRefreshing","profileRefreshed"];function zV(e){const t=e.medplum,n=e.navigate??$V,[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 AE)t.addEventListener(u,c);return()=>{for(const u of AE)t.removeEventListener(u,c)}},[t]);const s=v.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return o.jsx(KA.Provider,{value:s,children:e.children})}function $V(e){window.location.assign(e)}const _E=new Map,XA=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=_E.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 _E.set(t,e),e},[e]);function UV(e){const t=v.useRef(void 0);return v.useEffect(()=>{t.current=e}),t.current}function Qt(e,t){const n=_e(),[r,i]=v.useState(()=>kE(n,e)),s=v.useCallback(c=>{sa(c,r)||i(c)},[r]);return v.useEffect(()=>{let c=!0;const u=kE(n,e);return!u&&Ko(e)?n.readReference(e).then(f=>{c&&s(f)}).catch(f=>{c&&(s(void 0),t&&t(Zt(f)))}):s(u),()=>c=!1},[n,e,s,t]),r}function kE(e,t){if(t){if(fa(t))return t;if(Ko(t))return e.getCachedReference(t)}}function BV(e,t,n={leading:!1}){const[r,i]=v.useState(e),s=v.useRef(!1),c=v.useRef(void 0),u=v.useRef(!1),f=v.useCallback(()=>window.clearTimeout(c.current),[]);return v.useEffect(()=>{s.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(()=>(s.current=!0,f),[f]),[r,f]}const VV=250;function FV(e,t,n){return ZA("searchOne",e,t)}function xc(e,t,n){return ZA("searchResources",e,t)}function ZA(e,t,n,r){const i=_e(),[s,c]=v.useState(),[u,f]=v.useState(!0),[p,m]=v.useState(),[g,y]=v.useState(),b=i.fhirSearchUrl(t,n).toString(),[S]=BV(b,VV,{leading:!0});return v.useEffect(()=>{S!==s&&(c(S),i[e](t,n).then(j=>{f(!1),m(j),y(y8)}).catch(j=>{f(!1),m(void 0),y(Zt(j))}))},[i,e,t,n,s,S]),[p,u,g]}function HV(e){const t=e.value;return t?o.jsx(o.Fragment,{children:DA(t)}):null}const JA=["meta","implicitRules","contained","extension","modifierExtension"],e_=["language","text"],cn=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});cn.displayName="ElementsContext";const hb=["extension","modifierExtension"],qV=["id",...JA].filter(e=>!hb.includes(e));function GV(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||hb.includes(n)&&!Tn((i=r.slicing)==null?void 0:i.slices)||qV.includes(n)?!1:!(e_.includes(n)&&r.path.split(".").length===2||n.includes("."))})}function PE(e,t){return e.line&&e.line.length>t?e.line[t]:""}function NE(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:r}}function QV(e){const[t,n]=v.useState(e.defaultValue||{}),r=v.useRef(t);r.current=t;const{getExtendedProps:i}=v.useContext(cn),[s,c,u,f,p,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(NE(r.current||{},0,R))}function C(R){y(NE(r.current||{},1,R))}function T(R){y({...r.current,city:R})}function D(R){y({...r.current,state:R})}function E(R){y({...r.current,postalCode:R})}return o.jsxs(je,{gap:"xs",wrap:"nowrap",grow:!0,children:[o.jsx(ln,{disabled:e.disabled||(s==null?void 0:s.readonly),"data-testid":"address-use",defaultValue:t.use,onChange:R=>b(R.currentTarget.value),data:["","home","work","temp","old","billing"]}),o.jsx(ln,{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"]}),o.jsx(ze,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"Line 1",defaultValue:PE(t,0),onChange:R=>j(R.currentTarget.value)}),o.jsx(ze,{disabled:e.disabled||(f==null?void 0:f.readonly),placeholder:"Line 2",defaultValue:PE(t,1),onChange:R=>C(R.currentTarget.value)}),o.jsx(ze,{disabled:e.disabled||(p==null?void 0:p.readonly),placeholder:"City",defaultValue:t.city,onChange:R=>T(R.currentTarget.value)}),o.jsx(ze,{disabled:e.disabled||(m==null?void 0:m.readonly),placeholder:"State",defaultValue:t.state,onChange:R=>D(R.currentTarget.value)}),o.jsx(ze,{disabled:e.disabled||(g==null?void 0:g.readonly),placeholder:"Postal Code",defaultValue:t.postalCode,onChange:R=>E(R.currentTarget.value)})]})}function WV(e){const t=em(),[n,r]=v.useState(e.defaultValue||{});function i(s){const c=s?{text:s,authorReference:t&&on(t),time:new Date().toISOString()}:{};r(c),e.onChange&&e.onChange(c)}return o.jsx(ze,{disabled:e.disabled,name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:s=>i(s.currentTarget.value)})}/**
127
- * @license @tabler/icons-react v3.17.0 - 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 YV={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.17.0 - MIT
133
- *
134
- * This source code is licensed under the MIT license.
135
- * See the LICENSE file in the root directory of this source tree.
136
- */const Ve=(e,t,n,r)=>{const i=v.forwardRef(({color:s="currentColor",size:c=24,stroke:u=2,title:f,className:p,children:m,...g},y)=>v.createElement("svg",{ref:y,...YV[e],width:c,height:c,className:["tabler-icon",`tabler-icon-${t}`,p].join(" "),...e==="filled"?{fill:s}:{strokeWidth:u,stroke:s},...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.17.0 - MIT
138
- *
139
- * This source code is licensed under the MIT license.
140
- * See the LICENSE file in the root directory of this source tree.
141
- */var KV=Ve("outline","adjustments-horizontal","IconAdjustmentsHorizontal",[["path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M4 6l8 0",key:"svg-1"}],["path",{d:"M16 6l4 0",key:"svg-2"}],["path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-3"}],["path",{d:"M4 12l2 0",key:"svg-4"}],["path",{d:"M10 12l10 0",key:"svg-5"}],["path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-6"}],["path",{d:"M4 18l11 0",key:"svg-7"}],["path",{d:"M19 18l1 0",key:"svg-8"}]]);/**
142
- * @license @tabler/icons-react v3.17.0 - MIT
143
- *
144
- * This source code is licensed under the MIT license.
145
- * See the LICENSE file in the root directory of this source tree.
146
- */var rl=Ve("outline","alert-circle","IconAlertCircle",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]]);/**
147
- * @license @tabler/icons-react v3.17.0 - MIT
148
- *
149
- * This source code is licensed under the MIT license.
150
- * See the LICENSE file in the root directory of this source tree.
151
- */var XV=Ve("outline","arrow-down","IconArrowDown",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 13l-6 6",key:"svg-1"}],["path",{d:"M6 13l6 6",key:"svg-2"}]]);/**
152
- * @license @tabler/icons-react v3.17.0 - MIT
153
- *
154
- * This source code is licensed under the MIT license.
155
- * See the LICENSE file in the root directory of this source tree.
156
- */var ZV=Ve("outline","arrow-up","IconArrowUp",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]]);/**
157
- * @license @tabler/icons-react v3.17.0 - MIT
158
- *
159
- * This source code is licensed under the MIT license.
160
- * See the LICENSE file in the root directory of this source tree.
161
- */var JV=Ve("outline","bleach-off","IconBleachOff",[["path",{d:"M5 19h14m1.986 -1.977a2 2 0 0 0 -.146 -.773l-7.1 -12.25a2 2 0 0 0 -3.5 0l-.815 1.405m-1.488 2.568l-4.797 8.277a2 2 0 0 0 1.75 2.75",key:"svg-0"}],["path",{d:"M3 3l18 18",key:"svg-1"}]]);/**
162
- * @license @tabler/icons-react v3.17.0 - MIT
163
- *
164
- * This source code is licensed under the MIT license.
165
- * See the LICENSE file in the root directory of this source tree.
166
- */var eF=Ve("outline","bleach","IconBleach",[["path",{d:"M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75",key:"svg-0"}]]);/**
167
- * @license @tabler/icons-react v3.17.0 - MIT
168
- *
169
- * This source code is licensed under the MIT license.
170
- * See the LICENSE file in the root directory of this source tree.
171
- */var tF=Ve("outline","box-multiple","IconBoxMultiple",[["path",{d:"M7 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M17 17v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h2",key:"svg-1"}]]);/**
172
- * @license @tabler/icons-react v3.17.0 - MIT
173
- *
174
- * This source code is licensed under the MIT license.
175
- * See the LICENSE file in the root directory of this source tree.
176
- */var nF=Ve("outline","brackets-contain","IconBracketsContain",[["path",{d:"M7 4h-4v16h4",key:"svg-0"}],["path",{d:"M17 4h4v16h-4",key:"svg-1"}],["path",{d:"M8 16h.01",key:"svg-2"}],["path",{d:"M12 16h.01",key:"svg-3"}],["path",{d:"M16 16h.01",key:"svg-4"}]]);/**
177
- * @license @tabler/icons-react v3.17.0 - MIT
178
- *
179
- * This source code is licensed under the MIT license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */var rF=Ve("outline","brand-asana","IconBrandAsana",[["path",{d:"M12 7m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-0"}],["path",{d:"M17 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M7 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-2"}]]);/**
182
- * @license @tabler/icons-react v3.17.0 - MIT
183
- *
184
- * This source code is licensed under the MIT license.
185
- * See the LICENSE file in the root directory of this source tree.
186
- */var iF=Ve("outline","bucket-off","IconBucketOff",[["path",{d:"M5.029 5.036c-.655 .58 -1.029 1.25 -1.029 1.964c0 2.033 3.033 3.712 6.96 3.967m3.788 -.21c3.064 -.559 5.252 -2.029 5.252 -3.757c0 -2.21 -3.582 -4 -8 -4c-1.605 0 -3.1 .236 -4.352 .643",key:"svg-0"}],["path",{d:"M4 7c0 .664 .088 1.324 .263 1.965l2.737 10.035c.5 1.5 2.239 2 5 2s4.5 -.5 5 -2c.1 -.3 .252 -.812 .457 -1.535m.862 -3.146c.262 -.975 .735 -2.76 1.418 -5.354a7.45 7.45 0 0 0 .263 -1.965",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]]);/**
187
- * @license @tabler/icons-react v3.17.0 - MIT
188
- *
189
- * This source code is licensed under the MIT license.
190
- * See the LICENSE file in the root directory of this source tree.
191
- */var aF=Ve("outline","bucket","IconBucket",[["path",{d:"M12 7m-8 0a8 4 0 1 0 16 0a8 4 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 7c0 .664 .088 1.324 .263 1.965l2.737 10.035c.5 1.5 2.239 2 5 2s4.5 -.5 5 -2c.333 -1 1.246 -4.345 2.737 -10.035a7.45 7.45 0 0 0 .263 -1.965",key:"svg-1"}]]);/**
192
- * @license @tabler/icons-react v3.17.0 - MIT
193
- *
194
- * This source code is licensed under the MIT license.
195
- * See the LICENSE file in the root directory of this source tree.
196
- */var oF=Ve("outline","building","IconBuilding",[["path",{d:"M3 21l18 0",key:"svg-0"}],["path",{d:"M9 8l1 0",key:"svg-1"}],["path",{d:"M9 12l1 0",key:"svg-2"}],["path",{d:"M9 16l1 0",key:"svg-3"}],["path",{d:"M14 8l1 0",key:"svg-4"}],["path",{d:"M14 12l1 0",key:"svg-5"}],["path",{d:"M14 16l1 0",key:"svg-6"}],["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16",key:"svg-7"}]]);/**
197
- * @license @tabler/icons-react v3.17.0 - MIT
198
- *
199
- * This source code is licensed under the MIT license.
200
- * See the LICENSE file in the root directory of this source tree.
201
- */var Po=Ve("outline","calendar","IconCalendar",[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v4",key:"svg-2"}],["path",{d:"M4 11h16",key:"svg-3"}],["path",{d:"M11 15h1",key:"svg-4"}],["path",{d:"M12 15v3",key:"svg-5"}]]);/**
202
- * @license @tabler/icons-react v3.17.0 - MIT
203
- *
204
- * This source code is licensed under the MIT license.
205
- * See the LICENSE file in the root directory of this source tree.
206
- */var eo=Ve("outline","check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]);/**
207
- * @license @tabler/icons-react v3.17.0 - MIT
208
- *
209
- * This source code is licensed under the MIT license.
210
- * See the LICENSE file in the root directory of this source tree.
211
- */var sF=Ve("outline","checkbox","IconCheckbox",[["path",{d:"M9 11l3 3l8 -8",key:"svg-0"}],["path",{d:"M20 12v6a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h9",key:"svg-1"}]]);/**
212
- * @license @tabler/icons-react v3.17.0 - MIT
213
- *
214
- * This source code is licensed under the MIT license.
215
- * See the LICENSE file in the root directory of this source tree.
216
- */var pb=Ve("outline","chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]);/**
217
- * @license @tabler/icons-react v3.17.0 - MIT
218
- *
219
- * This source code is licensed under the MIT license.
220
- * See the LICENSE file in the root directory of this source tree.
221
- */var lF=Ve("outline","circle-check","IconCircleCheck",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l2 2l4 -4",key:"svg-1"}]]);/**
222
- * @license @tabler/icons-react v3.17.0 - MIT
223
- *
224
- * This source code is licensed under the MIT license.
225
- * See the LICENSE file in the root directory of this source tree.
226
- */var Hh=Ve("outline","circle-minus","IconCircleMinus",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l6 0",key:"svg-1"}]]);/**
227
- * @license @tabler/icons-react v3.17.0 - MIT
228
- *
229
- * This source code is licensed under the MIT license.
230
- * See the LICENSE file in the root directory of this source tree.
231
- */var qh=Ve("outline","circle-plus","IconCirclePlus",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M9 12h6",key:"svg-1"}],["path",{d:"M12 9v6",key:"svg-2"}]]);/**
232
- * @license @tabler/icons-react v3.17.0 - MIT
233
- *
234
- * This source code is licensed under the MIT license.
235
- * See the LICENSE file in the root directory of this source tree.
236
- */var mb=Ve("outline","cloud-upload","IconCloudUpload",[["path",{d:"M7 18a4.6 4.4 0 0 1 0 -9a5 4.5 0 0 1 11 2h1a3.5 3.5 0 0 1 0 7h-1",key:"svg-0"}],["path",{d:"M9 15l3 -3l3 3",key:"svg-1"}],["path",{d:"M12 12l0 9",key:"svg-2"}]]);/**
237
- * @license @tabler/icons-react v3.17.0 - MIT
238
- *
239
- * This source code is licensed under the MIT license.
240
- * See the LICENSE file in the root directory of this source tree.
241
- */var cF=Ve("outline","columns","IconColumns",[["path",{d:"M4 6l5.5 0",key:"svg-0"}],["path",{d:"M4 10l5.5 0",key:"svg-1"}],["path",{d:"M4 14l5.5 0",key:"svg-2"}],["path",{d:"M4 18l5.5 0",key:"svg-3"}],["path",{d:"M14.5 6l5.5 0",key:"svg-4"}],["path",{d:"M14.5 10l5.5 0",key:"svg-5"}],["path",{d:"M14.5 14l5.5 0",key:"svg-6"}],["path",{d:"M14.5 18l5.5 0",key:"svg-7"}]]);/**
242
- * @license @tabler/icons-react v3.17.0 - MIT
243
- *
244
- * This source code is licensed under the MIT license.
245
- * See the LICENSE file in the root directory of this source tree.
246
- */var t_=Ve("outline","copy","IconCopy",[["path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]]);/**
247
- * @license @tabler/icons-react v3.17.0 - MIT
248
- *
249
- * This source code is licensed under the MIT license.
250
- * See the LICENSE file in the root directory of this source tree.
251
- */var uF=Ve("outline","currency-dollar","IconCurrencyDollar",[["path",{d:"M16.7 8a3 3 0 0 0 -2.7 -2h-4a3 3 0 0 0 0 6h4a3 3 0 0 1 0 6h-4a3 3 0 0 1 -2.7 -2",key:"svg-0"}],["path",{d:"M12 3v3m0 12v3",key:"svg-1"}]]);/**
252
- * @license @tabler/icons-react v3.17.0 - MIT
253
- *
254
- * This source code is licensed under the MIT license.
255
- * See the LICENSE file in the root directory of this source tree.
256
- */var dF=Ve("outline","device-floppy","IconDeviceFloppy",[["path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2",key:"svg-0"}],["path",{d:"M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M14 4l0 4l-6 0l0 -4",key:"svg-2"}]]);/**
257
- * @license @tabler/icons-react v3.17.0 - MIT
258
- *
259
- * This source code is licensed under the MIT license.
260
- * See the LICENSE file in the root directory of this source tree.
261
- */var fF=Ve("outline","dots","IconDots",[["path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]]);/**
262
- * @license @tabler/icons-react v3.17.0 - MIT
263
- *
264
- * This source code is licensed under the MIT license.
265
- * See the LICENSE file in the root directory of this source tree.
266
- */var n_=Ve("outline","edit","IconEdit",[["path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]]);/**
267
- * @license @tabler/icons-react v3.17.0 - MIT
268
- *
269
- * This source code is licensed under the MIT license.
270
- * See the LICENSE file in the root directory of this source tree.
271
- */var _d=Ve("outline","equal-not","IconEqualNot",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}],["path",{d:"M5 19l14 -14",key:"svg-2"}]]);/**
272
- * @license @tabler/icons-react v3.17.0 - MIT
273
- *
274
- * This source code is licensed under the MIT license.
275
- * See the LICENSE file in the root directory of this source tree.
276
- */var kd=Ve("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);/**
277
- * @license @tabler/icons-react v3.17.0 - MIT
278
- *
279
- * This source code is licensed under the MIT license.
280
- * See the LICENSE file in the root directory of this source tree.
281
- */var OE=Ve("outline","file-alert","IconFileAlert",[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 17l.01 0",key:"svg-2"}],["path",{d:"M12 11l0 3",key:"svg-3"}]]);/**
282
- * @license @tabler/icons-react v3.17.0 - MIT
283
- *
284
- * This source code is licensed under the MIT license.
285
- * See the LICENSE file in the root directory of this source tree.
286
- */var hF=Ve("outline","file-plus","IconFilePlus",[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 11l0 6",key:"svg-2"}],["path",{d:"M9 14l6 0",key:"svg-3"}]]);/**
287
- * @license @tabler/icons-react v3.17.0 - MIT
288
- *
289
- * This source code is licensed under the MIT license.
290
- * See the LICENSE file in the root directory of this source tree.
291
- */var pF=Ve("outline","filter","IconFilter",[["path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z",key:"svg-0"}]]);/**
292
- * @license @tabler/icons-react v3.17.0 - MIT
293
- *
294
- * This source code is licensed under the MIT license.
295
- * See the LICENSE file in the root directory of this source tree.
296
- */var mF=Ve("outline","forms","IconForms",[["path",{d:"M12 3a3 3 0 0 0 -3 3v12a3 3 0 0 0 3 3",key:"svg-0"}],["path",{d:"M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3",key:"svg-1"}],["path",{d:"M13 7h7a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-7",key:"svg-2"}],["path",{d:"M5 7h-1a1 1 0 0 0 -1 1v8a1 1 0 0 0 1 1h1",key:"svg-3"}],["path",{d:"M17 12h.01",key:"svg-4"}],["path",{d:"M13 12h.01",key:"svg-5"}]]);/**
297
- * @license @tabler/icons-react v3.17.0 - MIT
298
- *
299
- * This source code is licensed under the MIT license.
300
- * See the LICENSE file in the root directory of this source tree.
301
- */var gF=Ve("outline","id","IconId",[["path",{d:"M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v10a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M9 10m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M15 8l2 0",key:"svg-2"}],["path",{d:"M15 12l2 0",key:"svg-3"}],["path",{d:"M7 16l10 0",key:"svg-4"}]]);/**
302
- * @license @tabler/icons-react v3.17.0 - MIT
303
- *
304
- * This source code is licensed under the MIT license.
305
- * See the LICENSE file in the root directory of this source tree.
306
- */var ME=Ve("outline","list-details","IconListDetails",[["path",{d:"M13 5h8",key:"svg-0"}],["path",{d:"M13 9h5",key:"svg-1"}],["path",{d:"M13 15h8",key:"svg-2"}],["path",{d:"M13 19h5",key:"svg-3"}],["path",{d:"M3 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M3 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-5"}]]);/**
307
- * @license @tabler/icons-react v3.17.0 - MIT
308
- *
309
- * This source code is licensed under the MIT license.
310
- * See the LICENSE file in the root directory of this source tree.
311
- */var vF=Ve("outline","lock-access","IconLockAccess",[["path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2",key:"svg-0"}],["path",{d:"M4 16v2a2 2 0 0 0 2 2h2",key:"svg-1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v2",key:"svg-2"}],["path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2",key:"svg-3"}],["path",{d:"M8 11m0 1a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v3a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M10 11v-2a2 2 0 1 1 4 0v2",key:"svg-5"}]]);/**
312
- * @license @tabler/icons-react v3.17.0 - MIT
313
- *
314
- * This source code is licensed under the MIT license.
315
- * See the LICENSE file in the root directory of this source tree.
316
- */var yF=Ve("outline","lock","IconLock",[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-4a4 4 0 1 1 8 0v4",key:"svg-2"}]]);/**
317
- * @license @tabler/icons-react v3.17.0 - MIT
318
- *
319
- * This source code is licensed under the MIT license.
320
- * See the LICENSE file in the root directory of this source tree.
321
- */var xF=Ve("outline","logout","IconLogout",[["path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M9 12h12l-3 -3",key:"svg-1"}],["path",{d:"M18 15l3 -3",key:"svg-2"}]]);/**
322
- * @license @tabler/icons-react v3.17.0 - MIT
323
- *
324
- * This source code is licensed under the MIT license.
325
- * See the LICENSE file in the root directory of this source tree.
326
- */var r_=Ve("outline","math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]);/**
327
- * @license @tabler/icons-react v3.17.0 - MIT
328
- *
329
- * This source code is licensed under the MIT license.
330
- * See the LICENSE file in the root directory of this source tree.
331
- */var i_=Ve("outline","math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]);/**
332
- * @license @tabler/icons-react v3.17.0 - MIT
333
- *
334
- * This source code is licensed under the MIT license.
335
- * See the LICENSE file in the root directory of this source tree.
336
- */var bF=Ve("outline","message","IconMessage",[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12z",key:"svg-2"}]]);/**
337
- * @license @tabler/icons-react v3.17.0 - MIT
338
- *
339
- * This source code is licensed under the MIT license.
340
- * See the LICENSE file in the root directory of this source tree.
341
- */var SF=Ve("outline","microscope","IconMicroscope",[["path",{d:"M5 21h14",key:"svg-0"}],["path",{d:"M6 18h2",key:"svg-1"}],["path",{d:"M7 18v3",key:"svg-2"}],["path",{d:"M9 11l3 3l6 -6l-3 -3z",key:"svg-3"}],["path",{d:"M10.5 12.5l-1.5 1.5",key:"svg-4"}],["path",{d:"M17 3l3 3",key:"svg-5"}],["path",{d:"M12 21a6 6 0 0 0 3.715 -10.712",key:"svg-6"}]]);/**
342
- * @license @tabler/icons-react v3.17.0 - MIT
343
- *
344
- * This source code is licensed under the MIT license.
345
- * See the LICENSE file in the root directory of this source tree.
346
- */var wF=Ve("outline","minus","IconMinus",[["path",{d:"M5 12l14 0",key:"svg-0"}]]);/**
347
- * @license @tabler/icons-react v3.17.0 - MIT
348
- *
349
- * This source code is licensed under the MIT license.
350
- * See the LICENSE file in the root directory of this source tree.
351
- */var jF=Ve("outline","packages","IconPackages",[["path",{d:"M7 16.5l-5 -3l5 -3l5 3v5.5l-5 3z",key:"svg-0"}],["path",{d:"M2 13.5v5.5l5 3",key:"svg-1"}],["path",{d:"M7 16.545l5 -3.03",key:"svg-2"}],["path",{d:"M17 16.5l-5 -3l5 -3l5 3v5.5l-5 3z",key:"svg-3"}],["path",{d:"M12 19l5 3",key:"svg-4"}],["path",{d:"M17 16.5l5 -3",key:"svg-5"}],["path",{d:"M12 13.5v-5.5l-5 -3l5 -3l5 3v5.5",key:"svg-6"}],["path",{d:"M7 5.03v5.455",key:"svg-7"}],["path",{d:"M12 8l5 -3",key:"svg-8"}]]);/**
352
- * @license @tabler/icons-react v3.17.0 - MIT
353
- *
354
- * This source code is licensed under the MIT license.
355
- * See the LICENSE file in the root directory of this source tree.
356
- */var CF=Ve("outline","pin","IconPin",[["path",{d:"M15 4.5l-4 4l-4 1.5l-1.5 1.5l7 7l1.5 -1.5l1.5 -4l4 -4",key:"svg-0"}],["path",{d:"M9 15l-4.5 4.5",key:"svg-1"}],["path",{d:"M14.5 4l5.5 5.5",key:"svg-2"}]]);/**
357
- * @license @tabler/icons-react v3.17.0 - MIT
358
- *
359
- * This source code is licensed under the MIT license.
360
- * See the LICENSE file in the root directory of this source tree.
361
- */var EF=Ve("outline","pinned-off","IconPinnedOff",[["path",{d:"M3 3l18 18",key:"svg-0"}],["path",{d:"M15 4.5l-3.249 3.249m-2.57 1.433l-2.181 .818l-1.5 1.5l7 7l1.5 -1.5l.82 -2.186m1.43 -2.563l3.25 -3.251",key:"svg-1"}],["path",{d:"M9 15l-4.5 4.5",key:"svg-2"}],["path",{d:"M14.5 4l5.5 5.5",key:"svg-3"}]]);/**
362
- * @license @tabler/icons-react v3.17.0 - MIT
363
- *
364
- * This source code is licensed under the MIT license.
365
- * See the LICENSE file in the root directory of this source tree.
366
- */var TF=Ve("outline","player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]);/**
367
- * @license @tabler/icons-react v3.17.0 - MIT
368
- *
369
- * This source code is licensed under the MIT license.
370
- * See the LICENSE file in the root directory of this source tree.
371
- */var a_=Ve("outline","plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]);/**
372
- * @license @tabler/icons-react v3.17.0 - MIT
373
- *
374
- * This source code is licensed under the MIT license.
375
- * See the LICENSE file in the root directory of this source tree.
376
- */var RF=Ve("outline","receipt","IconReceipt",[["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16l-3 -2l-2 2l-2 -2l-2 2l-2 -2l-3 2m4 -14h6m-6 4h6m-2 4h2",key:"svg-0"}]]);/**
377
- * @license @tabler/icons-react v3.17.0 - MIT
378
- *
379
- * This source code is licensed under the MIT license.
380
- * See the LICENSE file in the root directory of this source tree.
381
- */var o_=Ve("outline","refresh","IconRefresh",[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]]);/**
382
- * @license @tabler/icons-react v3.17.0 - MIT
383
- *
384
- * This source code is licensed under the MIT license.
385
- * See the LICENSE file in the root directory of this source tree.
386
- */var DF=Ve("outline","repeat","IconRepeat",[["path",{d:"M4 12v-3a3 3 0 0 1 3 -3h13m-3 -3l3 3l-3 3",key:"svg-0"}],["path",{d:"M20 12v3a3 3 0 0 1 -3 3h-13m3 3l-3 -3l3 -3",key:"svg-1"}]]);/**
387
- * @license @tabler/icons-react v3.17.0 - MIT
388
- *
389
- * This source code is licensed under the MIT license.
390
- * See the LICENSE file in the root directory of this source tree.
391
- */var AF=Ve("outline","report-medical","IconReportMedical",[["path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2",key:"svg-0"}],["path",{d:"M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z",key:"svg-1"}],["path",{d:"M10 14l4 0",key:"svg-2"}],["path",{d:"M12 12l0 4",key:"svg-3"}]]);/**
392
- * @license @tabler/icons-react v3.17.0 - MIT
393
- *
394
- * This source code is licensed under the MIT license.
395
- * See the LICENSE file in the root directory of this source tree.
396
- */var _F=Ve("outline","router","IconRouter",[["path",{d:"M3 13m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M17 17l0 .01",key:"svg-1"}],["path",{d:"M13 17l0 .01",key:"svg-2"}],["path",{d:"M15 13l0 -2",key:"svg-3"}],["path",{d:"M11.75 8.75a4 4 0 0 1 6.5 0",key:"svg-4"}],["path",{d:"M8.5 6.5a8 8 0 0 1 13 0",key:"svg-5"}]]);/**
397
- * @license @tabler/icons-react v3.17.0 - MIT
398
- *
399
- * This source code is licensed under the MIT license.
400
- * See the LICENSE file in the root directory of this source tree.
401
- */var kF=Ve("outline","search","IconSearch",[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]]);/**
402
- * @license @tabler/icons-react v3.17.0 - MIT
403
- *
404
- * This source code is licensed under the MIT license.
405
- * See the LICENSE file in the root directory of this source tree.
406
- */var By=Ve("outline","settings","IconSettings",[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]]);/**
407
- * @license @tabler/icons-react v3.17.0 - MIT
408
- *
409
- * This source code is licensed under the MIT license.
410
- * See the LICENSE file in the root directory of this source tree.
411
- */var gb=Ve("outline","sort-ascending","IconSortAscending",[["path",{d:"M4 6l7 0",key:"svg-0"}],["path",{d:"M4 12l7 0",key:"svg-1"}],["path",{d:"M4 18l9 0",key:"svg-2"}],["path",{d:"M15 9l3 -3l3 3",key:"svg-3"}],["path",{d:"M18 6l0 12",key:"svg-4"}]]);/**
412
- * @license @tabler/icons-react v3.17.0 - MIT
413
- *
414
- * This source code is licensed under the MIT license.
415
- * See the LICENSE file in the root directory of this source tree.
416
- */var vb=Ve("outline","sort-descending","IconSortDescending",[["path",{d:"M4 6l9 0",key:"svg-0"}],["path",{d:"M4 12l7 0",key:"svg-1"}],["path",{d:"M4 18l7 0",key:"svg-2"}],["path",{d:"M15 15l3 3l3 -3",key:"svg-3"}],["path",{d:"M18 6l0 12",key:"svg-4"}]]);/**
417
- * @license @tabler/icons-react v3.17.0 - MIT
418
- *
419
- * This source code is licensed under the MIT license.
420
- * See the LICENSE file in the root directory of this source tree.
421
- */var PF=Ve("outline","square","IconSquare",[["path",{d:"M3 3m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",key:"svg-0"}]]);/**
422
- * @license @tabler/icons-react v3.17.0 - MIT
423
- *
424
- * This source code is licensed under the MIT license.
425
- * See the LICENSE file in the root directory of this source tree.
426
- */var NF=Ve("outline","star","IconStar",[["path",{d:"M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z",key:"svg-0"}]]);/**
427
- * @license @tabler/icons-react v3.17.0 - MIT
428
- *
429
- * This source code is licensed under the MIT license.
430
- * See the LICENSE file in the root directory of this source tree.
431
- */var OF=Ve("outline","switch-horizontal","IconSwitchHorizontal",[["path",{d:"M16 3l4 4l-4 4",key:"svg-0"}],["path",{d:"M10 7l10 0",key:"svg-1"}],["path",{d:"M8 13l-4 4l4 4",key:"svg-2"}],["path",{d:"M4 17l9 0",key:"svg-3"}]]);/**
432
- * @license @tabler/icons-react v3.17.0 - MIT
433
- *
434
- * This source code is licensed under the MIT license.
435
- * See the LICENSE file in the root directory of this source tree.
436
- */var MF=Ve("outline","table-export","IconTableExport",[["path",{d:"M12.5 21h-7.5a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v7.5",key:"svg-0"}],["path",{d:"M3 10h18",key:"svg-1"}],["path",{d:"M10 3v18",key:"svg-2"}],["path",{d:"M16 19h6",key:"svg-3"}],["path",{d:"M19 16l3 3l-3 3",key:"svg-4"}]]);/**
437
- * @license @tabler/icons-react v3.17.0 - MIT
438
- *
439
- * This source code is licensed under the MIT license.
440
- * See the LICENSE file in the root directory of this source tree.
441
- */var IF=Ve("outline","text-recognition","IconTextRecognition",[["path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2",key:"svg-0"}],["path",{d:"M4 16v2a2 2 0 0 0 2 2h2",key:"svg-1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v2",key:"svg-2"}],["path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2",key:"svg-3"}],["path",{d:"M12 16v-7",key:"svg-4"}],["path",{d:"M9 9h6",key:"svg-5"}]]);/**
442
- * @license @tabler/icons-react v3.17.0 - MIT
443
- *
444
- * This source code is licensed under the MIT license.
445
- * See the LICENSE file in the root directory of this source tree.
446
- */var yb=Ve("outline","trash","IconTrash",[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]]);/**
447
- * @license @tabler/icons-react v3.17.0 - MIT
448
- *
449
- * This source code is licensed under the MIT license.
450
- * See the LICENSE file in the root directory of this source tree.
451
- */var IE=Ve("outline","upload","IconUpload",[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 9l5 -5l5 5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]]);/**
452
- * @license @tabler/icons-react v3.17.0 - MIT
453
- *
454
- * This source code is licensed under the MIT license.
455
- * See the LICENSE file in the root directory of this source tree.
456
- */var LF=Ve("outline","webhook","IconWebhook",[["path",{d:"M4.876 13.61a4 4 0 1 0 6.124 3.39h6",key:"svg-0"}],["path",{d:"M15.066 20.502a4 4 0 1 0 1.934 -7.502c-.706 0 -1.424 .179 -2 .5l-3 -5.5",key:"svg-1"}],["path",{d:"M16 8a4 4 0 1 0 -8 0c0 1.506 .77 2.818 2 3.5l-3 5.5",key:"svg-2"}]]);/**
457
- * @license @tabler/icons-react v3.17.0 - MIT
458
- *
459
- * This source code is licensed under the MIT license.
460
- * See the LICENSE file in the root directory of this source tree.
461
- */var Hs=Ve("outline","x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);/**
462
- * @license @tabler/icons-react v3.17.0 - MIT
463
- *
464
- * This source code is licensed under the MIT license.
465
- * See the LICENSE file in the root directory of this source tree.
466
- */var zF=Ve("filled","circle-filled","IconCircleFilled",[["path",{d:"M7 3.34a10 10 0 1 1 -4.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 4.995 -8.336z",key:"svg-0"}]]);class s_ 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?o.jsx(Ya,{icon:o.jsx(rl,{size:16}),title:"Something went wrong",color:"red",children:Ye(this.state.error)}):this.props.children}}function gi(){return o.jsx(er,{style:{width:"100%",height:"100vh"},children:o.jsx(_r,{})})}const $F="_main_6f7o5_1",UF={main:$F};function pn(e){e.preventDefault(),e.stopPropagation()}function l_(e){return e.button===1||e.ctrlKey||e.metaKey}function c_(e){if(LE(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&LE(t[0]))return!0}return!1}function LE(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}async function Yu(e,t){return new Promise((n,r)=>{var s;const i=new MessageChannel;i.port1.onmessage=({data:c})=>{i.port1.close(),c.error?r(c.error):n(c.result)},(s=e.contentWindow)==null||s.postMessage(t,new URL(e.src).origin,[i.port2])})}function u_(e,t){const n=new Blob([e],{type:hn.JSON}),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r;const s=t??new Date().toISOString().replace(/\D/g,"");i.download=`${s}.json`,document.body.appendChild(i),i.click(),URL.revokeObjectURL(r)}function mt(e){const t=Jp(),{to:n,suffix:r,label:i,onClick:s,children:c,...u}=e;let f=BF(n);return r&&(f+="/"+r),o.jsx(Nt,{href:f,"aria-label":i,onAuxClick:p=>{p.stopPropagation()},onClick:p=>{p.stopPropagation(),s?(p.preventDefault(),s(p)):n&&(l_(p)||(p.preventDefault(),t(f)))},...u,children:c})}function BF(e){if(e){if(typeof e=="string")return VF(e);if(fa(e))return FF(e);if(Ko(e))return HF(e)}return"#"}function VF(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function FF(e){return`/${e.resourceType}/${e.id}`}function HF(e){return`/${e.reference}`}function qF(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 Xo(e){const t=Qt(e.value),n=t?Va(t):e.alt??"",r=qF(n),i=(t&&X$(t))??e.src,s=XA(i??void 0),c=e.radius??"xl",u={...e,value:void 0,link:void 0};return e.link?o.jsx(mt,{to:t,children:o.jsx(zs,{src:s,alt:n,radius:c,...u,children:r})}):o.jsx(zs,{src:s,alt:n,radius:c,...u,children:r})}const GF="_logoButton_189g3_1",QF="_user_189g3_11",WF="_userName_189g3_21",YF="_userActive_189g3_31",oh={logoButton:GF,user:QF,userName:WF,userActive:YF};function xb(e){const t=e.value;return t?o.jsx(o.Fragment,{children:Nc(t,e.options)}):null}function KF(e){var f,p,m;const t=Zp(),{medplum:n,profile:r,navigate:i}=t,s=n.getLogins(),{colorScheme:c,setColorScheme:u}=jO();return o.jsxs(o.Fragment,{children:[o.jsxs(Ge,{align:"center",p:"xl",children:[o.jsx(Xo,{size:"xl",radius:100,value:t.profile}),o.jsx(xb,{value:(p=(f=t.profile)==null?void 0:f.name)==null?void 0:p[0]}),o.jsx(Ae,{c:"dimmed",size:"xs",children:(m=n.getActiveLogin())==null?void 0:m.project.display})]}),s.length>1&&o.jsx(Ce.Divider,{}),s.map(g=>g.profile.reference!==zt(t.profile)&&o.jsx(Ce.Item,{onClick:()=>{n.setActiveLogin(g).then(()=>window.location.reload()).catch(console.log)},children:o.jsxs(je,{children:[o.jsx(zs,{radius:"xl"}),o.jsxs("div",{style:{flex:1},children:[o.jsx(Ae,{size:"sm",fw:500,children:g.profile.display}),o.jsx(Ae,{c:"dimmed",size:"xs",children:g.project.display})]})]})},g.profile.reference)),o.jsx(Ce.Divider,{}),o.jsx(je,{justify:"center",children:o.jsx(Fp,{size:"xs",value:c,onChange:g=>u(g),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),o.jsx(Ce.Divider,{}),o.jsx(Ce.Item,{leftSection:o.jsx(OF,{size:14,stroke:1.5}),onClick:()=>i("/signin"),children:"Add another account"}),o.jsx(Ce.Item,{leftSection:o.jsx(By,{size:14,stroke:1.5}),onClick:()=>i(`/${zt(r)}`),children:"Account settings"}),o.jsx(Ce.Item,{leftSection:o.jsx(xF,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),i("/signin")},children:"Sign out"}),o.jsx(Ae,{size:"xs",c:"dimmed",ta:"center",children:e.version})]})}const zE={selectedItems:"selected-items",options:"options"};function bb(e){const t=yd({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:i,error:s,defaultValue:c,toOption:u,loadOptions:f,itemComponent:p,pillComponent:m,emptyComponent:g,onChange:y,onCreate:b,creatable:S,clearable:j,required:C,placeholder:T,leftSection:D,maxValues:E,optionsDropdownMaxHeight:R=320,minInputLength:A=0,...k}=e,M=k.disabled,I=XF(c),[$,V]=v.useState(""),[Y,Q]=v.useState(),[J,G]=v.useState(),[K,P]=v.useState(),[L,z]=v.useState(I.map(u)),[H,O]=v.useState([]),U=p??ZF,X=m??JF,ee=g??eH,Se=v.useRef($);Se.current=$;const be=v.useRef(void 0),xe=v.useRef(void 0),qe=v.useRef(Y);qe.current=Y;const Me=v.useRef(J);Me.current=J;const tt=v.useRef(K);tt.current=K;const ke=v.useRef(H);ke.current=H;const vt=v.useCallback(()=>{var me;if(Q(void 0),Se.current===xe.current&&f===be.current||(((me=Se.current)==null?void 0:me.length)??0)<A)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)),tt.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:Ye(ge)})}).finally(()=>{Re.signal.aborted||G(void 0)})},[t,f,y,u,A]),It=v.useCallback(Re=>{(H&&H.length>0||S)&&t.openDropdown(),t.updateSelectedOptionIndex(),V(Re.currentTarget.value),Me.current&&(Me.current.abort(),G(void 0)),qe.current!==void 0&&window.clearTimeout(qe.current);const me=window.setTimeout(()=>vt(),100);Q(me)},[t,H,S,vt]),Lt=v.useCallback(Re=>{const me=L.some(we=>we.value===Re),ge=me?L.filter(we=>we.value!==Re):[...L];let Pe=H==null?void 0:H.find(we=>we.value===Re);if(!Pe&&S!==!1&&b){const we=b(Re);Pe=u(we)}if(Pe){if(E===0){y([Pe.resource]),L.length>0&&z([]);return}me||ge.push(Pe)}if(E!==void 0)for(;ge.length>E;)ge.shift();y(ge.map(we=>we.resource)),z(ge)},[S,H,L,E,y,b,u]),gt=v.useMemo(()=>{if(!M)return Re=>{M||(E===1&&(V(""),O([]),t.closeDropdown()),xe.current=void 0,Re==="$create"?(V(""),Lt($)):Lt(Re))}},[Lt,t,M,E,$]),At=v.useCallback(Re=>{const me=L.filter(ge=>ge.value!==Re.value);y(me.map(ge=>ge.resource)),z(me)},[L,y]),nn=v.useCallback(Re=>{Re.key==="Enter"?(Y||J)&&P(!0):Re.key==="Backspace"&&$.length===0&&(pn(Re),At(L[L.length-1]))},[J,At,$.length,L,Y]);v.useEffect(()=>()=>{Me.current&&Me.current.abort()},[]);const Ee=!M&&j&&L.length>0&&o.jsx(ct.ClearButton,{title:"Clear all",size:"sm",onClear:()=>{V(""),z([]),y([]),t.closeDropdown()}}),De=S&&$.trim().length>0,Qe=H.length>0||De;return o.jsxs(ct,{store:t,onOptionSubmit:gt,withinPortal:!0,shadow:"xl",...k,children:[o.jsx(ct.DropdownTarget,{children:o.jsx(pc,{label:r,description:i,error:s,className:e.className,leftSection:D,rightSection:J?o.jsx(_r,{size:16}):Ee,required:C,disabled:M,children:o.jsxs($s.Group,{"data-testid":zE.selectedItems,children:[L.map(Re=>o.jsx(X,{item:Re,disabled:M,onRemove:()=>At(Re)},Re.value)),!M&&(E===void 0||E===0||L.length<E)&&o.jsx(ct.EventsTarget,{children:o.jsx(pc.Field,{role:"searchbox",name:n,value:$,placeholder:T,onFocus:It,onBlur:()=>{t.closeDropdown(),V("")},onKeyDown:nn,onChange:It})})]})})}),o.jsx(ct.Dropdown,{hidden:!Qe,"data-testid":zE.options,children:o.jsx(ct.Options,{children:o.jsxs(gp,{type:"scroll",mah:R,children:[H.map(Re=>{const me=L.some(ge=>ge.value===Re.value);return o.jsx(ct.Option,{value:Re.value,active:me,children:o.jsx(U,{...Re,active:me})},Re.value)}),De&&o.jsxs(ct.Option,{value:"$create",children:["+ Create ",$]}),!S&&$.trim().length>0&&H.length===0&&o.jsx(ee,{search:$})]})})})]})}function XF(e){return e?Array.isArray(e)?e:[e]:[]}function ZF(e){return o.jsxs(je,{gap:"xs",children:[e.active&&o.jsx(eo,{size:12}),o.jsx("span",{children:e.label})]})}function JF({item:e,disabled:t,onRemove:n}){return o.jsx($s,{withRemoveButton:!t,onRemove:n,children:e.label})}function eH(){return o.jsx(ct.Empty,{children:"Nothing found"})}const tH="_searchInput_dick8_1",nH={searchInput:tH};function rH(e){return{value:e.id,label:Va(e),resource:e}}function iH(e){const t=Jp(),n=_e(),r=v.useCallback(async(s,c)=>{const u=oH(s),f={signal:c},p=await n.graphql(u,void 0,void 0,f);return sH(p,s)},[n]),i=v.useCallback(s=>{s.length>0&&t(`/${zt(s[0])}`)},[t]);return o.jsx(bb,{size:"sm",radius:"md",className:nH.searchInput,leftSection:o.jsx(kF,{size:16}),placeholder:"Search",itemComponent:aH,toOption:rH,onChange:i,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const aH=v.forwardRef(({resource:e,active:t,...n},r)=>{var s;let i;return e.resourceType==="Patient"?i=e.birthDate:e.resourceType==="ServiceRequest"&&(i=(s=e.subject)==null?void 0:s.display),o.jsx("div",{ref:r,...n,children:o.jsxs(je,{wrap:"nowrap",children:[o.jsx(Xo,{value:e}),o.jsxs("div",{children:[o.jsx(Ae,{children:Va(e)}),o.jsx(Ae,{size:"xs",c:"dimmed",children:i})]})]})})});function oH(e){const t=JSON.stringify(e);return wA(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 sH(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),cH(lH(n),t).slice(0,5)}function lH(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 cH(e,t){return e.sort((n,r)=>$E(r,t)-$E(n,t))}function $E(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,UE(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,UE(Nc(r),t));return n}function UE(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function uH(e){var i;const t=em(),[n,r]=v.useState(!1);return o.jsx(Ar.Header,{p:8,style:{zIndex:101},children:o.jsxs(je,{justify:"space-between",children:[o.jsxs(je,{gap:"xs",children:[o.jsx(tr,{className:oh.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&o.jsx(iH,{pathname:e.pathname,searchParams:e.searchParams})]}),o.jsxs(je,{gap:"lg",pr:"sm",children:[e.notifications,o.jsxs(Ce,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:n,onClose:()=>r(!1),children:[o.jsx(Ce.Target,{children:o.jsx(tr,{className:Ut(oh.user,{[oh.userActive]:n}),onClick:()=>r(s=>!s),children:o.jsxs(je,{gap:7,children:[o.jsx(Xo,{value:t,radius:"xl",size:24}),o.jsx(Ae,{size:"sm",className:oh.userName,children:Nc((i=t==null?void 0:t.name)==null?void 0:i[0])}),o.jsx(pb,{size:12,stroke:1.5})]})})}),o.jsx(Ce.Dropdown,{children:o.jsx(KF,{version:e.version})})]})]})]})})}const Sb=v.createContext({submitting:!1});Sb.displayName="FormContext";function dH(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?fH(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&hH(t,n);return t}function fH(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function hH(e,t){e[t.name]=t.value}function pt(e){const[t,n]=v.useState(!1);return o.jsx(Sb.Provider,{value:{submitting:t},children:o.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:r=>{r.preventDefault();const i=dH(r.target);if(e.onSubmit){n(!0);const s=e.onSubmit(i);s!=null&&s.then?s.catch(console.error).finally(()=>{n(!1)}):n(!1)}},children:e.children})})}function Or(e){const{children:t,...n}=e,{submitting:r}=v.useContext(Sb);return o.jsx(Ne,{type:"submit",loading:r,...n,children:t})}function pH(e){const t=_e(),n=t.getUserConfiguration();function r(i){var m,g;const{menuname:s,bookmarkname:c}=i,u=`${e.pathname}?${e.searchParams.toString()}`,f=Qr(n),p=(m=f.menu)==null?void 0:m.find(({title:y})=>y===s);(g=p==null?void 0:p.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:Ye(y)})})}return o.jsx(Un,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:o.jsx(pt,{onSubmit:r,children:o.jsxs(Ge,{children:[o.jsx(mH,{config:n}),o.jsx(ze,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),o.jsx(je,{justify:"flex-end",children:o.jsx(Or,{mt:"sm",children:"OK"})})]})})})}function mH(e){function t(r){var i;return(i=r==null?void 0:r.menu)==null?void 0:i.map(s=>s.title)}const n=t(e.config);return o.jsx(ln,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function d_(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function gH(e){return typeof e.display=="string"?e.display:d_(e)}function vH(e){return{value:d_(e),label:gH(e),resource:e}}function yH(e){return{code:e,display:e}}function tm(e){const t=_e(),{binding:n,creatable:r,clearable:i,expandParams:s,withHelpText:c,...u}=e,f=v.useCallback(async(p,m)=>{var S;if(!n)return[];const y=((S=(await t.valueSetExpand({...s,url:n,filter:p,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,s,n]);return o.jsx(bb,{...u,creatable:r??!0,clearable:i??!0,toOption:vH,loadOptions:f,onCreate:yH,itemComponent:c?xH:void 0})}const xH=v.forwardRef(({label:e,resource:t,active:n,...r},i)=>o.jsx("div",{ref:i,...r,children:o.jsxs(je,{wrap:"nowrap",gap:"xs",children:[n&&o.jsx(eo,{size:12}),o.jsxs("div",{children:[o.jsx(Ae,{children:e}),o.jsx(Ae,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})]})}));function f_(e){const{defaultValue:t,onChange:n,withHelpText:r,...i}=e,[s,c]=v.useState(t);function u(f){const p=f[0],m=SH(p);c(m),n&&n(m)}return o.jsx(tm,{defaultValue:bH(s),onChange:u,withHelpText:r??!0,...i})}function bH(e){return e?{code:e}:void 0}function SH(e){return e==null?void 0:e.code}function wb(e){const[t,n]=v.useState(e.defaultValue),r=e.onChange,i=v.useCallback(s=>{n(s),r&&r(s)},[r]);return o.jsx(f_,{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 wH="_menuTitle_9g6l5_1",jH="_link_9g6l5_9",CH="_linkActive_9g6l5_38",Vy={menuTitle:wH,link:jH,linkActive:CH};function EH(e){var u;const t=Jp(),n=DH(e.pathname,e.searchParams,e.menus),[r,i]=v.useState(!1);function s(f,p){f.stopPropagation(),f.preventDefault(),t(p),window.innerWidth<768&&e.closeNavbar()}function c(f){f&&t(`/${f}`)}return o.jsxs(o.Fragment,{children:[o.jsx(Ar.Navbar,{children:o.jsxs(Yr,{p:"xs",children:[!e.resourceTypeSearchDisabled&&o.jsx(Ar.Section,{mb:"sm",children:o.jsx(wb,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:f=>c(f)},window.location.pathname)}),o.jsxs(Ar.Section,{grow:!0,children:[(u=e.menus)==null?void 0:u.map(f=>{var p;return o.jsxs(v.Fragment,{children:[o.jsx(Ae,{className:Vy.menuTitle,children:f.title}),(p=f.links)==null?void 0:p.map(m=>o.jsxs(TH,{to:m.href,active:m.href===(n==null?void 0:n.href),onClick:g=>s(g,m.href),children:[o.jsx(RH,{icon:m.icon}),o.jsx("span",{children:m.label})]},m.href))]},`menu-${f.title}`)}),e.displayAddBookmark&&o.jsx(Ne,{variant:"subtle",size:"xs",mt:"xl",leftSection:o.jsx(a_,{size:"0.75rem"}),onClick:()=>i(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&o.jsx(pH,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>i(!1),onCancel:()=>i(!1)})]})}function TH(e){return o.jsx(mt,{onClick:e.onClick,to:e.to,className:Ut(Vy.link,{[Vy.linkActive]:e.active}),children:e.children})}function RH(e){return e.icon?e.icon:o.jsx(Hp,{w:30})}function DH(e,t,n){if(!e||!t||!n)return;let r,i=0;for(const s of n)if(s.links)for(const c of s.links){const u=AH(e,t,c.href);u>i&&(i=u,r=c)}return r}function AH(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 s=1;for(const[c,u]of t.entries())i.includes(c)||r.searchParams.get(c)===u&&s++;return s}function _H(e){const[t,n]=v.useState(localStorage.navbarOpen==="true"),r=_e(),i=em();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 s(f){localStorage.navbarOpen=f.toString(),n(f)}function c(){s(!1)}function u(){s(!t)}return r.isLoading()?o.jsx(gi,{}):o.jsxs(Ar,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!i||!t,mobile:!i||!t}},padding:0,children:[i&&o.jsx(uH,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:u,notifications:e.notifications}),i&&t?o.jsx(EH,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:c,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,o.jsx(Ar.Main,{className:UF.main,children:o.jsx(s_,{children:o.jsx(v.Suspense,{fallback:o.jsx(gi,{}),children:e.children})})})]})}const kH="https://ccda.medplum.com",PH="https://ccda-validator.medplum.com/";function NH(e){const{url:t}=e,[n,r]=v.useState(!1),i=v.useRef(null),[s,c]=v.useState(),[u,f]=v.useState(!1);v.useEffect(()=>{t&&n&&i.current&&(Yu(i.current,{command:"loadCcdaXml",value:t}).catch(console.error),r(!1))},[t,n]);const p=async()=>{if(t)try{f(!0);const b=await(await fetch(t)).text(),S=new FormData;S.append("ccdaFile",new Blob([b],{type:"text/xml"}),"ccda.xml");const j=`${PH}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(!s)return;const y=JSON.stringify(s,null,2);u_(y,"ccda-validation-results")},g=()=>s?s.resultsMetaData.resultMetaData.filter(y=>y==null?void 0:y.type.includes("Error")).reduce((y,b)=>y+(b.count||0),0):0;return t?o.jsxs("div",{"data-testid":"ccda-iframe",style:{maxWidth:e.maxWidth},children:[o.jsx("div",{style:{minHeight:400},children:o.jsx("iframe",{title:"C-CDA Viewer",width:"100%",height:"400",ref:i,src:kH,allowFullScreen:!0,frameBorder:0,seamless:!0,onLoad:()=>r(!0)})}),o.jsxs("div",{style:{marginTop:"10px",marginBottom:"10px",display:"flex",alignItems:"center"},children:[o.jsx(Ne,{type:"button",onClick:p,disabled:u,children:u?"Validating...":"Validate"}),s&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{marginLeft:"15px"},children:[o.jsx("strong",{children:"Validation Results:"})," ",g()," errors found"]}),o.jsx(Ne,{type:"button",onClick:m,color:"green",style:{marginLeft:"auto"},children:"Download Full Results"})]})]})]}):null}function Pd(e){const{contentType:t,url:n,title:r}=e.value??{},i=XA(n);return i?o.jsxs("div",{"data-testid":"attachment-display",children:[(t==null?void 0:t.startsWith("image/"))&&o.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:i,alt:r}),(t==null?void 0:t.startsWith("video/"))&&o.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:o.jsx("source",{type:t,src:i})}),((t==null?void 0:t.startsWith("text/"))||t==="application/json"||t==="application/pdf")&&o.jsx("div",{"data-testid":"attachment-iframe",style:{maxWidth:e.maxWidth,minHeight:400},children:o.jsx("iframe",{title:"Attachment",width:"100%",height:"400",src:i+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),t===hn.CDA_XML&&o.jsx(NH,{url:i}),o.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:o.jsx(Nt,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:OH(r),children:r||"Download"})})]}):null}function OH(e){return e!=null&&e.includes(".")?e:void 0}const MH="_root_17n8t_1",IH="_compact_17n8t_25",BE={root:MH,compact:IH};function jb(e){const{children:t,compact:n}=e;return o.jsx("dl",{className:Ut(BE.root,{[BE.compact]:n}),children:t})}function La(e){return o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:e.term}),o.jsx("dd",{children:e.children})]})}function LH(e){var r;const t=(r=e.values)==null?void 0:r.map((i,s)=>o.jsx("div",{children:o.jsx(Pd,{value:i,maxWidth:e.maxWidth})},"attatchment-"+s));let n;if(e.includeDescriptionListEntry){if(e.property===void 0)throw new Error("props.property is required when includeDescriptionListEntry is true");if(!Tn(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const i=e.path.split(".").pop();n=o.jsx(La,{term:Vs(i),children:t})}else n=o.jsx(o.Fragment,{children:t});return n}function Cb(e){const t=_e(),n=v.useRef(null);function r(c){var u;pn(c),(u=n.current)==null||u.click()}function i(c){pn(c);const u=c.target.files;u&&Array.from(u).forEach(s)}function s(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(Zt(f))}))}return o.jsxs(o.Fragment,{children:[o.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 zH(e){const[t,n]=v.useState(e.defaultValue??[]),r=v.useRef(t);r.current=t;function i(s){n(s),e.onChange&&e.onChange(s)}return o.jsxs("table",{style:{width:"100%"},children:[o.jsxs("colgroup",{children:[o.jsx("col",{width:"97%"}),o.jsx("col",{width:"3%"})]}),o.jsxs("tbody",{children:[t.map((s,c)=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx(Pd,{value:s,maxWidth:200})}),o.jsx("td",{children:o.jsx(_n,{disabled:e.disabled,title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:u=>{pn(u);const f=t.slice();f.splice(c,1),i(f)},children:o.jsx(Hh,{})})})]},`${c}-${t.length}`)),o.jsxs("tr",{children:[o.jsx("td",{}),o.jsx("td",{children:o.jsx(Cb,{disabled:e.disabled,onUpload:s=>{i([...r.current,s])},children:s=>o.jsx(_n,{...s,title:"Add",variant:"subtle",size:"sm",color:s.disabled?"gray":"green",children:o.jsx(mb,{})})})})]})]})]})}function h_(e){const[t,n]=v.useState(e.defaultValue);function r(i){n(i),e.onChange&&e.onChange(i)}return t?o.jsxs(o.Fragment,{children:[o.jsx(Pd,{value:t,maxWidth:200}),o.jsx(Ne,{disabled:e.disabled,onClick:i=>{pn(i),r(void 0)},children:"Remove"})]}):o.jsx(Cb,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:i=>o.jsx(Ne,{...i,children:"Upload..."})})}const $H="_root_1vii2_1",UH={root:$H};function Ic(e){const{children:t,...n}=e;return o.jsx(f0,{className:UH.root,...n,children:t})}const BH="_paper_1igaj_1",VH="_fill_1igaj_20",VE={paper:BH,fill:VH};function nm(e){const{width:t,fill:n,className:r,children:i,...s}=e,c=t?{maxWidth:t}:void 0;return o.jsx(mr,{className:Ut(VE.paper,n&&VE.fill,r),style:c,shadow:"sm",radius:"sm",withBorder:!0,...s,children:i})}function ot(e){const{children:t,...n}=e;return o.jsx(Ic,{children:o.jsx(nm,{...n,children:t})})}function Ui(e){return o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 491 491",style:{width:e.size,height:e.size},children:[o.jsx("title",{children:"Medplum Logo"}),o.jsx("path",{fill:e.fill??"#ad7136",d:"M282 67c6-16 16-29 29-40L289 0c-22 17-37 41-43 68l17 23 19-24z"}),o.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"}),o.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"}),o.jsx("path",{fill:e.fill??"#40bc26",d:"M207 220a176 176 0 01-177 43A176 176 0 01251 43l1 5c17 59 2 125-45 172z"}),o.jsx("path",{fill:e.fill??"#33961e",d:"M252 48A421 421 0 0057 270l-27-7A176 176 0 01251 43l1 5z"})]})}function Ot(e,t){var n,r,i;return(i=(r=(n=e==null?void 0:e.issue)==null?void 0:n.filter(s=>{var c;return p_((c=s.expression)==null?void 0:c[0],t)}))==null?void 0:r.map(s=>{var c;return(c=s.details)==null?void 0:c.text}))==null?void 0:i.join(`
530
- `)}function Nd(e,t){var n;return(n=e==null?void 0:e.issue)==null?void 0:n.filter(r=>{var i;return p_((i=r.expression)==null?void 0:i[0],t)})}const sh=/\[\d+\]/;function p_(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 s=t.indexOf(".");return s>=0&&t.substring(s+1)===e}function m_(e){const t=_e(),[n,r]=v.useState();return o.jsxs(pt,{onSubmit:async i=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:i.projectName}))}catch(s){r(Zt(s))}},children:[o.jsxs(er,{style:{flexDirection:"column"},children:[o.jsx(Ui,{size:32}),o.jsx(Le,{children:"Create project"})]}),o.jsxs(Ge,{gap:"xl",children:[o.jsx(ze,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:Ot(n,"projectName")}),o.jsxs(Ae,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",o.jsx(Nt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",o.jsx(Nt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),o.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:o.jsx(Or,{children:"Create project"})})]})}function g_(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 v_(e){const t=_e(),{googleClientId:n,handleGoogleCredential:r}=e,i=v.useRef(null),[s,c]=v.useState(typeof google<"u"),[u,f]=v.useState(!1),[p,m]=v.useState(!1);return v.useEffect(()=>{if(typeof google>"u"){g_("https://accounts.google.com/gsi/client",()=>c(!0));return}u||(google.accounts.id.initialize({client_id:n,callback:r}),f(!0)),i.current&&!p&&(google.accounts.id.renderButton(i.current,{}),m(!0))},[t,n,u,s,i,p,r]),n?o.jsx("div",{ref:i}):null}function y_(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 Kr(e){var n;const t=((n=e.outcome)==null?void 0:n.issue)||e.issues;return!t||t.length===0?null:o.jsx(Ya,{icon:o.jsx(rl,{size:16}),color:"red",children:t.map(r=>{var i;return o.jsx("div",{"data-testid":"text-field-error",children:cA(r)},(i=r.details)==null?void 0:i.text)})})}function x_(e){typeof grecaptcha>"u"&&g_("https://www.google.com/recaptcha/api.js?render="+e)}function b_(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function FH(e){const t=y_(e.googleClientId),n=e.recaptchaSiteKey,r=_e(),[i,s]=v.useState(),c=Nd(i,void 0);return v.useEffect(()=>{n&&x_(n)},[n]),o.jsxs(pt,{onSubmit:async u=>{s(void 0);try{let f="";n&&(f=await b_(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){s(Zt(f))}},children:[o.jsx(er,{style:{flexDirection:"column"},children:e.children}),o.jsx(Kr,{issues:c}),t&&o.jsxs(o.Fragment,{children:[o.jsx(je,{justify:"center",p:"xl",style:{height:70},children:o.jsx(v_,{googleClientId:t,handleGoogleCredential:async u=>{try{e.handleAuthResponse(await r.startGoogleLogin({googleClientId:u.clientId,googleCredential:u.credential,projectId:e.projectId,createUser:!0}))}catch(f){s(Zt(f))}}})}),o.jsx(Cn,{label:"or",labelPosition:"center",my:"lg"})]}),o.jsxs(Ge,{gap:"xl",children:[o.jsx(ze,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:Ot(i,"firstName")}),o.jsx(ze,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:Ot(i,"lastName")}),o.jsx(ze,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:Ot(i,"email")}),o.jsx(Ni,{name:"password",label:"Password",autoComplete:"off",required:!0,error:Ot(i,"password")}),o.jsxs(Ae,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",o.jsx(Nt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",o.jsx(Nt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),o.jsxs(Ae,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",o.jsx(Nt,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",o.jsx(Nt,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),o.jsxs(je,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[o.jsx(zn,{name:"remember",label:"Remember me",size:"xs"}),o.jsx(Or,{children:"Create account"})]})]})}function HH(e){const{type:t,projectId:n,clientId:r,googleClientId:i,recaptchaSiteKey:s,onSuccess:c}=e,u=_e(),[f,p]=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(Zt(b)))},[u,t,n,f,c]);function y(b){b.code?u.processCode(b.code).then(()=>c()).catch(console.log):b.login&&p(b.login)}return o.jsxs(ot,{width:450,children:[m&&o.jsx("pre",{children:JSON.stringify(m,null,2)}),!f&&o.jsx(FH,{projectId:n,clientId:r,googleClientId:i,recaptchaSiteKey:s,handleAuthResponse:y,children:e.children}),f&&t==="project"&&o.jsx(m_,{login:f,handleAuthResponse:y})]})}function qH(e){const[t,n]=v.useState();return t?o.jsx(QH,{email:t,...e}):o.jsx(GH,{setEmail:n,...e})}function GH(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:i,disableEmailAuth:s,...c}=e,u=_e(),f=!e.disableGoogleAuth&&y_(e.googleClientId),[p,m]=v.useState(),g=Nd(p,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(Zt(C))}},[u,c,y,r]);return o.jsxs(pt,{onSubmit:b,children:[o.jsx(er,{style:{flexDirection:"column"},children:i}),o.jsx(Kr,{issues:g}),f&&o.jsxs(o.Fragment,{children:[o.jsx(je,{justify:"center",p:"xl",style:{height:70},children:o.jsx(v_,{googleClientId:f,handleGoogleCredential:S})}),!s&&o.jsx(Cn,{label:"or",labelPosition:"center",my:"lg"})]}),!s&&o.jsx(ze,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:Ot(p,"email")}),o.jsxs(je,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[o.jsx("div",{children:n&&o.jsx(Nt,{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"})}),!s&&o.jsx(Or,{children:"Next"})]})]})}function QH(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...i}=e,s=_e(),[c,u]=v.useState(),f=Nd(c,void 0),p=v.useCallback(m=>{s.startLogin({...i,password:m.password,remember:m.remember==="on"}).then(n).catch(g=>u(Zt(g)))},[s,i,n]);return o.jsxs(pt,{onSubmit:p,children:[o.jsx(er,{style:{flexDirection:"column"},children:r}),o.jsx(Kr,{issues:f}),o.jsx(Ge,{gap:"xl",children:o.jsx(Ni,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:Ot(c,"password")})}),o.jsxs(je,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&o.jsx(Nt,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),o.jsx(zn,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),o.jsx(Or,{children:"Sign in"})]})]})}function WH(e){const t=_e(),n=yd(),[r,i]=v.useState(""),[s,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 p(g){t.post("auth/profile",{login:e.login,profile:g}).then(e.handleAuthResponse).catch(y=>c(Zt(y)))}const m=e.memberships.filter(f).slice(0,10).map(g=>o.jsx(ct.Option,{value:g.id,children:o.jsx(YH,{...g})},g.id));return o.jsxs(Ge,{children:[o.jsxs(Vo,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[o.jsx(Ui,{size:32}),o.jsx(Le,{order:3,children:"Choose profile"})]}),o.jsx(Kr,{outcome:s}),o.jsxs(ct,{store:n,onOptionSubmit:p,children:[o.jsx(ct.EventsTarget,{children:o.jsx(ze,{placeholder:"Search",value:r,onChange:g=>{i(g.currentTarget.value),n.updateSelectedOptionIndex()}})}),o.jsx("div",{children:o.jsx(ct.Options,{children:m.length>0?m:o.jsx(ct.Empty,{children:"Nothing found..."})})})]})]})}function YH(e){var t,n;return o.jsxs(je,{children:[o.jsx(zs,{radius:"xl"}),o.jsxs("div",{children:[o.jsx(Ae,{fz:"sm",fw:500,children:(t=e.profile)==null?void 0:t.display}),o.jsx(Ae,{fz:"xs",opacity:.6,children:(n=e.project)==null?void 0:n.display})]})]})}const KH=/^patient\/Condition\.(?:\*|c?r?u?d?s?)$/,XH="?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis",ZH="?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item",JH="?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern",eq=/^patient\/Observation\.(?:\*|c?r?u?d?s?)$/,tq="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-observation-category|clinical-test",nq="?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory",rq="?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history",iq="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh",aq="?category=http://terminology.hl7.org/CodeSystem/observation-category|survey",oq="?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs";function sq(e){const t=_e();return o.jsx(pt,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:o.jsxs(Ge,{children:[o.jsxs(er,{style:{flexDirection:"column"},children:[o.jsx(Ui,{size:32}),o.jsx(Le,{children:"Choose scope"})]}),o.jsx(Ge,{children:(e.scope??"openid").split(" ").map(n=>{let r;return KH.test(n)?r=[n+XH,n+ZH,n+JH]:eq.test(n)&&(r=[n+tq,n+nq,n+rq,n+iq,n+aq,n+oq]),o.jsxs(o.Fragment,{children:[o.jsx(zn,{id:n,name:n,label:n,defaultChecked:!0},n),r==null?void 0:r.map(i=>o.jsx(zn,{id:i,name:i,label:i},i))]},n+"_group")})}),o.jsx(je,{justify:"flex-end",mt:"xl",children:o.jsx(Or,{children:"Set scope"})})]})})}function S_(e){const[t,n]=v.useState();return o.jsx(pt,{onSubmit:r=>{n(void 0),e.onSubmit(r).catch(i=>n(Ye(i)))},children:o.jsxs(Ge,{children:[o.jsxs(er,{style:{flexDirection:"column"},children:[o.jsx(Ui,{size:32}),o.jsx(Le,{children:"Enter MFA code"})]}),t&&o.jsx(Ya,{icon:o.jsx(rl,{size:16}),title:"Error",color:"red",children:t}),o.jsx(Ge,{children:o.jsx(ze,{name:"token",label:"MFA code",required:!0,autoFocus:!0})}),o.jsx(je,{justify:"flex-end",mt:"xl",children:o.jsx(Or,{children:"Submit code"})})]})})}function w_(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:i,onRegister:s,onCode:c,...u}=e,f=_e(),[p,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:Ye(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]),D=v.useCallback(E=>{C(E.code)},[C]);return v.useEffect(()=>{t&&!g.current&&!p&&(g.current=!0,f.get("auth/login/"+t).then(T).catch(E=>Oe({color:"red",message:Ye(E)})))},[f,t,g,p,T]),o.jsx(ot,{width:450,px:"sm",py:"md",children:p?y?o.jsx(S_,{onSubmit:async E=>{const R=await f.post("auth/mfa/verify",{login:p,token:E.token});T(R)}}):S?o.jsx(WH,{login:p,memberships:S,handleAuthResponse:T}):e.projectId==="new"?o.jsx(m_,{login:p,handleAuthResponse:T}):e.chooseScopes?o.jsx(sq,{login:p,scope:e.scope,handleAuthResponse:D}):o.jsx("div",{children:"Success"}):o.jsx(qH,{onForgotPassword:i,onRegister:s,handleAuthResponse:T,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...u,children:e.children})})}function ia(e){return o.jsx(o.Fragment,{children:Fo(e.value)})}function lq(e){return o.jsx(o.Fragment,{children:Ad(e.value)})}function j_(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("]")),o.jsx(o.Fragment,{children:n.join("").trim()})}function cq(e){var n;const t=e.value;return t?o.jsxs(o.Fragment,{children:[t.name,t.name&&": ",(n=t.telecom)==null?void 0:n.map(r=>o.jsx(j_,{value:r},`telecom-${t.name}-${r.value}`))]}):null}function rm(e,t,n){const r=gc(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 uq(e,t,n){const r=mA(e,t,n);return r?Array.isArray(r)?[r.map(i=>i.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function dq(e){const{elementDefinitionType:t}=e,n=_e(),r=v.useContext(cn),[i,s]=v.useState(hA("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=Pc(c);f(!1),g&&s(g)}).catch(g=>{f(!1),console.warn(g)}))},[n,c]),c&&(u||!Y0(c)))return o.jsx("div",{children:"Loading..."});const p=i.elements["value[x]"];if((p==null?void 0:p.max)!==0){const[g,y]=rm({type:"Extension",value:e.value},"value[x]",c??r.profileUrl);return o.jsx(Li,{propertyType:y,value:g})}return o.jsx(Gh,{path:e.path,value:{type:i.type,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:c})}function fq(e){var t,n;return o.jsxs("div",{children:[(t=e.value)==null?void 0:t.system,": ",(n=e.value)==null?void 0:n.value]})}function hq(e){return o.jsx(o.Fragment,{children:jU(e.value)})}function ld(e){return o.jsx(o.Fragment,{children:Ps(e.value)})}function Eb(e){return o.jsx(o.Fragment,{children:od(e.value)})}function pq(e){const t=e.value;return t?o.jsxs(o.Fragment,{children:[o.jsx(ld,{value:t.numerator})," / ",o.jsx(ld,{value:t.denominator})]}):null}function Fy(e){if(!e.value)return null;const t=e.value.display||e.value.reference||Ii(e.value);return e.link!==!1&&e.value.reference?o.jsx(mt,{to:e.value,children:t}):o.jsx(o.Fragment,{children:t})}function C_(e,t,n,r){if(!Tn(n==null?void 0:n.slices))return[e];const i=new Array(t.length+1);for(let s=0;s<i.length;s++)i[s]=[];for(const s of e){const c=WA(s,t,n.discriminator,r);let u=c?t.findIndex(f=>f.name===c):-1;u===-1&&(u=t.length),i[u].push(s)}return i}async function E_({medplum:e,property:t}){return new Promise((n,r)=>{var u,f;if(!t.slicing){n([]);return}const i=[],s=[],c=[];for(const p of t.slicing.slices){if(!QA(p)){console.debug("Unsupported slice definition",p);continue}let m;Tn(p.elements)||(m=(f=(u=p.type[0])==null?void 0:u.profile)==null?void 0:f[0]),i.push(p),s.push(m),m&&c.push(e.requestProfileSchema(m))}Promise.all(c).then(()=>{for(let p=0;p<i.length;p++){const m=i[p],g=s[p];if(g){const y=Pc(g);m.typeSchema=y}}n(i)}).catch(r)})}function im(e,t,n){return t!==void 0?o.jsx(e,{value:t,children:n}):n}function mq(e){var c,u;const{slice:t,property:n}=e,r=((c=t.typeSchema)==null?void 0:c.elements)??t.elements,i=v.useContext(cn),s=v.useMemo(()=>{var f;if(Tn(r))return yc({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 im(cn.Provider,s,o.jsx(o.Fragment,{children:e.value.map((f,p)=>o.jsx("div",{children:o.jsx(Li,{property:n,path:e.path,arrayElement:!0,elementDefinitionType:t.type[0],propertyType:t.type[0].code,value:f,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${p}-${e.value.length}`))}))}const FE=50;function gq(e){var C;const{property:t,propertyType:n}=e,r=_e(),i=v.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[s,c]=v.useState(!0),[u,f]=v.useState([]),[p,m]=v.useState(()=>[i]),[g,y]=v.useState(0),b=v.useContext(cn);if(v.useEffect(()=>{E_({medplum:r,property:t}).then(T=>{y(i.length),f(T);const D=i.slice(0,FE),E=C_(D,T,t.slicing,b.profileUrl);m(E),c(!1)}).catch(T=>{console.error(T),c(!1)})},[r,t,b.profileUrl,m,i]),s)return o.jsx("div",{children:"Loading..."});let S;if(((C=t.type[0])==null?void 0:C.code)!=="Extension"){const T=p[u.length],D=T.map((E,R)=>o.jsx("div",{children:o.jsx(Li,{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=o.jsx(La,{term:Vs(E),children:D})}else S=o.jsx(o.Fragment,{children:D})}return o.jsxs(o.Fragment,{children:[u.map((T,D)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let E=o.jsx(mq,{path:e.path,slice:T,property:t,value:p[D],ignoreMissingValues:e.ignoreMissingValues,link:e.link},T.name);return e.includeDescriptionListEntry&&(E=o.jsx(La,{term:Vs(T.name),children:E},T.name)),E}),S,g>FE&&o.jsx(je,{justify:"right",children:o.jsxs(Ae,{children:["... ",g," total values"]})})]})}function Li(e){var s;const{property:t,propertyType:n,value:r}=e;if((s=t==null?void 0:t.path)==null?void 0:s.endsWith(".id"))return o.jsxs(ce,{component:"div",style:{display:"flex",gap:3,alignItems:"center"},children:[r,!Rn(r)&&o.jsx(mD,{value:r,timeout:2e3,children:({copied:c,copy:u})=>o.jsx(el,{label:c?"Copied":"Copy",withArrow:!0,position:"right",children:o.jsx(_n,{variant:"subtle",color:c?"teal":"gray",onClick:u,children:c?o.jsx(eo,{size:"1rem"}):o.jsx(t_,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===oe.Attachment?o.jsx(LH,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):o.jsx(gq,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case oe.boolean:return o.jsx(o.Fragment,{children:r===void 0?"":(!!r).toString()});case oe.SystemString:case oe.string:return o.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case oe.code:case oe.date:case oe.decimal:case oe.id:case oe.integer:case oe.positiveInt:case oe.unsignedInt:case oe.uri:case oe.url:return o.jsx(o.Fragment,{children:r});case oe.canonical:return o.jsx(Fy,{value:{reference:r},link:e.link});case oe.dateTime:case oe.instant:return o.jsx(o.Fragment,{children:gr(r)});case oe.markdown:return o.jsx("pre",{children:r});case oe.Address:return o.jsx(HV,{value:r});case oe.Annotation:return o.jsx(o.Fragment,{children:r==null?void 0:r.text});case oe.Attachment:return o.jsx(Pd,{value:r,maxWidth:e.maxWidth});case oe.CodeableConcept:return o.jsx(ia,{value:r});case oe.Coding:return o.jsx(lq,{value:r});case oe.ContactDetail:return o.jsx(cq,{value:r});case oe.ContactPoint:return o.jsx(j_,{value:r});case oe.HumanName:return o.jsx(xb,{value:r});case oe.Identifier:return o.jsx(fq,{value:r});case oe.Money:return o.jsx(hq,{value:r});case oe.Period:return o.jsx(o.Fragment,{children:yU(r)});case oe.Quantity:case oe.Duration:return o.jsx(ld,{value:r});case oe.Range:return o.jsx(Eb,{value:r});case oe.Ratio:return o.jsx(pq,{value:r});case oe.Reference:return o.jsx(Fy,{value:r,link:e.link});case oe.Timing:return o.jsx(o.Fragment,{children:AA(r)});case oe.Dosage:case oe.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return o.jsx(Gh,{path:e.path,value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});case oe.Extension:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return o.jsx(dq,{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 o.jsx(Gh,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}const T_=["extension","modifierExtension"],vq=JA.filter(e=>!T_.includes(e));function Gh(e){const t=e.value,{value:n,type:r}=t,i=v.useContext(cn),s=e.profileUrl??(i==null?void 0:i.profileUrl),c=v.useMemo(()=>Gp(r,s),[s,r]),u=v.useMemo(()=>{if(c)return yc({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 o.jsxs("div",{children:[r," not implemented"]});if(typeof n=="object"&&"name"in n&&Object.keys(n).length===1&&typeof n.name=="string")return o.jsx("div",{children:n.name});const f=u??i;return im(cn.Provider,u,o.jsx(jb,{compact:e.compact,children:Object.entries(f.elements).map(([p,m])=>{var j;if(T_.includes(p)&&Rn((j=m.slicing)==null?void 0:j.slices))return null;if(vq.includes(p))return null;if(e_.includes(p)&&m.path.split(".").length===2||p.includes("."))return null;const[g,y]=rm(t,p,f.profileUrl);if((e.ignoreMissingValues||m.max===0)&&Rn(g)||e.path.endsWith(".extension")&&(p==="url"||p==="id"))return null;const b=m.max>1||m.isArray,S=o.jsx(Li,{property:m,propertyType:y,path:e.path+"."+p,value:g,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:b,link:e.link},p);return b?S:o.jsx(La,{term:Vs(p),children:S},p)})}))}const yq="_dimmed_11me5_1",xq="_preserveBreaks_11me5_5",Hy={dimmed:yq,preserveBreaks:xq},R_="Read Only";function D_(e,t){return e?o.jsx(el.Floating,{label:e,children:t}):t}function A_(e){const{debugMode:t}=v.useContext(cn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,D_(e!=null&&e.readonly?R_:void 0,o.jsxs(je,{wrap:"nowrap","data-testid":e.testId,children:[o.jsx("div",{children:e.children}),o.jsx("div",{children:o.jsx(mn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e!=null&&e.readonly?Hy.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function $t(e){const{debugMode:t}=v.useContext(cn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,D_(e!=null&&e.readonly?R_:void 0,o.jsx(mn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:Ut({[Hy.dimmed]:e==null?void 0:e.readonly},Hy.preserveBreaks)},description:e.description,withAsterisk:e.withAsterisk,error:Ot(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function bq(e,t,n,r,i){const s=r.type;if(s.length>1)for(const c of s){const u=t.replace("[x]",Hn(c.code));u in e&&delete e[u]}return Rn(i)?e[n]=void 0:e[n]=i,e}function Sq(e){return!!e&&!Rn(e.url)&&!Rn(e.name)}function wq(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:i,path:s,valuePath:c,...u}=e,[f,p]=v.useState(t);function m(g){const y=Cq(g);p(y),n&&n(y)}return o.jsx(tm,{defaultValue:f&&jq(f),onChange:m,withHelpText:r??!0,...u})}function jq(e){var t;return(t=e.coding)==null?void 0:t.map(n=>({system:n.system,code:n.code,display:n.display}))}function Cq(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function Eq(e){var p,m;const{defaultValue:t,onChange:n,withHelpText:r,response:i,...s}=e,[c,u]=v.useState(((m=(p=i==null?void 0:i.answer)==null?void 0:p[0])==null?void 0:m.valueCoding)??t);function f(g){const y=g[0],b=y&&Rq(y);u(b),n&&n(b)}return o.jsx(tm,{defaultValue:c?Tq(c):void 0,maxValues:1,onChange:f,withHelpText:r??!0,...s})}function Tq(e){return{system:e.system,code:e.code,display:e.display}}function Rq(e){return{system:e.system,code:e.code,display:e.display}}function __(e){const{path:t,outcome:n}=e,{elementsByPath:r,getExtendedProps:i}=v.useContext(cn),[s,c]=v.useState(e.defaultValue),u=v.useRef(s);u.current=s;const[f,p,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 D=e.valuePath??t;return o.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[o.jsx(ln,{disabled:e.disabled||(g==null?void 0:g.readonly),"data-testid":"system",defaultValue:s==null?void 0:s.system,required:((f==null?void 0:f.min)??0)>0,onChange:E=>j(E.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:Ot(n,D+".system")}),o.jsx(ln,{disabled:e.disabled||(y==null?void 0:y.readonly),"data-testid":"use",defaultValue:s==null?void 0:s.use,required:((p==null?void 0:p.min)??0)>0,onChange:E=>C(E.currentTarget.value),data:["","home","work","temp","old","mobile"],error:Ot(n,D+".use")}),o.jsx(ze,{disabled:e.disabled||(b==null?void 0:b.readonly),placeholder:"Value",defaultValue:s==null?void 0:s.value,required:((m==null?void 0:m.min)??0)>0,onChange:E=>T(E.currentTarget.value),error:Ot(n,D+".value")})]})}function Dq(e){var m;const[t,n]=v.useState(e.defaultValue),r=v.useRef(t);r.current=t;const{getExtendedProps:i}=v.useContext(cn),[s,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 p(g){const y={...r.current,telecom:g&&[g]};g||delete y.telecom,u(y)}return o.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[o.jsx(ze,{disabled:e.disabled||(s==null?void 0:s.readonly),"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t==null?void 0:t.name,onChange:g=>f(g.currentTarget.value)}),o.jsx(__,{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:p,outcome:e.outcome})]})}function Aq(e){if(!e)return"";const t=new Date(e);return Wp(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function Tb(e){if(!e)return"";const t=new Date(e);return Wp(t)?t.toISOString():""}function aa(e){return o.jsx(ze,{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:_q(),step:1,defaultValue:Aq(e.defaultValue),autoFocus:e.autoFocus,error:Ot(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(Tb(n))}}})}function _q(){return"datetime-local"}function kq(e){const{propertyType:t}=e,n=_e(),r=v.useMemo(()=>{if(Tn(t.profile))return t.profile[0]},[t]),[i,s]=v.useState(r!==void 0);return v.useEffect(()=>{r&&(s(!0),n.requestProfileSchema(r).then(()=>s(!1)).catch(c=>{s(!1),console.warn(c)}))},[n,r]),r&&(i||!Y0(r))?o.jsx("div",{children:"Loading..."}):o.jsx(_b,{profileUrl:r,path:e.path,typeName:"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function Pq(e){var D,E,R;const{outcome:t,path:n}=e,[r,i]=v.useState(e.defaultValue),{getExtendedProps:s}=v.useContext(cn),[c,u,f,p,m]=v.useMemo(()=>["use","prefix","given","family","suffix"].map(A=>s(e.path+"."+A)),[s,e.path]);function g(A){i(A),e.onChange&&e.onChange(A)}function y(A){g({...r,use:A||void 0})}function b(A){g({...r,prefix:A?A.split(" "):void 0})}function S(A){g({...r,given:A?A.split(" "):void 0})}function j(A){g({...r,family:A||void 0})}function C(A){g({...r,suffix:A?A.split(" "):void 0})}const T=e.valuePath??n;return o.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[o.jsx(ln,{disabled:e.disabled||(c==null?void 0:c.readonly),defaultValue:r==null?void 0:r.use,name:e.name+"-use","data-testid":"use",onChange:A=>y(A.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:Ot(t,T+".use")}),o.jsx(ze,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(D=r==null?void 0:r.prefix)==null?void 0:D.join(" "),onChange:A=>b(A.currentTarget.value),error:Ot(t,T+".prefix")}),o.jsx(ze,{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:A=>S(A.currentTarget.value),error:Ot(t,T+".given")}),o.jsx(ze,{disabled:e.disabled||(p==null?void 0:p.readonly),name:e.name+"-family",placeholder:"Family",defaultValue:r==null?void 0:r.family,onChange:A=>j(A.currentTarget.value),error:Ot(t,T+".family")}),o.jsx(ze,{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:A=>C(A.currentTarget.value),error:Ot(t,T+".suffix")})]})}function Nq(e){const[t,n]=v.useState(e.defaultValue),{elementsByPath:r,getExtendedProps:i}=v.useContext(cn),[s,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 p(g){n(g),e.onChange&&e.onChange(g)}const m=e.valuePath??e.path;return o.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[o.jsx(ze,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"System",required:((s==null?void 0:s.min)??0)>0,defaultValue:t==null?void 0:t.system,onChange:g=>p({...t,system:g.currentTarget.value}),error:Ot(e.outcome,m+".system")}),o.jsx(ze,{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=>p({...t,value:g.currentTarget.value}),error:Ot(e.outcome,m+".value")})]})}const Oq=["USD","EUR","CAD","GBP","AUD"];function Mq(e){var g;const{onChange:t}=e,[n,r]=v.useState(e.defaultValue),{getExtendedProps:i}=v.useContext(cn),[s,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]),p=v.useCallback(y=>{u({...n,value:y.currentTarget.valueAsNumber})},[n,u]),m=o.jsx(ln,{disabled:e.disabled||(s==null?void 0:s.readonly),defaultValue:n==null?void 0:n.currency,data:Oq,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:f});return o.jsx(ze,{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:o.jsx(uF,{size:14}),rightSection:m,rightSectionWidth:92,onChange:p})}function Iq(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(cn),[i,s]=v.useMemo(()=>["start","end"].map(u=>r(e.path+"."+u)),[r,e.path]);function c(u){n(u),e.onChange&&e.onChange(u)}return o.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[o.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})}),o.jsx(aa,{disabled:e.disabled||(s==null?void 0:s.readonly),name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:u=>c({...t,end:u})})]})}function qs(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(cn),[i,s,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 o.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[o.jsx(ln,{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})}),o.jsx(ze,{disabled:e.disabled||(s==null?void 0:s.readonly),id:e.name,name:e.name,required:e.required,"data-autofocus":e.autoFocus,"data-testid":e.name+"-value",type:"number",placeholder:"Value",defaultValue:t==null?void 0:t.value,autoFocus:e.autoFocus,step:"any",onWheel:f=>{e.disableWheel&&f.currentTarget.blur()},onChange:f=>{u({...t,value:Lq(f.currentTarget.value)})}}),o.jsx(ze,{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 Lq(e){if(e)return parseFloat(e)}function Rb(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(cn),[i,s]=v.useMemo(()=>["low","high"].map(u=>r(e.path+"."+u)),[r,e.path]);function c(u){n(u),e.onChange&&e.onChange(u)}return o.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[o.jsx(qs,{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})}),o.jsx(qs,{path:e.path+".high",disabled:e.disabled||(s==null?void 0:s.readonly),name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:u=>c({...t,high:u})})]})}function zq(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(cn),[i,s]=v.useMemo(()=>["numerator","denominator"].map(u=>r(e.path+"."+u)),[r,e.path]);function c(u){n(u),e.onChange&&e.onChange(u)}return o.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[o.jsx(qs,{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})}),o.jsx(qs,{path:e.path+".denominator",disabled:e.disabled||(s==null?void 0:s.readonly),name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:u=>c({...t,denominator:u})})]})}const $q={Device:"device-name",Observation:"code",Subscription:"criteria",User:"email:contains"},Uq=["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 Bq(e){return{value:zt(e)??"",label:Va(e),resource:e}}function il(e){const t=_e(),{resourceType:n,searchCriteria:r}=e,[i,s]=v.useState(),c=Qt(e.defaultValue,s),u=e.itemComponent??Vq,f=e.onChange,p=v.useCallback(async(g,y)=>{const b=Fq(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:o.jsx(bb,{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:Bq,loadOptions:p,onChange:m,clearable:!0})}const Vq=v.forwardRef(({label:e,resource:t,active:n,...r},i)=>o.jsx("div",{ref:i,...r,children:o.jsxs(je,{wrap:"nowrap",children:[o.jsx(Xo,{value:t}),o.jsxs("div",{children:[o.jsx(Ae,{children:e}),o.jsx(Ae,{size:"xs",c:"dimmed",children:t.birthDate||t.id})]})]})}));function Fq(e){return $q[e]??(Uq.includes(e)?"name":"_id")}function Od(e){const{onChange:t}=e,n=_e(),[r,i]=v.useState(e.defaultValue),[s,c]=v.useState(()=>Hq(e.targetTypes)),[u,f]=v.useState(()=>qq(e.defaultValue,s)),p=v.useRef(new aA),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=s==null?void 0:s.map(j=>{if(!Qq(j))return Promise.resolve(j);b=!0;const C=j.value,T=p.current.get(C);if(T)return T;const D=Gq(n,j.value).then(R=>{const A={...j};return R?Tn(R.type)?(A.resourceType=R.type,A.name=R.name,A.title=R.title):(console.error(`StructureDefinition.type missing for ${j.value}`),A.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${j.value}`),A.error="StructureDefinition not found"),A}).catch(R=>(console.error(R),{...j,error:R})),E=new Ai(D);return p.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,s]);const g=v.useCallback(b=>{const S=b?on(b):void 0;i(S),t&&t(S)},[t]),y=v.useMemo(()=>s?s.map(b=>({value:b.value,label:b.type==="profile"?b.title??b.name??b.resourceType??b.value:b.value})):[],[s]);return o.jsxs(o.Fragment,{children:[e.name&&o.jsx("input",{type:"hidden",name:e.name,value:(r==null?void 0:r.reference)??""}),o.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s&&s.length>1&&o.jsx(ln,{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=s.find(C=>C.value===S);f(j)},data:y}),!s&&o.jsx(wb,{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"}),o.jsx(il,{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 Hq(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 qq(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(s=>s.resourceType===n);return i||{type:"resourceType",value:n,resourceType:n}}if(t&&t.length>0)return t[0]}async function Gq(e,t){const n=Pc(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 Qq(e){return e.type==="profile"&&!(e!=null&&e.error)&&Rn(e.resourceType)}function Wq(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}const Yq="_indented_ldk1d_1",k_={indented:Yq};function Db({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?o.jsx(Ne,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:o.jsx(qh,{size:"1.25rem"}),onClick:t,children:r}):o.jsx(_n,{title:r,color:"green.6","data-testid":n,onClick:t,children:o.jsx(qh,{size:"1.25rem"})})}function P_({propertyDisplayName:e,onClick:t,testId:n}){return o.jsx(_n,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:o.jsx(Hh,{size:"1.25rem"})})}function Kq(e){var b,S;const{slice:t,property:n}=e,[r,i]=v.useState(e.defaultValue),s=((b=t.typeSchema)==null?void 0:b.elements)??t.elements,c=v.useContext(cn),u=v.useMemo(()=>{var j;if(Tn(s))return yc({parentContext:c,elements:s,path:e.path,profileUrl:(j=t.typeSchema)==null?void 0:j.url})},[c,e.path,(S=t.typeSchema)==null?void 0:S.url,s]);function f(j){i(j),e.onChange&&e.onChange(j)}const p=t.min>0,m=Rn(t.elements),g=PA(t.name),y=e.property.readonly&&r.length===0;return im(cn.Provider,u,o.jsx($t,{title:g,description:t.definition,withAsterisk:p,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:y?o.jsx(Ae,{c:"dimmed",children:"(empty)"}):o.jsxs(Ge,{className:m?k_.indented:void 0,children:[r.map((j,C)=>o.jsxs(je,{wrap:"nowrap",children:[o.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${C}`,children:o.jsx(Ab,{elementDefinitionType:t.type[0],name:t.name,defaultValue:j,onChange:T=>{const D=[...r];D[C]=T,f(D)},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&&o.jsx(P_,{propertyDisplayName:g,testId:e.testId&&`${e.testId}-remove-${C}`,onClick:T=>{pn(T);const D=[...r];D.splice(C,1),f(D)}})]},`${C}-${r.length}`)),!e.property.readonly&&r.length<t.max&&o.jsx(je,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:o.jsx(Db,{propertyDisplayName:g,onClick:j=>{pn(j);const C=[...r,void 0];f(C)},testId:e.testId&&`${e.testId}-add`})})]})}))}function Xq(e){var D;const{property:t}=e,n=_e(),[r,i]=v.useState(!0),[s,c]=v.useState([]),[u]=v.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[f,p]=v.useState(()=>[u]),m=v.useContext(cn),g=(D=t.type[0])==null?void 0:D.code;v.useEffect(()=>{E_({medplum:n,property:t}).then(E=>{c(E);const R=C_(u,E,t.slicing,m.profileUrl);Zq(R,E),p(R),i(!1)}).catch(E=>{console.error(E),i(!1)})},[n,t,u,m.profileUrl,p]);function y(E,R){const A=[...f];if(A[R]=E,p(A),e.onChange){const k=A.flat().filter(M=>M!==void 0);e.onChange(k)}}if(r)return o.jsx("div",{children:"Loading..."});const b=s.length,S=f[b],j=!(e.hideNonSliceValues??(g==="Extension"&&s.length>0)),C=Vs(t.path),T=e.property.readonly&&s.length===0&&u.length===0;return o.jsxs(Ge,{className:e.indent?k_.indented:void 0,children:[T&&o.jsx(Ae,{c:"dimmed",children:"(empty)"}),s.map((E,R)=>o.jsx(Kq,{slice:E,path:e.path,valuePath:e.valuePath,property:t,defaultValue:f[R],onChange:A=>{y(A,R)},testId:`slice-${E.name}`},E.name)),j&&S.map((E,R)=>o.jsxs(je,{wrap:"nowrap",style:{flexGrow:1},children:[o.jsx("div",{style:{flexGrow:1},children:o.jsx(Md,{arrayElement:!0,property:e.property,name:e.name+"."+R,path:e.path,valuePath:Wq(e.path,e.valuePath,R),defaultValue:E,onChange:A=>{const k=[...S];k[R]=A,y(k,b)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&o.jsx(P_,{propertyDisplayName:C,testId:`nonsliced-remove-${R}`,onClick:A=>{pn(A);const k=[...S];k.splice(R,1),y(k,b)}})]},`${R}-${S.length}`)),!e.property.readonly&&j&&f.flat().length<t.max&&o.jsx(je,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:o.jsx(Db,{propertyDisplayName:C,onClick:E=>{pn(E);const R=[...S];R.push(void 0),y(R,b)},testId:"nonsliced-add"})})]})}function Zq(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 Jq(e){const[t,n]=v.useState(!1),r=pR(),i=v.useRef(null),s={...e.styles};return t||(s.input||(s.input={}),s.input.WebkitTextSecurity="disc"),o.jsxs(Vo,{gap:"xs",children:[o.jsx(Js,{...e,styles:{...s,root:{...s.root??{},flexGrow:1}},ref:i,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),o.jsx(_n,{title:"Copy secret",onClick:()=>{var c;r.copy((c=i.current)==null?void 0:c.value),Oe({color:"green",message:"Copied"})},children:o.jsx(t_,{})})]})}const eG=["sun","mon","tue","wed","thu","fri","sat"];function tG(e){const[t,n]=v.useState(e.defaultValue),[r,i]=v.useState(!e.disabled&&(e.defaultModalOpen??!1)),s=v.useRef(t);return s.current=t,o.jsxs(o.Fragment,{children:[o.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[o.jsx("span",{children:AA(s.current)||"No repeat"}),o.jsx(Ne,{disabled:e.disabled,onClick:()=>i(!0),children:"Edit"})]}),!e.disabled&&o.jsx(nG,{path:e.path,visible:r,defaultValue:s.current,onOk:c=>{e.onChange&&e.onChange(c),n(c),i(!1)},onCancel:()=>i(!1)})]})}const HE={repeat:{period:1,periodUnit:"d"}};function nG(e){const[t,n]=v.useState(e.defaultValue||HE),{getExtendedProps:r}=v.useContext(cn),[i,s,c,u,f]=v.useMemo(()=>["event","repeat","repeat.period","repeat.periodUnit","repeat.dayOfWeek"].map(j=>r(e.path+"."+j)),[r,e.path]),p=v.useRef(t);p.current=t;function m(j){n({...p.current,event:[j]})}function g(j){n({...p.current,repeat:j})}function y(j){var C;g({...(C=p.current)==null?void 0:C.repeat,period:j})}function b(j){var C;g({...(C=p.current)==null?void 0:C.repeat,periodUnit:j})}function S(j){var C;g({...(C=p.current)==null?void 0:C.repeat,dayOfWeek:j})}return o.jsx(Un,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:o.jsxs(Ge,{children:[o.jsx($t,{title:"Starts on",htmlFor:"timing-dialog-start",children:o.jsx(aa,{disabled:i==null?void 0:i.readonly,name:"timing-dialog-start",onChange:j=>m(j)})}),o.jsx(jd,{disabled:s==null?void 0:s.readonly,label:"Repeat",checked:!!t.repeat,onChange:j=>g(j.currentTarget.checked?HE.repeat:void 0)}),t.repeat&&o.jsxs(o.Fragment,{children:[o.jsx($t,{title:"Repeat every",htmlFor:"timing-dialog-period",children:o.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[o.jsx(ze,{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)}),o.jsx(ln,{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"&&o.jsx($t,{title:"Repeat on",children:o.jsx(td.Group,{multiple:!0,onChange:S,children:o.jsx(je,{justify:"space-between",mt:"md",gap:"xs",children:eG.map(j=>o.jsx(td,{value:j,size:"xs",radius:"xl",disabled:f==null?void 0:f.readonly,children:j.charAt(0).toUpperCase()},j))})})})]}),o.jsx(je,{justify:"flex-end",children:o.jsx(Ne,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function Md(e){var u;const{property:t,name:n,onChange:r,defaultValue:i}=e,s=e.defaultPropertyType&&e.defaultPropertyType!=="undefined"?e.defaultPropertyType:t.type[0].code,c=t.type;if((t.isArray||t.max>1)&&!e.arrayElement){if(s===oe.Attachment)return o.jsx(zH,{name:n,defaultValue:i,onChange:r,disabled:t.readonly});const f=((u=c[0])==null?void 0:u.code)!==oe.Extension;return o.jsx(Xq,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:i,indent:f,onChange:r,outcome:e.outcome})}else return c.length>1?o.jsx(rG,{elementDefinitionTypes:c,...e}):o.jsx(Ab,{name:n,defaultValue:i,onChange:f=>{if(e.onChange){const p=e.name.replace("[x]",Hn(c[0].code));e.onChange(f,p)}},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 rG(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(s=>s.code===e.defaultPropertyType)),n||(n=t[0]);const[r,i]=v.useState(n);return o.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[o.jsx(ln,{disabled:e.property.readonly,style:{width:"200px"},defaultValue:r.code,"data-testid":e.name&&e.name+"-selector",onChange:s=>{i(t.find(c=>c.code===s.currentTarget.value))},data:t.map(s=>({value:s.code,label:s.code}))}),o.jsx(Ab,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:s=>{e.onChange&&e.onChange(s,e.name.replace("[x]",Hn(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 Ab(e){const{name:t,onChange:n,outcome:r,binding:i,path:s,valuePath:c,readOnly:u}=e,f=e.min!==void 0&&e.min>0,p=e.elementDefinitionType.code,m=v.useContext(cn),g=v.useMemo(()=>{if(!J0(p)||!Rn(e.defaultValue))return e.defaultValue;const S=Object.create(null);if(m.path===e.path)DE(S,m.elements);else{const j=ks(m.path,e.path);if(j===void 0)return e.defaultValue;DE(S,m.elements,j)}return Tn(S)?S:e.defaultValue},[p,m.path,m.elements,e.path,e.defaultValue]);if(!p)return o.jsx("div",{children:"Property type not specified "});function y(){return{name:t,defaultValue:g,onChange:n,outcome:r,path:s,valuePath:c,disabled:u}}function b(){const S=Ot(e.outcome,c??s);return{id:t,name:t,"data-testid":t,defaultValue:g,required:f,error:S,disabled:u}}switch(p){case oe.SystemString:case oe.canonical:case oe.string:case oe.time:case oe.uri:case oe.url:return e.path==="Project.secret.value[x]"?o.jsx(Jq,{...b(),onChange:S=>{e.onChange&&e.onChange(S.currentTarget.value)}}):o.jsx(ze,{...b(),onChange:S=>{n&&n(S.currentTarget.value)}});case oe.date:return o.jsx(ze,{...b(),type:"date",onChange:S=>{n&&n(S.currentTarget.value)}});case oe.dateTime:case oe.instant:return o.jsx(aa,{...b(),onChange:n,outcome:r});case oe.decimal:case oe.integer:case oe.positiveInt:case oe.unsignedInt:return o.jsx(ze,{...b(),type:"number",step:p===oe.decimal?"any":"1",onChange:S=>{if(n){const j=S.currentTarget.valueAsNumber;n(Number.isNaN(j)?void 0:j)}}});case oe.code:return o.jsx(f_,{...b(),error:void 0,onChange:n,binding:i==null?void 0:i.valueSet,creatable:!0,maxValues:1});case oe.boolean:return o.jsx(zn,{...b(),defaultChecked:!!g,onChange:S=>{n&&n(S.currentTarget.checked)}});case oe.base64Binary:case oe.markdown:return o.jsx(Js,{...b(),spellCheck:p!==oe.base64Binary,onChange:S=>{n&&n(S.currentTarget.value)}});case oe.Address:return o.jsx(QV,{...y()});case oe.Annotation:return o.jsx(WV,{...y()});case oe.Attachment:return o.jsx(h_,{...y()});case oe.CodeableConcept:return o.jsx(wq,{binding:i==null?void 0:i.valueSet,...y()});case oe.Coding:return o.jsx(Eq,{binding:i==null?void 0:i.valueSet,...y()});case oe.ContactDetail:return o.jsx(Dq,{...y()});case oe.ContactPoint:return o.jsx(__,{...y()});case oe.Extension:return o.jsx(kq,{...y(),propertyType:e.elementDefinitionType});case oe.HumanName:return o.jsx(Pq,{...y()});case oe.Identifier:return o.jsx(Nq,{...y()});case oe.Money:return o.jsx(Mq,{...y()});case oe.Period:return o.jsx(Iq,{...y()});case oe.Duration:case oe.Quantity:return o.jsx(qs,{...y()});case oe.Range:return o.jsx(Rb,{...y()});case oe.Ratio:return o.jsx(zq,{...y()});case oe.Reference:return o.jsx(Od,{...y(),targetTypes:aG(e.elementDefinitionType)});case oe.Timing:return o.jsx(tG,{...y()});case oe.Dosage:case oe.UsageContext:default:return o.jsx(_b,{...y(),typeName:p})}}const iG=[`${Rd}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function aG(e){var t;return(t=e==null?void 0:e.targetProfile)==null?void 0:t.map(n=>{const r=iG.find(i=>n.startsWith(i));return r?n.slice(r.length):n})}function oG(e){const[t,n]=v.useState(e.defaultValue??{}),r=v.useContext(cn),i=v.useMemo(()=>GV(r.elements),[r.elements]);function s(u){n(u),e.onChange&&e.onChange(u)}const c={type:e.type,value:t};return o.jsx(Ge,{style:{flexGrow:1},"data-testid":e.testId,children:i.map(([u,f])=>{const[p,m]=uq(c,u,f),g=f.min!==void 0&&f.min>0,y=e.valuePath?e.valuePath+"."+u:void 0,b=o.jsx(Md,{property:f,name:u,path:e.path+"."+u,valuePath:y,defaultValue:p,defaultPropertyType:m,onChange:(S,j)=>{s(bq({...t},u,j??u,f,S))},outcome:e.outcome},u);return e.type==="Extension"||hb.includes(u)?b:f.type.length===1&&f.type[0].code==="boolean"?o.jsx(A_,{title:Vs(u),description:f.description,htmlFor:u,fhirPath:f.path,withAsterisk:g,readonly:f.readonly,children:b},u):o.jsx($t,{title:Vs(u),description:f.description,withAsterisk:g,htmlFor:u,outcome:e.outcome,fhirPath:f.path,errorExpression:y,readonly:f.readonly,children:b},u)})})}function _b(e){const[t]=v.useState(()=>e.defaultValue??{}),n=v.useContext(cn),r=e.profileUrl??(n==null?void 0:n.profileUrl),i=v.useMemo(()=>Gp(e.typeName,r),[e.typeName,r]),s=(i==null?void 0:i.type)??e.typeName,c=v.useMemo(()=>{if(i)return yc({parentContext:n,elements:i.elements,path:e.path,profileUrl:i.url,accessPolicyResource:e.accessPolicyResource})},[i,n,e.path,e.accessPolicyResource]);return i?im(cn.Provider,c,o.jsx(oG,{path:e.path,valuePath:e.valuePath,type:s,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):o.jsxs("div",{children:[s," not implemented"]})}const sG="_noteCite_10swh_5",lG="_noteRoot_10swh_10",qE={noteCite:sG,noteRoot:lG};function N_({value:e}){return e?o.jsx(Ge,{justify:"flex-start",gap:"xs",children:e.map(t=>{var n;return t.text&&o.jsx(l0,{classNames:{cite:qE.noteCite,root:qE.noteRoot},cite:((n=t.authorReference)==null?void 0:n.display)||t.authorString,icon:null,children:t.text},`note-${t.text}`)})}):null}function Lc(e){const{value:t,link:n,...r}=e,[i,s]=v.useState(),c=Qt(t,s);let u;if(i&&!sA(i))u=`[${Ye(i)}]`;else if(c)u=Va(c);else return null;return n?o.jsx(mt,{to:t,...r,children:u}):o.jsx(Ae,{component:"span",...r,children:u})}function oc(e){return o.jsxs(je,{gap:"xs",children:[o.jsx(Xo,{size:24,radius:12,value:e.value,link:e.link}),o.jsx(Lc,{value:e.value,link:e.link})]})}const cG={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 am(e){const{status:t,...n}=e;return o.jsx(Cp,{color:e.color||cG[t],...n,children:t.replace(/-/g," ")})}const uG="_table_pe9td_1",dG="_criticalRow_pe9td_12",O_={table:uG,criticalRow:dG};kb.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1,hideSubject:!1};function kb(e){var c;const t=_e(),n=Qt(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 s=(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&&s.push({text:window.atob(u.data)})}return o.jsxs(Ge,{children:[o.jsx(Le,{children:"Diagnostic Report"}),o.jsx(fG,{value:n,hideSubject:e.hideSubject}),r&&!e.hideSpecimenInfo&&hG(r),n.result&&o.jsx(pG,{hideObservationNotes:e.hideObservationNotes,value:n.result}),s.length>0&&o.jsx(N_,{value:s})]})}function fG({value:e,hideSubject:t=!1}){var n,r;return o.jsxs(je,{mt:"md",gap:30,children:[e.subject&&!t&&o.jsxs("div",{children:[o.jsx(Ae,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),o.jsx(oc,{value:e.subject,link:!0})]}),(n=e.resultsInterpreter)==null?void 0:n.map(i=>o.jsxs("div",{children:[o.jsx(Ae,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),o.jsx(oc,{value:i,link:!0})]},i.reference)),(r=e.performer)==null?void 0:r.map(i=>o.jsxs("div",{children:[o.jsx(Ae,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),o.jsx(oc,{value:i,link:!0})]},i.reference)),e.issued&&o.jsxs("div",{children:[o.jsx(Ae,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),o.jsx(Ae,{children:gr(e.issued)})]}),e.status&&o.jsxs("div",{children:[o.jsx(Ae,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),o.jsx(am,{status:e.status})]})]})}function hG(e){return o.jsxs(Ge,{gap:"xs",children:[o.jsx(Le,{order:2,size:"h6",children:"Specimens"}),o.jsx(pr,{type:"ordered",children:e==null?void 0:e.map(t=>{var n;return o.jsx(pr.Item,{ml:"sm",children:o.jsxs(je,{gap:20,children:[o.jsxs(je,{gap:5,children:[o.jsx(Ae,{fw:500,children:"Collected:"})," ",gr((n=t.collection)==null?void 0:n.collectedDateTime)]}),o.jsxs(je,{gap:5,children:[o.jsx(Ae,{fw:500,children:"Received:"})," ",gr(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function pG(e){return o.jsxs("table",{className:O_.table,children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Test"}),o.jsx("th",{children:"Value"}),o.jsx("th",{children:"Reference Range"}),o.jsx("th",{children:"Interpretation"}),o.jsx("th",{children:"Category"}),o.jsx("th",{children:"Performer"}),o.jsx("th",{children:"Status"})]})}),o.jsx("tbody",{children:o.jsx(M_,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function M_(e){var t;return o.jsx(o.Fragment,{children:(t=e.value)==null?void 0:t.map(n=>o.jsx(mG,{value:n,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${Ko(n)?n.reference:n.id}`))})}function mG(e){var i,s;const t=Qt(e.value);if(!t||(i=e.ancestorIds)!=null&&i.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=yG(t);return o.jsxs(o.Fragment,{children:[o.jsxs("tr",{className:Ut({[O_.criticalRow]:r}),children:[o.jsx("td",{rowSpan:n?2:1,children:o.jsx(mt,{to:t,children:o.jsx(ia,{value:t.code})})}),o.jsx("td",{children:o.jsx(gG,{value:t})}),o.jsx("td",{children:o.jsx(vG,{value:t.referenceRange})}),o.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&o.jsx(ia,{value:t.interpretation[0]})}),o.jsx("td",{children:t.category&&t.category.length>0&&o.jsx(o.Fragment,{children:t.category.map(c=>o.jsx("div",{children:o.jsx(ia,{value:c})},`category-${Fo(c)}`))})}),o.jsx("td",{children:(s=t.performer)==null?void 0:s.map(c=>o.jsx(Fy,{value:c},c.reference))}),o.jsx("td",{children:t.status&&o.jsx(am,{status:t.status})})]}),t.hasMember&&o.jsx(M_,{value:t.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,t.id]:[t.id],hideObservationNotes:e.hideObservationNotes}),n&&o.jsx("tr",{children:o.jsx("td",{colSpan:6,children:o.jsx(N_,{value:t.note})})})]})}function gG(e){const t=e.value;return o.jsx(o.Fragment,{children:_A(t)})}function vG(e){const t=e.value&&e.value.length>0&&e.value[0];return t?t.text?o.jsx(o.Fragment,{children:t.text}):o.jsx(Eb,{value:t}):null}function yG(e){var n,r,i,s;const t=(s=(i=(r=(n=e.interpretation)==null?void 0:n[0])==null?void 0:r.coding)==null?void 0:i[0])==null?void 0:s.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}var Wv={},Na={},GE;function I_(){if(GE)return Na;GE=1,Object.defineProperty(Na,"__esModule",{value:!0}),Na.Pointer=Na.escapeToken=Na.unescapeToken=void 0;function e(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}Na.unescapeToken=e;function t(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}Na.escapeToken=t;var n=function(){function r(i){i===void 0&&(i=[""]),this.tokens=i}return r.fromJSON=function(i){var s=i.split("/").map(e);if(s[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(i));return new r(s)},r.prototype.toString=function(){return this.tokens.map(t).join("/")},r.prototype.evaluate=function(i){for(var s=null,c="",u=i,f=1,p=this.tokens.length;f<p;f++)s=u,c=this.tokens[f],!(c=="__proto__"||c=="constructor"||c=="prototype")&&(u=(s||{})[c]);return{parent:s,key:c,value:u}},r.prototype.get=function(i){return this.evaluate(i).value},r.prototype.set=function(i,s){var c=this.evaluate(i);c.parent&&(c.parent[c.key]=s)},r.prototype.push=function(i){this.tokens.push(i)},r.prototype.add=function(i){var s=this.tokens.concat(String(i));return new r(s)},r}();return Na.Pointer=n,Na}var gn={},Yv={},QE;function L_(){return QE||(QE=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 s=i.length,c=new Array(s),u=0;u<s;u++)c[u]=r(i[u]);return c}if(i.constructor==Date){var f=new Date(+i);return f}var p={};for(var m in i)e.hasOwnProperty.call(i,m)&&(p[m]=r(i[m]));return p}e.clone=r}(Yv)),Yv}var fr={},WE;function z_(){if(WE)return fr;WE=1,Object.defineProperty(fr,"__esModule",{value:!0}),fr.diffAny=fr.diffObjects=fr.diffArrays=fr.intersection=fr.subtract=fr.isDestructive=void 0;var e=L_();function t(m){var g=m.op;return g==="remove"||g==="replace"||g==="copy"||g==="move"}fr.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)}fr.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)}fr.intersection=r;function i(m){return m.op==="add"}function s(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=p);var S={"0,0":{operations:[],cost:0}};function j(R,A){var k="".concat(R,",").concat(A),M=S[k];if(M===void 0){if(R>0&&A>0&&!b(m[R-1],g[A-1],y.add(String(R-1))).length)M=j(R-1,A-1);else{var I=[];if(R>0){var $=j(R-1,A),V={op:"remove",index:R-1};I.push(c($,V))}if(A>0){var Y=j(R,A-1),Q={op:"add",index:R-1,value:g[A-1]};I.push(c(Y,Q))}if(R>0&&A>0){var J=j(R-1,A-1),G={op:"replace",index:R-1,original:m[R-1],value:g[A-1]};I.push(c(J,G))}var K=I.sort(function(P,L){return P.cost-L.cost})[0];M=K}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,D=j(C,T).operations,E=D.reduce(function(R,A){var k=R[0],M=R[1];if(i(A)){var I=A.index+1+M,$=I<C+M?String(I):"-",V={op:A.op,path:y.add($).toString(),value:A.value};return[k.concat(V),M+1]}else if(s(A)){var V={op:A.op,path:y.add(String(A.index+M)).toString()};return[k.concat(V),M-1]}else{var Y=y.add(String(A.index+M)),Q=b(A.original,A.value,Y);return[k.concat.apply(k,Q),M]}},[[],0])[0];return E}fr.diffArrays=u;function f(m,g,y,b){b===void 0&&(b=p);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}fr.diffObjects=f;function p(m,g,y,b){if(b===void 0&&(b=p),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 fr.diffAny=p,fr}var YE;function xG(){if(YE)return gn;YE=1;var e=gn&&gn.__extends||function(){var C=function(T,D){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,R){E.__proto__=R}||function(E,R){for(var A in R)Object.prototype.hasOwnProperty.call(R,A)&&(E[A]=R[A])},C(T,D)};return function(T,D){if(typeof D!="function"&&D!==null)throw new TypeError("Class extends value "+String(D)+" is not a constructor or null");C(T,D);function E(){this.constructor=T}T.prototype=D===null?Object.create(D):(E.prototype=D.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=I_(),n=L_(),r=z_(),i=function(C){e(T,C);function T(D){var E=C.call(this,"Value required at path: ".concat(D))||this;return E.path=D,E.name="MissingError",E}return T}(Error);gn.MissingError=i;var s=function(C){e(T,C);function T(D,E){var R=C.call(this,"Test failed: ".concat(D," != ").concat(E))||this;return R.actual=D,R.expected=E,R.name="TestError",R}return T}(Error);gn.TestError=s;function c(C,T,D){if(Array.isArray(C))if(T=="-")C.push(D);else{var E=parseInt(T,10);C.splice(E,0,D)}else C[T]=D}function u(C,T){if(Array.isArray(C)){var D=parseInt(T,10);C.splice(D,1)}else delete C[T]}function f(C,T){var D=t.Pointer.fromJSON(T.path).evaluate(C);return D.parent===void 0?new i(T.path):(c(D.parent,D.key,(0,n.clone)(T.value)),null)}gn.add=f;function p(C,T){var D=t.Pointer.fromJSON(T.path).evaluate(C);return D.value===void 0?new i(T.path):(u(D.parent,D.key),null)}gn.remove=p;function m(C,T){var D=t.Pointer.fromJSON(T.path).evaluate(C);if(D.parent===null)return new i(T.path);if(Array.isArray(D.parent)){if(parseInt(D.key,10)>=D.parent.length)return new i(T.path)}else if(D.value===void 0)return new i(T.path);return D.parent[D.key]=(0,n.clone)(T.value),null}gn.replace=m;function g(C,T){var D=t.Pointer.fromJSON(T.from).evaluate(C);if(D.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(D.parent,D.key),c(E.parent,E.key,D.value),null)}gn.move=g;function y(C,T){var D=t.Pointer.fromJSON(T.from).evaluate(C);if(D.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)(D.value)),null)}gn.copy=y;function b(C,T){var D=t.Pointer.fromJSON(T.path).evaluate(C);return(0,r.diffAny)(D.value,T.value,new t.Pointer).length?new s(D.value,T.value):null}gn.test=b;var S=function(C){e(T,C);function T(D){var E=C.call(this,"Invalid operation: ".concat(D.op))||this;return E.operation=D,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 p(C,T);case"replace":return m(C,T);case"move":return g(C,T);case"copy":return y(C,T);case"test":return b(C,T)}return new S(T)}return gn.apply=j,gn}var KE;function bG(){return KE||(KE=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=I_();Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=xG(),r=z_();function i(p,m){return m.map(function(g){return(0,n.apply)(p,g)})}e.applyPatch=i;function s(p){function m(g,y,b){var S=p(g,y,b);return Array.isArray(S)?S:(0,r.diffAny)(g,y,b,m)}return m}function c(p,m,g){var y=new t.Pointer;return(g?s(g):r.diffAny)(p,m,y)}e.createPatch=c;function u(p,m){var g=t.Pointer.fromJSON(m).evaluate(p);if(g!==void 0)return{op:"test",path:m,value:g.value}}function f(p,m){var g=new Array;return m.filter(r.isDestructive).forEach(function(y){var b=u(p,y.path);if(b&&g.push(b),"from"in y){var S=u(p,y.from);S&&g.push(S)}}),g}e.createTests=f}(Wv)),Wv}var $_=bG();const SG="_removed_el5zk_1",wG="_added_el5zk_6",XE={removed:SG,added:wG};function jG(e){var m;const{name:t,path:n,property:r,originalValue:i,revisedValue:s}=e,c=!!((m=r==null?void 0:r.type)!=null&&m.find(g=>g.code==="Attachment")),[u,f]=v.useState(c),p=()=>f(g=>!g);return o.jsx(o.Fragment,{children:c&&!u||!c?o.jsx(o.Fragment,{children:o.jsxs(ye.Tr,{children:[o.jsx(ye.Td,{children:t}),o.jsx(ye.Td,{className:XE.removed,children:i&&o.jsx(Li,{path:n,property:r,propertyType:i.type,value:i.value,ignoreMissingValues:!0})}),o.jsx(ye.Td,{className:XE.added,children:s&&o.jsx(Li,{path:n,property:r,propertyType:s.type,value:s.value,ignoreMissingValues:!0})})]})}):o.jsxs(ye.Tr,{children:[o.jsx(ye.Td,{children:t}),o.jsx(ye.Td,{colSpan:2,style:{textAlign:"right"},children:o.jsx(Ne,{onClick:p,variant:"light",children:"Expand"})})]})})}const CG="_root_15xvr_1",EG={root:CG};function TG(e){const t=_e(),{original:n,revised:r}=e,[i,s]=v.useState(!1);v.useEffect(()=>{t.requestSchema(e.original.resourceType).then(()=>s(!0)).catch(console.log)},[t,e.original.resourceType]);const c=v.useMemo(()=>{if(!i)return null;const u=[mi(n)],f=[mi(r)],p=[],m=RG($_.createPatch(n,r));for(const g of m){const y=g.path,b=DG(y),S=AG(n.resourceType,b),j=g.op==="add"?void 0:Fs(b,u),C=g.op==="remove"?void 0:Fs(b,f);p.push({key:`op-${g.op}-${g.path}`,name:`${Hn(g.op)} ${b}`,path:(S==null?void 0:S.path)??n.resourceType+"."+b,property:S,originalValue:ZE(S,j),revisedValue:ZE(S,C)})}return p},[i,n,r]);return c?o.jsxs(ye,{className:EG.root,children:[o.jsx(ye.Thead,{children:o.jsxs(ye.Tr,{children:[o.jsx(ye.Th,{}),o.jsx(ye.Th,{children:"Before"}),o.jsx(ye.Th,{children:"After"})]})}),o.jsx(ye.Tbody,{children:c.map(u=>{const{key:f,...p}=u;return o.jsx(jG,{...p},f)})})]}):null}function RG(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 s=e.filter(u=>u.op===r&&u.path===i).length,c={op:r,path:i};s>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 DG(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 AG(e,t){var r;const n=Mc(e,{code:e+"."+t,expression:e+"."+t});return(r=n==null?void 0:n.elementDefinitions)==null?void 0:r[0]}function ZE(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:_G(t,!!(e!=null&&e.isArray))}}function _G(e,t){const n=uU(e).flatMap(r=>r.value);return t?n:n[0]}function Pb(e){const{profileUrl:t}=e,n=_e(),r=n.getAccessPolicy(),i=Qt(e.value),[s,c]=v.useState(!1);v.useEffect(()=>{if(i)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{Pc(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&&zA(i,Ns.READ,r),[r,i]);return!s||!i?null:o.jsx(Gh,{path:i.resourceType,value:{type:i.resourceType,value:e.forceUseInput?e.value:i},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:u})}const kG="_item_5q6yx_1",PG="_itemPadding_5q6yx_5",JE={item:kG,itemPadding:PG};function NG(e){return o.jsx(Ic,{children:e.children})}function Gs(e){var f,p;const{resource:t,profile:n,padding:r,popupMenuItems:i,...s}=e,c=n??((f=t.meta)==null?void 0:f.author),u=e.dateTime??((p=t.meta)==null?void 0:p.lastUpdated);return o.jsxs(nm,{"data-testid":"timeline-item",fill:!0,...s,children:[o.jsxs(je,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[o.jsx(Xo,{value:c,link:!0,size:"md"}),o.jsxs("div",{style:{flex:1},children:[o.jsx(Ae,{size:"sm",children:o.jsx(Lc,{c:"dark",fw:500,value:c,link:!0})}),o.jsxs(Ae,{size:"xs",children:[o.jsx(mt,{c:"dimmed",to:e.resource,children:gr(u)}),o.jsx(Ae,{component:"span",c:"dimmed",mx:8,children:"·"}),o.jsx(mt,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),i&&o.jsxs(Ce,{position:"bottom-end",shadow:"md",width:200,children:[o.jsx(Ce.Target,{children:o.jsx(_n,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${zt(e.resource)}`,children:o.jsx(fF,{})})}),i]})]}),o.jsx(s_,{children:o.jsx("div",{className:Ut(JE.item,{[JE.itemPadding]:r}),children:e.children})})]})}function U_(e,t){e.sort((n,r)=>{const i=eT(n,t),s=eT(r,t);return i>s?1:i<s?-1:tT(n,t)-tT(r,t)})}function eT(e,t){if(!B_(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function tT(e,t){var r;if(!B_(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 B_(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const OG="_pinnedComment_u08s5_1",MG={pinnedComment:OG};function om(e){const t=_e(),n=t.getProfile(),r=v.useRef(null),i=Qt(e.value),[s,c]=v.useState(),[u,f]=v.useState([]),p=e.loadTimelineResources,m=v.useRef(u);m.current=u;const g=v.useCallback(R=>{U_(R,i),R.reverse(),f(R)},[i]),y=v.useCallback(R=>{const A=[];for(const k of R){if(k.status!=="fulfilled")continue;const M=k.value;if(M.type==="history"&&c(M),M.entry)for(const I of M.entry)A.push(I.resource)}g(A)},[g]),b=v.useCallback(R=>g([...m.current,R]),[g]),S=v.useCallback(()=>{var k;let R,A;"resourceType"in e.value?(R=e.value.resourceType,A=e.value.id):[R,A]=(k=e.value.reference)==null?void 0:k.split("/"),p(t,R,A).then(y).catch(console.error)},[t,e.value,p,y]);v.useEffect(()=>S(),[S]);function j(R){!i||!e.createCommunication||t.createResource(e.createCommunication(i,n,R)).then(A=>b(A)).catch(console.error)}function C(R){!i||!e.createMedia||t.createResource(e.createMedia(i,n,R)).then(A=>b(A)).then(()=>As({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:o.jsx(eo,{size:16}),autoClose:2e3})).catch(A=>As({id:"upload-notification",color:"red",title:"Upload error",message:Ye(A),icon:o.jsx(OE,{size:16}),autoClose:2e3}))}function T(){Oe({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function D(R){As({id:"upload-notification",loading:!0,title:"Uploading...",message:VG(R),autoClose:!1,withCloseButton:!1})}function E(R){As({id:"upload-notification",color:"red",title:"Upload error",message:Ye(R),icon:o.jsx(OE,{size:16}),autoClose:2e3})}return i?o.jsxs(NG,{children:[e.createCommunication&&o.jsx(nm,{children:o.jsx(pt,{testid:"timeline-form",onSubmit:R=>{j(R.text);const A=r.current;A&&(A.value="",A.focus())},children:o.jsxs(je,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[o.jsx(Xo,{value:n}),o.jsx(ze,{name:"text",ref:r,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),o.jsx(_n,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:o.jsx(bF,{size:16})}),o.jsx(Cb,{securityContext:on(i),onUpload:C,onUploadStart:T,onUploadProgress:D,onUploadError:E,children:R=>o.jsx(_n,{...R,radius:"xl",color:"blue",variant:"filled",children:o.jsx(mb,{size:16})})})]})})}),u.map(R=>{var M;if(!R)return null;const A=`${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 o.jsx(IG,{history:s,resource:R,popupMenuItems:k},A);switch(R.resourceType){case"AuditEvent":return o.jsx(UG,{resource:R,popupMenuItems:k},A);case"Communication":return o.jsx(zG,{resource:R,popupMenuItems:k},A);case"DiagnosticReport":return o.jsx(BG,{resource:R,popupMenuItems:k},A);case"Media":return o.jsx($G,{resource:R,popupMenuItems:k},A);default:return o.jsx(Gs,{resource:R,padding:!0,children:o.jsx(Pb,{value:R,ignoreMissingValues:!0})},A)}})]}):o.jsx(er,{style:{width:"100%",height:"100%"},children:o.jsx(_r,{})})}function IG(e){const{history:t,resource:n,...r}=e,i=LG(t,n);return i?o.jsx(Gs,{resource:n,padding:!0,...r,children:o.jsx(TG,{original:i,revised:e.resource})}):o.jsxs(Gs,{resource:n,padding:!0,...r,children:[o.jsx("h3",{children:"Created"}),o.jsx(Pb,{value:n,ignoreMissingValues:!0,forceUseInput:!0})]})}function LG(e,t){const n=e.entry??[],r=n.findIndex(i=>{var s,c,u;return((c=(s=i.resource)==null?void 0:s.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 zG(e){var r,i;const n=!e.resource.priority||e.resource.priority==="routine"?void 0:MG.pinnedComment;return o.jsx(Gs,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:e.popupMenuItems,children:o.jsx("p",{children:(i=(r=e.resource.payload)==null?void 0:r[0])==null?void 0:i.contentString})})}function $G(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 o.jsx(Gs,{resource:e.resource,padding:!!n,popupMenuItems:e.popupMenuItems,children:o.jsx(Pd,{value:e.resource.content})})}function UG(e){return o.jsx(Gs,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:o.jsx(Yr,{children:o.jsx("pre",{children:e.resource.outcomeDesc})})})}function BG(e){return o.jsx(Gs,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:o.jsx(kb,{value:e.resource})})}function VG(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${Kv(e.loaded)} / ${Kv(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${Kv(e.loaded)}`}function Kv(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 FG(e){const{resource:t,...n}=e;return o.jsx(om,{value:t,loadTimelineResources:async(r,i,s)=>{const c=`${i}/${s}`;return Promise.allSettled([r.readHistory(i,s),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:100})])},...n})}function HG(e){const{encounter:t,...n}=e;return o.jsx(om,{value:t,loadTimelineResources:async(r,i,s)=>Promise.allSettled([r.readHistory("Encounter",s),r.search("Communication","encounter=Encounter/"+s),r.search("Media","encounter=Encounter/"+s)]),createCommunication:(r,i,s)=>({resourceType:"Communication",status:"completed",encounter:on(r),subject:r.subject,sender:on(i),sent:new Date().toISOString(),payload:[{contentString:s}]}),createMedia:(r,i,s)=>({resourceType:"Media",status:"completed",encounter:on(r),subject:r.subject,operator:on(i),issued:new Date().toISOString(),content:s}),...n})}function qG(e){let t;try{t=Oc(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 o.jsx(Li,{value:t[0]||"",propertyType:e.propertyType})}function GG(e){return o.jsxs(Un,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[o.jsxs(ce,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&o.jsx(nT,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&o.jsx(nT,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),o.jsx(Ae,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function nT(e){return o.jsx(Ne,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const QG={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]},WG={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 Nb(e,t){return{...e,filters:t,offset:0,name:void 0}}function V_(e,t){return Nb(e,(e.filters??[]).filter(n=>n.code!==t))}function sm(e,t,n,r,i){const s=[];return e.filters&&s.push(...e.filters),s.push({code:t,operator:n,value:r??""}),Nb(e,s)}function YG(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function KG(e,t){return Ob(e,t,-1)}function XG(e,t){return Ob(e,t,0)}function ZG(e,t){return Ob(e,t,1)}function Ob(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),lm(e,t,r,i)}function JG(e,t){const n=new Date,r=new Date(n.getTime()+24*60*60*1e3);return lm(e,t,n,r)}function eQ(e,t){return Mb(e,t,-1)}function tQ(e,t){return Mb(e,t,0)}function nQ(e,t){return Mb(e,t,1)}function Mb(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),lm(e,t,r,i)}function rQ(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),lm(e,t,n,new Date)}function lm(e,t,n,r){return e=V_(e,t),e=rT(e,t,ue.GREATER_THAN_OR_EQUALS,n),e=rT(e,t,ue.LESS_THAN_OR_EQUALS,r),e}function rT(e,t,n,r){return sm(e,t,n,r.toISOString())}function iT(e,t,n=!0){return sm(e,t,ue.MISSING,n.toString())}function iQ(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function aQ(e,t){const n=e.count??Yp,r=(t-1)*n;return iQ(e,r)}function oQ(e,t,n){return t===sQ(e)&&n!==void 0&&n===lQ(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function sQ(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function lQ(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function cQ(e){return QG[e.type]}function F_(e){return WG[e]??""}function Qs(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(Hn).join(" "))}function uQ(e,t){var r,i;const n=t.name;return n==="id"?o.jsx(mt,{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?dQ(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?fQ(e,t.searchParams[0]):null}function dQ(e,t){var s,c,u;const n=((u=(c=(s=t.path)==null?void 0:s.split("."))==null?void 0:c.pop())==null?void 0:u.replaceAll("[x]",""))??"",[r,i]=rm({type:e.resourceType,value:e},n);return r?o.jsx(Li,{path:t.path,property:t,propertyType:i,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function fQ(e,t){const n=Fs(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:o.jsx(o.Fragment,{children:n.map((r,i)=>o.jsx(Li,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${i}-${n.length}`))})}function hQ(e){const t=v.useRef(!1),[n,r]=v.useState({search:JSON.parse(Ii(e.search))}),[i,s]=v.useState(!1);v.useEffect(()=>{r({search:e.search})},[e.search]);const c=v.useMemo(()=>{if(!e.visible)return[];const f=e.search.resourceType,p=hA(f),m=tb(f);return ad(pQ(p,m)).map(g=>({value:g,label:Qs(g)}))},[e.visible,e.search.resourceType]);function u(f){r({search:{...n.search,fields:f}})}return o.jsx(Un,{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:o.jsx("div",{"data-testid":"overlay-child"})},children:o.jsxs(Ge,{children:[o.jsx(Op,{style:{width:550},placeholder:"Select fields to display",data:c,value:n.search.fields??[],onChange:u,onDropdownOpen:()=>s(!0),onDropdownClose:()=>s(!1),maxDropdownHeight:"250px",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),o.jsx(je,{justify:"flex-end",children:o.jsx(Ne,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function pQ(e,t){const n=[],r=new Set,i=new Set;for(const s of Object.keys(e.elements))n.push(s),r.add(s.toLowerCase()),i.add(Qs(s));if(t)for(const s of Object.keys(t)){const c=Qs(s);!r.has(s)&&!i.has(c)&&(n.push(s),r.add(s),i.add(c))}return n}function H_(e){const t=Mc(e.resourceType,e.searchParam),n=e.name??"filter-value";switch(t.type){case Jn.REFERENCE:return o.jsx(Od,{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 Jn.BOOLEAN:return o.jsx(zn,{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 Jn.DATE:return o.jsx(ze,{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 Jn.DATETIME:return o.jsx(aa,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case Jn.NUMBER:return o.jsx(ze,{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 Jn.QUANTITY:return o.jsx(qs,{name:n,path:"",defaultValue:mQ(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return o.jsx(ze,{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 mQ(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function gQ(e){const[t,n]=v.useState(Qr(e.search)),r=v.useRef(t);r.current=t,v.useEffect(()=>{n(Qr(e.search))},[e.search]);function i(f){n(sm(r.current,f.code,f.operator,f.value))}const s=e.search.resourceType,c=tb(s)??{},u=t.filters||[];return o.jsx(Un,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:o.jsxs(pt,{onSubmit:()=>e.onOk(r.current),children:[o.jsxs("div",{children:[o.jsxs("table",{children:[o.jsxs("colgroup",{children:[o.jsx("col",{style:{width:200}}),o.jsx("col",{style:{width:200}}),o.jsx("col",{style:{width:380}}),o.jsx("col",{style:{width:40}})]}),o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Field"}),o.jsx("th",{children:"Operation"}),o.jsx("th",{children:"Value"}),o.jsx("th",{})]})}),o.jsx("tbody",{children:u.map((f,p)=>o.jsx(vQ,{id:`filter-${p}-row`,resourceType:s,searchParams:c,value:f,onChange:m=>{const g=[...u];g[p]=m,n(Nb(r.current,g))},onDelete:()=>n(YG(r.current,p))},`filter-${p}-row`))})]}),o.jsx(Db,{propertyDisplayName:"Filter",onClick:()=>i({})})]}),o.jsx(je,{justify:"flex-end",mt:"xl",children:o.jsx(Or,{children:"OK"})})]})})}function vQ(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 s(f){n.current.value=f,e.onChange(n.current)}const c=e.searchParams[t.code],u=c&&cQ(c);return o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx(ln,{"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:Qs(f)}))]})}),o.jsx("td",{children:u&&o.jsx(ln,{"data-testid":`${e.id}-filter-operation`,defaultValue:t.operator,onChange:f=>i(f.currentTarget.value),data:["",...u.map(f=>({value:f,label:F_(f)}))]},`${e.id}-filter-value-${e.value.code}`)}),o.jsx("td",{children:c&&t.operator&&o.jsx(H_,{name:`${e.id}-filter-value`,resourceType:e.resourceType,searchParam:c,defaultValue:t.value,onChange:s},`${e.id}-filter-value-${e.value.code}-${e.value.operator}`)}),o.jsx("td",{children:e.onDelete&&o.jsx(_n,{variant:"outline",color:"red",radius:"xl","aria-label":"Delete filter",onClick:e.onDelete,children:o.jsx(Hs,{style:{width:"70%",height:"70%"},stroke:1.5})})})]})}function yQ(e){const[t,n]=v.useState(e.defaultValue??"");if(!e.searchParam||!e.filter)return null;function r(){e.onOk({...e.filter,value:t})}return o.jsx(Un,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:o.jsx(pt,{onSubmit:r,children:o.jsxs(or,{children:[o.jsx(or.Col,{span:10,children:o.jsx(H_,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),o.jsx(or.Col,{span:2,children:o.jsx(Ne,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function xQ(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 o.jsx(Lc,{value:{reference:n.value}});const s=Mc(t,r);if(n.code==="_lastUpdated"||s.type===Jn.DATETIME)return o.jsx(o.Fragment,{children:gr(n.value)})}return o.jsx(o.Fragment,{children:n.value})}function bQ(e){if(!e.searchParams)return null;function t(s,c){i(oQ(e.search,s.code,c))}function n(s){i(V_(e.search,s.code))}function r(s,c){e.onPrompt(s,{code:s.code,operator:c,value:""})}function i(s){e.onChange(s)}return e.searchParams.length===1?o.jsx(SQ,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:i,onClear:n}):o.jsx(Ce.Dropdown,{children:e.searchParams.map(s=>o.jsx(Ce.Item,{children:Qs(s.code)},s.code))})}function SQ(e){switch(e.searchParam.type){case"date":return o.jsx(wQ,{...e});case"number":case"quantity":return o.jsx(jQ,{...e});case"reference":return o.jsx(CQ,{...e});case"string":return o.jsx(EQ,{...e});case"token":case"uri":return o.jsx(TQ,{...e});default:return o.jsxs(o.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function wQ(e){const{searchParam:t}=e,n=t.code;return o.jsxs(Ce.Dropdown,{children:[o.jsx(Ce.Item,{leftSection:o.jsx(gb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),o.jsx(Ce.Item,{leftSection:o.jsx(vb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),o.jsx(Ce.Divider,{}),o.jsx(Ce.Item,{leftSection:o.jsx(kd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),o.jsx(Ce.Item,{leftSection:o.jsx(_d,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT_EQUALS),children:"Does not equal..."}),o.jsx(Ce.Divider,{}),o.jsx(Ce.Item,{leftSection:o.jsx(i_,{size:14}),onClick:()=>e.onPrompt(t,ue.ENDS_BEFORE),children:"Before..."}),o.jsx(Ce.Item,{leftSection:o.jsx(r_,{size:14}),onClick:()=>e.onPrompt(t,ue.STARTS_AFTER),children:"After..."}),o.jsx(Ce.Item,{leftSection:o.jsx(nF,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Between..."}),o.jsx(Ce.Divider,{}),o.jsx(Ce.Item,{leftSection:o.jsx(Po,{size:14}),onClick:()=>e.onChange(ZG(e.search,n)),children:"Tomorrow"}),o.jsx(Ce.Item,{leftSection:o.jsx(Po,{size:14}),onClick:()=>e.onChange(XG(e.search,n)),children:"Today"}),o.jsx(Ce.Item,{leftSection:o.jsx(Po,{size:14}),onClick:()=>e.onChange(KG(e.search,n)),children:"Yesterday"}),o.jsx(Ce.Item,{leftSection:o.jsx(Po,{size:14}),onClick:()=>e.onChange(JG(e.search,n)),children:"Next 24 Hours"}),o.jsx(Ce.Divider,{}),o.jsx(Ce.Item,{leftSection:o.jsx(Po,{size:14}),onClick:()=>e.onChange(nQ(e.search,n)),children:"Next Month"}),o.jsx(Ce.Item,{leftSection:o.jsx(Po,{size:14}),onClick:()=>e.onChange(tQ(e.search,n)),children:"This Month"}),o.jsx(Ce.Item,{leftSection:o.jsx(Po,{size:14}),onClick:()=>e.onChange(eQ(e.search,n)),children:"Last Month"}),o.jsx(Ce.Divider,{}),o.jsx(Ce.Item,{leftSection:o.jsx(Po,{size:14}),onClick:()=>e.onChange(rQ(e.search,n)),children:"Year to date"}),o.jsx(Id,{...e})]})}function jQ(e){const{searchParam:t}=e;return o.jsxs(Ce.Dropdown,{children:[o.jsx(Ce.Item,{leftSection:o.jsx(gb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),o.jsx(Ce.Item,{leftSection:o.jsx(vb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),o.jsx(Ce.Divider,{}),o.jsx(Ce.Item,{leftSection:o.jsx(kd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),o.jsx(Ce.Item,{leftSection:o.jsx(_d,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT_EQUALS),children:"Does not equal..."}),o.jsx(Ce.Divider,{}),o.jsx(Ce.Item,{leftSection:o.jsx(r_,{size:14}),onClick:()=>e.onPrompt(t,ue.GREATER_THAN),children:"Greater than..."}),o.jsx(Ce.Item,{leftSection:o.jsx(By,{size:14}),onClick:()=>e.onPrompt(t,ue.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),o.jsx(Ce.Item,{leftSection:o.jsx(i_,{size:14}),onClick:()=>e.onPrompt(t,ue.LESS_THAN),children:"Less than..."}),o.jsx(Ce.Item,{leftSection:o.jsx(By,{size:14}),onClick:()=>e.onPrompt(t,ue.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),o.jsx(Id,{...e})]})}function CQ(e){const{searchParam:t}=e;return o.jsxs(Ce.Dropdown,{children:[o.jsx(Ce.Item,{leftSection:o.jsx(kd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),o.jsx(Ce.Item,{leftSection:o.jsx(_d,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT),children:"Does not equal..."}),o.jsx(Id,{...e})]})}function EQ(e){const{searchParam:t}=e;return o.jsxs(Ce.Dropdown,{children:[o.jsx(Ce.Item,{leftSection:o.jsx(gb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),o.jsx(Ce.Item,{leftSection:o.jsx(vb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),o.jsx(Ce.Divider,{}),o.jsx(Ce.Item,{leftSection:o.jsx(kd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),o.jsx(Ce.Item,{leftSection:o.jsx(_d,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT),children:"Does not equal..."}),o.jsx(Ce.Divider,{}),o.jsx(Ce.Item,{leftSection:o.jsx(aF,{size:14}),onClick:()=>e.onPrompt(t,ue.CONTAINS),children:"Contains..."}),o.jsx(Ce.Item,{leftSection:o.jsx(iF,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Does not contain..."}),o.jsx(Id,{...e})]})}function TQ(e){const{searchParam:t}=e;return o.jsxs(Ce.Dropdown,{children:[o.jsx(Ce.Item,{leftSection:o.jsx(kd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),o.jsx(Ce.Item,{leftSection:o.jsx(_d,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT),children:"Does not equal..."}),o.jsx(Id,{...e})]})}function Id(e){const{searchParam:t}=e,n=t.code;return o.jsxs(o.Fragment,{children:[o.jsx(Ce.Divider,{}),o.jsx(Ce.Item,{leftSection:o.jsx(eF,{size:14}),onClick:()=>e.onChange(iT(e.search,n)),children:"Missing"}),o.jsx(Ce.Item,{leftSection:o.jsx(JV,{size:14}),onClick:()=>e.onChange(iT(e.search,n,!1)),children:"Not missing"}),o.jsx(Ce.Divider,{}),o.jsx(Ce.Item,{leftSection:o.jsx(Hs,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}const RQ="_root_vlout_1",DQ="_table_vlout_8",AQ="_tr_vlout_12",_Q="_control_vlout_22",kQ="_icon_vlout_31",zu={root:RQ,table:DQ,tr:AQ,control:_Q,icon:kQ};function PQ(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(NQ(t,r));return n}function NQ(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=Yo(e,t),r=RU(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const s=tb(e);let c;if(s){const u=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);c=Object.values(s).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 s=Mc(e,r);return{name:t,elementDefinition:(i=s.elementDefinitions)==null?void 0:i[0],searchParams:[r]}}return{name:t}}class OQ extends Event{constructor(t){super("change"),this.definition=t}}class MQ extends Event{constructor(t){super("load"),this.response=t}}class Qh extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function zc(e){var G,K;const t=_e(),[n,r]=v.useState(),{search:i,onLoad:s}=e,[c,u]=v.useState(i);sa(i,c)||u(i);const[f,p]=v.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),m=v.useRef(f);m.current=f;const g=c.total??"accurate",y=v.useCallback(P=>{r(void 0),t.requestSchema(c.resourceType).then(()=>t.search(c.resourceType,Uo({...c,total:g,fields:void 0}),P)).then(L=>{p({...m.current,searchResponse:L}),s&&s(new MQ(L))}).catch(L=>{p({...m.current,searchResponse:void 0}),r(Zt(L))})},[t,c,g,s]),b=v.useCallback(()=>{p({...m.current,searchResponse:void 0}),y({cache:"reload"})},[y]);v.useEffect(()=>{y()},[y]);function S(P,L){P.stopPropagation();const H=P.target.checked,O={...m.current.selected};H?O[L]=!0:delete O[L],p({...m.current,selected:O})}function j(P){P.stopPropagation();const z=P.target.checked,H={},O=m.current.searchResponse;z&&(O!=null&&O.entry)&&O.entry.forEach(U=>{var X;(X=U.resource)!=null&&X.id&&(H[U.resource.id]=!0)}),p({...m.current,selected:H})}function C(){var L,z;const P=m.current;if(!((L=P.searchResponse)!=null&&L.entry)||P.searchResponse.entry.length===0)return!1;for(const H of P.searchResponse.entry)if((z=H.resource)!=null&&z.id&&!P.selected[H.resource.id])return!1;return!0}function T(P){e.onChange&&e.onChange(new OQ(P))}function D(P,L){if(c_(P.target)||P.button===2)return;pn(P);const z=l_(P);!z&&e.onClick&&e.onClick(new Qh(L,P)),z&&e.onAuxClick&&e.onAuxClick(new Qh(L,P))}function E(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(n)return o.jsx(Kr,{outcome:n});if(!fA(c.resourceType))return o.jsx(er,{style:{width:"100%",height:"100%"},children:o.jsx(_r,{})});const R=e.checkboxesEnabled,A=PQ(c),k=c.resourceType,M=f.searchResponse,I=M==null?void 0:M.entry,$=I==null?void 0:I.map(P=>P.resource),V="subtle",Y="gray",Q=16,J=window.innerWidth<768;return o.jsxs("div",{className:zu.root,"data-testid":"search-control",children:[!e.hideToolbar&&o.jsxs(je,{justify:"space-between",mb:"xl",children:[o.jsxs(je,{gap:2,children:[o.jsx(Ne,{size:"compact-md",variant:V,color:Y,leftSection:o.jsx(cF,{size:Q}),onClick:()=>p({...m.current,fieldEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Fields"}),o.jsx(Ne,{size:"compact-md",variant:V,color:Y,leftSection:o.jsx(pF,{size:Q}),onClick:()=>p({...m.current,filterEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Filters"}),e.onNew&&o.jsx(Ne,{size:"compact-md",variant:V,color:Y,leftSection:o.jsx(hF,{size:Q}),onClick:e.onNew,children:"New..."}),!J&&E()&&o.jsx(Ne,{size:"compact-md",variant:V,color:Y,leftSection:o.jsx(MF,{size:Q}),onClick:e.onExport?e.onExport:()=>p({...m.current,exportDialogVisible:!0,dialogOpenTime:Date.now()}),children:"Export..."}),!J&&e.onDelete&&o.jsx(Ne,{size:"compact-md",variant:V,color:Y,leftSection:o.jsx(yb,{size:Q}),onClick:()=>e.onDelete(Object.keys(f.selected)),children:"Delete..."}),!J&&e.onBulk&&o.jsx(Ne,{size:"compact-md",variant:V,color:Y,leftSection:o.jsx(tF,{size:Q}),onClick:()=>e.onBulk(Object.keys(f.selected)),children:"Bulk..."})]}),o.jsxs(je,{gap:2,children:[M&&o.jsxs(Ae,{size:"xs",c:"dimmed","data-testid":"count-display",children:[q_(c,M).toLocaleString(),"-",UQ(c,M).toLocaleString(),M.total!==void 0&&` of ${c.total==="estimate"?"~":""}${(G=M.total)==null?void 0:G.toLocaleString()}`]}),o.jsx(_n,{variant:V,color:Y,title:"Refresh",onClick:b,children:o.jsx(o_,{size:Q})})]})]}),o.jsxs(ye,{className:zu.table,children:[o.jsxs(ye.Thead,{children:[o.jsxs(ye.Tr,{children:[R&&o.jsx(ye.Th,{children:o.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:P=>j(P)})}),A.map(P=>o.jsx(ye.Th,{children:o.jsxs(Ce,{shadow:"md",width:240,position:"bottom-end",children:[o.jsx(Ce.Target,{children:o.jsx(tr,{className:zu.control,p:2,children:o.jsxs(je,{justify:"space-between",wrap:"nowrap",children:[o.jsx(Ae,{fw:500,children:Qs(P.name)}),o.jsx(er,{className:zu.icon,children:o.jsx(KV,{size:14,stroke:1.5})})]})})}),o.jsx(bQ,{search:c,searchParams:P.searchParams,onPrompt:(L,z)=>{p({...m.current,filterDialogVisible:!0,filterDialogSearchParam:L,filterDialogFilter:z,dialogOpenTime:Date.now()})},onChange:L=>{T(L)}})]})},P.name))]}),!e.hideFilters&&o.jsxs(ye.Tr,{children:[R&&o.jsx(ye.Th,{}),A.map(P=>o.jsx(ye.Th,{children:P.searchParams&&o.jsx(LQ,{resourceType:k,searchParams:P.searchParams,filters:c.filters})},P.name))]})]}),o.jsx(ye.Tbody,{children:$==null?void 0:$.map(P=>P&&o.jsxs(ye.Tr,{className:zu.tr,"data-testid":"search-control-row",onClick:L=>D(L,P),onAuxClick:L=>D(L,P),children:[R&&o.jsx(ye.Td,{children:o.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${P.id}`,checked:!!f.selected[P.id],onChange:L=>S(L,P.id)})}),A.map(L=>o.jsx(ye.Td,{children:uQ(P,L)},L.name))]},P.id))})]}),!($!=null&&$.length)&&o.jsx(Ic,{children:o.jsx(er,{style:{height:150},children:o.jsx(Ae,{size:"xl",c:"dimmed",children:"No results"})})}),M&&o.jsx(er,{m:"md",p:"md",children:o.jsx($i,{value:zQ(c),total:$Q(c,M),onChange:P=>T(aQ(c,P)),getControlProps:P=>{switch(P){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),o.jsx(hQ,{search:c,visible:m.current.fieldEditorVisible,onOk:P=>{T(P),p({...m.current,fieldEditorVisible:!1})},onCancel:()=>{p({...m.current,fieldEditorVisible:!1})}},`search-field-editor-${f.dialogOpenTime}`),o.jsx(gQ,{search:c,visible:m.current.filterEditorVisible,onOk:P=>{T(P),p({...m.current,filterEditorVisible:!1})},onCancel:()=>{p({...m.current,filterEditorVisible:!1})}},`search-filter-editor-${f.dialogOpenTime}`),o.jsx(GG,{visible:m.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{p({...m.current,exportDialogVisible:!1})}},`search-export-dialog-${f.dialogOpenTime}`),o.jsx(yQ,{visible:m.current.filterDialogVisible,title:(K=f.filterDialogSearchParam)!=null&&K.code?Qs(f.filterDialogSearchParam.code):"",resourceType:k,searchParam:f.filterDialogSearchParam,filter:f.filterDialogFilter,defaultValue:"",onOk:P=>{T(sm(c,P.code,P.operator,P.value)),p({...m.current,filterDialogVisible:!1})},onCancel:()=>{p({...m.current,filterDialogVisible:!1})}},`search-filter-dialog-${f.dialogOpenTime}`)]})}const IQ=zc;function LQ(e){const t=(e.filters??[]).filter(n=>e.searchParams.find(r=>r.code===n.code));return t.length===0?o.jsx("span",{children:"no filters"}):o.jsx(o.Fragment,{children:t.map(n=>o.jsxs("div",{children:[F_(n.operator)," ",o.jsx(xQ,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function zQ(e){return Math.floor((e.offset??0)/(e.count??Yp))+1}function $Q(e,t){const n=e.count??Yp,r=G_(e,t);return Math.ceil(r/n)}function q_(e,t){return Math.min(G_(e,t),(e.offset??0)+1)}function UQ(e,t){var n;return Math.max(q_(e,t)+(((n=t.entry)==null?void 0:n.length)??0)-1,0)}function G_(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(s=>s.relation==="next")?1:0)),n}function BQ(e){const t=_e(),[n,r]=v.useState(!1),[i,s]=v.useState(),{query:c,fields:u}=e,[f,p]=v.useState(),[m,g]=v.useState({}),y=v.useRef(f);y.current=f;const b=v.useRef({});b.current=m,v.useEffect(()=>{s(void 0),t.graphql(c).then(p).catch(E=>s(Zt(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 I;E.stopPropagation();const A=E.target.checked,k={},M=(I=y.current)==null?void 0:I.data.ResourceList;A&&M&&M.forEach($=>{$.id&&(k[$.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 A of E)if(A.id&&!b.current[A.id])return!1;return!0}function T(E,R){c_(E.target)||(pn(E),E.button!==1&&e.onClick&&e.onClick(new Qh(R,E)),E.button===1&&e.onAuxClick&&e.onAuxClick(new Qh(R,E)))}if(v.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return o.jsx(_r,{});const D=e.checkboxesEnabled;return o.jsxs("div",{onContextMenu:E=>pn(E),"data-testid":"search-control",children:[o.jsxs(ye,{children:[o.jsx(ye.Thead,{children:o.jsxs(ye.Tr,{children:[D&&o.jsx(ye.Th,{children:o.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:E=>j(E)})}),u.map(E=>o.jsx(ye.Th,{children:E.name},E.name))]})}),o.jsx(ye.Tbody,{children:f==null?void 0:f.data.ResourceList.map(E=>E&&o.jsxs(ye.Tr,{"data-testid":"search-control-row",onClick:R=>T(R,E),onAuxClick:R=>T(R,E),children:[D&&o.jsx(ye.Td,{children:o.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=>o.jsx(ye.Td,{children:o.jsx(qG,{propertyType:R.propertyType,path:R.fhirPath,resource:E})},R.name))]},E.id))})]}),(f==null?void 0:f.data.ResourceList.length)===0&&o.jsx("div",{"data-testid":"empty-search",children:"No results"}),i&&o.jsx("div",{"data-testid":"search-error",children:o.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(i,void 0,2)})}),e.onBulk&&o.jsx(Ne,{onClick:()=>e.onBulk(Object.keys(b.current)),children:"Bulk..."})]})}const VQ=v.memo(BQ),FQ="_root_1fbwr_1",HQ="_entry_1fbwr_8",qQ="_key_1fbwr_13",GQ="_value_1fbwr_20",cm={root:FQ,entry:HQ,key:qQ,value:GQ};function ht(e){return o.jsx(Yr,{children:o.jsx("div",{className:cm.root,children:e.children})})}ht.Entry=function(t){return o.jsx("div",{className:cm.entry,children:t.children})};ht.Key=function(t){return o.jsx("div",{className:cm.key,children:t.children})};ht.Value=function(t){return o.jsx("div",{className:cm.value,children:t.children})};function QQ(e){const{group:t}=e;return o.jsx(mr,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:o.jsxs(je,{children:[t.measureScore&&o.jsx(KQ,{group:t}),!t.measureScore&&o.jsx(YQ,{group:t})]})})}function WQ(e){const{measure:t}=e;return o.jsxs(o.Fragment,{children:[o.jsx(Ae,{fz:"md",fw:500,mb:8,children:t.title}),o.jsx(Ae,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function YQ(e){const{group:t}=e,n=t.population,r=n==null?void 0:n.find(f=>Fo(f.code)==="numerator"),i=n==null?void 0:n.find(f=>Fo(f.code)==="denominator"),s=r==null?void 0:r.count,c=i==null?void 0:i.count;if(c===0)return o.jsxs(ce,{children:[o.jsx(Le,{order:3,children:"Not Applicable"}),o.jsx(Ae,{children:`Denominator: ${c}`})]});if(s===void 0||c===void 0)return o.jsxs(ce,{children:[o.jsx(Le,{order:3,children:"Insufficient Data"}),o.jsx(Ae,{children:`Numerator: ${s}`}),o.jsx(Ae,{children:`Denominator: ${c}`})]});const u=s/c*100;return o.jsx(Vp,{size:120,thickness:12,roundCaps:!0,sections:[{value:u,color:Q_(u)}],label:o.jsx(Vo,{justify:"center",children:o.jsxs(Ae,{fw:700,fz:18,children:[s," / ",c]})})})}function KQ(e){var r,i,s;const{group:t}=e,n=((r=t.measureScore)==null?void 0:r.unit)??((i=t.measureScore)==null?void 0:i.code);return o.jsx(o.Fragment,{children:n==="%"?o.jsx(Vp,{size:120,thickness:12,roundCaps:!0,sections:[{value:XQ(t),color:Q_(((s=t==null?void 0:t.measureScore)==null?void 0:s.value)??0)}],label:o.jsx(Vo,{justify:"center",children:o.jsx(Ae,{fw:700,fz:18,children:o.jsx(ld,{value:t.measureScore})})})}):o.jsx(Vo,{h:120,align:"center",children:o.jsx(Le,{order:3,children:o.jsx(ld,{value:t.measureScore})})})})}function XQ(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 Q_(e){return e<=33?"red":e<=67?"yellow":"green"}function ZQ(e){var r;const t=Qt(e.measureReport),[n]=FV("Measure",{url:t==null?void 0:t.measure});return t?o.jsxs(ce,{children:[n&&o.jsx(WQ,{measure:n}),o.jsx(M0,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:(r=t.group)==null?void 0:r.map((i,s)=>o.jsx(QQ,{group:i},i.id??s))})]}):null}const Xv="patient-export",Zv="Patient Export",JQ={everything:{operation:"$everything",extension:"json",contentType:hn.FHIR_JSON},summary:{operation:"$summary",extension:"json",contentType:hn.FHIR_JSON},ccda:{operation:"$ccda-export",extension:"xml",contentType:hn.CDA_XML},ccdaReferral:{operation:"$ccda-export",type:"referral",extension:"xml",contentType:hn.CDA_XML}};function eW(e){const t=_e(),{patient:n}=e,r=v.useCallback(async i=>{const s=Bs(n),c=i.format,{operation:u,type:f,contentType:p,extension:m}=JQ[c],g=t.fhirUrl("Patient",s,u),y={};f&&(y.type=f),i.author&&(y.author={reference:i.author}),i.authoredOn&&(y.authoredOn=Tb(i.authoredOn)),i.startDate&&(y.start=i.startDate),i.endDate&&(y.end=i.endDate),di.show({id:Xv,title:Zv,loading:!0,message:"Exporting...",autoClose:!1,withCloseButton:!1});try{const b=await t.post(g,y,void 0,{cache:"no-cache",headers:{Accept:p}}),S=`Patient-export-${s}-${new Date().toISOString().replaceAll(":","-")}.${m}`;tW(b,S,p),di.update({id:Xv,title:Zv,color:"green",message:"Done",icon:o.jsx(eo,{size:"1rem"}),loading:!1,autoClose:!0,withCloseButton:!0})}catch(b){di.update({id:Xv,title:Zv,color:"red",message:Ye(b),icon:o.jsx(Hs,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}},[t,n]);return o.jsx(pt,{onSubmit:r,children:o.jsxs(Ge,{children:[o.jsx($t,{title:"Export Format",description:"Required",withAsterisk:!0,children:o.jsx(Fp,{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})}),o.jsx($t,{title:"Author",description:"Optional author for composition. Default value is current user.",children:o.jsx(Od,{name:"author",placeholder:"Author",targetTypes:["Organization","Practitioner","PractitionerRole"]})}),o.jsx($t,{title:"Authored On",description:"Optional date for composition authored on. Default value is current date.",children:o.jsx(aa,{name:"authoredOn",placeholder:"Authored on"})}),o.jsx($t,{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:o.jsx(aa,{name:"startDate",placeholder:"Start date"})}),o.jsx($t,{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:o.jsx(aa,{name:"endDate",placeholder:"End date"})}),o.jsx(je,{justify:"right",children:o.jsx(Or,{children:"Request Export"})})]})})}function tW(e,t,n){const r=typeof e=="string"?e:JSON.stringify(e,null,2),i=new Blob([r],{type:n}),s=window.URL.createObjectURL(i),c=document.createElement("a");document.body.appendChild(c),c.style.display="none",c.href=s,c.download=t,c.click(),window.URL.revokeObjectURL(s)}function nW(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function W_(e){var n,r;const t=Qt(e.patient);return t?o.jsxs(ht,{children:[o.jsx(Xo,{value:t,size:"lg",color:nW(t)}),o.jsxs(ht.Entry,{children:[o.jsx(ht.Key,{children:"Name"}),o.jsx(ht.Value,{children:o.jsx(mt,{to:t,fw:500,children:t.name?o.jsx(xb,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&o.jsxs(o.Fragment,{children:[o.jsxs(ht.Entry,{children:[o.jsx(ht.Key,{children:"DoB"}),o.jsx(ht.Value,{children:t.birthDate})]}),o.jsxs(ht.Entry,{children:[o.jsx(ht.Key,{children:"Age"}),o.jsx(ht.Value,{children:Z$(t.birthDate)})]})]}),t.gender&&o.jsxs(ht.Entry,{children:[o.jsx(ht.Key,{children:"Gender"}),o.jsx(ht.Value,{children:t.gender})]}),t.address&&o.jsxs(ht.Entry,{children:[o.jsx(ht.Key,{children:"State"}),o.jsx(ht.Value,{children:(n=t.address[0])==null?void 0:n.state})]}),(r=t.identifier)==null?void 0:r.map(i=>o.jsxs(ht.Entry,{children:[o.jsx(ht.Key,{children:i==null?void 0:i.system}),o.jsx(ht.Value,{children:i==null?void 0:i.value})]},`${i==null?void 0:i.system}-${i==null?void 0:i.value}`))]}):null}function rW(e){const{patient:t,...n}=e,r=v.useCallback((i,s,c)=>{const u=`${s}/${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 o.jsx(om,{value:t,loadTimelineResources:r,createCommunication:(i,s,c)=>({resourceType:"Communication",status:"completed",subject:on(i),sender:on(s),sent:new Date().toISOString(),payload:[{contentString:c}]}),createMedia:(i,s,c)=>({resourceType:"Media",status:"completed",subject:on(i),operator:on(s),issued:new Date().toISOString(),content:c}),...n})}const iW="_section_pqpwm_1",aW="_hovering_pqpwm_7",qy={section:iW,hovering:aW};function oW(e){const t=_e(),n=Qt(e.value),[r,i]=v.useState(!1),[s,c]=v.useState(),[u,f]=v.useState(),[p,m]=v.useState();function g(){f(void 0)}function y(){c(void 0)}const b=v.useRef(p);if(b.current=p,v.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>i(!0)).catch(console.log)},[t]),v.useEffect(()=>(m(dW(n??{resourceType:"PlanDefinition",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",y),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",y)}),[n]),!r||!p)return null;function S(j,C){m({...b.current,[j]:C})}return o.jsx("div",{children:o.jsxs(pt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(p),children:[o.jsx(ze,{label:"Plan Title",py:"md",defaultValue:p.title,onChange:j=>S("title",j.currentTarget.value)}),o.jsx(sW,{actions:p.action||[],selectedKey:s,setSelectedKey:c,hoverKey:u,setHoverKey:f,onChange:j=>S("action",j)}),o.jsx(Or,{children:"Save"})]})})}function sW(e){const t=v.useRef(e.actions);t.current=e.actions;function n(s){e.onChange(t.current.map(c=>c.id===s.id?s:c))}function r(s){e.onChange([...t.current,s]),e.setSelectedKey(s.id)}function i(s){e.onChange(t.current.filter(c=>c!==s))}return o.jsxs(Ge,{gap:"md",className:qy.section,children:[e.actions.map(s=>o.jsx(lW,{action:s,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>i(s)},s.id)),o.jsx("div",{children:o.jsx(Ne,{variant:"outline",onClick:s=>{pn(s),r({id:Y_()})},children:"Add action"})})]})}function lW(e){const{action:t}=e,n=uW(t);function r(s){s.stopPropagation(),e.setSelectedKey(e.action.id)}function i(s){pn(s),e.setHoverKey(e.action.id)}return o.jsx("div",{onClick:r,onMouseOver:i,onFocus:i,children:o.jsx(cW,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,hoverKey:e.hoverKey,onRemove:e.onRemove})})}function cW(e){const{action:t}=e,[n,r]=v.useState(e.actionType),i=e.selectedKey===e.action.id,s=e.hoverKey===e.action.id;function c(f,p){e.onChange({...t,[f]:p})}const u=Ut(qy.section,{[qy.hovering]:s&&!i});return o.jsxs(mr,{"data-testid":t.id,className:u,p:0,radius:"sm",withBorder:!0,children:[o.jsxs(Vo,{w:"100%",p:"xs",bg:"gray.0",gap:"md",align:"center",justify:"space-between",children:[o.jsx(ze,{w:"100%",name:`actionTitle-${t.id}`,defaultValue:t.title,placeholder:"Title",onChange:f=>c("title",f.currentTarget.value)}),o.jsx(Qo,{"data-testid":"close-button",onClick:e.onRemove})]}),i&&o.jsxs(Ge,{gap:"xl",p:"md",children:[o.jsx(ce,{children:o.jsx(ze,{label:"Task Description",placeholder:"Enter task description",name:`actionDescription-${t.id}`,defaultValue:t.description,onChange:f=>c("description",f.currentTarget.value)})}),o.jsx(ce,{children:o.jsx(ln,{label:"Type of Action",value:n,onChange:f=>{const p=f.currentTarget.value==="standard"?void 0:f.currentTarget.value;r(p),e.onChange({...e.action,definitionCanonical:p==="standard"?void 0:e.action.definitionCanonical})},data:[{value:"standard",label:"Standard task"},{value:"questionnaire",label:"Task with Questionnaire"},{value:"activitydefinition",label:"Task with Activity Definition"}]})}),n==="questionnaire"&&o.jsxs(Ge,{gap:0,children:[o.jsxs(je,{gap:0,mb:"xs",children:[o.jsx(Ae,{fw:600,children:"Select questionnaire"}),o.jsx(Ae,{c:"red",children:"*"})]}),o.jsxs(Ae,{size:"sm",c:"dimmed",mb:"sm",children:["Questionnaire to be shown in the task in Encounter view. You can create new one from"," ",o.jsx(Nt,{href:"/Questionnaire",target:"_blank",c:"blue",children:"questionnaires list"})]}),o.jsx(aT,{resourceType:"Questionnaire",action:t,onChange:e.onChange})]}),n==="activitydefinition"&&o.jsxs(Ge,{gap:0,children:[o.jsxs(je,{gap:0,mb:"xs",children:[o.jsx(Ae,{fw:600,children:"Select activity definition"}),o.jsx(Ae,{c:"red",children:"*"})]}),o.jsxs(Ae,{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"," ",o.jsx(Nt,{href:"/ActivityDefinition",target:"_blank",c:"blue",children:"activity definitions list"})]}),o.jsx(aT,{resourceType:"ActivityDefinition",action:t,onChange:e.onChange})]})]})]})}function aT(e){const{id:t,definitionCanonical:n}=e.action,r=n!=null&&n.startsWith(e.resourceType+"/")?{reference:n}:void 0;return o.jsx(il,{name:t,resourceType:e.resourceType,defaultValue:r,onChange:i=>{i?e.onChange({...e.action,definitionCanonical:zt(i)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function uW(e){var t,n;return(t=e.definitionCanonical)!=null&&t.startsWith("Questionnaire")?"questionnaire":(n=e.definitionCanonical)!=null&&n.startsWith("ActivityDefinition")?"activitydefinition":"standard"}let Jv=1;function Y_(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(Jv=Math.max(Jv,t+1))}return e}return"id-"+Jv++}function dW(e){return{...e,action:K_(e.action)}}function K_(e){if(e)return e.map(t=>({...t,id:Y_(t.id),action:K_(t.action)}))}const _t={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"};function fW(e){return e.type==="choice"||e.type==="open-choice"}function hW(e,t){var i;const n=Ja(e,Rd+"/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression");if(t&&n){const s=(i=n.valueExpression)==null?void 0:i.expression;if(s){const c=mi(t),u=Fs(s,[c],{"%resource":c});return ea(u)}}if(!e.enableWhen)return!0;const r=e.enableBehavior??"any";for(const s of e.enableWhen){const c=Z_(t==null?void 0:t.item,s.question);if(s.operator==="exists"&&!s.answerBoolean&&!(c!=null&&c.length)){if(r==="any")return!0;continue}const{anyMatch:u,allMatch:f}=vW(s,c,r);if(r==="any"&&u)return!0;if(r==="all"&&!f)return!1}return r!=="any"}function Ib(e,t){return e.map(n=>{if(n.item)return{...n,item:Ib(n.item,t)};try{const r=mW(n,t);if(!r)return null;const i=pW(n,r);return i?{id:n==null?void 0:n.id,linkId:n==null?void 0:n.linkId,text:n.text,answer:[i]}:null}catch(r){return{id:n==null?void 0:n.id,linkId:n==null?void 0:n.linkId,text:n.text,answer:[],extension:[{url:`${Rd}/fhir/StructureDefinition/questionnaire-validationError`,valueString:`Expression evaluation failed: ${Ye(r)}`}]}}}).filter(n=>n!==null)}function pW(e,t){if(e.type)switch(e.type){case _t.boolean:return t.type===oe.boolean?{valueBoolean:t.value}:void 0;case _t.date:return t.type===oe.date?{valueDate:t.value}:void 0;case _t.dateTime:return t.type===oe.dateTime?{valueDateTime:t.value}:void 0;case _t.time:return t.type===oe.time?{valueTime:t.value}:void 0;case _t.url:return t.type===oe.url?{valueString:t.value}:void 0;case _t.text:return t.type===oe.string?{valueString:t.value}:void 0;case _t.attachment:return t.type===oe.Attachment?{valueAttachment:t.value}:void 0;case _t.reference:return t.type===oe.Reference?{valueReference:t.value}:void 0;case _t.quantity:return{valueQuantity:t.value};case _t.decimal:return{valueDecimal:t.value};case _t.integer:return{valueInteger:t.value};case _t.string:return{valueString:t.value};default:return}}function mW(e,t){var r;if(!t)return;const n=Ja(e,Rd+"/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression");if(n){const i=(r=n.valueExpression)==null?void 0:r.expression;if(i){const s=mi(t),c=Fs(i,[s],{"%resource":s});return c.length!==0?c[0]:void 0}}}function Lb(e,t){return e.map(n=>{const r=t.find(i=>i.linkId===n.linkId);return r?{...n,item:r.item?Lb(n.item||[],r.item):n.item,answer:r.answer||n.answer,extension:r.extension||n.extension}:n})}function X_(e,t,n){var i;const r=[];for(const s of e){const c=(i=n.answerOption)==null?void 0:i.find(u=>vc(ca(u))===s);if(c){const u=ca(c);u&&r.push({[t]:u.value})}}return r}function Z_(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=Z_(n.item,t);if(r)return r}}}function gW(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}]=Fs(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return i}else return!1}function vW(e,t,n){const r=t||[],i=jW(e);let s=!1,c=!0;for(const u of r){const f=CW(u),{operator:p}=e;if(gW(f,i,p)?s=!0:c=!1,n==="any"&&s)break}return{anyMatch:s,allMatch:c}}function J_(e){var n,r;const t=Ja(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return(r=(n=t.valueCodeableConcept)==null?void 0:n.coding)==null?void 0:r.map(i=>i.code)}}function ey(e,t){var i;const n=Qr(e);let r=Ja(n,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");return!t||t.length===0?(r&&(n.extension=(i=n.extension)==null?void 0:i.filter(s=>s!==r)),n):(r||(n.extension||(n.extension=[]),r={url:"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource"},n.extension.push(r)),t.length===1?(r.valueCode=t[0],delete r.valueCodeableConcept):(r.valueCodeableConcept={coding:t.map(s=>({code:s}))},delete r.valueCode),n)}function yW(e,t,n){const r=Ja(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceFilter");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 s={},c=i.split("&");for(const u of c){const[f,p]=My(u,"=",2);s[f]=p}return s}function oT(e,t){return{resourceType:"QuestionnaireResponse",questionnaire:e.url??zt(e),item:ek(e.item,t==null?void 0:t.item),status:"in-progress"}}function ek(e,t){return(e==null?void 0:e.map(n=>tk(n,t)))??[]}function tk(e,t){var r;const n=t==null?void 0:t.find(i=>i.linkId===e.linkId);return{id:n?n.id:bW(),linkId:e.linkId,text:e.text,item:ek(e.item,n==null?void 0:n.item),answer:n?n.answer:((r=e.initial)==null?void 0:r.map(SW))??[]}}let xW=1;function bW(){return"id-"+xW++}function SW(e){return{...e}}function wW(e){var n,r,i,s;const t=(n=e==null?void 0:e.item)==null?void 0:n[0];if(t){const c=Ja(t,"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl");if(((s=(i=(r=c==null?void 0:c.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:i[0])==null?void 0:s.code)==="page")return e.item.length}return 1}function zb(e){return Dd({value:e},"value")}function ca(e){return Dd({value:e},"value")}function jW(e){return Dd({value:e},"answer")}function CW(e){return Dd({value:e},"value")}const nk=v.createContext({}),Is=30,Wh=50;function Gy(e){const t=v.useContext(nk),n=e.item,r=e.response;function i(g){var b,S,j,C;let y;Array.isArray(g)?y=g:e.index>=(((S=(b=e.response)==null?void 0:b.answer)==null?void 0:S.length)??0)?y=(((j=e.response)==null?void 0:j.answer)??[]).concat([g]):y=(((C=e.response)==null?void 0:C.answer)??[]).map((D,E)=>E===e.index?g:D)??[],e.onChange({id:r==null?void 0:r.id,linkId:r==null?void 0:r.linkId,text:n.text,answer:y})}const s=n.type;if(!s)return null;const c=n.linkId;if(!c)return null;const u=n.initial&&n.initial.length>0?n.initial[0]:void 0,f=Ub(r,e.index)??zb(u),p=Ja(r,`${Rd}/fhir/StructureDefinition/questionnaire-validationError`);let m=null;switch(s){case _t.display:m=o.jsx("p",{children:e.item.text},e.item.linkId);break;case _t.boolean:m=o.jsx(A_,{title:e.item.text,htmlFor:e.item.linkId,children:o.jsx(zn,{id:e.item.linkId,name:e.item.linkId,defaultChecked:f==null?void 0:f.value,onChange:g=>i({valueBoolean:g.currentTarget.checked})})},e.item.linkId);break;case _t.decimal:m=o.jsx(ze,{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 _t.integer:m=o.jsx(ze,{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 _t.date:m=o.jsx(ze,{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 _t.dateTime:m=o.jsx(aa,{name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>i({valueDateTime:g})});break;case _t.time:m=o.jsx(ze,{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 _t.string:case _t.url:m=o.jsx(ze,{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 _t.text:m=o.jsx(Js,{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 _t.attachment:m=o.jsx(je,{py:4,children:o.jsx(h_,{path:"",name:c,defaultValue:f==null?void 0:f.value,onChange:g=>i({valueAttachment:g})})});break;case _t.reference:m=o.jsx(Od,{name:c,required:e.required??n.required,targetTypes:J_(n),searchCriteria:yW(n,t.subject,t.encounter),defaultValue:f==null?void 0:f.value,onChange:g=>i({valueReference:g})});break;case _t.quantity:m=o.jsx(qs,{path:"",name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>i({valueQuantity:g}),disableWheel:!0});break;case _t.choice:case _t.openChoice:kW(n)?m=o.jsx(DW,{name:c,item:n,initial:u,response:r,onChangeAnswer:g=>i(g)}):_W(n)||n.answerValueSet&&!PW(n)?m=o.jsx(EW,{name:c,item:n,initial:u,response:r,onChangeAnswer:g=>i(g)}):m=o.jsx(RW,{name:c,item:n,initial:u,response:r,onChangeAnswer:g=>i(g)});break;default:return null}return o.jsxs(o.Fragment,{children:[m,(p==null?void 0:p.valueString)&&o.jsx(Ae,{c:"red",size:"lg",mt:4,children:p.valueString})]})}function EW(e){var m;const{name:t,item:n,initial:r,onChangeAnswer:i,response:s}=e;if(!((m=n.answerOption)!=null&&m.length)&&!n.answerValueSet)return o.jsx($b,{});const c=zb(r),u=Ub(s)??c,f=ak(s),p=n.repeats||NW(n);if(n.answerValueSet)return o.jsx(tm,{name:t,placeholder:"Select items",binding:n.answerValueSet,maxValues:p?void 0:1,onChange:g=>{p?g.length===0?i({}):i(g.map(y=>({valueCoding:y}))):i({valueCoding:g[0]})},defaultValue:u==null?void 0:u.value});if(p){const{propertyName:g,data:y}=OW(n);return o.jsx(Op,{data:y,placeholder:"Select items",searchable:!0,defaultValue:f||[vc(c)],onChange:b=>{if(b.length===0)i({});else{const S=X_(b,g,n);i(S)}}})}else{const g=[""];if(n.answerOption)for(const y of n.answerOption){const b=ca(y);g.push(vc(b))}return o.jsx(ln,{id:t,name:t,onChange:y=>{const b=y.currentTarget.selectedIndex;if(b===0){i({});return}const S=n.answerOption[b-1],j=ca(S),C="value"+Hn(j.type);i({[C]:j.value})},defaultValue:Ad(u==null?void 0:u.value)||(u==null?void 0:u.value),data:g})}}function TW(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 rk(e){const t=_e(),[n,r]=v.useState([]),[i,s]=v.useState(!1);return v.useEffect(()=>{async function c(){if(e){s(!0);try{const u=await TW(e,t);r(u)}catch(u){console.error("Error loading value set:",u)}finally{s(!1)}}}c().catch(console.error)},[e,t]),[n,i]}function ik(e,t){return e.map((n,r)=>{const i=`${t}-valueset-${r}`,s={type:"Coding",value:{system:n.system,code:n.code,display:n.display}};return[i,s]})}function RW(e){const{name:t,item:n,initial:r,onChangeAnswer:i,response:s}=e,c=Yo("QuestionnaireItemAnswerOption","value[x]"),u=zb(r),[f,p]=rk(n.answerValueSet),m=[];let g;if(n.answerValueSet)m.push(...ik(f,t));else if(n.answerOption){const j=n.answerOption.slice(0,Wh).map((C,T)=>{const D=`${t}-option-${T}`,E=ca(C);return E!=null&&E.value?(u&&Ii(E)===Ii(u)&&(g=D),[D,E]):null}).filter(C=>C!==null);m.push(...j)}const y=Ub(s),b=AW(m,y);if(p)return o.jsx(Ae,{children:"Loading options..."});if(m.length===0)return o.jsx($b,{});const S=m.slice(0,Is);return o.jsxs(o.Fragment,{children:[o.jsx(Us.Group,{name:t,value:b??g,onChange:j=>{const C=m.find(T=>T[0]===j);if(C){const T=C[1],D="value"+Hn(T.type);i({[D]:T.value})}},children:S.map(([j,C])=>o.jsx(Us,{id:j,value:j,py:4,label:o.jsx(Li,{property:c,propertyType:C.type,value:C.value})},j))}),(n.answerValueSet&&m.length>Is||n.answerOption&&m.length>Wh)&&o.jsxs(Ae,{size:"sm",c:"dimmed",mt:"xs",children:["Showing first ",Is," options"]})]})}function DW(e){var S;const{name:t,item:n,onChangeAnswer:r,response:i}=e,s=Yo("QuestionnaireItemAnswerOption","value[x]"),[c,u]=rk(n.answerValueSet),f=n.answerValueSet?(((S=i.answer)==null?void 0:S.map(j=>j.valueCoding))||[]).filter(j=>j!==void 0):ak(i),[p,m]=v.useState(f),g=[];if(n.answerValueSet)g.push(...ik(c,t));else if(n.answerOption){const j=n.answerOption.slice(0,Wh).map((C,T)=>{const D=`${t}-option-${T}`,E=ca(C);return E!=null&&E.value?[D,E]:null}).filter(C=>C!==null);g.push(...j)}if(u)return o.jsx(Ae,{children:"Loading options..."});if(g.length===0)return o.jsx($b,{});const y=g.slice(0,Is),b=(j,C)=>{if(n.answerValueSet){const T=p;let D;C?D=[...T,j.value]:D=T.filter(E=>!sa(E,j.value)),m(D),D.length===0?r({}):r(D.map(E=>({valueCoding:E})))}else{const T=p,D=vc(j);let E;if(C?E=[...T,D]:E=T.filter(R=>R!==D),m(E),E.length===0)r({});else{const R=X_(E,"value"+Hn(j.type),n);r(R)}}};return o.jsxs(je,{style:{flexDirection:"column",alignItems:"flex-start"},children:[y.map(([j,C])=>{const T=vc(C),D=n.answerValueSet?p.some(E=>sa(E,C.value)):p.includes(T);return o.jsx(zn,{id:j,label:o.jsx(Li,{property:s,propertyType:C.type,value:C.value}),checked:D,onChange:E=>b(C,E.currentTarget.checked)},j)}),(n.answerValueSet&&g.length>Is||n.answerOption&&g.length>Wh)&&o.jsxs(Ae,{size:"sm",c:"dimmed",children:["Showing first ",Is," options"]})]})}function $b(){return o.jsx(ze,{disabled:!0,placeholder:"No Answers Defined"})}function Ub(e,t=0){const n=e.answer;return ca((n==null?void 0:n[t])??{})}function ak(e){const t=e.answer;return t?t.map(r=>ca(r)).map(r=>Ad(r==null?void 0:r.value)||(r==null?void 0:r.value)):[]}function AW(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 um(e,t){var n;return!!((n=e.extension)!=null&&n.some(r=>{var i,s,c;return r.url==="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl"&&((c=(s=(i=r.valueCodeableConcept)==null?void 0:i.coding)==null?void 0:s[0])==null?void 0:c.code)===t}))}function _W(e){return um(e,"drop-down")}function kW(e){return um(e,"check-box")}function PW(e){return um(e,"radio-button")}function NW(e){return um(e,"multi-select")}function OW(e){var s;if(((s=e.answerOption)==null?void 0:s.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=ca(t),r="value"+Hn(n.type),i=(e.answerOption??[]).map(c=>{const u=ca(c),f=vc(u);return{value:f,label:f}});return{propertyName:r,data:i}}const MW="_section_my8o4_1",IW="_hovering_my8o4_10",LW="_editing_my8o4_14",zW="_questionBody_my8o4_20",$W="_topActions_my8o4_24",UW="_bottomActions_my8o4_33",BW="_movementActions_my8o4_44",VW="_movementIcons_my8o4_56",FW="_columnAlignment_my8o4_60",HW="_linkIdInput_my8o4_65",qW="_typeSelect_my8o4_70",GW="_preserveBreaks_my8o4_74",Fr={section:MW,hovering:IW,editing:LW,questionBody:zW,topActions:$W,bottomActions:UW,movementActions:BW,movementIcons:VW,columnAlignment:FW,linkIdInput:HW,typeSelect:qW,preserveBreaks:GW};function QW(e){const t=_e(),n=Qt(e.questionnaire),[r,i]=v.useState(!1),[s,c]=v.useState(),[u,f]=v.useState(),[p,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(XW(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||!s?null:o.jsx("div",{children:o.jsxs(pt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(s),children:[o.jsx(ok,{item:s,selectedKey:u,setSelectedKey:f,hoverKey:p,setHoverKey:m,onChange:b}),o.jsx(Or,{children:"Save"})]})})}function ok(e){var E;const t=e.item,n=e.item,r=fa(e.item),i=r||n.type===_t.group,s=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 p(R){pn(R),e.setSelectedKey(e.item.id)}function m(R){pn(R),e.setHoverKey(e.item.id)}function g(R){var k;const A=f.current;e.onChange({...A,item:(k=A.item)==null?void 0:k.map(M=>M.id===R.id?R:M)})}function y(R,A){e.onChange({...e.item,item:[...e.item.item??[],R]},A)}function b(R){var A;e.onChange({...e.item,item:(A=e.item.item)==null?void 0:A.filter(k=>k!==R)})}function S(R,A){e.onChange({...f.current,[R]:A})}function j(R){e.onChange({...e.item,...R})}function C(R){var A;e.onChange({...e.item,item:(A=e.item.item)==null?void 0:A.map(k=>k===R?{...k,repeats:!k.repeats}:k)})}function T(R,A){const k=eY(e.item.item,R,A);e.onChange({...e.item,item:k})}const D=Ut(Fr.section,{[Fr.editing]:c,[Fr.hovering]:u&&!c});return o.jsxs("div",{"data-testid":n.linkId,className:D,onClick:p,onMouseOver:m,onFocus:m,children:[o.jsx("div",{className:Fr.questionBody,children:c?o.jsxs(o.Fragment,{children:[r&&o.jsx(ze,{size:"xl",defaultValue:t.title,onBlur:R=>S("title",R.currentTarget.value)}),!r&&o.jsx(Js,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:R=>S("text",R.currentTarget.value)}),n.type==="reference"&&o.jsx(KW,{item:n,onChange:j}),fW(n)&&o.jsx(WW,{item:n,onChange:R=>j(R)})]}):o.jsxs(o.Fragment,{children:[t.title&&o.jsx(Le,{children:t.title}),n.text&&o.jsx("div",{className:Fr.preserveBreaks,children:n.text}),!i&&o.jsx(Gy,{item:n,index:0,required:!1,onChange:()=>{},response:{linkId:n.linkId}})]})}),(E=n.item)==null?void 0:E.map((R,A)=>o.jsx("div",{children:o.jsx(ok,{item:R,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:A===0,isLast:A===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:g,onRemove:()=>b(R),onRepeatable:C,onMoveUp:()=>T(A,-1),onMoveDown:()=>T(A,1)})},R.id)),!i&&o.jsx("div",{className:Fr.topActions,children:c?o.jsxs(o.Fragment,{children:[o.jsx(ze,{size:"xs",className:Fr.linkIdInput,defaultValue:n.linkId,onBlur:R=>S("linkId",R.currentTarget.value)}),!i&&o.jsx(ln,{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"}]})]}):o.jsx("div",{children:s})}),!r&&o.jsx(ce,{className:Fr.movementActions,children:o.jsxs(ce,{className:Fr.columnAlignment,children:[!e.isFirst&&o.jsx(Nt,{href:"#",onClick:R=>{R.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:o.jsx(ZV,{"data-testid":"up-button",size:15,className:Fr.movementIcons})}),!e.isLast&&o.jsx(Nt,{href:"#",onClick:R=>{R.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:o.jsx(XV,{"data-testid":"down-button",size:15,className:Fr.movementIcons})})]})}),o.jsxs("div",{className:Fr.bottomActions,children:[i&&o.jsxs(o.Fragment,{children:[o.jsx(Nt,{href:"#",onClick:R=>{R.preventDefault(),y({id:Ws(),linkId:Yy("q"),type:"string",text:"Question"})},children:"Add item"}),o.jsx(Nt,{href:"#",onClick:R=>{R.preventDefault(),y({id:Ws(),linkId:Yy("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&o.jsx(Nt,{href:"#",onClick:R=>{R.preventDefault(),y(JW(),!0)},children:"Add Page"}),c&&!r&&o.jsxs(o.Fragment,{children:[o.jsx(Nt,{href:"#",onClick:R=>{R.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),o.jsx(Nt,{href:"#",onClick:R=>{R.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function WW(e){const t=Yo("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return o.jsxs("div",{children:[e.item.answerValueSet!==void 0?o.jsx(ze,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):o.jsx(YW,{options:n,property:t,item:e.item,onChange:e.onChange}),o.jsxs(ce,{display:"flex",children:[o.jsx(Nt,{href:"#",onClick:r=>{pn(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:Ws()}]})},children:"Add choice"}),o.jsx(Hp,{w:"lg"}),o.jsx(Nt,{href:"#",onClick:r=>{pn(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function YW(e){return o.jsx("div",{children:e.options.map(t=>{const[n,r]=rm({type:"QuestionnaireItemAnswerOption",value:t},"value");return o.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"},children:[o.jsx("div",{children:o.jsx(Md,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(i,s)=>{const c=[...e.options],u=c.findIndex(f=>f.id===t.id);c[u]={id:t.id,[s]:i},e.onChange({...e.item,answerOption:c})},outcome:void 0},t.id)}),o.jsx("div",{children:o.jsx(Nt,{href:"#",onClick:i=>{pn(i),e.onChange({...e.item,answerOption:e.options.filter(s=>s.id!==t.id)})},children:"Remove"})})]},t.id)})})}function KW(e){const t=J_(e.item)??[];return o.jsxs(o.Fragment,{children:[t.map((n,r)=>o.jsxs(je,{children:[o.jsx(wb,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:i=>{e.onChange(ey(e.item,t.map(s=>s===n?i:s)))}}),o.jsx(Nt,{href:"#",onClick:i=>{pn(i),e.onChange(ey(e.item,t.filter(s=>s!==n)))},children:"Remove"})]},`${n}-${r}`)),o.jsx(Nt,{href:"#",onClick:n=>{pn(n),e.onChange(ey(e.item,[...t,""]))},children:"Add Resource Type"})]})}let Qy=1,Wy=1;function Yy(e){return e+Qy++}function Ws(){return"id-"+Wy++}function XW(e){return{...e,id:e.id||Ws(),item:sk(e.item)}}function sk(e){if(e)return e.forEach(t=>{var n,r;(n=t.id)!=null&&n.match(/^id-\d+$/)&&(Wy=Math.max(Wy,parseInt(t.id.substring(3),10)+1)),(r=t.linkId)!=null&&r.match(/^q\d+$/)&&(Qy=Math.max(Qy,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||Ws(),item:sk(t.item),answerOption:ZW(t.answerOption)}))}function ZW(e){if(e)return e.map(t=>({...t,id:t.id||Ws()}))}function JW(){return{id:Ws(),linkId:Yy("s"),type:"group",text:"New Page",extension:[{url:"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",valueCodeableConcept:{coding:[{system:"http://hl7.org/fhir/questionnaire-item-control",code:"page"}]}}]}}function eY(e,t,n){const r=e??[],i=t+n;if(i<0||i>=r.length)return r;const s=[...r];return[s[t],s[i]]=[s[i],s[t]],s}function lk(e){const{item:t,response:n,onChange:r}=e,[i,s]=v.useState(tY(t,n??{linkId:t.linkId}));if(!e.checkForQuestionEnabled(t)||!n)return null;if(t.type===_t.display)return o.jsx("p",{children:t.text},t.linkId);const c=(t==null?void 0:t.repeats)&&t.type!==_t.choice&&t.type!==_t.openChoice;return t.type===_t.boolean?o.jsx(Gy,{item:t,response:n,onChange:u=>r([u]),index:0},t.linkId):o.jsxs($t,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[[...Array(i)].map((u,f)=>o.jsx(Gy,{item:t,response:n,onChange:p=>r([p]),index:f},`${t.linkId}-${f}`)),c&&o.jsx(Nt,{onClick:()=>s(u=>u+1),children:"Add Item"})]},e.item.linkId)}function tY(e,t){if(e.type===_t.choice||e.type===_t.openChoice)return 1;const n=t.answer;return n!=null&&n.length?n.length:1}function ck(e){const[t,n]=v.useState(e.response);if(v.useEffect(()=>{n(e.response)},[e.response]),t.length===0)return null;function r(s,c){const u=t.map((f,p)=>p===c?s[0]:f);n(u),e.onChange(u)}function i(){const s=tk(e.item,void 0);n([...t,s])}return o.jsxs(o.Fragment,{children:[t.map((s,c)=>o.jsx(uk,{item:e.item,response:s,checkForQuestionEnabled:e.checkForQuestionEnabled,onChange:u=>r(u,c)},s.id)),e.item.repeats&&o.jsx(Nt,{onClick:i,children:`Add Group: ${e.item.text}`})]})}function uk(e){var s;const{response:t,checkForQuestionEnabled:n,onChange:r}=e;function i(c){var m;const u=(m=t.item)==null?void 0:m.map(g=>c.find(b=>b.id===g.id)??g),f=u==null?void 0:u.concat(c.slice(1)),p={...t,item:f};r([p])}return e.checkForQuestionEnabled(e.item)?o.jsxs("div",{children:[e.item.text&&o.jsx(Le,{order:3,mb:"md",children:e.item.text}),o.jsx(Ge,{children:(s=e.item.item)==null?void 0:s.map(c=>{var u,f,p;return c.type===_t.group?c.repeats?o.jsx(ck,{item:c,response:((u=t.item)==null?void 0:u.filter(m=>m.linkId===c.linkId))??[],checkForQuestionEnabled:n,onChange:i},c.linkId):o.jsx(uk,{item:c,checkForQuestionEnabled:n,response:((f=t.item)==null?void 0:f.find(m=>m.linkId===c.linkId))??{linkId:c.linkId},onChange:i},c.linkId):o.jsx(lk,{item:c,response:(p=t.item)==null?void 0:p.find(m=>m.linkId===c.linkId),onChange:i,checkForQuestionEnabled:n},c.linkId)})})]},e.item.linkId):null}function nY(e){const{items:t,response:n,activePage:r,onChange:i,nextStep:s,prevStep:c,numberOfPages:u,renderPages:f,submitButtonText:p,excludeButtons:m,checkForQuestionEnabled:g}=e,y=t.map(b=>{var C;const S=((C=n==null?void 0:n.item)==null?void 0:C.filter(T=>T.linkId===b.linkId))??[],j=b.type===_t.group?o.jsx(ck,{item:b,response:S,onChange:i,checkForQuestionEnabled:g},b.linkId):o.jsx(lk,{item:b,response:S==null?void 0:S[0],onChange:i,checkForQuestionEnabled:g},b.linkId);return f?o.jsx(mc.Step,{label:b.text,children:j},b.linkId):j});return o.jsxs(o.Fragment,{children:[f&&o.jsx(mc,{active:r??0,allowNextStepsSelect:!1,p:6,children:y}),!f&&o.jsx(Ge,{children:y}),!m&&o.jsx(rY,{activePage:r??0,numberOfPages:u,nextStep:f?s:void 0,prevStep:f?c:void 0,renderPages:f,submitButtonText:p})]})}function rY(e){const t=e.renderPages&&e.activePage>0,n=e.renderPages&&e.activePage<e.numberOfPages-1,r=!e.renderPages||e.activePage===e.numberOfPages-1;return o.jsxs(je,{justify:"flex-end",mt:"xl",gap:"xs",children:[t&&o.jsx(Ne,{onClick:e.prevStep,children:"Back"}),n&&o.jsx(Ne,{onClick:i=>{const s=i.currentTarget.closest("form");e.nextStep&&s.reportValidity()&&e.nextStep()},children:"Next"}),r&&o.jsx(Or,{children:e.submitButtonText??"Submit"})]})}function dk(e){const t=_e(),{subject:n,source:r}=e,i=Qt(e.questionnaire),s=UV(i),c=Qt(e.questionnaireResponse),[u,f]=v.useState(c),[p,m]=v.useState(0),g=v.useRef(e.onChange);g.current=e.onChange;const y=v.useRef(e.onSubmit);y.current=e.onSubmit,v.useEffect(()=>{if(c!=null&&c.item&&i){const E=oT(i,c),R=hk(E,i);f(R)}else{if(i&&sT(s)===sT(i))return;f(i?oT(i):void 0)}},[c,i,s]),v.useEffect(()=>{if(u&&g.current)try{g.current(u)}catch(E){console.error("Error invoking QuestionnaireForm.onChange callback",E)}},[u]);const b=v.useCallback(E=>{f(R=>aY(R,E,i))},[i]),S=v.useCallback(()=>{const E=y.current;if(E&&i&&u){let R=r;if(!R){const A=t.getProfile();A&&(R=on(A))}E({...u,questionnaire:i.url??zt(i),subject:n,source:R,authored:new Date().toISOString(),status:"completed"})}},[t,i,u,n,r]);function j(E){return hW(E,u)}if(!i||!u)return null;const C=wW(i),T=()=>m(E=>E+1),D=()=>m(E=>E-1);return o.jsx(nk.Provider,{value:{subject:e.subject,encounter:e.encounter},children:o.jsxs(pt,{testid:"questionnaire-form",onSubmit:S,children:[i.title&&o.jsx(Le,{children:i.title}),o.jsx(nY,{items:i.item??[],response:u,onChange:b,renderPages:!e.disablePagination&&C>1,activePage:p,numberOfPages:C,excludeButtons:e.excludeButtons,submitButtonText:e.submitButtonText,checkForQuestionEnabled:j,nextStep:T,prevStep:D})]})})}function iY(e,t){const n=fk(e.item??[],t.item??[]);return{...t,item:n.length>0?n:void 0,answer:t.answer&&t.answer.length>0?t.answer:e.answer}}function fk(e,t){const n=[],r=new Set;for(const i of e){const s=i.id,c=t.find(u=>u.id===s);c?(n.push(iY(i,c)),r.add(c.id)):n.push(i)}for(const i of t)r.has(i.id)||n.push(i);return n}function sT(e){return(e==null?void 0:e.id)||e}function aY(e,t,n){if(!t)return{resourceType:"QuestionnaireResponse",status:"in-progress"};const r=(e==null?void 0:e.item)??[],i=fk(r,Array.isArray(t)?t:[t]),s={resourceType:"QuestionnaireResponse",status:"in-progress",item:i},c=Ib((n==null?void 0:n.item)??[],s);return s.item=Lb(i,c),hk(s,n)}function hk(e,t){const n=Ib((t==null?void 0:t.item)??[],e);return{resourceType:"QuestionnaireResponse",status:"in-progress",item:Lb(e.item??[],n)}}const oY="_section_4m5it_1",sY={section:oY},lY=["gender","age","gestationalAge","context","appliesTo","category"],cY={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function uY(e){e=Object.assign(cY,e);const t=e.definition,[n,r]=v.useState([]),[i,s]=v.useState(1),[c,u]=v.useState(1);return v.useEffect(()=>{const S=hY(t,u);r(pY(S.qualifiedInterval||[],s))},[t]),o.jsxs(pt,{testid:"reference-range-editor",onSubmit:f,children:[o.jsx(Ge,{children:n.map(S=>{var j;return o.jsx(dY,{unit:gY((j=t.quantitativeDetails)==null?void 0:j.unit),onChange:g,onAdd:y,onRemove:b,onRemoveGroup:m,intervalGroup:S},`group-${S.id}`)})}),o.jsx(_n,{title:"Add Group",variant:"subtle",size:"sm",onClick:S=>{pn(S),p({id:`group-id-${i}`,filters:{},intervals:[]}),s(j=>j+1)},children:o.jsx(qh,{})}),o.jsx(je,{justify:"flex-end",children:o.jsx(Or,{children:"Save"})})]});function f(){const S=n.flatMap(j=>j.intervals).filter(j=>!vY(j));e.onSubmit({...t,qualifiedInterval:S})}function p(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),D=T==null?void 0:T.intervals.findIndex(E=>E.id===j.id);return D!==void 0&&(T!=null&&T.intervals[D])&&(T.intervals[D]=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(D=>D.id===S);if(T!==-1){const D={...C[T]};j={...j,...D.filters},D.intervals=[...D.intervals,j],C[T]=D}return C})}function b(S,j){r(C=>{C=[...C];const T=C.find(D=>D.id===S);return T&&(T.intervals=T.intervals.filter(D=>D.id!==j.id)),C})}}function dY(e){const{intervalGroup:t,unit:n}=e;return o.jsx(Ic,{"data-testid":t.id,className:sY.section,children:o.jsxs(Ge,{gap:"lg",children:[o.jsx(je,{justify:"flex-end",children:o.jsx(_n,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{pn(r),e.onRemoveGroup(t)},children:o.jsx(Hh,{})},`remove-group-button-${t.id}`)}),o.jsx(fY,{intervalGroup:t,onChange:e.onChange}),o.jsx(Cn,{}),t.intervals.map(r=>o.jsxs(Ge,{gap:"xs",children:[o.jsxs(je,{children:[o.jsx(ze,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:i=>{pn(i),e.onChange(t.id,{...r,condition:i.currentTarget.value.trim()})}},`condition-${r.id}`),o.jsx(_n,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:i=>{pn(i),e.onRemove(t.id,r)},children:o.jsx(Hh,{})},`remove-interval-${r.id}`)]}),o.jsx(Rb,{path:"",onChange:i=>{e.onChange(t.id,{...r,range:i})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),o.jsx(_n,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{pn(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:o.jsx(qh,{})})]})})}function fY(e){var r,i;const{intervalGroup:t,onChange:n}=e;t.filters.age||(t.filters.age={});for(const s of["low","high"])(r=t.filters.age[s])!=null&&r.unit||(t.filters.age[s]={...t.filters.age[s],unit:"years",system:"http://unitsofmeasure.org"});return o.jsxs(Ge,{style:{maxWidth:"50%"},children:[o.jsx(je,{children:o.jsx(ln,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:s=>{for(const c of t.intervals){let u=s.currentTarget.value;u===""&&(u=void 0),n(t.id,{...c,gender:u})}}})}),o.jsxs(je,{gap:"xs",children:[o.jsx(Ae,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),o.jsx("div",{id:`div-age-${t.id}`,children:o.jsx(Rb,{path:"",name:`age-${t.id}`,defaultValue:t.filters.age,onChange:s=>{for(const c of t.intervals)n(t.id,{...c,age:s})}},`age-${t.id}`)})]}),o.jsx(ln,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:((i=t.filters.context)==null?void 0:i.text)||"",onChange:s=>{for(const c of t.intervals){let u=s.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"}]}})}}}),o.jsx(ln,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:s=>{for(const c of t.intervals){const u=s.currentTarget.value;u===""?n(t.id,{...c,category:void 0}):n(t.id,{...c,category:u})}}})]})}function hY(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(i=>{var c;const s=parseInt(((c=i.id)==null?void 0:c.substring(3))||"",10);return isNaN(s)?Number.NEGATIVE_INFINITY:s}))+1;return Number.isFinite(r)||(r=1),e={...e,qualifiedInterval:n.map(i=>({...i,id:i.id||`id-${r++}`}))},t(r),e}function pY(e,t){let n=1;const r={};for(const i of e){const s=mY(i);s in r||(r[s]={id:`group-id-${n++}`,filters:Object.fromEntries(lY.map(c=>[c,i[c]])),intervals:[]}),r[s].intervals.push(i)}return t(n),Object.values(r)}function mY(e){var n,r;return[`gender=${e.gender}`,`age=${od(e.age)}`,`gestationalAge=${od(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 gY(e){return e&&(cU(e,"http://unitsofmeasure.org")||e.text)}function vY(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 yY(e){var p;const t=_e(),n=Qt(e.value),[r,i]=v.useState(!1),[s,c]=v.useState();if(v.useEffect(()=>{n&&!r&&(t.executeBatch(u(n)).then(c).catch(console.log),i(!0))},[t,n,r]),!n||!s)return null;return o.jsx(or,{children:(p=n.action)==null?void 0:p.map((m,g)=>{var j,C,T,D,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=(D=(T=y==null?void 0:y.output)==null?void 0:T[0])==null?void 0:D.valueReference;return o.jsxs(v.Fragment,{children:[o.jsx(or.Col,{span:1,p:"md",children:(y==null?void 0:y.status)==="completed"?o.jsx(sF,{}):o.jsx(PF,{color:"gray"})}),o.jsxs(or.Col,{span:9,p:"xs",children:[o.jsx(Ae,{fw:500,children:m.title}),m.description&&o.jsx("div",{children:m.description}),o.jsxs("div",{children:["Last edited by ",o.jsx(Lc,{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)]}),o.jsxs("div",{children:["Status: ",o.jsx(am,{status:(y==null?void 0:y.status)||"unknown"})]})]}),o.jsxs(or.Col,{span:2,p:"md",children:[b&&!S&&o.jsx(Ne,{onClick:()=>e.onStart(y,b),children:"Start"}),b&&S&&o.jsx(Ne,{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(s==null?void 0:s.entry)??[])if(g.resource&&m.reference===zt(g.resource))return g.resource}}function pk(e,t){const n=xY(e,t);return bY(n,e,t)}function xY(e,t){const n=e.length,r=t.length,i=n+r+1,s=1+2*i,c=s/2|0,u=new Array(s);u[c+1]={i:0,j:-1,prev:void 0,snake:!0};for(let f=0;f<i;f++){for(let p=-f;p<=f;p+=2){const m=c+p,g=m+1,y=m-1,b=u[g],S=u[y];let j,C=0;p===-f||p!==f&&S.i<b.i?(C=b.i,j=b):(C=S.i+1,j=S),u[y]=void 0;let T=C-p,D={i:C,j:T,prev:SY(j),snake:!1};for(;C<n&&T<r&&e[C]===t[T];)C++,T++;if(C>D.i&&(D={i:C,j:T,prev:D,snake:!0}),u[m]=D,C>=n&&T>=r)return u[m]}u[c+f-1]=void 0}}function bY(e,t,n){const r=[];let i=e;for(i.snake&&(i=i.prev);i!=null&&i.prev&&i.prev.j>=0;){const s=i.i,c=i.j;i=i.prev;const u=i.i,f=i.j,p={position:u,lines:t.slice(u,s)},m={position:f,lines:n.slice(f,c)};let g;p.lines.length===0&&m.lines.length>0?g="insert":p.lines.length>0&&m.lines.length===0?g="delete":g="change",r.push({original:p,revised:m,type:g}),i.snake&&(i=i.prev)}return r}function SY(e){return e&&!e.snake&&e.prev?e.prev:e}function wY(e){const t=(e.entry??[]).filter(r=>!!r.resource).map(r=>{var i;return{meta:(i=r.resource)==null?void 0:i.meta,lines:Ii(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 jY(n,t),CY(n),n}function jY(e,t){for(let n=1;n<t.length;n++){const r=pk(t[n-1].lines,t[n].lines);for(const i of r){const s=i.original.position,c=i.original.lines,u=i.revised.lines;if((i.type==="delete"||i.type==="change")&&e.splice(s,c.length),i.type==="insert"||i.type==="change")for(let f=0;f<i.revised.lines.length;f++)e.splice(s+f,0,{id:t[n].meta.versionId,meta:t[n].meta,value:u[f],span:1})}}}function CY(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 EY="_container_1oj0p_1",TY="_root_1oj0p_5",RY="_startRow_1oj0p_20",DY="_normalRow_1oj0p_24",AY="_author_1oj0p_28",_Y="_dateTime_1oj0p_32",kY="_lineNumber_1oj0p_37",PY="_line_1oj0p_37",NY="_pre_1oj0p_52",Oa={container:EY,root:TY,startRow:RY,normalRow:DY,author:AY,dateTime:_Y,lineNumber:kY,line:PY,pre:NY};function OY(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function MY(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return Zl(n,"year");const r=Math.floor(t/2592e3);if(r>0)return Zl(r,"month");const i=Math.floor(t/86400);if(i>0)return Zl(i,"day");const s=Math.floor(t/3600);if(s>0)return Zl(s,"hour");const c=Math.floor(t/60);return c>0?Zl(c,"minute"):Zl(t,"second")}function Zl(e,t){return`${e} ${e===1?t:t+"s"} ago`}function IY(e){var c,u;const t=_e(),[n,r]=v.useState(e.history);if(v.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),!n)return o.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 s=wY(n);return o.jsx("div",{className:Oa.container,children:o.jsx("table",{className:Oa.root,children:o.jsx("tbody",{children:s.map((f,p)=>o.jsxs("tr",{className:f.span>0?Oa.startRow:Oa.normalRow,children:[f.span>0&&o.jsxs(o.Fragment,{children:[o.jsx("td",{className:Oa.author,rowSpan:f.span,children:o.jsx(oc,{value:f.meta.author,link:!0})}),o.jsx("td",{className:Oa.dateTime,rowSpan:f.span,children:o.jsx(mt,{to:OY(i,f.meta.versionId),children:MY(f.meta.lastUpdated)})})]}),o.jsx("td",{className:Oa.lineNumber,children:p+1}),o.jsx("td",{className:Oa.line,children:o.jsx("pre",{className:Oa.pre,children:f.value})})]},"row-"+p))})})})}const LY="_removed_el5zk_1",zY="_added_el5zk_6",lT={removed:LY,added:zY};function $Y(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=Ii(t,!0).match(/[^\r\n]+/g),i=Ii(n,!0).match(/[^\r\n]+/g),s=pk(r,i);return o.jsx("pre",{style:{color:"gray"},children:s.map((c,u)=>o.jsx(UY,{delta:c},"delta"+u))})}function UY(e){return o.jsxs(o.Fragment,{children:["...",o.jsx("br",{}),e.delta.original.lines.length>0&&o.jsx("div",{className:lT.removed,children:e.delta.original.lines.join(`
537
- `)}),e.delta.revised.lines.length>0&&o.jsx("div",{className:lT.added,children:e.delta.revised.lines.join(`
538
- `)}),"...",o.jsx("br",{})]})}const BY="_splitButton_1i0gi_1",VY="_menuControl_1i0gi_6",cT={splitButton:BY,menuControl:VY};function Yh(e){const{outcome:t}=e,n=_e(),r=Qt(e.defaultValue),i=r==null?void 0:r.resourceType,[s,c]=v.useState(!1),[u,f]=v.useState(),p=n.getAccessPolicy(),m=Sn();v.useEffect(()=>{if(r)if(e.profileUrl){const b=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const S=Pc(b);if(S){c(!0);const j=kV(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&&zA(r,Ns.READ,p),[p,r]),y=v.useMemo(()=>n.isSuperAdmin()||!p||!Tn(u==null?void 0:u.resourceType)?!0:NB(p,u==null?void 0:u.resourceType),[n,p,u==null?void 0:u.resourceType]);return!s||!u?o.jsx("div",{children:"Loading..."}):y?o.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:b=>{b.preventDefault(),e.onSubmit&&e.onSubmit(u)},children:[o.jsxs(Ge,{mb:"xl",children:[o.jsx($t,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:o.jsx(ze,{name:"resourceType",defaultValue:u.resourceType,disabled:!0})}),o.jsx($t,{title:"ID",htmlFor:"id",outcome:t,children:o.jsx(ze,{name:"id",defaultValue:u.id,disabled:!0})})]}),o.jsx(_b,{path:u.resourceType,valuePath:u.resourceType,typeName:i,defaultValue:u,outcome:t,onChange:f,profileUrl:e.profileUrl,accessPolicyResource:g}),o.jsxs(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",gap:0,children:[o.jsx(Ne,{type:"submit",className:Ut((e.onPatch||e.onDelete)&&cT.splitButton),children:r!=null&&r.id?"Update":"Create"}),(e.onPatch||e.onDelete)&&o.jsxs(Ce,{transitionProps:{transition:"pop"},position:"bottom-end",withinPortal:!0,children:[o.jsx(Ce.Target,{children:o.jsx(_n,{variant:"filled",color:m.primaryColor,size:36,className:cT.menuControl,"aria-label":"More actions",children:o.jsx(pb,{size:14,stroke:1.5})})}),o.jsxs(Ce.Dropdown,{children:[e.onPatch&&o.jsx(Ce.Item,{leftSection:o.jsx(n_,{size:14,stroke:1.5}),onClick:()=>{e.onPatch(u)},children:"Patch"}),e.onDelete&&o.jsx(Ce.Item,{color:"red",leftSection:o.jsx(yb,{size:14,stroke:1.5,color:"red"}),onClick:()=>{e.onDelete(u)},children:"Delete"})]})]})]})]}):o.jsxs(Ya,{color:"red",title:"Permission denied",icon:o.jsx(rl,{}),children:["Your access level prevents you from editing and creating ",u.resourceType," resources."]})}function FY(e){var i;const t=_e(),[n,r]=v.useState(e.history);return v.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),n?o.jsxs(ye,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[o.jsx(ye.Thead,{children:o.jsxs(ye.Tr,{children:[o.jsx(ye.Th,{children:"Author"}),o.jsx(ye.Th,{children:"Date"}),o.jsx(ye.Th,{children:"Version"})]})}),o.jsx(ye.Tbody,{children:(i=n.entry)==null?void 0:i.map((s,c)=>o.jsx(HY,{entry:s},"entry-"+c))})]}):o.jsx("div",{children:"Loading..."})}function HY(e){var r,i,s;const{response:t,resource:n}=e.entry;return n?o.jsxs(ye.Tr,{children:[o.jsx(ye.Td,{children:o.jsx(oc,{value:(r=n.meta)==null?void 0:r.author,link:!0})}),o.jsx(ye.Td,{children:gr((i=n.meta)==null?void 0:i.lastUpdated)}),o.jsx(ye.Td,{children:o.jsx(mt,{to:qY(n),children:(s=n.meta)==null?void 0:s.versionId})})]}):o.jsx(ye.Tr,{children:o.jsx(ye.Td,{colSpan:3,children:Ye(t==null?void 0:t.outcome)})})}function qY(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function GY(e){const{serviceRequest:t,...n}=e;return o.jsx(om,{value:t,loadTimelineResources:async(r,i,s)=>{const c=`${i}/${s}`,u=100;return Promise.allSettled([r.readHistory("ServiceRequest",s),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,s)=>({resourceType:"Communication",status:"completed",basedOn:[on(r)],subject:r.subject,sender:on(i),sent:new Date().toISOString(),payload:[{contentString:s}]}),createMedia:(r,i,s)=>({resourceType:"Media",status:"completed",basedOn:[on(r)],subject:r.subject,operator:on(i),issued:new Date().toISOString(),content:s}),...n})}function QY(e){const t=_e(),{client:n,patient:r,encounter:i,children:s,...c}=e;function u(){t.createResource({resourceType:"SmartAppLaunch",patient:r,encounter:i}).then(f=>{const p=new URL(n.launchUri);p.searchParams.set("iss",eb(t.fhirUrl().toString())),p.searchParams.set("launch",f.id),window.location.assign(p.toString())}).catch(f=>Oe({color:"red",message:Ye(f),autoClose:!1}))}return o.jsx(Nt,{onClick:()=>u(),...c,children:s})}var ty={exports:{}},$u={},ny={exports:{}},ry={};/**
539
- * @license React
540
- * scheduler.production.js
541
- *
542
- * Copyright (c) Meta Platforms, Inc. and affiliates.
543
- *
544
- * This source code is licensed under the MIT license found in the
545
- * LICENSE file in the root directory of this source tree.
546
- */var uT;function WY(){return uT||(uT=1,function(e){function t(P,L){var z=P.length;P.push(L);e:for(;0<z;){var H=z-1>>>1,O=P[H];if(0<i(O,L))P[H]=L,P[z]=O,z=H;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var L=P[0],z=P.pop();if(z!==L){P[0]=z;e:for(var H=0,O=P.length,U=O>>>1;H<U;){var X=2*(H+1)-1,ee=P[X],Se=X+1,be=P[Se];if(0>i(ee,z))Se<O&&0>i(be,ee)?(P[H]=be,P[Se]=z,H=Se):(P[H]=ee,P[X]=z,H=X);else if(Se<O&&0>i(be,z))P[H]=be,P[Se]=z,H=Se;else break e}}return L}function i(P,L){var z=P.sortIndex-L.sortIndex;return z!==0?z:P.id-L.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var f=[],p=[],m=1,g=null,y=3,b=!1,S=!1,j=!1,C=!1,T=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function R(P){for(var L=n(p);L!==null;){if(L.callback===null)r(p);else if(L.startTime<=P)r(p),L.sortIndex=L.expirationTime,t(f,L);else break;L=n(p)}}function A(P){if(j=!1,R(P),!S)if(n(f)!==null)S=!0,k||(k=!0,Q());else{var L=n(p);L!==null&&K(A,L.startTime-P)}}var k=!1,M=-1,I=5,$=-1;function V(){return C?!0:!(e.unstable_now()-$<I)}function Y(){if(C=!1,k){var P=e.unstable_now();$=P;var L=!0;try{e:{S=!1,j&&(j=!1,D(M),M=-1),b=!0;var z=y;try{t:{for(R(P),g=n(f);g!==null&&!(g.expirationTime>P&&V());){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),L=!0;break t}g===n(f)&&r(f),R(P)}else r(f);g=n(f)}if(g!==null)L=!0;else{var U=n(p);U!==null&&K(A,U.startTime-P),L=!1}}break e}finally{g=null,y=z,b=!1}L=void 0}}finally{L?Q():k=!1}}}var Q;if(typeof E=="function")Q=function(){E(Y)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,G=J.port2;J.port1.onmessage=Y,Q=function(){G.postMessage(null)}}else Q=function(){T(Y,0)};function K(P,L){M=T(function(){P(e.unstable_now())},L)}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"):I=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 L=3;break;default:L=y}var z=y;y=L;try{return P()}finally{y=z}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(P,L){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var z=y;y=P;try{return L()}finally{y=z}},e.unstable_scheduleCallback=function(P,L,z){var H=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?H+z:H):z=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=z+O,P={id:m++,callback:L,priorityLevel:P,startTime:z,expirationTime:O,sortIndex:-1},z>H?(P.sortIndex=z,t(p,P),n(f)===null&&P===n(p)&&(j?(D(M),M=-1):j=!0,K(A,z-H))):(P.sortIndex=O,t(f,P),S||b||(S=!0,k||(k=!0,Q()))),P},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(P){var L=y;return function(){var z=y;y=L;try{return P.apply(this,arguments)}finally{y=z}}}}(ry)),ry}var dT;function YY(){return dT||(dT=1,ny.exports=WY()),ny.exports}/**
547
- * @license React
548
- * react-dom-client.production.js
549
- *
550
- * Copyright (c) Meta Platforms, Inc. and affiliates.
551
- *
552
- * This source code is licensed under the MIT license found in the
553
- * LICENSE file in the root directory of this source tree.
554
- */var fT;function KY(){if(fT)return $u;fT=1;var e=YY(),t=lx(),n=OR();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 s(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(s(a)!==a)throw Error(r(188))}function f(a){var l=a.alternate;if(!l){if(l=s(a),l===null)throw Error(r(188));return l!==a?null:a}for(var d=a,h=l;;){var x=d.return;if(x===null)break;var w=x.alternate;if(w===null){if(h=x.return,h!==null){d=h;continue}break}if(x.child===w.child){for(w=x.child;w;){if(w===d)return u(x),a;if(w===h)return u(x),l;w=w.sibling}throw Error(r(188))}if(d.return!==h.return)d=x,h=w;else{for(var _=!1,N=x.child;N;){if(N===d){_=!0,d=x,h=w;break}if(N===h){_=!0,h=x,d=w;break}N=N.sibling}if(!_){for(N=w.child;N;){if(N===d){_=!0,d=w,h=x;break}if(N===h){_=!0,h=w,d=x;break}N=N.sibling}if(!_)throw Error(r(189))}}if(d.alternate!==h)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?a:l}function p(a){var l=a.tag;if(l===5||l===26||l===27||l===6)return a;for(a=a.child;a!==null;){if(l=p(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"),D=Symbol.for("react.consumer"),E=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),V=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function Q(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 A:return"Suspense";case k:return"SuspenseList";case $:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case b:return"Portal";case E:return(a.displayName||"Context")+".Provider";case D: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 I:l=a._payload,a=a._init;try{return G(a(l))}catch{}}return null}var K=Array.isArray,P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},H=[],O=-1;function U(a){return{current:a}}function X(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),qe=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)?cj(a):0;break;default:if(a=l.tagName,l=l.namespaceURI)l=cj(l),a=uj(l,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}X(Se),ee(Se,a)}function tt(){X(Se),X(be),X(xe)}function ke(a){a.memoizedState!==null&&ee(qe,a);var l=Se.current,d=uj(l,a.type);l!==d&&(ee(be,a),ee(Se,d))}function vt(a){be.current===a&&(X(Se),X(be)),qe.current===a&&(X(qe),Du._currentValue=z)}var It=Object.prototype.hasOwnProperty,Lt=e.unstable_scheduleCallback,gt=e.unstable_cancelCallback,At=e.unstable_shouldYield,nn=e.unstable_requestPaint,Ee=e.unstable_now,De=e.unstable_getCurrentPriorityLevel,Qe=e.unstable_ImmediatePriority,Re=e.unstable_UserBlockingPriority,me=e.unstable_NormalPriority,ge=e.unstable_LowPriority,Pe=e.unstable_IdlePriority,we=e.log,$e=e.unstable_setDisableYieldValue,yt=null,ft=null;function Gt(a){if(typeof we=="function"&&$e(a),ft&&typeof ft.setStrictMode=="function")try{ft.setStrictMode(yt,a)}catch{}}var kt=Math.clz32?Math.clz32:Vi,un=Math.log,wt=Math.LN2;function Vi(a){return a>>>=0,a===0?32:31-(un(a)/wt|0)|0}var Si=256,pa=4194304;function Bn(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 h=a.pendingLanes;if(h===0)return 0;var x=0,w=a.suspendedLanes,_=a.pingedLanes;a=a.warmLanes;var N=h&134217727;return N!==0?(h=N&~w,h!==0?x=Bn(h):(_&=N,_!==0?x=Bn(_):d||(d=N&~a,d!==0&&(x=Bn(d))))):(N=h&~w,N!==0?x=Bn(N):_!==0?x=Bn(_):d||(d=h&~a,d!==0&&(x=Bn(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 Xr(a,l){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&l)===0}function ll(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 ma(){var a=Si;return Si<<=1,(Si&4194048)===0&&(Si=256),a}function no(){var a=pa;return pa<<=1,(pa&62914560)===0&&(pa=4194304),a}function Fi(a){for(var l=[],d=0;31>d;d++)l.push(a);return l}function xr(a,l){a.pendingLanes|=l,l!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function qn(a,l,d,h,x,w){var _=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=_&~d;0<d;){var de=31-kt(d),pe=1<<de;N[de]=0,B[de]=-1;var ie=ne[de];if(ie!==null)for(ne[de]=null,de=0;de<ie.length;de++){var ae=ie[de];ae!==null&&(ae.lane&=-536870913)}d&=~pe}h!==0&&ga(a,h,0),w!==0&&x===0&&a.tag!==0&&(a.suspendedLanes|=w&~(_&~l))}function ga(a,l,d){a.pendingLanes|=l,a.suspendedLanes&=~l;var h=31-kt(l);a.entangledLanes|=l,a.entanglements[h]=a.entanglements[h]|1073741824|d&4194090}function ro(a,l){var d=a.entangledLanes|=l;for(a=a.entanglements;d;){var h=31-kt(d),x=1<<h;x&l|a[h]&l&&(a[h]|=l),d&=~x}}function es(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 ts(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function F(){var a=L.p;return a!==0?a:(a=window.event,a===void 0?32:Aj(a.type))}function Z(a,l){var d=L.p;try{return L.p=a,l()}finally{L.p=d}}var re=Math.random().toString(36).slice(2),he="__reactFiber$"+re,Te="__reactProps$"+re,Be="__reactContainer$"+re,nt="__reactEvents$"+re,Ue="__reactListeners$"+re,Ze="__reactHandles$"+re,Je="__reactResources$"+re,it="__reactMarker$"+re;function Ke(a){delete a[he],delete a[Te],delete a[nt],delete a[Ue],delete a[Ze]}function st(a){var l=a[he];if(l)return l;for(var d=a.parentNode;d;){if(l=d[Be]||d[he]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(a=pj(a);a!==null;){if(d=a[he])return d;a=pj(a)}return l}a=d,d=a.parentNode}return null}function Xe(a){if(a=a[he]||a[Be]){var l=a.tag;if(l===5||l===6||l===13||l===26||l===27||l===3)return a}return null}function Wt(a){var l=a.tag;if(l===5||l===26||l===27||l===6)return a.stateNode;throw Error(r(33))}function dn(a){var l=a[Je];return l||(l=a[Je]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Pt(a){a[it]=!0}var Tt=new Set,io={};function cr(a,l){Zr(a,l),Zr(a+"Capture",l)}function Zr(a,l){for(io[a]=l,a=0;a<l.length;a++)Tt.add(l[a])}var br=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]*$"),ao={},oo={};function $c(a){return It.call(oo,a)?!0:It.call(ao,a)?!1:br.test(a)?oo[a]=!0:(ao[a]=!0,!1)}function Jr(a,l,d){if($c(l))if(d===null)a.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":a.removeAttribute(l);return;case"boolean":var h=l.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){a.removeAttribute(l);return}}a.setAttribute(l,""+d)}}function va(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 jt(a,l,d,h){if(h===null)a.removeAttribute(d);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(d);return}a.setAttributeNS(l,d,""+h)}}var nr,ji;function Ci(a){if(nr===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);nr=l&&l[1]||"",ji=-1<d.stack.indexOf(`
555
- at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
556
- `+nr+a+ji}var ns=!1;function xn(a,l){if(!a||ns)return"";ns=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={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(ae){var ie=ae}Reflect.construct(a,[],pe)}else{try{pe.call()}catch(ae){ie=ae}a.call(pe.prototype)}}else{try{throw Error()}catch(ae){ie=ae}(pe=a())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(ae){if(ae&&ie&&typeof ae.stack=="string")return[ae.stack,ie.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=h.DetermineComponentFrameRoot(),_=w[0],N=w[1];if(_&&N){var B=_.split(`
557
- `),ne=N.split(`
558
- `);for(x=h=0;h<B.length&&!B[h].includes("DetermineComponentFrameRoot");)h++;for(;x<ne.length&&!ne[x].includes("DetermineComponentFrameRoot");)x++;if(h===B.length||x===ne.length)for(h=B.length-1,x=ne.length-1;1<=h&&0<=x&&B[h]!==ne[x];)x--;for(;1<=h&&0<=x;h--,x--)if(B[h]!==ne[x]){if(h!==1||x!==1)do if(h--,x--,0>x||B[h]!==ne[x]){var de=`
559
- `+B[h].replace(" at new "," at ");return a.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",a.displayName)),de}while(1<=h&&0<=x);break}}}finally{ns=!1,Error.prepareStackTrace=d}return(d=a?a.displayName||a.name:"")?Ci(d):""}function so(a){switch(a.tag){case 26:case 27:case 5:return Ci(a.type);case 16:return Ci("Lazy");case 13:return Ci("Suspense");case 19:return Ci("SuspenseList");case 0:case 15:return xn(a.type,!1);case 11:return xn(a.type.render,!1);case 1:return xn(a.type,!0);case 31:return Ci("Activity");default:return""}}function Uc(a){try{var l="";do l+=so(a),a=a.return;while(a);return l}catch(d){return`
560
- Error generating stack: `+d.message+`
561
- `+d.stack}}function Sr(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function i1(a){var l=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function c4(a){var l=i1(a)?"checked":"value",d=Object.getOwnPropertyDescriptor(a.constructor.prototype,l),h=""+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(_){h=""+_,w.call(this,_)}}),Object.defineProperty(a,l,{enumerable:d.enumerable}),{getValue:function(){return h},setValue:function(_){h=""+_},stopTracking:function(){a._valueTracker=null,delete a[l]}}}}function Vd(a){a._valueTracker||(a._valueTracker=c4(a))}function a1(a){if(!a)return!1;var l=a._valueTracker;if(!l)return!0;var d=l.getValue(),h="";return a&&(h=i1(a)?a.checked?"true":"false":a.value),a=h,a!==d?(l.setValue(a),!0):!1}function Fd(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 u4=/[\n"\\]/g;function ei(a){return a.replace(u4,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function pm(a,l,d,h,x,w,_,N){a.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?a.type=_:a.removeAttribute("type"),l!=null?_==="number"?(l===0&&a.value===""||a.value!=l)&&(a.value=""+Sr(l)):a.value!==""+Sr(l)&&(a.value=""+Sr(l)):_!=="submit"&&_!=="reset"||a.removeAttribute("value"),l!=null?mm(a,_,Sr(l)):d!=null?mm(a,_,Sr(d)):h!=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=""+Sr(N):a.removeAttribute("name")}function o1(a,l,d,h,x,w,_,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?""+Sr(d):"",l=l!=null?""+Sr(l):d,N||l===a.value||(a.value=l),a.defaultValue=l}h=h??x,h=typeof h!="function"&&typeof h!="symbol"&&!!h,a.checked=N?a.checked:!!h,a.defaultChecked=!!h,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(a.name=_)}function mm(a,l,d){l==="number"&&Fd(a.ownerDocument)===a||a.defaultValue===""+d||(a.defaultValue=""+d)}function cl(a,l,d,h){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&&h&&(a[d].defaultSelected=!0)}else{for(d=""+Sr(d),l=null,x=0;x<a.length;x++){if(a[x].value===d){a[x].selected=!0,h&&(a[x].defaultSelected=!0);return}l!==null||a[x].disabled||(l=a[x])}l!==null&&(l.selected=!0)}}function s1(a,l,d){if(l!=null&&(l=""+Sr(l),l!==a.value&&(a.value=l),d==null)){a.defaultValue!==l&&(a.defaultValue=l);return}a.defaultValue=d!=null?""+Sr(d):""}function l1(a,l,d,h){if(l==null){if(h!=null){if(d!=null)throw Error(r(92));if(K(h)){if(1<h.length)throw Error(r(93));h=h[0]}d=h}d==null&&(d=""),l=d}d=Sr(l),a.defaultValue=d,h=a.textContent,h===d&&h!==""&&h!==null&&(a.value=h)}function ul(a,l){if(l){var d=a.firstChild;if(d&&d===a.lastChild&&d.nodeType===3){d.nodeValue=l;return}}a.textContent=l}var d4=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 c1(a,l,d){var h=l.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?h?a.setProperty(l,""):l==="float"?a.cssFloat="":a[l]="":h?a.setProperty(l,d):typeof d!="number"||d===0||d4.has(l)?l==="float"?a.cssFloat=d:a[l]=(""+d).trim():a[l]=d+"px"}function u1(a,l,d){if(l!=null&&typeof l!="object")throw Error(r(62));if(a=a.style,d!=null){for(var h in d)!d.hasOwnProperty(h)||l!=null&&l.hasOwnProperty(h)||(h.indexOf("--")===0?a.setProperty(h,""):h==="float"?a.cssFloat="":a[h]="");for(var x in l)h=l[x],l.hasOwnProperty(x)&&d[x]!==h&&c1(a,x,h)}else for(var w in l)l.hasOwnProperty(w)&&c1(a,w,l[w])}function gm(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 f4=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"]]),h4=/^[\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 Hd(a){return h4.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}var vm=null;function ym(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var dl=null,fl=null;function d1(a){var l=Xe(a);if(l&&(a=l.stateNode)){var d=a[Te]||null;e:switch(a=l.stateNode,l.type){case"input":if(pm(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="'+ei(""+l)+'"][type="radio"]'),l=0;l<d.length;l++){var h=d[l];if(h!==a&&h.form===a.form){var x=h[Te]||null;if(!x)throw Error(r(90));pm(h,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(l=0;l<d.length;l++)h=d[l],h.form===a.form&&a1(h)}break e;case"textarea":s1(a,d.value,d.defaultValue);break e;case"select":l=d.value,l!=null&&cl(a,!!d.multiple,l,!1)}}}var xm=!1;function f1(a,l,d){if(xm)return a(l,d);xm=!0;try{var h=a(l);return h}finally{if(xm=!1,(dl!==null||fl!==null)&&(_f(),dl&&(l=dl,a=fl,fl=dl=null,d1(l),a)))for(l=0;l<a.length;l++)d1(a[l])}}function Bc(a,l){var d=a.stateNode;if(d===null)return null;var h=d[Te]||null;if(h===null)return null;d=h[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":(h=!h.disabled)||(a=a.type,h=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!h;break e;default:a=!1}if(a)return null;if(d&&typeof d!="function")throw Error(r(231,l,typeof d));return d}var ya=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bm=!1;if(ya)try{var Vc={};Object.defineProperty(Vc,"passive",{get:function(){bm=!0}}),window.addEventListener("test",Vc,Vc),window.removeEventListener("test",Vc,Vc)}catch{bm=!1}var lo=null,Sm=null,qd=null;function h1(){if(qd)return qd;var a,l=Sm,d=l.length,h,x="value"in lo?lo.value:lo.textContent,w=x.length;for(a=0;a<d&&l[a]===x[a];a++);var _=d-a;for(h=1;h<=_&&l[d-h]===x[w-h];h++);return qd=x.slice(a,1<h?1-h:void 0)}function Gd(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 Qd(){return!0}function p1(){return!1}function wr(a){function l(d,h,x,w,_){this._reactName=d,this._targetInst=x,this.type=h,this.nativeEvent=w,this.target=_,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)?Qd:p1,this.isPropagationStopped=p1,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=Qd)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Qd)},persist:function(){},isPersistent:Qd}),l}var rs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wd=wr(rs),Fc=m({},rs,{view:0,detail:0}),p4=wr(Fc),wm,jm,Hc,Yd=m({},Fc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Em,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!==Hc&&(Hc&&a.type==="mousemove"?(wm=a.screenX-Hc.screenX,jm=a.screenY-Hc.screenY):jm=wm=0,Hc=a),wm)},movementY:function(a){return"movementY"in a?a.movementY:jm}}),m1=wr(Yd),m4=m({},Yd,{dataTransfer:0}),g4=wr(m4),v4=m({},Fc,{relatedTarget:0}),Cm=wr(v4),y4=m({},rs,{animationName:0,elapsedTime:0,pseudoElement:0}),x4=wr(y4),b4=m({},rs,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),S4=wr(b4),w4=m({},rs,{data:0}),g1=wr(w4),j4={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},C4={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"},E4={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function T4(a){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(a):(a=E4[a])?!!l[a]:!1}function Em(){return T4}var R4=m({},Fc,{key:function(a){if(a.key){var l=j4[a.key]||a.key;if(l!=="Unidentified")return l}return a.type==="keypress"?(a=Gd(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?C4[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Em,charCode:function(a){return a.type==="keypress"?Gd(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Gd(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),D4=wr(R4),A4=m({},Yd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),v1=wr(A4),_4=m({},Fc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Em}),k4=wr(_4),P4=m({},rs,{propertyName:0,elapsedTime:0,pseudoElement:0}),N4=wr(P4),O4=m({},Yd,{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}),M4=wr(O4),I4=m({},rs,{newState:0,oldState:0}),L4=wr(I4),z4=[9,13,27,32],Tm=ya&&"CompositionEvent"in window,qc=null;ya&&"documentMode"in document&&(qc=document.documentMode);var $4=ya&&"TextEvent"in window&&!qc,y1=ya&&(!Tm||qc&&8<qc&&11>=qc),x1=" ",b1=!1;function S1(a,l){switch(a){case"keyup":return z4.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function w1(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var hl=!1;function U4(a,l){switch(a){case"compositionend":return w1(l);case"keypress":return l.which!==32?null:(b1=!0,x1);case"textInput":return a=l.data,a===x1&&b1?null:a;default:return null}}function B4(a,l){if(hl)return a==="compositionend"||!Tm&&S1(a,l)?(a=h1(),qd=Sm=lo=null,hl=!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 y1&&l.locale!=="ko"?null:l.data;default:return null}}var V4={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 j1(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l==="input"?!!V4[a.type]:l==="textarea"}function C1(a,l,d,h){dl?fl?fl.push(h):fl=[h]:dl=h,l=If(l,"onChange"),0<l.length&&(d=new Wd("onChange","change",null,d,h),a.push({event:d,listeners:l}))}var Gc=null,Qc=null;function F4(a){ij(a,0)}function Kd(a){var l=Wt(a);if(a1(l))return a}function E1(a,l){if(a==="change")return l}var T1=!1;if(ya){var Rm;if(ya){var Dm="oninput"in document;if(!Dm){var R1=document.createElement("div");R1.setAttribute("oninput","return;"),Dm=typeof R1.oninput=="function"}Rm=Dm}else Rm=!1;T1=Rm&&(!document.documentMode||9<document.documentMode)}function D1(){Gc&&(Gc.detachEvent("onpropertychange",A1),Qc=Gc=null)}function A1(a){if(a.propertyName==="value"&&Kd(Qc)){var l=[];C1(l,Qc,a,ym(a)),f1(F4,l)}}function H4(a,l,d){a==="focusin"?(D1(),Gc=l,Qc=d,Gc.attachEvent("onpropertychange",A1)):a==="focusout"&&D1()}function q4(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Kd(Qc)}function G4(a,l){if(a==="click")return Kd(l)}function Q4(a,l){if(a==="input"||a==="change")return Kd(l)}function W4(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var Ir=typeof Object.is=="function"?Object.is:W4;function Wc(a,l){if(Ir(a,l))return!0;if(typeof a!="object"||a===null||typeof l!="object"||l===null)return!1;var d=Object.keys(a),h=Object.keys(l);if(d.length!==h.length)return!1;for(h=0;h<d.length;h++){var x=d[h];if(!It.call(l,x)||!Ir(a[x],l[x]))return!1}return!0}function _1(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function k1(a,l){var d=_1(a);a=0;for(var h;d;){if(d.nodeType===3){if(h=a+d.textContent.length,a<=l&&h>=l)return{node:d,offset:l-a};a=h}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=_1(d)}}function P1(a,l){return a&&l?a===l?!0:a&&a.nodeType===3?!1:l&&l.nodeType===3?P1(a,l.parentNode):"contains"in a?a.contains(l):a.compareDocumentPosition?!!(a.compareDocumentPosition(l)&16):!1:!1}function N1(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var l=Fd(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=Fd(a.document)}return l}function Am(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 Y4=ya&&"documentMode"in document&&11>=document.documentMode,pl=null,_m=null,Yc=null,km=!1;function O1(a,l,d){var h=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;km||pl==null||pl!==Fd(h)||(h=pl,"selectionStart"in h&&Am(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Yc&&Wc(Yc,h)||(Yc=h,h=If(_m,"onSelect"),0<h.length&&(l=new Wd("onSelect","select",null,l,d),a.push({event:l,listeners:h}),l.target=pl)))}function is(a,l){var d={};return d[a.toLowerCase()]=l.toLowerCase(),d["Webkit"+a]="webkit"+l,d["Moz"+a]="moz"+l,d}var ml={animationend:is("Animation","AnimationEnd"),animationiteration:is("Animation","AnimationIteration"),animationstart:is("Animation","AnimationStart"),transitionrun:is("Transition","TransitionRun"),transitionstart:is("Transition","TransitionStart"),transitioncancel:is("Transition","TransitionCancel"),transitionend:is("Transition","TransitionEnd")},Pm={},M1={};ya&&(M1=document.createElement("div").style,"AnimationEvent"in window||(delete ml.animationend.animation,delete ml.animationiteration.animation,delete ml.animationstart.animation),"TransitionEvent"in window||delete ml.transitionend.transition);function as(a){if(Pm[a])return Pm[a];if(!ml[a])return a;var l=ml[a],d;for(d in l)if(l.hasOwnProperty(d)&&d in M1)return Pm[a]=l[d];return a}var I1=as("animationend"),L1=as("animationiteration"),z1=as("animationstart"),K4=as("transitionrun"),X4=as("transitionstart"),Z4=as("transitioncancel"),$1=as("transitionend"),U1=new Map,Nm="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(" ");Nm.push("scrollEnd");function Ei(a,l){U1.set(a,l),cr(l,[a])}var B1=new WeakMap;function ti(a,l){if(typeof a=="object"&&a!==null){var d=B1.get(a);return d!==void 0?d:(l={value:a,source:l,stack:Uc(l)},B1.set(a,l),l)}return{value:a,source:l,stack:Uc(l)}}var ni=[],gl=0,Om=0;function Xd(){for(var a=gl,l=Om=gl=0;l<a;){var d=ni[l];ni[l++]=null;var h=ni[l];ni[l++]=null;var x=ni[l];ni[l++]=null;var w=ni[l];if(ni[l++]=null,h!==null&&x!==null){var _=h.pending;_===null?x.next=x:(x.next=_.next,_.next=x),h.pending=x}w!==0&&V1(d,x,w)}}function Zd(a,l,d,h){ni[gl++]=a,ni[gl++]=l,ni[gl++]=d,ni[gl++]=h,Om|=h,a.lanes|=h,a=a.alternate,a!==null&&(a.lanes|=h)}function Mm(a,l,d,h){return Zd(a,l,d,h),Jd(a)}function vl(a,l){return Zd(a,null,null,l),Jd(a)}function V1(a,l,d){a.lanes|=d;var h=a.alternate;h!==null&&(h.lanes|=d);for(var x=!1,w=a.return;w!==null;)w.childLanes|=d,h=w.alternate,h!==null&&(h.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,h=a[x],h===null?a[x]=[l]:h.push(l),l.lane=d|536870912),w):null}function Jd(a){if(50<bu)throw bu=0,Bg=null,Error(r(185));for(var l=a.return;l!==null;)a=l,l=a.return;return a.tag===3?a.stateNode:null}var yl={};function J4(a,l,d,h){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=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Lr(a,l,d,h){return new J4(a,l,d,h)}function Im(a){return a=a.prototype,!(!a||!a.isReactComponent)}function xa(a,l){var d=a.alternate;return d===null?(d=Lr(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 F1(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 ef(a,l,d,h,x,w){var _=0;if(h=a,typeof a=="function")Im(a)&&(_=1);else if(typeof a=="string")_=t3(a,d,Se.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case $:return a=Lr(31,d,l,x),a.elementType=$,a.lanes=w,a;case S:return os(d.children,x,w,l);case j:_=8,x|=24;break;case C:return a=Lr(12,d,l,x|2),a.elementType=C,a.lanes=w,a;case A:return a=Lr(13,d,l,x),a.elementType=A,a.lanes=w,a;case k:return a=Lr(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:_=10;break e;case D:_=9;break e;case R:_=11;break e;case M:_=14;break e;case I:_=16,h=null;break e}_=29,d=Error(r(130,a===null?"null":typeof a,"")),h=null}return l=Lr(_,d,l,x),l.elementType=a,l.type=h,l.lanes=w,l}function os(a,l,d,h){return a=Lr(7,a,h,l),a.lanes=d,a}function Lm(a,l,d){return a=Lr(6,a,null,l),a.lanes=d,a}function zm(a,l,d){return l=Lr(4,a.children!==null?a.children:[],a.key,l),l.lanes=d,l.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},l}var xl=[],bl=0,tf=null,nf=0,ri=[],ii=0,ss=null,ba=1,Sa="";function ls(a,l){xl[bl++]=nf,xl[bl++]=tf,tf=a,nf=l}function H1(a,l,d){ri[ii++]=ba,ri[ii++]=Sa,ri[ii++]=ss,ss=a;var h=ba;a=Sa;var x=32-kt(h)-1;h&=~(1<<x),d+=1;var w=32-kt(l)+x;if(30<w){var _=x-x%5;w=(h&(1<<_)-1).toString(32),h>>=_,x-=_,ba=1<<32-kt(l)+x|d<<x|h,Sa=w+a}else ba=1<<w|d<<x|h,Sa=a}function $m(a){a.return!==null&&(ls(a,1),H1(a,1,0))}function Um(a){for(;a===tf;)tf=xl[--bl],xl[bl]=null,nf=xl[--bl],xl[bl]=null;for(;a===ss;)ss=ri[--ii],ri[ii]=null,Sa=ri[--ii],ri[ii]=null,ba=ri[--ii],ri[ii]=null}var ur=null,Dn=null,Ft=!1,cs=null,Hi=!1,Bm=Error(r(519));function us(a){var l=Error(r(418,""));throw Zc(ti(l,a)),Bm}function q1(a){var l=a.stateNode,d=a.type,h=a.memoizedProps;switch(l[he]=a,l[Te]=h,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<wu.length;d++)Dt(wu[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),o1(l,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0),Vd(l);break;case"select":Dt("invalid",l);break;case"textarea":Dt("invalid",l),l1(l,h.value,h.defaultValue,h.children),Vd(l)}d=h.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||l.textContent===""+d||h.suppressHydrationWarning===!0||lj(l.textContent,d)?(h.popover!=null&&(Dt("beforetoggle",l),Dt("toggle",l)),h.onScroll!=null&&Dt("scroll",l),h.onScrollEnd!=null&&Dt("scrollend",l),h.onClick!=null&&(l.onclick=Lf),l=!0):l=!1,l||us(a)}function G1(a){for(ur=a.return;ur;)switch(ur.tag){case 5:case 13:Hi=!1;return;case 27:case 3:Hi=!0;return;default:ur=ur.return}}function Kc(a){if(a!==ur)return!1;if(!Ft)return G1(a),Ft=!0,!1;var l=a.tag,d;if((d=l!==3&&l!==27)&&((d=l===5)&&(d=a.type,d=!(d!=="form"&&d!=="button")||rv(a.type,a.memoizedProps)),d=!d),d&&Dn&&us(a),G1(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){Dn=Ri(a.nextSibling);break e}l--}else d!=="$"&&d!=="$!"&&d!=="$?"||l++;a=a.nextSibling}Dn=null}}else l===27?(l=Dn,Eo(a.type)?(a=sv,sv=null,Dn=a):Dn=l):Dn=ur?Ri(a.stateNode.nextSibling):null;return!0}function Xc(){Dn=ur=null,Ft=!1}function Q1(){var a=cs;return a!==null&&(Er===null?Er=a:Er.push.apply(Er,a),cs=null),a}function Zc(a){cs===null?cs=[a]:cs.push(a)}var Vm=U(null),ds=null,wa=null;function co(a,l,d){ee(Vm,l._currentValue),l._currentValue=d}function ja(a){a._currentValue=Vm.current,X(Vm)}function Fm(a,l,d){for(;a!==null;){var h=a.alternate;if((a.childLanes&l)!==l?(a.childLanes|=l,h!==null&&(h.childLanes|=l)):h!==null&&(h.childLanes&l)!==l&&(h.childLanes|=l),a===d)break;a=a.return}}function Hm(a,l,d,h){var x=a.child;for(x!==null&&(x.return=a);x!==null;){var w=x.dependencies;if(w!==null){var _=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),Fm(w.return,d,a),h||(_=null);break e}w=N.next}}else if(x.tag===18){if(_=x.return,_===null)throw Error(r(341));_.lanes|=d,w=_.alternate,w!==null&&(w.lanes|=d),Fm(_,d,a),_=null}else _=x.child;if(_!==null)_.return=x;else for(_=x;_!==null;){if(_===a){_=null;break}if(x=_.sibling,x!==null){x.return=_.return,_=x;break}_=_.return}x=_}}function Jc(a,l,d,h){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 _=x.alternate;if(_===null)throw Error(r(387));if(_=_.memoizedProps,_!==null){var N=x.type;Ir(x.pendingProps.value,_.value)||(a!==null?a.push(N):a=[N])}}else if(x===qe.current){if(_=x.alternate,_===null)throw Error(r(387));_.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(a!==null?a.push(Du):a=[Du])}x=x.return}a!==null&&Hm(l,a,d,h),l.flags|=262144}function rf(a){for(a=a.firstContext;a!==null;){if(!Ir(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function fs(a){ds=a,wa=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function rr(a){return W1(ds,a)}function af(a,l){return ds===null&&fs(a),W1(a,l)}function W1(a,l){var d=l._currentValue;if(l={context:l,memoizedValue:d,next:null},wa===null){if(a===null)throw Error(r(308));wa=l,a.dependencies={lanes:0,firstContext:l},a.flags|=524288}else wa=wa.next=l;return d}var eP=typeof AbortController<"u"?AbortController:function(){var a=[],l=this.signal={aborted:!1,addEventListener:function(d,h){a.push(h)}};this.abort=function(){l.aborted=!0,a.forEach(function(d){return d()})}},tP=e.unstable_scheduleCallback,nP=e.unstable_NormalPriority,Vn={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function qm(){return{controller:new eP,data:new Map,refCount:0}}function eu(a){a.refCount--,a.refCount===0&&tP(nP,function(){a.controller.abort()})}var tu=null,Gm=0,Sl=0,wl=null;function rP(a,l){if(tu===null){var d=tu=[];Gm=0,Sl=Wg(),wl={status:"pending",value:void 0,then:function(h){d.push(h)}}}return Gm++,l.then(Y1,Y1),l}function Y1(){if(--Gm===0&&tu!==null){wl!==null&&(wl.status="fulfilled");var a=tu;tu=null,Sl=0,wl=null;for(var l=0;l<a.length;l++)(0,a[l])()}}function iP(a,l){var d=[],h={status:"pending",value:null,reason:null,then:function(x){d.push(x)}};return a.then(function(){h.status="fulfilled",h.value=l;for(var x=0;x<d.length;x++)(0,d[x])(l)},function(x){for(h.status="rejected",h.reason=x,x=0;x<d.length;x++)(0,d[x])(void 0)}),h}var K1=P.S;P.S=function(a,l){typeof l=="object"&&l!==null&&typeof l.then=="function"&&rP(a,l),K1!==null&&K1(a,l)};var hs=U(null);function Qm(){var a=hs.current;return a!==null?a:fn.pooledCache}function of(a,l){l===null?ee(hs,hs.current):ee(hs,l.pool)}function X1(){var a=Qm();return a===null?null:{parent:Vn._currentValue,pool:a}}var nu=Error(r(460)),Z1=Error(r(474)),sf=Error(r(542)),Wm={then:function(){}};function J1(a){return a=a.status,a==="fulfilled"||a==="rejected"}function lf(){}function eS(a,l,d){switch(d=a[d],d===void 0?a.push(l):d!==l&&(l.then(lf,lf),l=d),l.status){case"fulfilled":return l.value;case"rejected":throw a=l.reason,nS(a),a;default:if(typeof l.status=="string")l.then(lf,lf);else{if(a=fn,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=l,a.status="pending",a.then(function(h){if(l.status==="pending"){var x=l;x.status="fulfilled",x.value=h}},function(h){if(l.status==="pending"){var x=l;x.status="rejected",x.reason=h}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw a=l.reason,nS(a),a}throw ru=l,nu}}var ru=null;function tS(){if(ru===null)throw Error(r(459));var a=ru;return ru=null,a}function nS(a){if(a===nu||a===sf)throw Error(r(483))}var uo=!1;function Ym(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Km(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 fo(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function ho(a,l,d){var h=a.updateQueue;if(h===null)return null;if(h=h.shared,(Yt&2)!==0){var x=h.pending;return x===null?l.next=l:(l.next=x.next,x.next=l),h.pending=l,l=Jd(a),V1(a,null,d),l}return Zd(a,h,l,d),Jd(a)}function iu(a,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194048)!==0)){var h=l.lanes;h&=a.pendingLanes,d|=h,l.lanes=d,ro(a,d)}}function Xm(a,l){var d=a.updateQueue,h=a.alternate;if(h!==null&&(h=h.updateQueue,d===h)){var x=null,w=null;if(d=d.firstBaseUpdate,d!==null){do{var _={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};w===null?x=w=_:w=w.next=_,d=d.next}while(d!==null);w===null?x=w=l:w=w.next=l}else x=w=l;d={baseState:h.baseState,firstBaseUpdate:x,lastBaseUpdate:w,shared:h.shared,callbacks:h.callbacks},a.updateQueue=d;return}a=d.lastBaseUpdate,a===null?d.firstBaseUpdate=l:a.next=l,d.lastBaseUpdate=l}var Zm=!1;function au(){if(Zm){var a=wl;if(a!==null)throw a}}function ou(a,l,d,h){Zm=!1;var x=a.updateQueue;uo=!1;var w=x.firstBaseUpdate,_=x.lastBaseUpdate,N=x.shared.pending;if(N!==null){x.shared.pending=null;var B=N,ne=B.next;B.next=null,_===null?w=ne:_.next=ne,_=B;var de=a.alternate;de!==null&&(de=de.updateQueue,N=de.lastBaseUpdate,N!==_&&(N===null?de.firstBaseUpdate=ne:N.next=ne,de.lastBaseUpdate=B))}if(w!==null){var pe=x.baseState;_=0,de=ne=B=null,N=w;do{var ie=N.lane&-536870913,ae=ie!==N.lane;if(ae?(Mt&ie)===ie:(h&ie)===ie){ie!==0&&ie===Sl&&(Zm=!0),de!==null&&(de=de.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var ut=a,at=N;ie=l;var tn=d;switch(at.tag){case 1:if(ut=at.payload,typeof ut=="function"){pe=ut.call(tn,pe,ie);break e}pe=ut;break e;case 3:ut.flags=ut.flags&-65537|128;case 0:if(ut=at.payload,ie=typeof ut=="function"?ut.call(tn,pe,ie):ut,ie==null)break e;pe=m({},pe,ie);break e;case 2:uo=!0}}ie=N.callback,ie!==null&&(a.flags|=64,ae&&(a.flags|=8192),ae=x.callbacks,ae===null?x.callbacks=[ie]:ae.push(ie))}else ae={lane:ie,tag:N.tag,payload:N.payload,callback:N.callback,next:null},de===null?(ne=de=ae,B=pe):de=de.next=ae,_|=ie;if(N=N.next,N===null){if(N=x.shared.pending,N===null)break;ae=N,N=ae.next,ae.next=null,x.lastBaseUpdate=ae,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),So|=_,a.lanes=_,a.memoizedState=pe}}function rS(a,l){if(typeof a!="function")throw Error(r(191,a));a.call(l)}function iS(a,l){var d=a.callbacks;if(d!==null)for(a.callbacks=null,a=0;a<d.length;a++)rS(d[a],l)}var jl=U(null),cf=U(0);function aS(a,l){a=_a,ee(cf,a),ee(jl,l),_a=a|l.baseLanes}function Jm(){ee(cf,_a),ee(jl,jl.current)}function eg(){_a=cf.current,X(jl),X(cf)}var po=0,St=null,Jt=null,In=null,uf=!1,Cl=!1,ps=!1,df=0,su=0,El=null,aP=0;function kn(){throw Error(r(321))}function tg(a,l){if(l===null)return!1;for(var d=0;d<l.length&&d<a.length;d++)if(!Ir(a[d],l[d]))return!1;return!0}function ng(a,l,d,h,x,w){return po=w,St=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,P.H=a===null||a.memoizedState===null?VS:FS,ps=!1,w=d(h,x),ps=!1,Cl&&(w=sS(l,d,h,x)),oS(a),w}function oS(a){P.H=vf;var l=Jt!==null&&Jt.next!==null;if(po=0,In=Jt=St=null,uf=!1,su=0,El=null,l)throw Error(r(300));a===null||Gn||(a=a.dependencies,a!==null&&rf(a)&&(Gn=!0))}function sS(a,l,d,h){St=a;var x=0;do{if(Cl&&(El=null),su=0,Cl=!1,25<=x)throw Error(r(301));if(x+=1,In=Jt=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=fP,w=l(d,h)}while(Cl);return w}function oP(){var a=P.H,l=a.useState()[0];return l=typeof l.then=="function"?lu(l):l,a=a.useState()[0],(Jt!==null?Jt.memoizedState:null)!==a&&(St.flags|=1024),l}function rg(){var a=df!==0;return df=0,a}function ig(a,l,d){l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~d}function ag(a){if(uf){for(a=a.memoizedState;a!==null;){var l=a.queue;l!==null&&(l.pending=null),a=a.next}uf=!1}po=0,In=Jt=St=null,Cl=!1,su=df=0,El=null}function jr(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return In===null?St.memoizedState=In=a:In=In.next=a,In}function Ln(){if(Jt===null){var a=St.alternate;a=a!==null?a.memoizedState:null}else a=Jt.next;var l=In===null?St.memoizedState:In.next;if(l!==null)In=l,Jt=a;else{if(a===null)throw St.alternate===null?Error(r(467)):Error(r(310));Jt=a,a={memoizedState:Jt.memoizedState,baseState:Jt.baseState,baseQueue:Jt.baseQueue,queue:Jt.queue,next:null},In===null?St.memoizedState=In=a:In=In.next=a}return In}function og(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function lu(a){var l=su;return su+=1,El===null&&(El=[]),a=eS(El,a,l),l=St,(In===null?l.memoizedState:In.next)===null&&(l=l.alternate,P.H=l===null||l.memoizedState===null?VS:FS),a}function ff(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return lu(a);if(a.$$typeof===E)return rr(a)}throw Error(r(438,String(a)))}function sg(a){var l=null,d=St.updateQueue;if(d!==null&&(l=d.memoCache),l==null){var h=St.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(l={data:h.data.map(function(x){return x.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),d===null&&(d=og(),St.updateQueue=d),d.memoCache=l,d=l.data[l.index],d===void 0)for(d=l.data[l.index]=Array(a),h=0;h<a;h++)d[h]=V;return l.index++,d}function Ca(a,l){return typeof l=="function"?l(a):l}function hf(a){var l=Ln();return lg(l,Jt,a)}function lg(a,l,d){var h=a.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=d;var x=a.baseQueue,w=h.pending;if(w!==null){if(x!==null){var _=x.next;x.next=w.next,w.next=_}l.baseQueue=x=w,h.pending=null}if(w=a.baseState,x===null)a.memoizedState=w;else{l=x.next;var N=_=null,B=null,ne=l,de=!1;do{var pe=ne.lane&-536870913;if(pe!==ne.lane?(Mt&pe)===pe:(po&pe)===pe){var ie=ne.revertLane;if(ie===0)B!==null&&(B=B.next={lane:0,revertLane:0,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),pe===Sl&&(de=!0);else if((po&ie)===ie){ne=ne.next,ie===Sl&&(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,_=w):B=B.next=pe,St.lanes|=ie,So|=ie;pe=ne.action,ps&&d(w,pe),w=ne.hasEagerState?ne.eagerState:d(w,pe)}else ie={lane:pe,revertLane:ne.revertLane,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},B===null?(N=B=ie,_=w):B=B.next=ie,St.lanes|=pe,So|=pe;ne=ne.next}while(ne!==null&&ne!==l);if(B===null?_=w:B.next=N,!Ir(w,a.memoizedState)&&(Gn=!0,de&&(d=wl,d!==null)))throw d;a.memoizedState=w,a.baseState=_,a.baseQueue=B,h.lastRenderedState=w}return x===null&&(h.lanes=0),[a.memoizedState,h.dispatch]}function cg(a){var l=Ln(),d=l.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=a;var h=d.dispatch,x=d.pending,w=l.memoizedState;if(x!==null){d.pending=null;var _=x=x.next;do w=a(w,_.action),_=_.next;while(_!==x);Ir(w,l.memoizedState)||(Gn=!0),l.memoizedState=w,l.baseQueue===null&&(l.baseState=w),d.lastRenderedState=w}return[w,h]}function lS(a,l,d){var h=St,x=Ln(),w=Ft;if(w){if(d===void 0)throw Error(r(407));d=d()}else d=l();var _=!Ir((Jt||x).memoizedState,d);_&&(x.memoizedState=d,Gn=!0),x=x.queue;var N=dS.bind(null,h,x,a);if(cu(2048,8,N,[a]),x.getSnapshot!==l||_||In!==null&&In.memoizedState.tag&1){if(h.flags|=2048,Tl(9,pf(),uS.bind(null,h,x,d,l),null),fn===null)throw Error(r(349));w||(po&124)!==0||cS(h,l,d)}return d}function cS(a,l,d){a.flags|=16384,a={getSnapshot:l,value:d},l=St.updateQueue,l===null?(l=og(),St.updateQueue=l,l.stores=[a]):(d=l.stores,d===null?l.stores=[a]:d.push(a))}function uS(a,l,d,h){l.value=d,l.getSnapshot=h,fS(l)&&hS(a)}function dS(a,l,d){return d(function(){fS(l)&&hS(a)})}function fS(a){var l=a.getSnapshot;a=a.value;try{var d=l();return!Ir(a,d)}catch{return!0}}function hS(a){var l=vl(a,2);l!==null&&Vr(l,a,2)}function ug(a){var l=jr();if(typeof a=="function"){var d=a;if(a=d(),ps){Gt(!0);try{d()}finally{Gt(!1)}}}return l.memoizedState=l.baseState=a,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ca,lastRenderedState:a},l}function pS(a,l,d,h){return a.baseState=d,lg(a,Jt,typeof h=="function"?h:Ca)}function sP(a,l,d,h,x){if(gf(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(_){w.listeners.push(_)}};P.T!==null?d(!0):w.isTransition=!1,h(w),d=l.pending,d===null?(w.next=l.pending=w,mS(l,w)):(w.next=d.next,l.pending=d.next=w)}}function mS(a,l){var d=l.action,h=l.payload,x=a.state;if(l.isTransition){var w=P.T,_={};P.T=_;try{var N=d(x,h),B=P.S;B!==null&&B(_,N),gS(a,l,N)}catch(ne){dg(a,l,ne)}finally{P.T=w}}else try{w=d(x,h),gS(a,l,w)}catch(ne){dg(a,l,ne)}}function gS(a,l,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(h){vS(a,l,h)},function(h){return dg(a,l,h)}):vS(a,l,d)}function vS(a,l,d){l.status="fulfilled",l.value=d,yS(l),a.state=d,l=a.pending,l!==null&&(d=l.next,d===l?a.pending=null:(d=d.next,l.next=d,mS(a,d)))}function dg(a,l,d){var h=a.pending;if(a.pending=null,h!==null){h=h.next;do l.status="rejected",l.reason=d,yS(l),l=l.next;while(l!==h)}a.action=null}function yS(a){a=a.listeners;for(var l=0;l<a.length;l++)(0,a[l])()}function xS(a,l){return l}function bS(a,l){if(Ft){var d=fn.formState;if(d!==null){e:{var h=St;if(Ft){if(Dn){t:{for(var x=Dn,w=Hi;x.nodeType!==8;){if(!w){x=null;break t}if(x=Ri(x.nextSibling),x===null){x=null;break t}}w=x.data,x=w==="F!"||w==="F"?x:null}if(x){Dn=Ri(x.nextSibling),h=x.data==="F!";break e}}us(h)}h=!1}h&&(l=d[0])}}return d=jr(),d.memoizedState=d.baseState=l,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xS,lastRenderedState:l},d.queue=h,d=$S.bind(null,St,h),h.dispatch=d,h=ug(!1),w=gg.bind(null,St,!1,h.queue),h=jr(),x={state:l,dispatch:null,action:a,pending:null},h.queue=x,d=sP.bind(null,St,x,w,d),x.dispatch=d,h.memoizedState=a,[l,d,!1]}function SS(a){var l=Ln();return wS(l,Jt,a)}function wS(a,l,d){if(l=lg(a,l,xS)[0],a=hf(Ca)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var h=lu(l)}catch(_){throw _===nu?sf:_}else h=l;l=Ln();var x=l.queue,w=x.dispatch;return d!==l.memoizedState&&(St.flags|=2048,Tl(9,pf(),lP.bind(null,x,d),null)),[h,w,a]}function lP(a,l){a.action=l}function jS(a){var l=Ln(),d=Jt;if(d!==null)return wS(l,d,a);Ln(),l=l.memoizedState,d=Ln();var h=d.queue.dispatch;return d.memoizedState=a,[l,h,!1]}function Tl(a,l,d,h){return a={tag:a,create:d,deps:h,inst:l,next:null},l=St.updateQueue,l===null&&(l=og(),St.updateQueue=l),d=l.lastEffect,d===null?l.lastEffect=a.next=a:(h=d.next,d.next=a,a.next=h,l.lastEffect=a),a}function pf(){return{destroy:void 0,resource:void 0}}function CS(){return Ln().memoizedState}function mf(a,l,d,h){var x=jr();h=h===void 0?null:h,St.flags|=a,x.memoizedState=Tl(1|l,pf(),d,h)}function cu(a,l,d,h){var x=Ln();h=h===void 0?null:h;var w=x.memoizedState.inst;Jt!==null&&h!==null&&tg(h,Jt.memoizedState.deps)?x.memoizedState=Tl(l,w,d,h):(St.flags|=a,x.memoizedState=Tl(1|l,w,d,h))}function ES(a,l){mf(8390656,8,a,l)}function TS(a,l){cu(2048,8,a,l)}function RS(a,l){return cu(4,2,a,l)}function DS(a,l){return cu(4,4,a,l)}function AS(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 _S(a,l,d){d=d!=null?d.concat([a]):null,cu(4,4,AS.bind(null,l,a),d)}function fg(){}function kS(a,l){var d=Ln();l=l===void 0?null:l;var h=d.memoizedState;return l!==null&&tg(l,h[1])?h[0]:(d.memoizedState=[a,l],a)}function PS(a,l){var d=Ln();l=l===void 0?null:l;var h=d.memoizedState;if(l!==null&&tg(l,h[1]))return h[0];if(h=a(),ps){Gt(!0);try{a()}finally{Gt(!1)}}return d.memoizedState=[h,l],h}function hg(a,l,d){return d===void 0||(po&1073741824)!==0?a.memoizedState=l:(a.memoizedState=d,a=Mw(),St.lanes|=a,So|=a,d)}function NS(a,l,d,h){return Ir(d,l)?d:jl.current!==null?(a=hg(a,d,h),Ir(a,l)||(Gn=!0),a):(po&42)===0?(Gn=!0,a.memoizedState=d):(a=Mw(),St.lanes|=a,So|=a,l)}function OS(a,l,d,h,x){var w=L.p;L.p=w!==0&&8>w?w:8;var _=P.T,N={};P.T=N,gg(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=iP(B,h);uu(a,l,de,Br(a))}else uu(a,l,h,Br(a))}catch(pe){uu(a,l,{then:function(){},status:"rejected",reason:pe},Br())}finally{L.p=w,P.T=_}}function cP(){}function pg(a,l,d,h){if(a.tag!==5)throw Error(r(476));var x=MS(a).queue;OS(a,x,l,z,d===null?cP:function(){return IS(a),d(h)})}function MS(a){var l=a.memoizedState;if(l!==null)return l;l={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ca,lastRenderedState:z},next:null};var d={};return l.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ca,lastRenderedState:d},next:null},a.memoizedState=l,a=a.alternate,a!==null&&(a.memoizedState=l),l}function IS(a){var l=MS(a).next.queue;uu(a,l,{},Br())}function mg(){return rr(Du)}function LS(){return Ln().memoizedState}function zS(){return Ln().memoizedState}function uP(a){for(var l=a.return;l!==null;){switch(l.tag){case 24:case 3:var d=Br();a=fo(d);var h=ho(l,a,d);h!==null&&(Vr(h,l,d),iu(h,l,d)),l={cache:qm()},a.payload=l;return}l=l.return}}function dP(a,l,d){var h=Br();d={lane:h,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null},gf(a)?US(l,d):(d=Mm(a,l,d,h),d!==null&&(Vr(d,a,h),BS(d,l,h)))}function $S(a,l,d){var h=Br();uu(a,l,d,h)}function uu(a,l,d,h){var x={lane:h,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null};if(gf(a))US(l,x);else{var w=a.alternate;if(a.lanes===0&&(w===null||w.lanes===0)&&(w=l.lastRenderedReducer,w!==null))try{var _=l.lastRenderedState,N=w(_,d);if(x.hasEagerState=!0,x.eagerState=N,Ir(N,_))return Zd(a,l,x,0),fn===null&&Xd(),!1}catch{}finally{}if(d=Mm(a,l,x,h),d!==null)return Vr(d,a,h),BS(d,l,h),!0}return!1}function gg(a,l,d,h){if(h={lane:2,revertLane:Wg(),action:h,hasEagerState:!1,eagerState:null,next:null},gf(a)){if(l)throw Error(r(479))}else l=Mm(a,d,h,2),l!==null&&Vr(l,a,2)}function gf(a){var l=a.alternate;return a===St||l!==null&&l===St}function US(a,l){Cl=uf=!0;var d=a.pending;d===null?l.next=l:(l.next=d.next,d.next=l),a.pending=l}function BS(a,l,d){if((d&4194048)!==0){var h=l.lanes;h&=a.pendingLanes,d|=h,l.lanes=d,ro(a,d)}}var vf={readContext:rr,use:ff,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},VS={readContext:rr,use:ff,useCallback:function(a,l){return jr().memoizedState=[a,l===void 0?null:l],a},useContext:rr,useEffect:ES,useImperativeHandle:function(a,l,d){d=d!=null?d.concat([a]):null,mf(4194308,4,AS.bind(null,l,a),d)},useLayoutEffect:function(a,l){return mf(4194308,4,a,l)},useInsertionEffect:function(a,l){mf(4,2,a,l)},useMemo:function(a,l){var d=jr();l=l===void 0?null:l;var h=a();if(ps){Gt(!0);try{a()}finally{Gt(!1)}}return d.memoizedState=[h,l],h},useReducer:function(a,l,d){var h=jr();if(d!==void 0){var x=d(l);if(ps){Gt(!0);try{d(l)}finally{Gt(!1)}}}else x=l;return h.memoizedState=h.baseState=x,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:x},h.queue=a,a=a.dispatch=dP.bind(null,St,a),[h.memoizedState,a]},useRef:function(a){var l=jr();return a={current:a},l.memoizedState=a},useState:function(a){a=ug(a);var l=a.queue,d=$S.bind(null,St,l);return l.dispatch=d,[a.memoizedState,d]},useDebugValue:fg,useDeferredValue:function(a,l){var d=jr();return hg(d,a,l)},useTransition:function(){var a=ug(!1);return a=OS.bind(null,St,a.queue,!0,!1),jr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,l,d){var h=St,x=jr();if(Ft){if(d===void 0)throw Error(r(407));d=d()}else{if(d=l(),fn===null)throw Error(r(349));(Mt&124)!==0||cS(h,l,d)}x.memoizedState=d;var w={value:d,getSnapshot:l};return x.queue=w,ES(dS.bind(null,h,w,a),[a]),h.flags|=2048,Tl(9,pf(),uS.bind(null,h,w,d,l),null),d},useId:function(){var a=jr(),l=fn.identifierPrefix;if(Ft){var d=Sa,h=ba;d=(h&~(1<<32-kt(h)-1)).toString(32)+d,l="«"+l+"R"+d,d=df++,0<d&&(l+="H"+d.toString(32)),l+="»"}else d=aP++,l="«"+l+"r"+d.toString(32)+"»";return a.memoizedState=l},useHostTransitionStatus:mg,useFormState:bS,useActionState:bS,useOptimistic:function(a){var l=jr();l.memoizedState=l.baseState=a;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=d,l=gg.bind(null,St,!0,d),d.dispatch=l,[a,l]},useMemoCache:sg,useCacheRefresh:function(){return jr().memoizedState=uP.bind(null,St)}},FS={readContext:rr,use:ff,useCallback:kS,useContext:rr,useEffect:TS,useImperativeHandle:_S,useInsertionEffect:RS,useLayoutEffect:DS,useMemo:PS,useReducer:hf,useRef:CS,useState:function(){return hf(Ca)},useDebugValue:fg,useDeferredValue:function(a,l){var d=Ln();return NS(d,Jt.memoizedState,a,l)},useTransition:function(){var a=hf(Ca)[0],l=Ln().memoizedState;return[typeof a=="boolean"?a:lu(a),l]},useSyncExternalStore:lS,useId:LS,useHostTransitionStatus:mg,useFormState:SS,useActionState:SS,useOptimistic:function(a,l){var d=Ln();return pS(d,Jt,a,l)},useMemoCache:sg,useCacheRefresh:zS},fP={readContext:rr,use:ff,useCallback:kS,useContext:rr,useEffect:TS,useImperativeHandle:_S,useInsertionEffect:RS,useLayoutEffect:DS,useMemo:PS,useReducer:cg,useRef:CS,useState:function(){return cg(Ca)},useDebugValue:fg,useDeferredValue:function(a,l){var d=Ln();return Jt===null?hg(d,a,l):NS(d,Jt.memoizedState,a,l)},useTransition:function(){var a=cg(Ca)[0],l=Ln().memoizedState;return[typeof a=="boolean"?a:lu(a),l]},useSyncExternalStore:lS,useId:LS,useHostTransitionStatus:mg,useFormState:jS,useActionState:jS,useOptimistic:function(a,l){var d=Ln();return Jt!==null?pS(d,Jt,a,l):(d.baseState=a,[a,d.queue.dispatch])},useMemoCache:sg,useCacheRefresh:zS},Rl=null,du=0;function yf(a){var l=du;return du+=1,Rl===null&&(Rl=[]),eS(Rl,a,l)}function fu(a,l){l=l.props.ref,a.ref=l!==void 0?l:null}function xf(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 HS(a){var l=a._init;return l(a._payload)}function qS(a){function l(W,q){if(a){var te=W.deletions;te===null?(W.deletions=[q],W.flags|=16):te.push(q)}}function d(W,q){if(!a)return null;for(;q!==null;)l(W,q),q=q.sibling;return null}function h(W){for(var q=new Map;W!==null;)W.key!==null?q.set(W.key,W):q.set(W.index,W),W=W.sibling;return q}function x(W,q){return W=xa(W,q),W.index=0,W.sibling=null,W}function w(W,q,te){return W.index=te,a?(te=W.alternate,te!==null?(te=te.index,te<q?(W.flags|=67108866,q):te):(W.flags|=67108866,q)):(W.flags|=1048576,q)}function _(W){return a&&W.alternate===null&&(W.flags|=67108866),W}function N(W,q,te,fe){return q===null||q.tag!==6?(q=Lm(te,W.mode,fe),q.return=W,q):(q=x(q,te),q.return=W,q)}function B(W,q,te,fe){var He=te.type;return He===S?de(W,q,te.props.children,fe,te.key):q!==null&&(q.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===I&&HS(He)===q.type)?(q=x(q,te.props),fu(q,te),q.return=W,q):(q=ef(te.type,te.key,te.props,null,W.mode,fe),fu(q,te),q.return=W,q)}function ne(W,q,te,fe){return q===null||q.tag!==4||q.stateNode.containerInfo!==te.containerInfo||q.stateNode.implementation!==te.implementation?(q=zm(te,W.mode,fe),q.return=W,q):(q=x(q,te.children||[]),q.return=W,q)}function de(W,q,te,fe,He){return q===null||q.tag!==7?(q=os(te,W.mode,fe,He),q.return=W,q):(q=x(q,te),q.return=W,q)}function pe(W,q,te){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=Lm(""+q,W.mode,te),q.return=W,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case y:return te=ef(q.type,q.key,q.props,null,W.mode,te),fu(te,q),te.return=W,te;case b:return q=zm(q,W.mode,te),q.return=W,q;case I:var fe=q._init;return q=fe(q._payload),pe(W,q,te)}if(K(q)||Q(q))return q=os(q,W.mode,te,null),q.return=W,q;if(typeof q.then=="function")return pe(W,yf(q),te);if(q.$$typeof===E)return pe(W,af(W,q),te);xf(W,q)}return null}function ie(W,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(W,q,""+te,fe);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case y:return te.key===He?B(W,q,te,fe):null;case b:return te.key===He?ne(W,q,te,fe):null;case I:return He=te._init,te=He(te._payload),ie(W,q,te,fe)}if(K(te)||Q(te))return He!==null?null:de(W,q,te,fe,null);if(typeof te.then=="function")return ie(W,q,yf(te),fe);if(te.$$typeof===E)return ie(W,q,af(W,te),fe);xf(W,te)}return null}function ae(W,q,te,fe,He){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return W=W.get(te)||null,N(q,W,""+fe,He);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case y:return W=W.get(fe.key===null?te:fe.key)||null,B(q,W,fe,He);case b:return W=W.get(fe.key===null?te:fe.key)||null,ne(q,W,fe,He);case I:var Ct=fe._init;return fe=Ct(fe._payload),ae(W,q,te,fe,He)}if(K(fe)||Q(fe))return W=W.get(te)||null,de(q,W,fe,He,null);if(typeof fe.then=="function")return ae(W,q,te,yf(fe),He);if(fe.$$typeof===E)return ae(W,q,te,af(q,fe),He);xf(q,fe)}return null}function ut(W,q,te,fe){for(var He=null,Ct=null,et=q,lt=q=0,Wn=null;et!==null&&lt<te.length;lt++){et.index>lt?(Wn=et,et=null):Wn=et.sibling;var Bt=ie(W,et,te[lt],fe);if(Bt===null){et===null&&(et=Wn);break}a&&et&&Bt.alternate===null&&l(W,et),q=w(Bt,q,lt),Ct===null?He=Bt:Ct.sibling=Bt,Ct=Bt,et=Wn}if(lt===te.length)return d(W,et),Ft&&ls(W,lt),He;if(et===null){for(;lt<te.length;lt++)et=pe(W,te[lt],fe),et!==null&&(q=w(et,q,lt),Ct===null?He=et:Ct.sibling=et,Ct=et);return Ft&&ls(W,lt),He}for(et=h(et);lt<te.length;lt++)Wn=ae(et,W,lt,te[lt],fe),Wn!==null&&(a&&Wn.alternate!==null&&et.delete(Wn.key===null?lt:Wn.key),q=w(Wn,q,lt),Ct===null?He=Wn:Ct.sibling=Wn,Ct=Wn);return a&&et.forEach(function(_o){return l(W,_o)}),Ft&&ls(W,lt),He}function at(W,q,te,fe){if(te==null)throw Error(r(151));for(var He=null,Ct=null,et=q,lt=q=0,Wn=null,Bt=te.next();et!==null&&!Bt.done;lt++,Bt=te.next()){et.index>lt?(Wn=et,et=null):Wn=et.sibling;var _o=ie(W,et,Bt.value,fe);if(_o===null){et===null&&(et=Wn);break}a&&et&&_o.alternate===null&&l(W,et),q=w(_o,q,lt),Ct===null?He=_o:Ct.sibling=_o,Ct=_o,et=Wn}if(Bt.done)return d(W,et),Ft&&ls(W,lt),He;if(et===null){for(;!Bt.done;lt++,Bt=te.next())Bt=pe(W,Bt.value,fe),Bt!==null&&(q=w(Bt,q,lt),Ct===null?He=Bt:Ct.sibling=Bt,Ct=Bt);return Ft&&ls(W,lt),He}for(et=h(et);!Bt.done;lt++,Bt=te.next())Bt=ae(et,W,lt,Bt.value,fe),Bt!==null&&(a&&Bt.alternate!==null&&et.delete(Bt.key===null?lt:Bt.key),q=w(Bt,q,lt),Ct===null?He=Bt:Ct.sibling=Bt,Ct=Bt);return a&&et.forEach(function(h3){return l(W,h3)}),Ft&&ls(W,lt),He}function tn(W,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(W,q.sibling),fe=x(q,te.props.children),fe.return=W,W=fe;break e}}else if(q.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===I&&HS(He)===q.type){d(W,q.sibling),fe=x(q,te.props),fu(fe,te),fe.return=W,W=fe;break e}d(W,q);break}else l(W,q);q=q.sibling}te.type===S?(fe=os(te.props.children,W.mode,fe,te.key),fe.return=W,W=fe):(fe=ef(te.type,te.key,te.props,null,W.mode,fe),fu(fe,te),fe.return=W,W=fe)}return _(W);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(W,q.sibling),fe=x(q,te.children||[]),fe.return=W,W=fe;break e}else{d(W,q);break}else l(W,q);q=q.sibling}fe=zm(te,W.mode,fe),fe.return=W,W=fe}return _(W);case I:return He=te._init,te=He(te._payload),tn(W,q,te,fe)}if(K(te))return ut(W,q,te,fe);if(Q(te)){if(He=Q(te),typeof He!="function")throw Error(r(150));return te=He.call(te),at(W,q,te,fe)}if(typeof te.then=="function")return tn(W,q,yf(te),fe);if(te.$$typeof===E)return tn(W,q,af(W,te),fe);xf(W,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,q!==null&&q.tag===6?(d(W,q.sibling),fe=x(q,te),fe.return=W,W=fe):(d(W,q),fe=Lm(te,W.mode,fe),fe.return=W,W=fe),_(W)):d(W,q)}return function(W,q,te,fe){try{du=0;var He=tn(W,q,te,fe);return Rl=null,He}catch(et){if(et===nu||et===sf)throw et;var Ct=Lr(29,et,null,W.mode);return Ct.lanes=fe,Ct.return=W,Ct}finally{}}}var Dl=qS(!0),GS=qS(!1),ai=U(null),qi=null;function mo(a){var l=a.alternate;ee(Fn,Fn.current&1),ee(ai,a),qi===null&&(l===null||jl.current!==null||l.memoizedState!==null)&&(qi=a)}function QS(a){if(a.tag===22){if(ee(Fn,Fn.current),ee(ai,a),qi===null){var l=a.alternate;l!==null&&l.memoizedState!==null&&(qi=a)}}else go()}function go(){ee(Fn,Fn.current),ee(ai,ai.current)}function Ea(a){X(ai),qi===a&&(qi=null),X(Fn)}var Fn=U(0);function bf(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==="$?"||ov(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 vg(a,l,d,h){l=a.memoizedState,d=d(h,l),d=d==null?l:m({},l,d),a.memoizedState=d,a.lanes===0&&(a.updateQueue.baseState=d)}var yg={enqueueSetState:function(a,l,d){a=a._reactInternals;var h=Br(),x=fo(h);x.payload=l,d!=null&&(x.callback=d),l=ho(a,x,h),l!==null&&(Vr(l,a,h),iu(l,a,h))},enqueueReplaceState:function(a,l,d){a=a._reactInternals;var h=Br(),x=fo(h);x.tag=1,x.payload=l,d!=null&&(x.callback=d),l=ho(a,x,h),l!==null&&(Vr(l,a,h),iu(l,a,h))},enqueueForceUpdate:function(a,l){a=a._reactInternals;var d=Br(),h=fo(d);h.tag=2,l!=null&&(h.callback=l),l=ho(a,h,d),l!==null&&(Vr(l,a,d),iu(l,a,d))}};function WS(a,l,d,h,x,w,_){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(h,w,_):l.prototype&&l.prototype.isPureReactComponent?!Wc(d,h)||!Wc(x,w):!0}function YS(a,l,d,h){a=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,h),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,h),l.state!==a&&yg.enqueueReplaceState(l,l.state,null)}function ms(a,l){var d=l;if("ref"in l){d={};for(var h in l)h!=="ref"&&(d[h]=l[h])}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 Sf=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 KS(a){Sf(a)}function XS(a){console.error(a)}function ZS(a){Sf(a)}function wf(a,l){try{var d=a.onUncaughtError;d(l.value,{componentStack:l.stack})}catch(h){setTimeout(function(){throw h})}}function JS(a,l,d){try{var h=a.onCaughtError;h(d.value,{componentStack:d.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function xg(a,l,d){return d=fo(d),d.tag=3,d.payload={element:null},d.callback=function(){wf(a,l)},d}function ew(a){return a=fo(a),a.tag=3,a}function tw(a,l,d,h){var x=d.type.getDerivedStateFromError;if(typeof x=="function"){var w=h.value;a.payload=function(){return x(w)},a.callback=function(){JS(l,d,h)}}var _=d.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(a.callback=function(){JS(l,d,h),typeof x!="function"&&(wo===null?wo=new Set([this]):wo.add(this));var N=h.stack;this.componentDidCatch(h.value,{componentStack:N!==null?N:""})})}function hP(a,l,d,h,x){if(d.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(l=d.alternate,l!==null&&Jc(l,d,x,!0),d=ai.current,d!==null){switch(d.tag){case 13:return qi===null?Fg():d.alternate===null&&An===0&&(An=3),d.flags&=-257,d.flags|=65536,d.lanes=x,h===Wm?d.flags|=16384:(l=d.updateQueue,l===null?d.updateQueue=new Set([h]):l.add(h),qg(a,h,x)),!1;case 22:return d.flags|=65536,h===Wm?d.flags|=16384:(l=d.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([h])},d.updateQueue=l):(d=l.retryQueue,d===null?l.retryQueue=new Set([h]):d.add(h)),qg(a,h,x)),!1}throw Error(r(435,d.tag))}return qg(a,h,x),Fg(),!1}if(Ft)return l=ai.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=x,h!==Bm&&(a=Error(r(422),{cause:h}),Zc(ti(a,d)))):(h!==Bm&&(l=Error(r(423),{cause:h}),Zc(ti(l,d))),a=a.current.alternate,a.flags|=65536,x&=-x,a.lanes|=x,h=ti(h,d),x=xg(a.stateNode,h,x),Xm(a,x),An!==4&&(An=2)),!1;var w=Error(r(520),{cause:h});if(w=ti(w,d),xu===null?xu=[w]:xu.push(w),An!==4&&(An=2),l===null)return!0;h=ti(h,d),d=l;do{switch(d.tag){case 3:return d.flags|=65536,a=x&-x,d.lanes|=a,a=xg(d.stateNode,h,a),Xm(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"&&(wo===null||!wo.has(w))))return d.flags|=65536,x&=-x,d.lanes|=x,x=ew(x),tw(x,a,d,h),Xm(d,x),!1}d=d.return}while(d!==null);return!1}var nw=Error(r(461)),Gn=!1;function Kn(a,l,d,h){l.child=a===null?GS(l,null,d,h):Dl(l,a.child,d,h)}function rw(a,l,d,h,x){d=d.render;var w=l.ref;if("ref"in h){var _={};for(var N in h)N!=="ref"&&(_[N]=h[N])}else _=h;return fs(l),h=ng(a,l,d,_,w,x),N=rg(),a!==null&&!Gn?(ig(a,l,x),Ta(a,l,x)):(Ft&&N&&$m(l),l.flags|=1,Kn(a,l,h,x),l.child)}function iw(a,l,d,h,x){if(a===null){var w=d.type;return typeof w=="function"&&!Im(w)&&w.defaultProps===void 0&&d.compare===null?(l.tag=15,l.type=w,aw(a,l,w,h,x)):(a=ef(d.type,null,h,l,l.mode,x),a.ref=l.ref,a.return=l,l.child=a)}if(w=a.child,!Rg(a,x)){var _=w.memoizedProps;if(d=d.compare,d=d!==null?d:Wc,d(_,h)&&a.ref===l.ref)return Ta(a,l,x)}return l.flags|=1,a=xa(w,h),a.ref=l.ref,a.return=l,l.child=a}function aw(a,l,d,h,x){if(a!==null){var w=a.memoizedProps;if(Wc(w,h)&&a.ref===l.ref)if(Gn=!1,l.pendingProps=h=w,Rg(a,x))(a.flags&131072)!==0&&(Gn=!0);else return l.lanes=a.lanes,Ta(a,l,x)}return bg(a,l,d,h,x)}function ow(a,l,d){var h=l.pendingProps,x=h.children,w=a!==null?a.memoizedState:null;if(h.mode==="hidden"){if((l.flags&128)!==0){if(h=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&~h}else l.childLanes=0,l.child=null;return sw(a,l,h,d)}if((d&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},a!==null&&of(l,w!==null?w.cachePool:null),w!==null?aS(l,w):Jm(),QS(l);else return l.lanes=l.childLanes=536870912,sw(a,l,w!==null?w.baseLanes|d:d,d)}else w!==null?(of(l,w.cachePool),aS(l,w),go(),l.memoizedState=null):(a!==null&&of(l,null),Jm(),go());return Kn(a,l,x,d),l.child}function sw(a,l,d,h){var x=Qm();return x=x===null?null:{parent:Vn._currentValue,pool:x},l.memoizedState={baseLanes:d,cachePool:x},a!==null&&of(l,null),Jm(),QS(l),a!==null&&Jc(a,l,h,!0),null}function jf(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 bg(a,l,d,h,x){return fs(l),d=ng(a,l,d,h,void 0,x),h=rg(),a!==null&&!Gn?(ig(a,l,x),Ta(a,l,x)):(Ft&&h&&$m(l),l.flags|=1,Kn(a,l,d,x),l.child)}function lw(a,l,d,h,x,w){return fs(l),l.updateQueue=null,d=sS(l,h,d,x),oS(a),h=rg(),a!==null&&!Gn?(ig(a,l,w),Ta(a,l,w)):(Ft&&h&&$m(l),l.flags|=1,Kn(a,l,d,w),l.child)}function cw(a,l,d,h,x){if(fs(l),l.stateNode===null){var w=yl,_=d.contextType;typeof _=="object"&&_!==null&&(w=rr(_)),w=new d(h,w),l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=yg,l.stateNode=w,w._reactInternals=l,w=l.stateNode,w.props=h,w.state=l.memoizedState,w.refs={},Ym(l),_=d.contextType,w.context=typeof _=="object"&&_!==null?rr(_):yl,w.state=l.memoizedState,_=d.getDerivedStateFromProps,typeof _=="function"&&(vg(l,d,_,h),w.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(_=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),_!==w.state&&yg.enqueueReplaceState(w,w.state,null),ou(l,h,w,x),au(),w.state=l.memoizedState),typeof w.componentDidMount=="function"&&(l.flags|=4194308),h=!0}else if(a===null){w=l.stateNode;var N=l.memoizedProps,B=ms(d,N);w.props=B;var ne=w.context,de=d.contextType;_=yl,typeof de=="object"&&de!==null&&(_=rr(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!==_)&&YS(l,w,h,_),uo=!1;var ie=l.memoizedState;w.state=ie,ou(l,h,w,x),au(),ne=l.memoizedState,N||ie!==ne||uo?(typeof pe=="function"&&(vg(l,d,pe,h),ne=l.memoizedState),(B=uo||WS(l,d,B,h,ie,ne,_))?(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=h,l.memoizedState=ne),w.props=h,w.state=ne,w.context=_,h=B):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),h=!1)}else{w=l.stateNode,Km(a,l),_=l.memoizedProps,de=ms(d,_),w.props=de,pe=l.pendingProps,ie=w.context,ne=d.contextType,B=yl,typeof ne=="object"&&ne!==null&&(B=rr(ne)),N=d.getDerivedStateFromProps,(ne=typeof N=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(_!==pe||ie!==B)&&YS(l,w,h,B),uo=!1,ie=l.memoizedState,w.state=ie,ou(l,h,w,x),au();var ae=l.memoizedState;_!==pe||ie!==ae||uo||a!==null&&a.dependencies!==null&&rf(a.dependencies)?(typeof N=="function"&&(vg(l,d,N,h),ae=l.memoizedState),(de=uo||WS(l,d,de,h,ie,ae,B)||a!==null&&a.dependencies!==null&&rf(a.dependencies))?(ne||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(h,ae,B),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(h,ae,B)),typeof w.componentDidUpdate=="function"&&(l.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof w.componentDidUpdate!="function"||_===a.memoizedProps&&ie===a.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||_===a.memoizedProps&&ie===a.memoizedState||(l.flags|=1024),l.memoizedProps=h,l.memoizedState=ae),w.props=h,w.state=ae,w.context=B,h=de):(typeof w.componentDidUpdate!="function"||_===a.memoizedProps&&ie===a.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||_===a.memoizedProps&&ie===a.memoizedState||(l.flags|=1024),h=!1)}return w=h,jf(a,l),h=(l.flags&128)!==0,w||h?(w=l.stateNode,d=h&&typeof d.getDerivedStateFromError!="function"?null:w.render(),l.flags|=1,a!==null&&h?(l.child=Dl(l,a.child,null,x),l.child=Dl(l,null,d,x)):Kn(a,l,d,x),l.memoizedState=w.state,a=l.child):a=Ta(a,l,x),a}function uw(a,l,d,h){return Xc(),l.flags|=256,Kn(a,l,d,h),l.child}var Sg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function wg(a){return{baseLanes:a,cachePool:X1()}}function jg(a,l,d){return a=a!==null?a.childLanes&~d:0,l&&(a|=oi),a}function dw(a,l,d){var h=l.pendingProps,x=!1,w=(l.flags&128)!==0,_;if((_=w)||(_=a!==null&&a.memoizedState===null?!1:(Fn.current&2)!==0),_&&(x=!0,l.flags&=-129),_=(l.flags&32)!==0,l.flags&=-33,a===null){if(Ft){if(x?mo(l):go(),Ft){var N=Dn,B;if(B=N){e:{for(B=N,N=Hi;B.nodeType!==8;){if(!N){N=null;break e}if(B=Ri(B.nextSibling),B===null){N=null;break e}}N=B}N!==null?(l.memoizedState={dehydrated:N,treeContext:ss!==null?{id:ba,overflow:Sa}:null,retryLane:536870912,hydrationErrors:null},B=Lr(18,null,null,0),B.stateNode=N,B.return=l,l.child=B,ur=l,Dn=null,B=!0):B=!1}B||us(l)}if(N=l.memoizedState,N!==null&&(N=N.dehydrated,N!==null))return ov(N)?l.lanes=32:l.lanes=536870912,null;Ea(l)}return N=h.children,h=h.fallback,x?(go(),x=l.mode,N=Cf({mode:"hidden",children:N},x),h=os(h,x,d,null),N.return=l,h.return=l,N.sibling=h,l.child=N,x=l.child,x.memoizedState=wg(d),x.childLanes=jg(a,_,d),l.memoizedState=Sg,h):(mo(l),Cg(l,N))}if(B=a.memoizedState,B!==null&&(N=B.dehydrated,N!==null)){if(w)l.flags&256?(mo(l),l.flags&=-257,l=Eg(a,l,d)):l.memoizedState!==null?(go(),l.child=a.child,l.flags|=128,l=null):(go(),x=h.fallback,N=l.mode,h=Cf({mode:"visible",children:h.children},N),x=os(x,N,d,null),x.flags|=2,h.return=l,x.return=l,h.sibling=x,l.child=h,Dl(l,a.child,null,d),h=l.child,h.memoizedState=wg(d),h.childLanes=jg(a,_,d),l.memoizedState=Sg,l=x);else if(mo(l),ov(N)){if(_=N.nextSibling&&N.nextSibling.dataset,_)var ne=_.dgst;_=ne,h=Error(r(419)),h.stack="",h.digest=_,Zc({value:h,source:null,stack:null}),l=Eg(a,l,d)}else if(Gn||Jc(a,l,d,!1),_=(d&a.childLanes)!==0,Gn||_){if(_=fn,_!==null&&(h=d&-d,h=(h&42)!==0?1:es(h),h=(h&(_.suspendedLanes|d))!==0?0:h,h!==0&&h!==B.retryLane))throw B.retryLane=h,vl(a,h),Vr(_,a,h),nw;N.data==="$?"||Fg(),l=Eg(a,l,d)}else N.data==="$?"?(l.flags|=192,l.child=a.child,l=null):(a=B.treeContext,Dn=Ri(N.nextSibling),ur=l,Ft=!0,cs=null,Hi=!1,a!==null&&(ri[ii++]=ba,ri[ii++]=Sa,ri[ii++]=ss,ba=a.id,Sa=a.overflow,ss=l),l=Cg(l,h.children),l.flags|=4096);return l}return x?(go(),x=h.fallback,N=l.mode,B=a.child,ne=B.sibling,h=xa(B,{mode:"hidden",children:h.children}),h.subtreeFlags=B.subtreeFlags&65011712,ne!==null?x=xa(ne,x):(x=os(x,N,d,null),x.flags|=2),x.return=l,h.return=l,h.sibling=x,l.child=h,h=x,x=l.child,N=a.child.memoizedState,N===null?N=wg(d):(B=N.cachePool,B!==null?(ne=Vn._currentValue,B=B.parent!==ne?{parent:ne,pool:ne}:B):B=X1(),N={baseLanes:N.baseLanes|d,cachePool:B}),x.memoizedState=N,x.childLanes=jg(a,_,d),l.memoizedState=Sg,h):(mo(l),d=a.child,a=d.sibling,d=xa(d,{mode:"visible",children:h.children}),d.return=l,d.sibling=null,a!==null&&(_=l.deletions,_===null?(l.deletions=[a],l.flags|=16):_.push(a)),l.child=d,l.memoizedState=null,d)}function Cg(a,l){return l=Cf({mode:"visible",children:l},a.mode),l.return=a,a.child=l}function Cf(a,l){return a=Lr(22,a,null,l),a.lanes=0,a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},a}function Eg(a,l,d){return Dl(l,a.child,null,d),a=Cg(l,l.pendingProps.children),a.flags|=2,l.memoizedState=null,a}function fw(a,l,d){a.lanes|=l;var h=a.alternate;h!==null&&(h.lanes|=l),Fm(a.return,l,d)}function Tg(a,l,d,h,x){var w=a.memoizedState;w===null?a.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:h,tail:d,tailMode:x}:(w.isBackwards=l,w.rendering=null,w.renderingStartTime=0,w.last=h,w.tail=d,w.tailMode=x)}function hw(a,l,d){var h=l.pendingProps,x=h.revealOrder,w=h.tail;if(Kn(a,l,h.children,d),h=Fn.current,(h&2)!==0)h=h&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&&fw(a,d,l);else if(a.tag===19)fw(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}h&=1}switch(ee(Fn,h),x){case"forwards":for(d=l.child,x=null;d!==null;)a=d.alternate,a!==null&&bf(a)===null&&(x=d),d=d.sibling;d=x,d===null?(x=l.child,l.child=null):(x=d.sibling,d.sibling=null),Tg(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&&bf(a)===null){l.child=x;break}a=x.sibling,x.sibling=d,d=x,x=a}Tg(l,!0,d,null,w);break;case"together":Tg(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Ta(a,l,d){if(a!==null&&(l.dependencies=a.dependencies),So|=l.lanes,(d&l.childLanes)===0)if(a!==null){if(Jc(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=xa(a,a.pendingProps),l.child=d,d.return=l;a.sibling!==null;)a=a.sibling,d=d.sibling=xa(a,a.pendingProps),d.return=l;d.sibling=null}return l.child}function Rg(a,l){return(a.lanes&l)!==0?!0:(a=a.dependencies,!!(a!==null&&rf(a)))}function pP(a,l,d){switch(l.tag){case 3:Me(l,l.stateNode.containerInfo),co(l,Vn,a.memoizedState.cache),Xc();break;case 27:case 5:ke(l);break;case 4:Me(l,l.stateNode.containerInfo);break;case 10:co(l,l.type,l.memoizedProps.value);break;case 13:var h=l.memoizedState;if(h!==null)return h.dehydrated!==null?(mo(l),l.flags|=128,null):(d&l.child.childLanes)!==0?dw(a,l,d):(mo(l),a=Ta(a,l,d),a!==null?a.sibling:null);mo(l);break;case 19:var x=(a.flags&128)!==0;if(h=(d&l.childLanes)!==0,h||(Jc(a,l,d,!1),h=(d&l.childLanes)!==0),x){if(h)return hw(a,l,d);l.flags|=128}if(x=l.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),ee(Fn,Fn.current),h)break;return null;case 22:case 23:return l.lanes=0,ow(a,l,d);case 24:co(l,Vn,a.memoizedState.cache)}return Ta(a,l,d)}function pw(a,l,d){if(a!==null)if(a.memoizedProps!==l.pendingProps)Gn=!0;else{if(!Rg(a,d)&&(l.flags&128)===0)return Gn=!1,pP(a,l,d);Gn=(a.flags&131072)!==0}else Gn=!1,Ft&&(l.flags&1048576)!==0&&H1(l,nf,l.index);switch(l.lanes=0,l.tag){case 16:e:{a=l.pendingProps;var h=l.elementType,x=h._init;if(h=x(h._payload),l.type=h,typeof h=="function")Im(h)?(a=ms(h,a),l.tag=1,l=cw(null,l,h,a,d)):(l.tag=0,l=bg(null,l,h,a,d));else{if(h!=null){if(x=h.$$typeof,x===R){l.tag=11,l=rw(null,l,h,a,d);break e}else if(x===M){l.tag=14,l=iw(null,l,h,a,d);break e}}throw l=G(h)||h,Error(r(306,l,""))}}return l;case 0:return bg(a,l,l.type,l.pendingProps,d);case 1:return h=l.type,x=ms(h,l.pendingProps),cw(a,l,h,x,d);case 3:e:{if(Me(l,l.stateNode.containerInfo),a===null)throw Error(r(387));h=l.pendingProps;var w=l.memoizedState;x=w.element,Km(a,l),ou(l,h,null,d);var _=l.memoizedState;if(h=_.cache,co(l,Vn,h),h!==w.cache&&Hm(l,[Vn],d,!0),au(),h=_.element,w.isDehydrated)if(w={element:h,isDehydrated:!1,cache:_.cache},l.updateQueue.baseState=w,l.memoizedState=w,l.flags&256){l=uw(a,l,h,d);break e}else if(h!==x){x=ti(Error(r(424)),l),Zc(x),l=uw(a,l,h,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(Dn=Ri(a.firstChild),ur=l,Ft=!0,cs=null,Hi=!0,d=GS(l,null,h,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling}else{if(Xc(),h===x){l=Ta(a,l,d);break e}Kn(a,l,h,d)}l=l.child}return l;case 26:return jf(a,l),a===null?(d=yj(l.type,null,l.pendingProps,null))?l.memoizedState=d:Ft||(d=l.type,a=l.pendingProps,h=zf(xe.current).createElement(d),h[he]=l,h[Te]=a,Zn(h,d,a),Pt(h),l.stateNode=h):l.memoizedState=yj(l.type,a.memoizedProps,l.pendingProps,a.memoizedState),null;case 27:return ke(l),a===null&&Ft&&(h=l.stateNode=mj(l.type,l.pendingProps,xe.current),ur=l,Hi=!0,x=Dn,Eo(l.type)?(sv=x,Dn=Ri(h.firstChild)):Dn=x),Kn(a,l,l.pendingProps.children,d),jf(a,l),a===null&&(l.flags|=4194304),l.child;case 5:return a===null&&Ft&&((x=h=Dn)&&(h=VP(h,l.type,l.pendingProps,Hi),h!==null?(l.stateNode=h,ur=l,Dn=Ri(h.firstChild),Hi=!1,x=!0):x=!1),x||us(l)),ke(l),x=l.type,w=l.pendingProps,_=a!==null?a.memoizedProps:null,h=w.children,rv(x,w)?h=null:_!==null&&rv(x,_)&&(l.flags|=32),l.memoizedState!==null&&(x=ng(a,l,oP,null,null,d),Du._currentValue=x),jf(a,l),Kn(a,l,h,d),l.child;case 6:return a===null&&Ft&&((a=d=Dn)&&(d=FP(d,l.pendingProps,Hi),d!==null?(l.stateNode=d,ur=l,Dn=null,a=!0):a=!1),a||us(l)),null;case 13:return dw(a,l,d);case 4:return Me(l,l.stateNode.containerInfo),h=l.pendingProps,a===null?l.child=Dl(l,null,h,d):Kn(a,l,h,d),l.child;case 11:return rw(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 h=l.pendingProps,co(l,l.type,h.value),Kn(a,l,h.children,d),l.child;case 9:return x=l.type._context,h=l.pendingProps.children,fs(l),x=rr(x),h=h(x),l.flags|=1,Kn(a,l,h,d),l.child;case 14:return iw(a,l,l.type,l.pendingProps,d);case 15:return aw(a,l,l.type,l.pendingProps,d);case 19:return hw(a,l,d);case 31:return h=l.pendingProps,d=l.mode,h={mode:h.mode,children:h.children},a===null?(d=Cf(h,d),d.ref=l.ref,l.child=d,d.return=l,l=d):(d=xa(a.child,h),d.ref=l.ref,l.child=d,d.return=l,l=d),l;case 22:return ow(a,l,d);case 24:return fs(l),h=rr(Vn),a===null?(x=Qm(),x===null&&(x=fn,w=qm(),x.pooledCache=w,w.refCount++,w!==null&&(x.pooledCacheLanes|=d),x=w),l.memoizedState={parent:h,cache:x},Ym(l),co(l,Vn,x)):((a.lanes&d)!==0&&(Km(a,l),ou(l,null,null,d),au()),x=a.memoizedState,w=l.memoizedState,x.parent!==h?(x={parent:h,cache:h},l.memoizedState=x,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=x),co(l,Vn,h)):(h=w.cache,co(l,Vn,h),h!==x.cache&&Hm(l,[Vn],d,!0))),Kn(a,l,l.pendingProps.children,d),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function Ra(a){a.flags|=4}function mw(a,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!jj(l)){if(l=ai.current,l!==null&&((Mt&4194048)===Mt?qi!==null:(Mt&62914560)!==Mt&&(Mt&536870912)===0||l!==qi))throw ru=Wm,Z1;a.flags|=8192}}function Ef(a,l){l!==null&&(a.flags|=4),a.flags&16384&&(l=a.tag!==22?no():536870912,a.lanes|=l,Pl|=l)}function hu(a,l){if(!Ft)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 h=null;d!==null;)d.alternate!==null&&(h=d),d=d.sibling;h===null?l||a.tail===null?a.tail=null:a.tail.sibling=null:h.sibling=null}}function jn(a){var l=a.alternate!==null&&a.alternate.child===a.child,d=0,h=0;if(l)for(var x=a.child;x!==null;)d|=x.lanes|x.childLanes,h|=x.subtreeFlags&65011712,h|=x.flags&65011712,x.return=a,x=x.sibling;else for(x=a.child;x!==null;)d|=x.lanes|x.childLanes,h|=x.subtreeFlags,h|=x.flags,x.return=a,x=x.sibling;return a.subtreeFlags|=h,a.childLanes=d,l}function mP(a,l,d){var h=l.pendingProps;switch(Um(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,h=null,a!==null&&(h=a.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),ja(Vn),tt(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(a===null||a.child===null)&&(Kc(l)?Ra(l):a===null||a.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Q1())),jn(l),null;case 26:return d=l.memoizedState,a===null?(Ra(l),d!==null?(jn(l),mw(l,d)):(jn(l),l.flags&=-16777217)):d?d!==a.memoizedState?(Ra(l),jn(l),mw(l,d)):(jn(l),l.flags&=-16777217):(a.memoizedProps!==h&&Ra(l),jn(l),l.flags&=-16777217),null;case 27:vt(l),d=xe.current;var x=l.type;if(a!==null&&l.stateNode!=null)a.memoizedProps!==h&&Ra(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return jn(l),null}a=Se.current,Kc(l)?q1(l):(a=mj(x,h,d),l.stateNode=a,Ra(l))}return jn(l),null;case 5:if(vt(l),d=l.type,a!==null&&l.stateNode!=null)a.memoizedProps!==h&&Ra(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return jn(l),null}if(a=Se.current,Kc(l))q1(l);else{switch(x=zf(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 h.is=="string"?x.createElement("select",{is:h.is}):x.createElement("select"),h.multiple?a.multiple=!0:h.size&&(a.size=h.size);break;default:a=typeof h.is=="string"?x.createElement(d,{is:h.is}):x.createElement(d)}}a[he]=l,a[Te]=h;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(Zn(a,d,h),d){case"button":case"input":case"select":case"textarea":a=!!h.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Ra(l)}}return jn(l),l.flags&=-16777217,null;case 6:if(a&&l.stateNode!=null)a.memoizedProps!==h&&Ra(l);else{if(typeof h!="string"&&l.stateNode===null)throw Error(r(166));if(a=xe.current,Kc(l)){if(a=l.stateNode,d=l.memoizedProps,h=null,x=ur,x!==null)switch(x.tag){case 27:case 5:h=x.memoizedProps}a[he]=l,a=!!(a.nodeValue===d||h!==null&&h.suppressHydrationWarning===!0||lj(a.nodeValue,d)),a||us(l)}else a=zf(a).createTextNode(h),a[he]=l,l.stateNode=a}return jn(l),null;case 13:if(h=l.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(x=Kc(l),h!==null&&h.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 Xc(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;jn(l),x=!1}else x=Q1(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=x),x=!0;if(!x)return l.flags&256?(Ea(l),l):(Ea(l),null)}if(Ea(l),(l.flags&128)!==0)return l.lanes=d,l;if(d=h!==null,a=a!==null&&a.memoizedState!==null,d){h=l.child,x=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(x=h.alternate.memoizedState.cachePool.pool);var w=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(w=h.memoizedState.cachePool.pool),w!==x&&(h.flags|=2048)}return d!==a&&d&&(l.child.flags|=8192),Ef(l,l.updateQueue),jn(l),null;case 4:return tt(),a===null&&Zg(l.stateNode.containerInfo),jn(l),null;case 10:return ja(l.type),jn(l),null;case 19:if(X(Fn),x=l.memoizedState,x===null)return jn(l),null;if(h=(l.flags&128)!==0,w=x.rendering,w===null)if(h)hu(x,!1);else{if(An!==0||a!==null&&(a.flags&128)!==0)for(a=l.child;a!==null;){if(w=bf(a),w!==null){for(l.flags|=128,hu(x,!1),a=w.updateQueue,l.updateQueue=a,Ef(l,a),l.subtreeFlags=0,a=d,d=l.child;d!==null;)F1(d,a),d=d.sibling;return ee(Fn,Fn.current&1|2),l.child}a=a.sibling}x.tail!==null&&Ee()>Df&&(l.flags|=128,h=!0,hu(x,!1),l.lanes=4194304)}else{if(!h)if(a=bf(w),a!==null){if(l.flags|=128,h=!0,a=a.updateQueue,l.updateQueue=a,Ef(l,a),hu(x,!0),x.tail===null&&x.tailMode==="hidden"&&!w.alternate&&!Ft)return jn(l),null}else 2*Ee()-x.renderingStartTime>Df&&d!==536870912&&(l.flags|=128,h=!0,hu(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=Ee(),l.sibling=null,a=Fn.current,ee(Fn,h?a&1|2:a&1),l):(jn(l),null);case 22:case 23:return Ea(l),eg(),h=l.memoizedState!==null,a!==null?a.memoizedState!==null!==h&&(l.flags|=8192):h&&(l.flags|=8192),h?(d&536870912)!==0&&(l.flags&128)===0&&(jn(l),l.subtreeFlags&6&&(l.flags|=8192)):jn(l),d=l.updateQueue,d!==null&&Ef(l,d.retryQueue),d=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==d&&(l.flags|=2048),a!==null&&X(hs),null;case 24:return d=null,a!==null&&(d=a.memoizedState.cache),l.memoizedState.cache!==d&&(l.flags|=2048),ja(Vn),jn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function gP(a,l){switch(Um(l),l.tag){case 1:return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 3:return ja(Vn),tt(),a=l.flags,(a&65536)!==0&&(a&128)===0?(l.flags=a&-65537|128,l):null;case 26:case 27:case 5:return vt(l),null;case 13:if(Ea(l),a=l.memoizedState,a!==null&&a.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Xc()}return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 19:return X(Fn),null;case 4:return tt(),null;case 10:return ja(l.type),null;case 22:case 23:return Ea(l),eg(),a!==null&&X(hs),a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 24:return ja(Vn),null;case 25:return null;default:return null}}function gw(a,l){switch(Um(l),l.tag){case 3:ja(Vn),tt();break;case 26:case 27:case 5:vt(l);break;case 4:tt();break;case 13:Ea(l);break;case 19:X(Fn);break;case 10:ja(l.type);break;case 22:case 23:Ea(l),eg(),a!==null&&X(hs);break;case 24:ja(Vn)}}function pu(a,l){try{var d=l.updateQueue,h=d!==null?d.lastEffect:null;if(h!==null){var x=h.next;d=x;do{if((d.tag&a)===a){h=void 0;var w=d.create,_=d.inst;h=w(),_.destroy=h}d=d.next}while(d!==x)}}catch(N){rn(l,l.return,N)}}function vo(a,l,d){try{var h=l.updateQueue,x=h!==null?h.lastEffect:null;if(x!==null){var w=x.next;h=w;do{if((h.tag&a)===a){var _=h.inst,N=_.destroy;if(N!==void 0){_.destroy=void 0,x=l;var B=d,ne=N;try{ne()}catch(de){rn(x,B,de)}}}h=h.next}while(h!==w)}}catch(de){rn(l,l.return,de)}}function vw(a){var l=a.updateQueue;if(l!==null){var d=a.stateNode;try{iS(l,d)}catch(h){rn(a,a.return,h)}}}function yw(a,l,d){d.props=ms(a.type,a.memoizedProps),d.state=a.memoizedState;try{d.componentWillUnmount()}catch(h){rn(a,l,h)}}function mu(a,l){try{var d=a.ref;if(d!==null){switch(a.tag){case 26:case 27:case 5:var h=a.stateNode;break;case 30:h=a.stateNode;break;default:h=a.stateNode}typeof d=="function"?a.refCleanup=d(h):d.current=h}}catch(x){rn(a,l,x)}}function Gi(a,l){var d=a.ref,h=a.refCleanup;if(d!==null)if(typeof h=="function")try{h()}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 xw(a){var l=a.type,d=a.memoizedProps,h=a.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":d.autoFocus&&h.focus();break e;case"img":d.src?h.src=d.src:d.srcSet&&(h.srcset=d.srcSet)}}catch(x){rn(a,a.return,x)}}function Dg(a,l,d){try{var h=a.stateNode;LP(h,a.type,d,l),h[Te]=l}catch(x){rn(a,a.return,x)}}function bw(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Eo(a.type)||a.tag===4}function Ag(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||bw(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&&Eo(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 _g(a,l,d){var h=a.tag;if(h===5||h===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(h!==4&&(h===27&&Eo(a.type)&&(d=a.stateNode,l=null),a=a.child,a!==null))for(_g(a,l,d),a=a.sibling;a!==null;)_g(a,l,d),a=a.sibling}function Tf(a,l,d){var h=a.tag;if(h===5||h===6)a=a.stateNode,l?d.insertBefore(a,l):d.appendChild(a);else if(h!==4&&(h===27&&Eo(a.type)&&(d=a.stateNode),a=a.child,a!==null))for(Tf(a,l,d),a=a.sibling;a!==null;)Tf(a,l,d),a=a.sibling}function Sw(a){var l=a.stateNode,d=a.memoizedProps;try{for(var h=a.type,x=l.attributes;x.length;)l.removeAttributeNode(x[0]);Zn(l,h,d),l[he]=a,l[Te]=d}catch(w){rn(a,a.return,w)}}var Da=!1,Pn=!1,kg=!1,ww=typeof WeakSet=="function"?WeakSet:Set,Qn=null;function vP(a,l){if(a=a.containerInfo,tv=Hf,a=N1(a),Am(a)){if("selectionStart"in a)var d={start:a.selectionStart,end:a.selectionEnd};else e:{d=(d=a.ownerDocument)&&d.defaultView||window;var h=d.getSelection&&d.getSelection();if(h&&h.rangeCount!==0){d=h.anchorNode;var x=h.anchorOffset,w=h.focusNode;h=h.focusOffset;try{d.nodeType,w.nodeType}catch{d=null;break e}var _=0,N=-1,B=-1,ne=0,de=0,pe=a,ie=null;t:for(;;){for(var ae;pe!==d||x!==0&&pe.nodeType!==3||(N=_+x),pe!==w||h!==0&&pe.nodeType!==3||(B=_+h),pe.nodeType===3&&(_+=pe.nodeValue.length),(ae=pe.firstChild)!==null;)ie=pe,pe=ae;for(;;){if(pe===a)break t;if(ie===d&&++ne===x&&(N=_),ie===w&&++de===h&&(B=_),(ae=pe.nextSibling)!==null)break;pe=ie,ie=pe.parentNode}pe=ae}d=N===-1||B===-1?null:{start:N,end:B}}else d=null}d=d||{start:0,end:0}}else d=null;for(nv={focusedElem:a,selectionRange:d},Hf=!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,h=d.stateNode;try{var ut=ms(d.type,x,d.elementType===d.type);a=h.getSnapshotBeforeUpdate(ut,w),h.__reactInternalSnapshotBeforeUpdate=a}catch(at){rn(d,d.return,at)}}break;case 3:if((a&1024)!==0){if(a=l.stateNode.containerInfo,d=a.nodeType,d===9)av(a);else if(d===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":av(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 jw(a,l,d){var h=d.flags;switch(d.tag){case 0:case 11:case 15:yo(a,d),h&4&&pu(5,d);break;case 1:if(yo(a,d),h&4)if(a=d.stateNode,l===null)try{a.componentDidMount()}catch(_){rn(d,d.return,_)}else{var x=ms(d.type,l.memoizedProps);l=l.memoizedState;try{a.componentDidUpdate(x,l,a.__reactInternalSnapshotBeforeUpdate)}catch(_){rn(d,d.return,_)}}h&64&&vw(d),h&512&&mu(d,d.return);break;case 3:if(yo(a,d),h&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{iS(a,l)}catch(_){rn(d,d.return,_)}}break;case 27:l===null&&h&4&&Sw(d);case 26:case 5:yo(a,d),l===null&&h&4&&xw(d),h&512&&mu(d,d.return);break;case 12:yo(a,d);break;case 13:yo(a,d),h&4&&Tw(a,d),h&64&&(a=d.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(d=TP.bind(null,d),HP(a,d))));break;case 22:if(h=d.memoizedState!==null||Da,!h){l=l!==null&&l.memoizedState!==null||Pn,x=Da;var w=Pn;Da=h,(Pn=l)&&!w?xo(a,d,(d.subtreeFlags&8772)!==0):yo(a,d),Da=x,Pn=w}break;case 30:break;default:yo(a,d)}}function Cw(a){var l=a.alternate;l!==null&&(a.alternate=null,Cw(l)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(l=a.stateNode,l!==null&&Ke(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 bn=null,Cr=!1;function Aa(a,l,d){for(d=d.child;d!==null;)Ew(a,l,d),d=d.sibling}function Ew(a,l,d){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(yt,d)}catch{}switch(d.tag){case 26:Pn||Gi(d,l),Aa(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 h=bn,x=Cr;Eo(d.type)&&(bn=d.stateNode,Cr=!1),Aa(a,l,d),Cu(d.stateNode),bn=h,Cr=x;break;case 5:Pn||Gi(d,l);case 6:if(h=bn,x=Cr,bn=null,Aa(a,l,d),bn=h,Cr=x,bn!==null)if(Cr)try{(bn.nodeType===9?bn.body:bn.nodeName==="HTML"?bn.ownerDocument.body:bn).removeChild(d.stateNode)}catch(w){rn(d,l,w)}else try{bn.removeChild(d.stateNode)}catch(w){rn(d,l,w)}break;case 18:bn!==null&&(Cr?(a=bn,hj(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,d.stateNode),Pu(a)):hj(bn,d.stateNode));break;case 4:h=bn,x=Cr,bn=d.stateNode.containerInfo,Cr=!0,Aa(a,l,d),bn=h,Cr=x;break;case 0:case 11:case 14:case 15:Pn||vo(2,d,l),Pn||vo(4,d,l),Aa(a,l,d);break;case 1:Pn||(Gi(d,l),h=d.stateNode,typeof h.componentWillUnmount=="function"&&yw(d,l,h)),Aa(a,l,d);break;case 21:Aa(a,l,d);break;case 22:Pn=(h=Pn)||d.memoizedState!==null,Aa(a,l,d),Pn=h;break;default:Aa(a,l,d)}}function Tw(a,l){if(l.memoizedState===null&&(a=l.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Pu(a)}catch(d){rn(l,l.return,d)}}function yP(a){switch(a.tag){case 13:case 19:var l=a.stateNode;return l===null&&(l=a.stateNode=new ww),l;case 22:return a=a.stateNode,l=a._retryCache,l===null&&(l=a._retryCache=new ww),l;default:throw Error(r(435,a.tag))}}function Pg(a,l){var d=yP(a);l.forEach(function(h){var x=RP.bind(null,a,h);d.has(h)||(d.add(h),h.then(x,x))})}function zr(a,l){var d=l.deletions;if(d!==null)for(var h=0;h<d.length;h++){var x=d[h],w=a,_=l,N=_;e:for(;N!==null;){switch(N.tag){case 27:if(Eo(N.type)){bn=N.stateNode,Cr=!1;break e}break;case 5:bn=N.stateNode,Cr=!1;break e;case 3:case 4:bn=N.stateNode.containerInfo,Cr=!0;break e}N=N.return}if(bn===null)throw Error(r(160));Ew(w,_,x),bn=null,Cr=!1,w=x.alternate,w!==null&&(w.return=null),x.return=null}if(l.subtreeFlags&13878)for(l=l.child;l!==null;)Rw(l,a),l=l.sibling}var Ti=null;function Rw(a,l){var d=a.alternate,h=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:zr(l,a),$r(a),h&4&&(vo(3,a,a.return),pu(3,a),vo(5,a,a.return));break;case 1:zr(l,a),$r(a),h&512&&(Pn||d===null||Gi(d,d.return)),h&64&&Da&&(a=a.updateQueue,a!==null&&(h=a.callbacks,h!==null&&(d=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=d===null?h:d.concat(h))));break;case 26:var x=Ti;if(zr(l,a),$r(a),h&512&&(Pn||d===null||Gi(d,d.return)),h&4){var w=d!==null?d.memoizedState:null;if(h=a.memoizedState,d===null)if(h===null)if(a.stateNode===null){e:{h=a.type,d=a.memoizedProps,x=x.ownerDocument||x;t:switch(h){case"title":w=x.getElementsByTagName("title")[0],(!w||w[it]||w[he]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=x.createElement(h),x.head.insertBefore(w,x.querySelector("head > title"))),Zn(w,h,d),w[he]=a,Pt(w),h=w;break e;case"link":var _=Sj("link","href",x).get(h+(d.href||""));if(_){for(var N=0;N<_.length;N++)if(w=_[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)){_.splice(N,1);break t}}w=x.createElement(h),Zn(w,h,d),x.head.appendChild(w);break;case"meta":if(_=Sj("meta","content",x).get(h+(d.content||""))){for(N=0;N<_.length;N++)if(w=_[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)){_.splice(N,1);break t}}w=x.createElement(h),Zn(w,h,d),x.head.appendChild(w);break;default:throw Error(r(468,h))}w[he]=a,Pt(w),h=w}a.stateNode=h}else wj(x,a.type,a.stateNode);else a.stateNode=bj(x,h,a.memoizedProps);else w!==h?(w===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):w.count--,h===null?wj(x,a.type,a.stateNode):bj(x,h,a.memoizedProps)):h===null&&a.stateNode!==null&&Dg(a,a.memoizedProps,d.memoizedProps)}break;case 27:zr(l,a),$r(a),h&512&&(Pn||d===null||Gi(d,d.return)),d!==null&&h&4&&Dg(a,a.memoizedProps,d.memoizedProps);break;case 5:if(zr(l,a),$r(a),h&512&&(Pn||d===null||Gi(d,d.return)),a.flags&32){x=a.stateNode;try{ul(x,"")}catch(ae){rn(a,a.return,ae)}}h&4&&a.stateNode!=null&&(x=a.memoizedProps,Dg(a,x,d!==null?d.memoizedProps:x)),h&1024&&(kg=!0);break;case 6:if(zr(l,a),$r(a),h&4){if(a.stateNode===null)throw Error(r(162));h=a.memoizedProps,d=a.stateNode;try{d.nodeValue=h}catch(ae){rn(a,a.return,ae)}}break;case 3:if(Bf=null,x=Ti,Ti=$f(l.containerInfo),zr(l,a),Ti=x,$r(a),h&4&&d!==null&&d.memoizedState.isDehydrated)try{Pu(l.containerInfo)}catch(ae){rn(a,a.return,ae)}kg&&(kg=!1,Dw(a));break;case 4:h=Ti,Ti=$f(a.stateNode.containerInfo),zr(l,a),$r(a),Ti=h;break;case 12:zr(l,a),$r(a);break;case 13:zr(l,a),$r(a),a.child.flags&8192&&a.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(zg=Ee()),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Pg(a,h)));break;case 22:x=a.memoizedState!==null;var B=d!==null&&d.memoizedState!==null,ne=Da,de=Pn;if(Da=ne||x,Pn=de||B,zr(l,a),Pn=de,Da=ne,$r(a),h&8192)e:for(l=a.stateNode,l._visibility=x?l._visibility&-2:l._visibility|1,x&&(d===null||B||Da||Pn||gs(a)),d=null,l=a;;){if(l.tag===5||l.tag===26){if(d===null){B=d=l;try{if(w=B.stateNode,x)_=w.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{N=B.stateNode;var pe=B.memoizedProps.style,ie=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;N.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(ae){rn(B,B.return,ae)}}}else if(l.tag===6){if(d===null){B=l;try{B.stateNode.nodeValue=x?"":B.memoizedProps}catch(ae){rn(B,B.return,ae)}}}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}h&4&&(h=a.updateQueue,h!==null&&(d=h.retryQueue,d!==null&&(h.retryQueue=null,Pg(a,d))));break;case 19:zr(l,a),$r(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Pg(a,h)));break;case 30:break;case 21:break;default:zr(l,a),$r(a)}}function $r(a){var l=a.flags;if(l&2){try{for(var d,h=a.return;h!==null;){if(bw(h)){d=h;break}h=h.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var x=d.stateNode,w=Ag(a);Tf(a,w,x);break;case 5:var _=d.stateNode;d.flags&32&&(ul(_,""),d.flags&=-33);var N=Ag(a);Tf(a,N,_);break;case 3:case 4:var B=d.stateNode.containerInfo,ne=Ag(a);_g(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 Dw(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var l=a;Dw(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),a=a.sibling}}function yo(a,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)jw(a,l.alternate,l),l=l.sibling}function gs(a){for(a=a.child;a!==null;){var l=a;switch(l.tag){case 0:case 11:case 14:case 15:vo(4,l,l.return),gs(l);break;case 1:Gi(l,l.return);var d=l.stateNode;typeof d.componentWillUnmount=="function"&&yw(l,l.return,d),gs(l);break;case 27:Cu(l.stateNode);case 26:case 5:Gi(l,l.return),gs(l);break;case 22:l.memoizedState===null&&gs(l);break;case 30:gs(l);break;default:gs(l)}a=a.sibling}}function xo(a,l,d){for(d=d&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var h=l.alternate,x=a,w=l,_=w.flags;switch(w.tag){case 0:case 11:case 15:xo(x,w,d),pu(4,w);break;case 1:if(xo(x,w,d),h=w,x=h.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(ne){rn(h,h.return,ne)}if(h=w,x=h.updateQueue,x!==null){var N=h.stateNode;try{var B=x.shared.hiddenCallbacks;if(B!==null)for(x.shared.hiddenCallbacks=null,x=0;x<B.length;x++)rS(B[x],N)}catch(ne){rn(h,h.return,ne)}}d&&_&64&&vw(w),mu(w,w.return);break;case 27:Sw(w);case 26:case 5:xo(x,w,d),d&&h===null&&_&4&&xw(w),mu(w,w.return);break;case 12:xo(x,w,d);break;case 13:xo(x,w,d),d&&_&4&&Tw(x,w);break;case 22:w.memoizedState===null&&xo(x,w,d),mu(w,w.return);break;case 30:break;default:xo(x,w,d)}l=l.sibling}}function Ng(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&&eu(d))}function Og(a,l){a=null,l.alternate!==null&&(a=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==a&&(l.refCount++,a!=null&&eu(a))}function Qi(a,l,d,h){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Aw(a,l,d,h),l=l.sibling}function Aw(a,l,d,h){var x=l.flags;switch(l.tag){case 0:case 11:case 15:Qi(a,l,d,h),x&2048&&pu(9,l);break;case 1:Qi(a,l,d,h);break;case 3:Qi(a,l,d,h),x&2048&&(a=null,l.alternate!==null&&(a=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==a&&(l.refCount++,a!=null&&eu(a)));break;case 12:if(x&2048){Qi(a,l,d,h),a=l.stateNode;try{var w=l.memoizedProps,_=w.id,N=w.onPostCommit;typeof N=="function"&&N(_,l.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(B){rn(l,l.return,B)}}else Qi(a,l,d,h);break;case 13:Qi(a,l,d,h);break;case 23:break;case 22:w=l.stateNode,_=l.alternate,l.memoizedState!==null?w._visibility&2?Qi(a,l,d,h):gu(a,l):w._visibility&2?Qi(a,l,d,h):(w._visibility|=2,Al(a,l,d,h,(l.subtreeFlags&10256)!==0)),x&2048&&Ng(_,l);break;case 24:Qi(a,l,d,h),x&2048&&Og(l.alternate,l);break;default:Qi(a,l,d,h)}}function Al(a,l,d,h,x){for(x=x&&(l.subtreeFlags&10256)!==0,l=l.child;l!==null;){var w=a,_=l,N=d,B=h,ne=_.flags;switch(_.tag){case 0:case 11:case 15:Al(w,_,N,B,x),pu(8,_);break;case 23:break;case 22:var de=_.stateNode;_.memoizedState!==null?de._visibility&2?Al(w,_,N,B,x):gu(w,_):(de._visibility|=2,Al(w,_,N,B,x)),x&&ne&2048&&Ng(_.alternate,_);break;case 24:Al(w,_,N,B,x),x&&ne&2048&&Og(_.alternate,_);break;default:Al(w,_,N,B,x)}l=l.sibling}}function gu(a,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var d=a,h=l,x=h.flags;switch(h.tag){case 22:gu(d,h),x&2048&&Ng(h.alternate,h);break;case 24:gu(d,h),x&2048&&Og(h.alternate,h);break;default:gu(d,h)}l=l.sibling}}var vu=8192;function _l(a){if(a.subtreeFlags&vu)for(a=a.child;a!==null;)_w(a),a=a.sibling}function _w(a){switch(a.tag){case 26:_l(a),a.flags&vu&&a.memoizedState!==null&&r3(Ti,a.memoizedState,a.memoizedProps);break;case 5:_l(a);break;case 3:case 4:var l=Ti;Ti=$f(a.stateNode.containerInfo),_l(a),Ti=l;break;case 22:a.memoizedState===null&&(l=a.alternate,l!==null&&l.memoizedState!==null?(l=vu,vu=16777216,_l(a),vu=l):_l(a));break;default:_l(a)}}function kw(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 yu(a){var l=a.deletions;if((a.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var h=l[d];Qn=h,Nw(h,a)}kw(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Pw(a),a=a.sibling}function Pw(a){switch(a.tag){case 0:case 11:case 15:yu(a),a.flags&2048&&vo(9,a,a.return);break;case 3:yu(a);break;case 12:yu(a);break;case 22:var l=a.stateNode;a.memoizedState!==null&&l._visibility&2&&(a.return===null||a.return.tag!==13)?(l._visibility&=-3,Rf(a)):yu(a);break;default:yu(a)}}function Rf(a){var l=a.deletions;if((a.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var h=l[d];Qn=h,Nw(h,a)}kw(a)}for(a=a.child;a!==null;){switch(l=a,l.tag){case 0:case 11:case 15:vo(8,l,l.return),Rf(l);break;case 22:d=l.stateNode,d._visibility&2&&(d._visibility&=-3,Rf(l));break;default:Rf(l)}a=a.sibling}}function Nw(a,l){for(;Qn!==null;){var d=Qn;switch(d.tag){case 0:case 11:case 15:vo(8,d,l);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var h=d.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:eu(d.memoizedState.cache)}if(h=d.child,h!==null)h.return=d,Qn=h;else e:for(d=a;Qn!==null;){h=Qn;var x=h.sibling,w=h.return;if(Cw(h),h===d){Qn=null;break e}if(x!==null){x.return=w,Qn=x;break e}Qn=w}}}var xP={getCacheForType:function(a){var l=rr(Vn),d=l.data.get(a);return d===void 0&&(d=a(),l.data.set(a,d)),d}},bP=typeof WeakMap=="function"?WeakMap:Map,Yt=0,fn=null,Rt=null,Mt=0,Kt=0,Ur=null,bo=!1,kl=!1,Mg=!1,_a=0,An=0,So=0,vs=0,Ig=0,oi=0,Pl=0,xu=null,Er=null,Lg=!1,zg=0,Df=1/0,Af=null,wo=null,Xn=0,jo=null,Nl=null,Ol=0,$g=0,Ug=null,Ow=null,bu=0,Bg=null;function Br(){if((Yt&2)!==0&&Mt!==0)return Mt&-Mt;if(P.T!==null){var a=Sl;return a!==0?a:Wg()}return F()}function Mw(){oi===0&&(oi=(Mt&536870912)===0||Ft?ma():536870912);var a=ai.current;return a!==null&&(a.flags|=32),oi}function Vr(a,l,d){(a===fn&&(Kt===2||Kt===9)||a.cancelPendingCommit!==null)&&(Ml(a,0),Co(a,Mt,oi,!1)),xr(a,d),((Yt&2)===0||a!==fn)&&(a===fn&&((Yt&2)===0&&(vs|=d),An===4&&Co(a,Mt,oi,!1)),Wi(a))}function Iw(a,l,d){if((Yt&6)!==0)throw Error(r(327));var h=!d&&(l&124)===0&&(l&a.expiredLanes)===0||Xr(a,l),x=h?jP(a,l):Hg(a,l,!0),w=h;do{if(x===0){kl&&!h&&Co(a,l,0,!1);break}else{if(d=a.current.alternate,w&&!SP(d)){x=Hg(a,l,!1),w=!1;continue}if(x===2){if(w=l,a.errorRecoveryDisabledLanes&w)var _=0;else _=a.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){l=_;e:{var N=a;x=xu;var B=N.current.memoizedState.isDehydrated;if(B&&(Ml(N,_).flags|=256),_=Hg(N,_,!1),_!==2){if(Mg&&!B){N.errorRecoveryDisabledLanes|=w,vs|=w,x=4;break e}w=Er,Er=x,w!==null&&(Er===null?Er=w:Er.push.apply(Er,w))}x=_}if(w=!1,x!==2)continue}}if(x===1){Ml(a,0),Co(a,l,0,!0);break}e:{switch(h=a,w=x,w){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Co(h,l,oi,!bo);break e;case 2:Er=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(x=zg+300-Ee(),10<x)){if(Co(h,l,oi,!bo),wi(h,0,!0)!==0)break e;h.timeoutHandle=dj(Lw.bind(null,h,d,Er,Af,Lg,l,oi,vs,Pl,bo,w,2,-0,0),x);break e}Lw(h,d,Er,Af,Lg,l,oi,vs,Pl,bo,w,0,-0,0)}}break}while(!0);Wi(a)}function Lw(a,l,d,h,x,w,_,N,B,ne,de,pe,ie,ae){if(a.timeoutHandle=-1,pe=l.subtreeFlags,(pe&8192||(pe&16785408)===16785408)&&(Ru={stylesheets:null,count:0,unsuspend:n3},_w(l),pe=i3(),pe!==null)){a.cancelPendingCommit=pe(Hw.bind(null,a,l,w,d,h,x,_,N,B,de,1,ie,ae)),Co(a,w,_,!ne);return}Hw(a,l,w,d,h,x,_,N,B)}function SP(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 h=0;h<d.length;h++){var x=d[h],w=x.getSnapshot;x=x.value;try{if(!Ir(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 Co(a,l,d,h){l&=~Ig,l&=~vs,a.suspendedLanes|=l,a.pingedLanes&=~l,h&&(a.warmLanes|=l),h=a.expirationTimes;for(var x=l;0<x;){var w=31-kt(x),_=1<<w;h[w]=-1,x&=~_}d!==0&&ga(a,d,l)}function _f(){return(Yt&6)===0?(Su(0),!1):!0}function Vg(){if(Rt!==null){if(Kt===0)var a=Rt.return;else a=Rt,wa=ds=null,ag(a),Rl=null,du=0,a=Rt;for(;a!==null;)gw(a.alternate,a),a=a.return;Rt=null}}function Ml(a,l){var d=a.timeoutHandle;d!==-1&&(a.timeoutHandle=-1,$P(d)),d=a.cancelPendingCommit,d!==null&&(a.cancelPendingCommit=null,d()),Vg(),fn=a,Rt=d=xa(a.current,null),Mt=l,Kt=0,Ur=null,bo=!1,kl=Xr(a,l),Mg=!1,Pl=oi=Ig=vs=So=An=0,Er=xu=null,Lg=!1,(l&8)!==0&&(l|=l&32);var h=a.entangledLanes;if(h!==0)for(a=a.entanglements,h&=l;0<h;){var x=31-kt(h),w=1<<x;l|=a[x],h&=~w}return _a=l,Xd(),d}function zw(a,l){St=null,P.H=vf,l===nu||l===sf?(l=tS(),Kt=3):l===Z1?(l=tS(),Kt=4):Kt=l===nw?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Ur=l,Rt===null&&(An=1,wf(a,ti(l,a.current)))}function $w(){var a=P.H;return P.H=vf,a===null?vf:a}function Uw(){var a=P.A;return P.A=xP,a}function Fg(){An=4,bo||(Mt&4194048)!==Mt&&ai.current!==null||(kl=!0),(So&134217727)===0&&(vs&134217727)===0||fn===null||Co(fn,Mt,oi,!1)}function Hg(a,l,d){var h=Yt;Yt|=2;var x=$w(),w=Uw();(fn!==a||Mt!==l)&&(Af=null,Ml(a,l)),l=!1;var _=An;e:do try{if(Kt!==0&&Rt!==null){var N=Rt,B=Ur;switch(Kt){case 8:Vg(),_=6;break e;case 3:case 2:case 9:case 6:ai.current===null&&(l=!0);var ne=Kt;if(Kt=0,Ur=null,Il(a,N,B,ne),d&&kl){_=0;break e}break;default:ne=Kt,Kt=0,Ur=null,Il(a,N,B,ne)}}wP(),_=An;break}catch(de){zw(a,de)}while(!0);return l&&a.shellSuspendCounter++,wa=ds=null,Yt=h,P.H=x,P.A=w,Rt===null&&(fn=null,Mt=0,Xd()),_}function wP(){for(;Rt!==null;)Bw(Rt)}function jP(a,l){var d=Yt;Yt|=2;var h=$w(),x=Uw();fn!==a||Mt!==l?(Af=null,Df=Ee()+500,Ml(a,l)):kl=Xr(a,l);e:do try{if(Kt!==0&&Rt!==null){l=Rt;var w=Ur;t:switch(Kt){case 1:Kt=0,Ur=null,Il(a,l,w,1);break;case 2:case 9:if(J1(w)){Kt=0,Ur=null,Vw(l);break}l=function(){Kt!==2&&Kt!==9||fn!==a||(Kt=7),Wi(a)},w.then(l,l);break e;case 3:Kt=7;break e;case 4:Kt=5;break e;case 7:J1(w)?(Kt=0,Ur=null,Vw(l)):(Kt=0,Ur=null,Il(a,l,w,7));break;case 5:var _=null;switch(Rt.tag){case 26:_=Rt.memoizedState;case 5:case 27:var N=Rt;if(!_||jj(_)){Kt=0,Ur=null;var B=N.sibling;if(B!==null)Rt=B;else{var ne=N.return;ne!==null?(Rt=ne,kf(ne)):Rt=null}break t}}Kt=0,Ur=null,Il(a,l,w,5);break;case 6:Kt=0,Ur=null,Il(a,l,w,6);break;case 8:Vg(),An=6;break e;default:throw Error(r(462))}}CP();break}catch(de){zw(a,de)}while(!0);return wa=ds=null,P.H=h,P.A=x,Yt=d,Rt!==null?0:(fn=null,Mt=0,Xd(),An)}function CP(){for(;Rt!==null&&!At();)Bw(Rt)}function Bw(a){var l=pw(a.alternate,a,_a);a.memoizedProps=a.pendingProps,l===null?kf(a):Rt=l}function Vw(a){var l=a,d=l.alternate;switch(l.tag){case 15:case 0:l=lw(d,l,l.pendingProps,l.type,void 0,Mt);break;case 11:l=lw(d,l,l.pendingProps,l.type.render,l.ref,Mt);break;case 5:ag(l);default:gw(d,l),l=Rt=F1(l,_a),l=pw(d,l,_a)}a.memoizedProps=a.pendingProps,l===null?kf(a):Rt=l}function Il(a,l,d,h){wa=ds=null,ag(l),Rl=null,du=0;var x=l.return;try{if(hP(a,x,l,d,Mt)){An=1,wf(a,ti(d,a.current)),Rt=null;return}}catch(w){if(x!==null)throw Rt=x,w;An=1,wf(a,ti(d,a.current)),Rt=null;return}l.flags&32768?(Ft||h===1?a=!0:kl||(Mt&536870912)!==0?a=!1:(bo=a=!0,(h===2||h===9||h===3||h===6)&&(h=ai.current,h!==null&&h.tag===13&&(h.flags|=16384))),Fw(l,a)):kf(l)}function kf(a){var l=a;do{if((l.flags&32768)!==0){Fw(l,bo);return}a=l.return;var d=mP(l.alternate,l,_a);if(d!==null){Rt=d;return}if(l=l.sibling,l!==null){Rt=l;return}Rt=l=a}while(l!==null);An===0&&(An=5)}function Fw(a,l){do{var d=gP(a.alternate,a);if(d!==null){d.flags&=32767,Rt=d;return}if(d=a.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!l&&(a=a.sibling,a!==null)){Rt=a;return}Rt=a=d}while(a!==null);An=6,Rt=null}function Hw(a,l,d,h,x,w,_,N,B){a.cancelPendingCommit=null;do Pf();while(Xn!==0);if((Yt&6)!==0)throw Error(r(327));if(l!==null){if(l===a.current)throw Error(r(177));if(w=l.lanes|l.childLanes,w|=Om,qn(a,d,w,_,N,B),a===fn&&(Rt=fn=null,Mt=0),Nl=l,jo=a,Ol=d,$g=w,Ug=x,Ow=h,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,DP(me,function(){return Yw(),null})):(a.callbackNode=null,a.callbackPriority=0),h=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||h){h=P.T,P.T=null,x=L.p,L.p=2,_=Yt,Yt|=4;try{vP(a,l,d)}finally{Yt=_,L.p=x,P.T=h}}Xn=1,qw(),Gw(),Qw()}}function qw(){if(Xn===1){Xn=0;var a=jo,l=Nl,d=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||d){d=P.T,P.T=null;var h=L.p;L.p=2;var x=Yt;Yt|=4;try{Rw(l,a);var w=nv,_=N1(a.containerInfo),N=w.focusedElem,B=w.selectionRange;if(_!==N&&N&&N.ownerDocument&&P1(N.ownerDocument.documentElement,N)){if(B!==null&&Am(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,ie=pe&&pe.defaultView||window;if(ie.getSelection){var ae=ie.getSelection(),ut=N.textContent.length,at=Math.min(B.start,ut),tn=B.end===void 0?at:Math.min(B.end,ut);!ae.extend&&at>tn&&(_=tn,tn=at,at=_);var W=k1(N,at),q=k1(N,tn);if(W&&q&&(ae.rangeCount!==1||ae.anchorNode!==W.node||ae.anchorOffset!==W.offset||ae.focusNode!==q.node||ae.focusOffset!==q.offset)){var te=pe.createRange();te.setStart(W.node,W.offset),ae.removeAllRanges(),at>tn?(ae.addRange(te),ae.extend(q.node,q.offset)):(te.setEnd(q.node,q.offset),ae.addRange(te))}}}}for(pe=[],ae=N;ae=ae.parentNode;)ae.nodeType===1&&pe.push({element:ae,left:ae.scrollLeft,top:ae.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}}Hf=!!tv,nv=tv=null}finally{Yt=x,L.p=h,P.T=d}}a.current=l,Xn=2}}function Gw(){if(Xn===2){Xn=0;var a=jo,l=Nl,d=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||d){d=P.T,P.T=null;var h=L.p;L.p=2;var x=Yt;Yt|=4;try{jw(a,l.alternate,l)}finally{Yt=x,L.p=h,P.T=d}}Xn=3}}function Qw(){if(Xn===4||Xn===3){Xn=0,nn();var a=jo,l=Nl,d=Ol,h=Ow;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Xn=5:(Xn=0,Nl=jo=null,Ww(a,a.pendingLanes));var x=a.pendingLanes;if(x===0&&(wo=null),ts(d),l=l.stateNode,ft&&typeof ft.onCommitFiberRoot=="function")try{ft.onCommitFiberRoot(yt,l,void 0,(l.current.flags&128)===128)}catch{}if(h!==null){l=P.T,x=L.p,L.p=2,P.T=null;try{for(var w=a.onRecoverableError,_=0;_<h.length;_++){var N=h[_];w(N.value,{componentStack:N.stack})}}finally{P.T=l,L.p=x}}(Ol&3)!==0&&Pf(),Wi(a),x=a.pendingLanes,(d&4194090)!==0&&(x&42)!==0?a===Bg?bu++:(bu=0,Bg=a):bu=0,Su(0)}}function Ww(a,l){(a.pooledCacheLanes&=l)===0&&(l=a.pooledCache,l!=null&&(a.pooledCache=null,eu(l)))}function Pf(a){return qw(),Gw(),Qw(),Yw()}function Yw(){if(Xn!==5)return!1;var a=jo,l=$g;$g=0;var d=ts(Ol),h=P.T,x=L.p;try{L.p=32>d?32:d,P.T=null,d=Ug,Ug=null;var w=jo,_=Ol;if(Xn=0,Nl=jo=null,Ol=0,(Yt&6)!==0)throw Error(r(331));var N=Yt;if(Yt|=4,Pw(w.current),Aw(w,w.current,_,d),Yt=N,Su(0,!1),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(yt,w)}catch{}return!0}finally{L.p=x,P.T=h,Ww(a,l)}}function Kw(a,l,d){l=ti(d,l),l=xg(a.stateNode,l,2),a=ho(a,l,2),a!==null&&(xr(a,2),Wi(a))}function rn(a,l,d){if(a.tag===3)Kw(a,a,d);else for(;l!==null;){if(l.tag===3){Kw(l,a,d);break}else if(l.tag===1){var h=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(wo===null||!wo.has(h))){a=ti(d,a),d=ew(2),h=ho(l,d,2),h!==null&&(tw(d,h,l,a),xr(h,2),Wi(h));break}}l=l.return}}function qg(a,l,d){var h=a.pingCache;if(h===null){h=a.pingCache=new bP;var x=new Set;h.set(l,x)}else x=h.get(l),x===void 0&&(x=new Set,h.set(l,x));x.has(d)||(Mg=!0,x.add(d),a=EP.bind(null,a,l,d),l.then(a,a))}function EP(a,l,d){var h=a.pingCache;h!==null&&h.delete(l),a.pingedLanes|=a.suspendedLanes&d,a.warmLanes&=~d,fn===a&&(Mt&d)===d&&(An===4||An===3&&(Mt&62914560)===Mt&&300>Ee()-zg?(Yt&2)===0&&Ml(a,0):Ig|=d,Pl===Mt&&(Pl=0)),Wi(a)}function Xw(a,l){l===0&&(l=no()),a=vl(a,l),a!==null&&(xr(a,l),Wi(a))}function TP(a){var l=a.memoizedState,d=0;l!==null&&(d=l.retryLane),Xw(a,d)}function RP(a,l){var d=0;switch(a.tag){case 13:var h=a.stateNode,x=a.memoizedState;x!==null&&(d=x.retryLane);break;case 19:h=a.stateNode;break;case 22:h=a.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(l),Xw(a,d)}function DP(a,l){return Lt(a,l)}var Nf=null,Ll=null,Gg=!1,Of=!1,Qg=!1,ys=0;function Wi(a){a!==Ll&&a.next===null&&(Ll===null?Nf=Ll=a:Ll=Ll.next=a),Of=!0,Gg||(Gg=!0,_P())}function Su(a,l){if(!Qg&&Of){Qg=!0;do for(var d=!1,h=Nf;h!==null;){if(a!==0){var x=h.pendingLanes;if(x===0)var w=0;else{var _=h.suspendedLanes,N=h.pingedLanes;w=(1<<31-kt(42|a)+1)-1,w&=x&~(_&~N),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(d=!0,tj(h,w))}else w=Mt,w=wi(h,h===fn?w:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(w&3)===0||Xr(h,w)||(d=!0,tj(h,w));h=h.next}while(d);Qg=!1}}function AP(){Zw()}function Zw(){Of=Gg=!1;var a=0;ys!==0&&(zP()&&(a=ys),ys=0);for(var l=Ee(),d=null,h=Nf;h!==null;){var x=h.next,w=Jw(h,l);w===0?(h.next=null,d===null?Nf=x:d.next=x,x===null&&(Ll=d)):(d=h,(a!==0||(w&3)!==0)&&(Of=!0)),h=x}Su(a)}function Jw(a,l){for(var d=a.suspendedLanes,h=a.pingedLanes,x=a.expirationTimes,w=a.pendingLanes&-62914561;0<w;){var _=31-kt(w),N=1<<_,B=x[_];B===-1?((N&d)===0||(N&h)!==0)&&(x[_]=ll(N,l)):B<=l&&(a.expiredLanes|=N),w&=~N}if(l=fn,d=Mt,d=wi(a,a===l?d:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h=a.callbackNode,d===0||a===l&&(Kt===2||Kt===9)||a.cancelPendingCommit!==null)return h!==null&&h!==null&&gt(h),a.callbackNode=null,a.callbackPriority=0;if((d&3)===0||Xr(a,d)){if(l=d&-d,l===a.callbackPriority)return l;switch(h!==null&&gt(h),ts(d)){case 2:case 8:d=Re;break;case 32:d=me;break;case 268435456:d=Pe;break;default:d=me}return h=ej.bind(null,a),d=Lt(d,h),a.callbackPriority=l,a.callbackNode=d,l}return h!==null&&h!==null&&gt(h),a.callbackPriority=2,a.callbackNode=null,2}function ej(a,l){if(Xn!==0&&Xn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var d=a.callbackNode;if(Pf()&&a.callbackNode!==d)return null;var h=Mt;return h=wi(a,a===fn?h:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h===0?null:(Iw(a,h,l),Jw(a,Ee()),a.callbackNode!=null&&a.callbackNode===d?ej.bind(null,a):null)}function tj(a,l){if(Pf())return null;Iw(a,l,!0)}function _P(){UP(function(){(Yt&6)!==0?Lt(Qe,AP):Zw()})}function Wg(){return ys===0&&(ys=ma()),ys}function nj(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Hd(""+a)}function rj(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 kP(a,l,d,h,x){if(l==="submit"&&d&&d.stateNode===x){var w=nj((x[Te]||null).action),_=h.submitter;_&&(l=(l=_[Te]||null)?nj(l.formAction):_.getAttribute("formAction"),l!==null&&(w=l,_=null));var N=new Wd("action","action",null,h,x);a.push({event:N,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(ys!==0){var B=_?rj(x,_):new FormData(x);pg(d,{pending:!0,data:B,method:x.method,action:w},null,B)}}else typeof w=="function"&&(N.preventDefault(),B=_?rj(x,_):new FormData(x),pg(d,{pending:!0,data:B,method:x.method,action:w},w,B))},currentTarget:x}]})}}for(var Yg=0;Yg<Nm.length;Yg++){var Kg=Nm[Yg],PP=Kg.toLowerCase(),NP=Kg[0].toUpperCase()+Kg.slice(1);Ei(PP,"on"+NP)}Ei(I1,"onAnimationEnd"),Ei(L1,"onAnimationIteration"),Ei(z1,"onAnimationStart"),Ei("dblclick","onDoubleClick"),Ei("focusin","onFocus"),Ei("focusout","onBlur"),Ei(K4,"onTransitionRun"),Ei(X4,"onTransitionStart"),Ei(Z4,"onTransitionCancel"),Ei($1,"onTransitionEnd"),Zr("onMouseEnter",["mouseout","mouseover"]),Zr("onMouseLeave",["mouseout","mouseover"]),Zr("onPointerEnter",["pointerout","pointerover"]),Zr("onPointerLeave",["pointerout","pointerover"]),cr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),cr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),cr("onBeforeInput",["compositionend","keypress","textInput","paste"]),cr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),cr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),cr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wu="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(" "),OP=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wu));function ij(a,l){l=(l&4)!==0;for(var d=0;d<a.length;d++){var h=a[d],x=h.event;h=h.listeners;e:{var w=void 0;if(l)for(var _=h.length-1;0<=_;_--){var N=h[_],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){Sf(de)}x.currentTarget=null,w=B}else for(_=0;_<h.length;_++){if(N=h[_],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){Sf(de)}x.currentTarget=null,w=B}}}}function Dt(a,l){var d=l[nt];d===void 0&&(d=l[nt]=new Set);var h=a+"__bubble";d.has(h)||(aj(l,a,2,!1),d.add(h))}function Xg(a,l,d){var h=0;l&&(h|=4),aj(d,a,h,l)}var Mf="_reactListening"+Math.random().toString(36).slice(2);function Zg(a){if(!a[Mf]){a[Mf]=!0,Tt.forEach(function(d){d!=="selectionchange"&&(OP.has(d)||Xg(d,!1,a),Xg(d,!0,a))});var l=a.nodeType===9?a:a.ownerDocument;l===null||l[Mf]||(l[Mf]=!0,Xg("selectionchange",!1,l))}}function aj(a,l,d,h){switch(Aj(l)){case 2:var x=s3;break;case 8:x=l3;break;default:x=fv}d=x.bind(null,l,d,a),x=void 0,!bm||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(x=!0),h?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 Jg(a,l,d,h,x){var w=h;if((l&1)===0&&(l&2)===0&&h!==null)e:for(;;){if(h===null)return;var _=h.tag;if(_===3||_===4){var N=h.stateNode.containerInfo;if(N===x)break;if(_===4)for(_=h.return;_!==null;){var B=_.tag;if((B===3||B===4)&&_.stateNode.containerInfo===x)return;_=_.return}for(;N!==null;){if(_=st(N),_===null)return;if(B=_.tag,B===5||B===6||B===26||B===27){h=w=_;continue e}N=N.parentNode}}h=h.return}f1(function(){var ne=w,de=ym(d),pe=[];e:{var ie=U1.get(a);if(ie!==void 0){var ae=Wd,ut=a;switch(a){case"keypress":if(Gd(d)===0)break e;case"keydown":case"keyup":ae=D4;break;case"focusin":ut="focus",ae=Cm;break;case"focusout":ut="blur",ae=Cm;break;case"beforeblur":case"afterblur":ae=Cm;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":ae=m1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=g4;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=k4;break;case I1:case L1:case z1:ae=x4;break;case $1:ae=N4;break;case"scroll":case"scrollend":ae=p4;break;case"wheel":ae=M4;break;case"copy":case"cut":case"paste":ae=S4;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=v1;break;case"toggle":case"beforetoggle":ae=L4}var at=(l&4)!==0,tn=!at&&(a==="scroll"||a==="scrollend"),W=at?ie!==null?ie+"Capture":null:ie;at=[];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||W===null||(fe=Bc(q,W),fe!=null&&at.push(ju(q,fe,te))),tn)break;q=q.return}0<at.length&&(ie=new ae(ie,ut,null,d,de),pe.push({event:ie,listeners:at}))}}if((l&7)===0){e:{if(ie=a==="mouseover"||a==="pointerover",ae=a==="mouseout"||a==="pointerout",ie&&d!==vm&&(ut=d.relatedTarget||d.fromElement)&&(st(ut)||ut[Be]))break e;if((ae||ie)&&(ie=de.window===de?de:(ie=de.ownerDocument)?ie.defaultView||ie.parentWindow:window,ae?(ut=d.relatedTarget||d.toElement,ae=ne,ut=ut?st(ut):null,ut!==null&&(tn=s(ut),at=ut.tag,ut!==tn||at!==5&&at!==27&&at!==6)&&(ut=null)):(ae=null,ut=ne),ae!==ut)){if(at=m1,fe="onMouseLeave",W="onMouseEnter",q="mouse",(a==="pointerout"||a==="pointerover")&&(at=v1,fe="onPointerLeave",W="onPointerEnter",q="pointer"),tn=ae==null?ie:Wt(ae),te=ut==null?ie:Wt(ut),ie=new at(fe,q+"leave",ae,d,de),ie.target=tn,ie.relatedTarget=te,fe=null,st(de)===ne&&(at=new at(W,q+"enter",ut,d,de),at.target=te,at.relatedTarget=tn,fe=at),tn=fe,ae&&ut)t:{for(at=ae,W=ut,q=0,te=at;te;te=zl(te))q++;for(te=0,fe=W;fe;fe=zl(fe))te++;for(;0<q-te;)at=zl(at),q--;for(;0<te-q;)W=zl(W),te--;for(;q--;){if(at===W||W!==null&&at===W.alternate)break t;at=zl(at),W=zl(W)}at=null}else at=null;ae!==null&&oj(pe,ie,ae,at,!1),ut!==null&&tn!==null&&oj(pe,tn,ut,at,!0)}}e:{if(ie=ne?Wt(ne):window,ae=ie.nodeName&&ie.nodeName.toLowerCase(),ae==="select"||ae==="input"&&ie.type==="file")var He=E1;else if(j1(ie))if(T1)He=Q4;else{He=q4;var Ct=H4}else ae=ie.nodeName,!ae||ae.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?ne&&gm(ne.elementType)&&(He=E1):He=G4;if(He&&(He=He(a,ne))){C1(pe,He,d,de);break e}Ct&&Ct(a,ie,ne),a==="focusout"&&ne&&ie.type==="number"&&ne.memoizedProps.value!=null&&mm(ie,"number",ie.value)}switch(Ct=ne?Wt(ne):window,a){case"focusin":(j1(Ct)||Ct.contentEditable==="true")&&(pl=Ct,_m=ne,Yc=null);break;case"focusout":Yc=_m=pl=null;break;case"mousedown":km=!0;break;case"contextmenu":case"mouseup":case"dragend":km=!1,O1(pe,d,de);break;case"selectionchange":if(Y4)break;case"keydown":case"keyup":O1(pe,d,de)}var et;if(Tm)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 hl?S1(a,d)&&(lt="onCompositionEnd"):a==="keydown"&&d.keyCode===229&&(lt="onCompositionStart");lt&&(y1&&d.locale!=="ko"&&(hl||lt!=="onCompositionStart"?lt==="onCompositionEnd"&&hl&&(et=h1()):(lo=de,Sm="value"in lo?lo.value:lo.textContent,hl=!0)),Ct=If(ne,lt),0<Ct.length&&(lt=new g1(lt,a,null,d,de),pe.push({event:lt,listeners:Ct}),et?lt.data=et:(et=w1(d),et!==null&&(lt.data=et)))),(et=$4?U4(a,d):B4(a,d))&&(lt=If(ne,"onBeforeInput"),0<lt.length&&(Ct=new g1("onBeforeInput","beforeinput",null,d,de),pe.push({event:Ct,listeners:lt}),Ct.data=et)),kP(pe,a,ne,d,de)}ij(pe,l)})}function ju(a,l,d){return{instance:a,listener:l,currentTarget:d}}function If(a,l){for(var d=l+"Capture",h=[];a!==null;){var x=a,w=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||w===null||(x=Bc(a,d),x!=null&&h.unshift(ju(a,x,w)),x=Bc(a,l),x!=null&&h.push(ju(a,x,w))),a.tag===3)return h;a=a.return}return[]}function zl(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function oj(a,l,d,h,x){for(var w=l._reactName,_=[];d!==null&&d!==h;){var N=d,B=N.alternate,ne=N.stateNode;if(N=N.tag,B!==null&&B===h)break;N!==5&&N!==26&&N!==27||ne===null||(B=ne,x?(ne=Bc(d,w),ne!=null&&_.unshift(ju(d,ne,B))):x||(ne=Bc(d,w),ne!=null&&_.push(ju(d,ne,B)))),d=d.return}_.length!==0&&a.push({event:l,listeners:_})}var MP=/\r\n?/g,IP=/\u0000|\uFFFD/g;function sj(a){return(typeof a=="string"?a:""+a).replace(MP,`
562
- `).replace(IP,"")}function lj(a,l){return l=sj(l),sj(a)===l}function Lf(){}function en(a,l,d,h,x,w){switch(d){case"children":typeof h=="string"?l==="body"||l==="textarea"&&h===""||ul(a,h):(typeof h=="number"||typeof h=="bigint")&&l!=="body"&&ul(a,""+h);break;case"className":va(a,"class",h);break;case"tabIndex":va(a,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":va(a,d,h);break;case"style":u1(a,h,w);break;case"data":if(l!=="object"){va(a,"data",h);break}case"src":case"href":if(h===""&&(l!=="a"||d!=="href")){a.removeAttribute(d);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(d);break}h=Hd(""+h),a.setAttribute(d,h);break;case"action":case"formAction":if(typeof h=="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"&&en(a,l,"name",x.name,x,null),en(a,l,"formEncType",x.formEncType,x,null),en(a,l,"formMethod",x.formMethod,x,null),en(a,l,"formTarget",x.formTarget,x,null)):(en(a,l,"encType",x.encType,x,null),en(a,l,"method",x.method,x,null),en(a,l,"target",x.target,x,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(d);break}h=Hd(""+h),a.setAttribute(d,h);break;case"onClick":h!=null&&(a.onclick=Lf);break;case"onScroll":h!=null&&Dt("scroll",a);break;case"onScrollEnd":h!=null&&Dt("scrollend",a);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(d=h.__html,d!=null){if(x.children!=null)throw Error(r(60));a.innerHTML=d}}break;case"multiple":a.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":a.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){a.removeAttribute("xlink:href");break}d=Hd(""+h),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":h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(d,""+h):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":h&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(d,""):a.removeAttribute(d);break;case"capture":case"download":h===!0?a.setAttribute(d,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(d,h):a.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?a.setAttribute(d,h):a.removeAttribute(d);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?a.removeAttribute(d):a.setAttribute(d,h);break;case"popover":Dt("beforetoggle",a),Dt("toggle",a),Jr(a,"popover",h);break;case"xlinkActuate":jt(a,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":jt(a,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":jt(a,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":jt(a,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":jt(a,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":jt(a,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":jt(a,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":jt(a,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":jt(a,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":Jr(a,"is",h);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=f4.get(d)||d,Jr(a,d,h))}}function ev(a,l,d,h,x,w){switch(d){case"style":u1(a,h,w);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(d=h.__html,d!=null){if(x.children!=null)throw Error(r(60));a.innerHTML=d}}break;case"children":typeof h=="string"?ul(a,h):(typeof h=="number"||typeof h=="bigint")&&ul(a,""+h);break;case"onScroll":h!=null&&Dt("scroll",a);break;case"onScrollEnd":h!=null&&Dt("scrollend",a);break;case"onClick":h!=null&&(a.onclick=Lf);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!io.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[Te]||null,w=w!=null?w[d]:null,typeof w=="function"&&a.removeEventListener(l,w,x),typeof h=="function")){typeof w!="function"&&w!==null&&(d in a?a[d]=null:a.hasAttribute(d)&&a.removeAttribute(d)),a.addEventListener(l,h,x);break e}d in a?a[d]=h:h===!0?a.setAttribute(d,""):Jr(a,d,h)}}}function Zn(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 h=!1,x=!1,w;for(w in d)if(d.hasOwnProperty(w)){var _=d[w];if(_!=null)switch(w){case"src":h=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:en(a,l,w,_,d,null)}}x&&en(a,l,"srcSet",d.srcSet,d,null),h&&en(a,l,"src",d.src,d,null);return;case"input":Dt("invalid",a);var N=w=_=x=null,B=null,ne=null;for(h in d)if(d.hasOwnProperty(h)){var de=d[h];if(de!=null)switch(h){case"name":x=de;break;case"type":_=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:en(a,l,h,de,d,null)}}o1(a,w,N,B,ne,_,x,!1),Vd(a);return;case"select":Dt("invalid",a),h=_=w=null;for(x in d)if(d.hasOwnProperty(x)&&(N=d[x],N!=null))switch(x){case"value":w=N;break;case"defaultValue":_=N;break;case"multiple":h=N;default:en(a,l,x,N,d,null)}l=w,d=_,a.multiple=!!h,l!=null?cl(a,!!h,l,!1):d!=null&&cl(a,!!h,d,!0);return;case"textarea":Dt("invalid",a),w=x=h=null;for(_ in d)if(d.hasOwnProperty(_)&&(N=d[_],N!=null))switch(_){case"value":h=N;break;case"defaultValue":x=N;break;case"children":w=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(r(91));break;default:en(a,l,_,N,d,null)}l1(a,h,x,w),Vd(a);return;case"option":for(B in d)if(d.hasOwnProperty(B)&&(h=d[B],h!=null))switch(B){case"selected":a.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:en(a,l,B,h,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(h=0;h<wu.length;h++)Dt(wu[h],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)&&(h=d[ne],h!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:en(a,l,ne,h,d,null)}return;default:if(gm(l)){for(de in d)d.hasOwnProperty(de)&&(h=d[de],h!==void 0&&ev(a,l,de,h,d,void 0));return}}for(N in d)d.hasOwnProperty(N)&&(h=d[N],h!=null&&en(a,l,N,h,d,null))}function LP(a,l,d,h){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,_=null,N=null,B=null,ne=null,de=null;for(ae in d){var pe=d[ae];if(d.hasOwnProperty(ae)&&pe!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":B=pe;default:h.hasOwnProperty(ae)||en(a,l,ae,null,h,pe)}}for(var ie in h){var ae=h[ie];if(pe=d[ie],h.hasOwnProperty(ie)&&(ae!=null||pe!=null))switch(ie){case"type":w=ae;break;case"name":x=ae;break;case"checked":ne=ae;break;case"defaultChecked":de=ae;break;case"value":_=ae;break;case"defaultValue":N=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,l));break;default:ae!==pe&&en(a,l,ie,ae,h,pe)}}pm(a,_,N,B,ne,de,w,x);return;case"select":ae=_=N=ie=null;for(w in d)if(B=d[w],d.hasOwnProperty(w)&&B!=null)switch(w){case"value":break;case"multiple":ae=B;default:h.hasOwnProperty(w)||en(a,l,w,null,h,B)}for(x in h)if(w=h[x],B=d[x],h.hasOwnProperty(x)&&(w!=null||B!=null))switch(x){case"value":ie=w;break;case"defaultValue":N=w;break;case"multiple":_=w;default:w!==B&&en(a,l,x,w,h,B)}l=N,d=_,h=ae,ie!=null?cl(a,!!d,ie,!1):!!h!=!!d&&(l!=null?cl(a,!!d,l,!0):cl(a,!!d,d?[]:"",!1));return;case"textarea":ae=ie=null;for(N in d)if(x=d[N],d.hasOwnProperty(N)&&x!=null&&!h.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:en(a,l,N,null,h,x)}for(_ in h)if(x=h[_],w=d[_],h.hasOwnProperty(_)&&(x!=null||w!=null))switch(_){case"value":ie=x;break;case"defaultValue":ae=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:x!==w&&en(a,l,_,x,h,w)}s1(a,ie,ae);return;case"option":for(var ut in d)if(ie=d[ut],d.hasOwnProperty(ut)&&ie!=null&&!h.hasOwnProperty(ut))switch(ut){case"selected":a.selected=!1;break;default:en(a,l,ut,null,h,ie)}for(B in h)if(ie=h[B],ae=d[B],h.hasOwnProperty(B)&&ie!==ae&&(ie!=null||ae!=null))switch(B){case"selected":a.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:en(a,l,B,ie,h,ae)}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 at in d)ie=d[at],d.hasOwnProperty(at)&&ie!=null&&!h.hasOwnProperty(at)&&en(a,l,at,null,h,ie);for(ne in h)if(ie=h[ne],ae=d[ne],h.hasOwnProperty(ne)&&ie!==ae&&(ie!=null||ae!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,l));break;default:en(a,l,ne,ie,h,ae)}return;default:if(gm(l)){for(var tn in d)ie=d[tn],d.hasOwnProperty(tn)&&ie!==void 0&&!h.hasOwnProperty(tn)&&ev(a,l,tn,void 0,h,ie);for(de in h)ie=h[de],ae=d[de],!h.hasOwnProperty(de)||ie===ae||ie===void 0&&ae===void 0||ev(a,l,de,ie,h,ae);return}}for(var W in d)ie=d[W],d.hasOwnProperty(W)&&ie!=null&&!h.hasOwnProperty(W)&&en(a,l,W,null,h,ie);for(pe in h)ie=h[pe],ae=d[pe],!h.hasOwnProperty(pe)||ie===ae||ie==null&&ae==null||en(a,l,pe,ie,h,ae)}var tv=null,nv=null;function zf(a){return a.nodeType===9?a:a.ownerDocument}function cj(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 uj(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 rv(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 iv=null;function zP(){var a=window.event;return a&&a.type==="popstate"?a===iv?!1:(iv=a,!0):(iv=null,!1)}var dj=typeof setTimeout=="function"?setTimeout:void 0,$P=typeof clearTimeout=="function"?clearTimeout:void 0,fj=typeof Promise=="function"?Promise:void 0,UP=typeof queueMicrotask=="function"?queueMicrotask:typeof fj<"u"?function(a){return fj.resolve(null).then(a).catch(BP)}:dj;function BP(a){setTimeout(function(){throw a})}function Eo(a){return a==="head"}function hj(a,l){var d=l,h=0,x=0;do{var w=d.nextSibling;if(a.removeChild(d),w&&w.nodeType===8)if(d=w.data,d==="/$"){if(0<h&&8>h){d=h;var _=a.ownerDocument;if(d&1&&Cu(_.documentElement),d&2&&Cu(_.body),d&4)for(d=_.head,Cu(d),_=d.firstChild;_;){var N=_.nextSibling,B=_.nodeName;_[it]||B==="SCRIPT"||B==="STYLE"||B==="LINK"&&_.rel.toLowerCase()==="stylesheet"||d.removeChild(_),_=N}}if(x===0){a.removeChild(w),Pu(l);return}x--}else d==="$"||d==="$?"||d==="$!"?x++:h=d.charCodeAt(0)-48;else h=0;d=w}while(d);Pu(l)}function av(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":av(d),Ke(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}a.removeChild(d)}}function VP(a,l,d,h){for(;a.nodeType===1;){var x=d;if(a.nodeName.toLowerCase()!==l.toLowerCase()){if(!h&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(h){if(!a[it])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=Ri(a.nextSibling),a===null)break}return null}function FP(a,l,d){if(l==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!d||(a=Ri(a.nextSibling),a===null))return null;return a}function ov(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState==="complete"}function HP(a,l){var d=a.ownerDocument;if(a.data!=="$?"||d.readyState==="complete")l();else{var h=function(){l(),d.removeEventListener("DOMContentLoaded",h)};d.addEventListener("DOMContentLoaded",h),a._reactRetry=h}}function Ri(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 sv=null;function pj(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 mj(a,l,d){switch(l=zf(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 Cu(a){for(var l=a.attributes;l.length;)a.removeAttributeNode(l[0]);Ke(a)}var si=new Map,gj=new Set;function $f(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var ka=L.d;L.d={f:qP,r:GP,D:QP,C:WP,L:YP,m:KP,X:ZP,S:XP,M:JP};function qP(){var a=ka.f(),l=_f();return a||l}function GP(a){var l=Xe(a);l!==null&&l.tag===5&&l.type==="form"?IS(l):ka.r(a)}var $l=typeof document>"u"?null:document;function vj(a,l,d){var h=$l;if(h&&typeof l=="string"&&l){var x=ei(l);x='link[rel="'+a+'"][href="'+x+'"]',typeof d=="string"&&(x+='[crossorigin="'+d+'"]'),gj.has(x)||(gj.add(x),a={rel:a,crossOrigin:d,href:l},h.querySelector(x)===null&&(l=h.createElement("link"),Zn(l,"link",a),Pt(l),h.head.appendChild(l)))}}function QP(a){ka.D(a),vj("dns-prefetch",a,null)}function WP(a,l){ka.C(a,l),vj("preconnect",a,l)}function YP(a,l,d){ka.L(a,l,d);var h=$l;if(h&&a&&l){var x='link[rel="preload"][as="'+ei(l)+'"]';l==="image"&&d&&d.imageSrcSet?(x+='[imagesrcset="'+ei(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(x+='[imagesizes="'+ei(d.imageSizes)+'"]')):x+='[href="'+ei(a)+'"]';var w=x;switch(l){case"style":w=Ul(a);break;case"script":w=Bl(a)}si.has(w)||(a=m({rel:"preload",href:l==="image"&&d&&d.imageSrcSet?void 0:a,as:l},d),si.set(w,a),h.querySelector(x)!==null||l==="style"&&h.querySelector(Eu(w))||l==="script"&&h.querySelector(Tu(w))||(l=h.createElement("link"),Zn(l,"link",a),Pt(l),h.head.appendChild(l)))}}function KP(a,l){ka.m(a,l);var d=$l;if(d&&a){var h=l&&typeof l.as=="string"?l.as:"script",x='link[rel="modulepreload"][as="'+ei(h)+'"][href="'+ei(a)+'"]',w=x;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=Bl(a)}if(!si.has(w)&&(a=m({rel:"modulepreload",href:a},l),si.set(w,a),d.querySelector(x)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(Tu(w)))return}h=d.createElement("link"),Zn(h,"link",a),Pt(h),d.head.appendChild(h)}}}function XP(a,l,d){ka.S(a,l,d);var h=$l;if(h&&a){var x=dn(h).hoistableStyles,w=Ul(a);l=l||"default";var _=x.get(w);if(!_){var N={loading:0,preload:null};if(_=h.querySelector(Eu(w)))N.loading=5;else{a=m({rel:"stylesheet",href:a,"data-precedence":l},d),(d=si.get(w))&&lv(a,d);var B=_=h.createElement("link");Pt(B),Zn(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,Uf(_,l,h)}_={type:"stylesheet",instance:_,count:1,state:N},x.set(w,_)}}}function ZP(a,l){ka.X(a,l);var d=$l;if(d&&a){var h=dn(d).hoistableScripts,x=Bl(a),w=h.get(x);w||(w=d.querySelector(Tu(x)),w||(a=m({src:a,async:!0},l),(l=si.get(x))&&cv(a,l),w=d.createElement("script"),Pt(w),Zn(w,"link",a),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(x,w))}}function JP(a,l){ka.M(a,l);var d=$l;if(d&&a){var h=dn(d).hoistableScripts,x=Bl(a),w=h.get(x);w||(w=d.querySelector(Tu(x)),w||(a=m({src:a,async:!0,type:"module"},l),(l=si.get(x))&&cv(a,l),w=d.createElement("script"),Pt(w),Zn(w,"link",a),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(x,w))}}function yj(a,l,d,h){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=Ul(d.href),d=dn(x).hoistableStyles,h=d.get(l),h||(h={type:"style",instance:null,count:0,state:null},d.set(l,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){a=Ul(d.href);var w=dn(x).hoistableStyles,_=w.get(a);if(_||(x=x.ownerDocument||x,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(a,_),(w=x.querySelector(Eu(a)))&&!w._p&&(_.instance=w,_.state.loading=5),si.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},si.set(a,d),w||e3(x,a,d,_.state))),l&&h===null)throw Error(r(528,""));return _}if(l&&h!==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=Bl(d),d=dn(x).hoistableScripts,h=d.get(l),h||(h={type:"script",instance:null,count:0,state:null},d.set(l,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Ul(a){return'href="'+ei(a)+'"'}function Eu(a){return'link[rel="stylesheet"]['+a+"]"}function xj(a){return m({},a,{"data-precedence":a.precedence,precedence:null})}function e3(a,l,d,h){a.querySelector('link[rel="preload"][as="style"]['+l+"]")?h.loading=1:(l=a.createElement("link"),h.preload=l,l.addEventListener("load",function(){return h.loading|=1}),l.addEventListener("error",function(){return h.loading|=2}),Zn(l,"link",d),Pt(l),a.head.appendChild(l))}function Bl(a){return'[src="'+ei(a)+'"]'}function Tu(a){return"script[async]"+a}function bj(a,l,d){if(l.count++,l.instance===null)switch(l.type){case"style":var h=a.querySelector('style[data-href~="'+ei(d.href)+'"]');if(h)return l.instance=h,Pt(h),h;var x=m({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return h=(a.ownerDocument||a).createElement("style"),Pt(h),Zn(h,"style",x),Uf(h,d.precedence,a),l.instance=h;case"stylesheet":x=Ul(d.href);var w=a.querySelector(Eu(x));if(w)return l.state.loading|=4,l.instance=w,Pt(w),w;h=xj(d),(x=si.get(x))&&lv(h,x),w=(a.ownerDocument||a).createElement("link"),Pt(w);var _=w;return _._p=new Promise(function(N,B){_.onload=N,_.onerror=B}),Zn(w,"link",h),l.state.loading|=4,Uf(w,d.precedence,a),l.instance=w;case"script":return w=Bl(d.src),(x=a.querySelector(Tu(w)))?(l.instance=x,Pt(x),x):(h=d,(x=si.get(w))&&(h=m({},d),cv(h,x)),a=a.ownerDocument||a,x=a.createElement("script"),Pt(x),Zn(x,"link",h),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&&(h=l.instance,l.state.loading|=4,Uf(h,d.precedence,a));return l.instance}function Uf(a,l,d){for(var h=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=h.length?h[h.length-1]:null,w=x,_=0;_<h.length;_++){var N=h[_];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 lv(a,l){a.crossOrigin==null&&(a.crossOrigin=l.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=l.referrerPolicy),a.title==null&&(a.title=l.title)}function cv(a,l){a.crossOrigin==null&&(a.crossOrigin=l.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=l.referrerPolicy),a.integrity==null&&(a.integrity=l.integrity)}var Bf=null;function Sj(a,l,d){if(Bf===null){var h=new Map,x=Bf=new Map;x.set(d,h)}else x=Bf,h=x.get(d),h||(h=new Map,x.set(d,h));if(h.has(a))return h;for(h.set(a,null),d=d.getElementsByTagName(a),x=0;x<d.length;x++){var w=d[x];if(!(w[it]||w[he]||a==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var _=w.getAttribute(l)||"";_=a+_;var N=h.get(_);N?N.push(w):h.set(_,[w])}}return h}function wj(a,l,d){a=a.ownerDocument||a,a.head.insertBefore(d,l==="title"?a.querySelector("head > title"):null)}function t3(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 jj(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}var Ru=null;function n3(){}function r3(a,l,d){if(Ru===null)throw Error(r(475));var h=Ru;if(l.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var x=Ul(d.href),w=a.querySelector(Eu(x));if(w){a=w._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(h.count++,h=Vf.bind(h),a.then(h,h)),l.state.loading|=4,l.instance=w,Pt(w);return}w=a.ownerDocument||a,d=xj(d),(x=si.get(x))&&lv(d,x),w=w.createElement("link"),Pt(w);var _=w;_._p=new Promise(function(N,B){_.onload=N,_.onerror=B}),Zn(w,"link",d),l.instance=w}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(l,a),(a=l.state.preload)&&(l.state.loading&3)===0&&(h.count++,l=Vf.bind(h),a.addEventListener("load",l),a.addEventListener("error",l))}}function i3(){if(Ru===null)throw Error(r(475));var a=Ru;return a.stylesheets&&a.count===0&&uv(a,a.stylesheets),0<a.count?function(l){var d=setTimeout(function(){if(a.stylesheets&&uv(a,a.stylesheets),a.unsuspend){var h=a.unsuspend;a.unsuspend=null,h()}},6e4);return a.unsuspend=l,function(){a.unsuspend=null,clearTimeout(d)}}:null}function Vf(){if(this.count--,this.count===0){if(this.stylesheets)uv(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Ff=null;function uv(a,l){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Ff=new Map,l.forEach(a3,a),Ff=null,Vf.call(a))}function a3(a,l){if(!(l.state.loading&4)){var d=Ff.get(a);if(d)var h=d.get(null);else{d=new Map,Ff.set(a,d);for(var x=a.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<x.length;w++){var _=x[w];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(d.set(_.dataset.precedence,_),h=_)}h&&d.set(null,h)}x=l.instance,_=x.getAttribute("data-precedence"),w=d.get(_)||h,w===h&&d.set(null,x),d.set(_,x),this.count++,h=Vf.bind(this),x.addEventListener("load",h),x.addEventListener("error",h),w?w.parentNode.insertBefore(x,w.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(x,a.firstChild)),l.state.loading|=4}}var Du={$$typeof:E,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function o3(a,l,d,h,x,w,_,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=Fi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fi(0),this.hiddenUpdates=Fi(null),this.identifierPrefix=h,this.onUncaughtError=x,this.onCaughtError=w,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function Cj(a,l,d,h,x,w,_,N,B,ne,de,pe){return a=new o3(a,l,d,_,N,B,ne,pe),l=1,w===!0&&(l|=24),w=Lr(3,null,null,l),a.current=w,w.stateNode=a,l=qm(),l.refCount++,a.pooledCache=l,l.refCount++,w.memoizedState={element:h,isDehydrated:d,cache:l},Ym(w),a}function Ej(a){return a?(a=yl,a):yl}function Tj(a,l,d,h,x,w){x=Ej(x),h.context===null?h.context=x:h.pendingContext=x,h=fo(l),h.payload={element:d},w=w===void 0?null:w,w!==null&&(h.callback=w),d=ho(a,h,l),d!==null&&(Vr(d,a,l),iu(d,a,l))}function Rj(a,l){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var d=a.retryLane;a.retryLane=d!==0&&d<l?d:l}}function dv(a,l){Rj(a,l),(a=a.alternate)&&Rj(a,l)}function Dj(a){if(a.tag===13){var l=vl(a,67108864);l!==null&&Vr(l,a,67108864),dv(a,67108864)}}var Hf=!0;function s3(a,l,d,h){var x=P.T;P.T=null;var w=L.p;try{L.p=2,fv(a,l,d,h)}finally{L.p=w,P.T=x}}function l3(a,l,d,h){var x=P.T;P.T=null;var w=L.p;try{L.p=8,fv(a,l,d,h)}finally{L.p=w,P.T=x}}function fv(a,l,d,h){if(Hf){var x=hv(h);if(x===null)Jg(a,l,h,qf,d),_j(a,h);else if(u3(x,a,l,d,h))h.stopPropagation();else if(_j(a,h),l&4&&-1<c3.indexOf(a)){for(;x!==null;){var w=Xe(x);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var _=Bn(w.pendingLanes);if(_!==0){var N=w;for(N.pendingLanes|=2,N.entangledLanes|=2;_;){var B=1<<31-kt(_);N.entanglements[1]|=B,_&=~B}Wi(w),(Yt&6)===0&&(Df=Ee()+500,Su(0))}}break;case 13:N=vl(w,2),N!==null&&Vr(N,w,2),_f(),dv(w,2)}if(w=hv(h),w===null&&Jg(a,l,h,qf,d),w===x)break;x=w}x!==null&&h.stopPropagation()}else Jg(a,l,h,null,d)}}function hv(a){return a=ym(a),pv(a)}var qf=null;function pv(a){if(qf=null,a=st(a),a!==null){var l=s(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 qf=a,null}function Aj(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 Pe:return 268435456;default:return 32}default:return 32}}var mv=!1,To=null,Ro=null,Do=null,Au=new Map,_u=new Map,Ao=[],c3="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 _j(a,l){switch(a){case"focusin":case"focusout":To=null;break;case"dragenter":case"dragleave":Ro=null;break;case"mouseover":case"mouseout":Do=null;break;case"pointerover":case"pointerout":Au.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":_u.delete(l.pointerId)}}function ku(a,l,d,h,x,w){return a===null||a.nativeEvent!==w?(a={blockedOn:l,domEventName:d,eventSystemFlags:h,nativeEvent:w,targetContainers:[x]},l!==null&&(l=Xe(l),l!==null&&Dj(l)),a):(a.eventSystemFlags|=h,l=a.targetContainers,x!==null&&l.indexOf(x)===-1&&l.push(x),a)}function u3(a,l,d,h,x){switch(l){case"focusin":return To=ku(To,a,l,d,h,x),!0;case"dragenter":return Ro=ku(Ro,a,l,d,h,x),!0;case"mouseover":return Do=ku(Do,a,l,d,h,x),!0;case"pointerover":var w=x.pointerId;return Au.set(w,ku(Au.get(w)||null,a,l,d,h,x)),!0;case"gotpointercapture":return w=x.pointerId,_u.set(w,ku(_u.get(w)||null,a,l,d,h,x)),!0}return!1}function kj(a){var l=st(a.target);if(l!==null){var d=s(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 h=Br();h=es(h);var x=vl(d,h);x!==null&&Vr(x,d,h),dv(d,h)}});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){a.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Gf(a){if(a.blockedOn!==null)return!1;for(var l=a.targetContainers;0<l.length;){var d=hv(a.nativeEvent);if(d===null){d=a.nativeEvent;var h=new d.constructor(d.type,d);vm=h,d.target.dispatchEvent(h),vm=null}else return l=Xe(d),l!==null&&Dj(l),a.blockedOn=d,!1;l.shift()}return!0}function Pj(a,l,d){Gf(a)&&d.delete(l)}function d3(){mv=!1,To!==null&&Gf(To)&&(To=null),Ro!==null&&Gf(Ro)&&(Ro=null),Do!==null&&Gf(Do)&&(Do=null),Au.forEach(Pj),_u.forEach(Pj)}function Qf(a,l){a.blockedOn===l&&(a.blockedOn=null,mv||(mv=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,d3)))}var Wf=null;function Nj(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],h=a[l+1],x=a[l+2];if(typeof h!="function"){if(pv(h||d)===null)continue;break}var w=Xe(d);w!==null&&(a.splice(l,3),l-=3,pg(w,{pending:!0,data:x,method:d.method,action:h},h,x))}}))}function Pu(a){function l(B){return Qf(B,a)}To!==null&&Qf(To,a),Ro!==null&&Qf(Ro,a),Do!==null&&Qf(Do,a),Au.forEach(l),_u.forEach(l);for(var d=0;d<Ao.length;d++){var h=Ao[d];h.blockedOn===a&&(h.blockedOn=null)}for(;0<Ao.length&&(d=Ao[0],d.blockedOn===null);)kj(d),d.blockedOn===null&&Ao.shift();if(d=(a.ownerDocument||a).$$reactFormReplay,d!=null)for(h=0;h<d.length;h+=3){var x=d[h],w=d[h+1],_=x[Te]||null;if(typeof w=="function")_||Nj(d);else if(_){var N=null;if(w&&w.hasAttribute("formAction")){if(x=w,_=w[Te]||null)N=_.formAction;else if(pv(x)!==null)continue}else N=_.action;typeof N=="function"?d[h+1]=N:(d.splice(h,3),h-=3),Nj(d)}}}function gv(a){this._internalRoot=a}Yf.prototype.render=gv.prototype.render=function(a){var l=this._internalRoot;if(l===null)throw Error(r(409));var d=l.current,h=Br();Tj(d,h,a,l,null,null)},Yf.prototype.unmount=gv.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var l=a.containerInfo;Tj(a.current,2,null,a,null,null),_f(),l[Be]=null}};function Yf(a){this._internalRoot=a}Yf.prototype.unstable_scheduleHydration=function(a){if(a){var l=F();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&&kj(a)}};var Oj=t.version;if(Oj!=="19.1.0")throw Error(r(527,Oj,"19.1.0"));L.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?p(a):null,a=a===null?null:a.stateNode,a};var f3={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Kf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kf.isDisabled&&Kf.supportsFiber)try{yt=Kf.inject(f3),ft=Kf}catch{}}return $u.createRoot=function(a,l){if(!i(a))throw Error(r(299));var d=!1,h="",x=KS,w=XS,_=ZS,N=null;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(x=l.onUncaughtError),l.onCaughtError!==void 0&&(w=l.onCaughtError),l.onRecoverableError!==void 0&&(_=l.onRecoverableError),l.unstable_transitionCallbacks!==void 0&&(N=l.unstable_transitionCallbacks)),l=Cj(a,1,!1,null,null,d,h,x,w,_,N,null),a[Be]=l.current,Zg(a),new gv(l)},$u.hydrateRoot=function(a,l,d){if(!i(a))throw Error(r(299));var h=!1,x="",w=KS,_=XS,N=ZS,B=null,ne=null;return d!=null&&(d.unstable_strictMode===!0&&(h=!0),d.identifierPrefix!==void 0&&(x=d.identifierPrefix),d.onUncaughtError!==void 0&&(w=d.onUncaughtError),d.onCaughtError!==void 0&&(_=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=Cj(a,1,!0,l,d??null,h,x,w,_,N,B,ne),l.context=Ej(null),d=l.current,h=Br(),h=es(h),x=fo(h),x.callback=null,ho(d,x,h),d=h,l.current.lanes=d,xr(l,d),Wi(l),a[Be]=l.current,Zg(a),new Yf(l)},$u.version="19.1.0",$u}var hT;function XY(){if(hT)return ty.exports;hT=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(),ty.exports=KY(),ty.exports}var ZY=XY(),Uu={},pT;function JY(){if(pT)return Uu;pT=1,Object.defineProperty(Uu,"__esModule",{value:!0}),Uu.parse=c,Uu.serialize=p;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,s=(()=>{const y=function(){};return y.prototype=Object.create(null),y})();function c(y,b){const S=new s,j=y.length;if(j<2)return S;const C=(b==null?void 0:b.decode)||m;let T=0;do{const D=y.indexOf("=",T);if(D===-1)break;const E=y.indexOf(";",T),R=E===-1?j:E;if(D>R){T=y.lastIndexOf(";",D-1)+1;continue}const A=u(y,T,D),k=f(y,D,A),M=y.slice(A,k);if(S[M]===void 0){let I=u(y,D+1,R),$=f(y,R,I);const V=C(y.slice(I,$));S[M]=V}T=R+1}while(T<j);return S}function u(y,b,S){do{const j=y.charCodeAt(b);if(j!==32&&j!==9)return b}while(++b<S);return S}function f(y,b,S){for(;b>S;){const j=y.charCodeAt(--b);if(j!==32&&j!==9)return b+1}return S}function p(y,b,S){const j=(S==null?void 0:S.encode)||encodeURIComponent;if(!e.test(y))throw new TypeError(`argument name is invalid: ${y}`);const C=j(b);if(!t.test(C))throw new TypeError(`argument val is invalid: ${b}`);let T=y+"="+C;if(!S)return T;if(S.maxAge!==void 0){if(!Number.isInteger(S.maxAge))throw new TypeError(`option maxAge is invalid: ${S.maxAge}`);T+="; Max-Age="+S.maxAge}if(S.domain){if(!n.test(S.domain))throw new TypeError(`option domain is invalid: ${S.domain}`);T+="; Domain="+S.domain}if(S.path){if(!r.test(S.path))throw new TypeError(`option path is invalid: ${S.path}`);T+="; Path="+S.path}if(S.expires){if(!g(S.expires)||!Number.isFinite(S.expires.valueOf()))throw new TypeError(`option expires is invalid: ${S.expires}`);T+="; Expires="+S.expires.toUTCString()}if(S.httpOnly&&(T+="; HttpOnly"),S.secure&&(T+="; Secure"),S.partitioned&&(T+="; Partitioned"),S.priority)switch(typeof S.priority=="string"?S.priority.toLowerCase():void 0){case"low":T+="; Priority=Low";break;case"medium":T+="; Priority=Medium";break;case"high":T+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${S.priority}`)}if(S.sameSite)switch(typeof S.sameSite=="string"?S.sameSite.toLowerCase():S.sameSite){case!0:case"strict":T+="; SameSite=Strict";break;case"lax":T+="; SameSite=Lax";break;case"none":T+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${S.sameSite}`)}return T}function m(y){if(y.indexOf("%")===-1)return y;try{return decodeURIComponent(y)}catch{return y}}function g(y){return i.call(y)==="[object Date]"}return Uu}JY();/**
563
- * react-router v7.6.3
564
- *
565
- * Copyright (c) Remix Software Inc.
566
- *
567
- * This source code is licensed under the MIT license found in the
568
- * LICENSE.md file in the root directory of this source tree.
569
- *
570
- * @license MIT
571
- */var mk=e=>{throw TypeError(e)},eK=(e,t,n)=>t.has(e)||mk("Cannot "+n),iy=(e,t,n)=>(eK(e,t,"read from private field"),n?n.call(e):t.get(e)),tK=(e,t,n)=>t.has(e)?mk("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),mT="popstate";function nK(e={}){function t(r,i){let{pathname:s,search:c,hash:u}=r.location;return cd("",{pathname:s,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:Ho(i)}return iK(t,n,null,e)}function bt(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 rK(){return Math.random().toString(36).substring(2,10)}function gT(e,t){return{usr:e.state,key:e.key,idx:t}}function cd(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?to(t):t,state:n,key:t&&t.key||r||rK()}}function Ho({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 to(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 iK(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,c=i.history,u="POP",f=null,p=m();p==null&&(p=0,c.replaceState({...c.state,idx:p},""));function m(){return(c.state||{idx:null}).idx}function g(){u="POP";let C=m(),T=C==null?null:C-p;p=C,f&&f({action:u,location:j.location,delta:T})}function y(C,T){u="PUSH";let D=cd(j.location,C,T);p=m()+1;let E=gT(D,p),R=j.createHref(D);try{c.pushState(E,"",R)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;i.location.assign(R)}s&&f&&f({action:u,location:j.location,delta:1})}function b(C,T){u="REPLACE";let D=cd(j.location,C,T);p=m();let E=gT(D,p),R=j.createHref(D);c.replaceState(E,"",R),s&&f&&f({action:u,location:j.location,delta:0})}function S(C){return gk(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(mT,g),f=C,()=>{i.removeEventListener(mT,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 gk(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),bt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Ho(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Gu,vT=class{constructor(e){if(tK(this,Gu,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(iy(this,Gu).has(e))return iy(this,Gu).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){iy(this,Gu).set(e,t)}};Gu=new WeakMap;var aK=new Set(["lazy","caseSensitive","path","id","index","children"]);function oK(e){return aK.has(e)}var sK=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function lK(e){return sK.has(e)}function cK(e){return e.index===!0}function Kh(e,t,n=[],r={}){return e.map((i,s)=>{let c=[...n,String(s)],u=typeof i.id=="string"?i.id:c.join("-");if(bt(i.index!==!0||!i.children,"Cannot specify children on an index route"),bt(!r[u],`Found a route id collision on id "${u}". Route id's must be globally unique within Data Router usages`),cK(i)){let f={...i,...t(i),id:u};return r[u]=f,f}else{let f={...i,...t(i),id:u,children:void 0};return r[u]=f,i.children&&(f.children=Kh(i.children,t,c,r)),f}})}function zo(e,t,n="/"){return Sh(e,t,n,!1)}function Sh(e,t,n,r){let i=typeof t=="string"?to(t):t,s=vi(i.pathname||"/",n);if(s==null)return null;let c=vk(e);dK(c);let u=null;for(let f=0;u==null&&f<c.length;++f){let p=wK(s);u=bK(c[f],p,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 vk(e,t=[],n=[],r=""){let i=(s,c,u)=>{let f={relativePath:u===void 0?s.path||"":u,caseSensitive:s.caseSensitive===!0,childrenIndex:c,route:s};f.relativePath.startsWith("/")&&(bt(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 p=oa([r,f.relativePath]),m=n.concat(f);s.children&&s.children.length>0&&(bt(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),vk(s.children,t,m,p)),!(s.path==null&&!s.index)&&t.push({path:p,score:yK(p,s.index),routesMeta:m})};return e.forEach((s,c)=>{var u;if(s.path===""||!((u=s.path)!=null&&u.includes("?")))i(s,c);else for(let f of yk(s.path))i(s,c,f)}),t}function yk(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let c=yk(r.join("/")),u=[];return u.push(...c.map(f=>f===""?s:[s,f].join("/"))),i&&u.push(...c),u.map(f=>e.startsWith("/")&&f===""?"/":f)}function dK(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:xK(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var fK=/^:[\w-]+$/,hK=3,pK=2,mK=1,gK=10,vK=-2,yT=e=>e==="*";function yK(e,t){let n=e.split("/"),r=n.length;return n.some(yT)&&(r+=vK),t&&(r+=pK),n.filter(i=>!yT(i)).reduce((i,s)=>i+(fK.test(s)?hK:s===""?mK:gK),r)}function xK(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 bK(e,t,n=!1){let{routesMeta:r}=e,i={},s="/",c=[];for(let u=0;u<r.length;++u){let f=r[u],p=u===r.length-1,m=s==="/"?t:t.slice(s.length)||"/",g=Xh({path:f.relativePath,caseSensitive:f.caseSensitive,end:p},m),y=f.route;if(!g&&p&&n&&!r[r.length-1].route.index&&(g=Xh({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!g)return null;Object.assign(i,g.params),c.push({params:i,pathname:oa([s,g.pathname]),pathnameBase:EK(oa([s,g.pathnameBase])),route:y}),g.pathnameBase!=="/"&&(s=oa([s,g.pathnameBase]))}return c}function Xh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=SK(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],c=s.replace(/(.)\/+$/,"$1"),u=i.slice(1);return{params:r.reduce((p,{paramName:m,isOptional:g},y)=>{if(m==="*"){let S=u[y]||"";c=s.slice(0,s.length-S.length).replace(/(.)\/+$/,"$1")}const b=u[y];return g&&!b?p[m]=void 0:p[m]=(b||"").replace(/%2F/g,"/"),p},{}),pathname:s,pathnameBase:c,pattern:e}}function SK(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 wK(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(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?to(e):e;return{pathname:n?n.startsWith("/")?n:CK(n,t):t,search:TK(r),hash:RK(i)}}function CK(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 ay(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 xk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Bb(e){let t=xk(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Vb(e,t,n,r=!1){let i;typeof e=="string"?i=to(e):(i={...e},bt(!i.pathname||!i.pathname.includes("?"),ay("?","pathname","search",i)),bt(!i.pathname||!i.pathname.includes("#"),ay("#","pathname","hash",i)),bt(!i.search||!i.search.includes("#"),ay("#","search","hash",i)));let s=e===""||i.pathname==="",c=s?"/":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=jK(i,u),p=c&&c!=="/"&&c.endsWith("/"),m=(s||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(p||m)&&(f.pathname+="/"),f}var oa=e=>e.join("/").replace(/\/\/+/g,"/"),EK=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),TK=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,RK=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Zh=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 ud(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var bk=["POST","PUT","PATCH","DELETE"],DK=new Set(bk),AK=["GET",...bk],_K=new Set(AK),kK=new Set([301,302,303,307,308]),PK=new Set([307,308]),oy={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},NK={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Bu={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Fb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,OK=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Sk="remix-router-transitions",wk=Symbol("ResetLoaderData");function MK(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";bt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||OK,s={},c=Kh(e.routes,i,void 0,s),u,f=e.basename||"/",p=e.dataStrategy||UK,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),D=!1,E=null,R;if(T==null&&!e.patchRoutesOnNavigation){let F=ui(404,{pathname:e.history.location.pathname}),{matches:Z,route:re}=_T(c);R=!0,T=Z,E={[re.id]:F}}else if(T&&!e.hydrationData&&ga(T,c,e.history.location.pathname).active&&(T=null),T)if(T.some(F=>F.route.lazy))R=!1;else if(!T.some(F=>F.route.loader))R=!0;else{let F=e.hydrationData?e.hydrationData.loaderData:null,Z=e.hydrationData?e.hydrationData.errors:null;if(Z){let re=T.findIndex(he=>Z[he.route.id]!==void 0);R=T.slice(0,re+1).every(he=>!Xy(he.route,F,Z))}else R=T.every(re=>!Xy(re.route,F,Z))}else{R=!1,T=[];let F=ga(null,c,e.history.location.pathname);F.active&&F.matches&&(D=!0,T=F.matches)}let A,k={historyAction:e.history.action,location:e.history.location,matches:T,initialized:R,navigation:oy,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",I=!1,$,V=!1,Y=new Map,Q=null,J=!1,G=!1,K=new Set,P=new Map,L=0,z=-1,H=new Map,O=new Set,U=new Map,X=new Map,ee=new Set,Se=new Map,be,xe=null;function qe(){if(g=e.history.listen(({action:F,location:Z,delta:re})=>{if(be){be(),be=void 0;return}Mn(Se.size===0||re!=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=ll({currentLocation:k.location,nextLocation:Z,historyAction:F});if(he&&re!=null){let Te=new Promise(Be=>{be=Be});e.history.go(re*-1),Xr(he,{state:"blocked",location:Z,proceed(){Xr(he,{state:"proceeding",proceed:void 0,reset:void 0,location:Z}),Te.then(()=>e.history.go(re))},reset(){let Be=new Map(k.blockers);Be.set(he,Bu),ke({blockers:Be})}});return}return gt(F,Z)}),n){XK(t,Y);let F=()=>ZK(t,Y);t.addEventListener("pagehide",F),Q=()=>t.removeEventListener("pagehide",F)}return k.initialized||gt("POP",k.location,{initialHydration:!0}),A}function Me(){g&&g(),Q&&Q(),y.clear(),$&&$.abort(),k.fetchers.forEach((F,Z)=>kt(Z)),k.blockers.forEach((F,Z)=>wi(Z))}function tt(F){return y.add(F),()=>y.delete(F)}function ke(F,Z={}){k={...k,...F};let re=[],he=[];k.fetchers.forEach((Te,Be)=>{Te.state==="idle"&&(ee.has(Be)?re.push(Be):he.push(Be))}),ee.forEach(Te=>{!k.fetchers.has(Te)&&!P.has(Te)&&re.push(Te)}),[...y].forEach(Te=>Te(k,{deletedFetchers:re,viewTransitionOpts:Z.viewTransitionOpts,flushSync:Z.flushSync===!0})),re.forEach(Te=>kt(Te)),he.forEach(Te=>k.fetchers.delete(Te))}function vt(F,Z,{flushSync:re}={}){var Je,it;let he=k.actionData!=null&&k.navigation.formMethod!=null&&qr(k.navigation.formMethod)&&k.navigation.state==="loading"&&((Je=F.state)==null?void 0:Je._isRedirect)!==!0,Te;Z.actionData?Object.keys(Z.actionData).length>0?Te=Z.actionData:Te=null:he?Te=k.actionData:Te=null;let Be=Z.loaderData?DT(k.loaderData,Z.loaderData,Z.matches||[],Z.errors):k.loaderData,nt=k.blockers;nt.size>0&&(nt=new Map(nt),nt.forEach((Ke,st)=>nt.set(st,Bu)));let Ue=I===!0||k.navigation.formMethod!=null&&qr(k.navigation.formMethod)&&((it=F.state)==null?void 0:it._isRedirect)!==!0;u&&(c=u,u=void 0),J||M==="POP"||(M==="PUSH"?e.history.push(F,F.state):M==="REPLACE"&&e.history.replace(F,F.state));let Ze;if(M==="POP"){let Ke=Y.get(k.location.pathname);Ke&&Ke.has(F.pathname)?Ze={currentLocation:k.location,nextLocation:F}:Y.has(F.pathname)&&(Ze={currentLocation:F,nextLocation:k.location})}else if(V){let Ke=Y.get(k.location.pathname);Ke?Ke.add(F.pathname):(Ke=new Set([F.pathname]),Y.set(k.location.pathname,Ke)),Ze={currentLocation:k.location,nextLocation:F}}ke({...Z,actionData:Te,loaderData:Be,historyAction:M,location:F,initialized:!0,navigation:oy,revalidation:"idle",restoreScrollPosition:qn(F,Z.matches||k.matches),preventScrollReset:Ue,blockers:nt},{viewTransitionOpts:Ze,flushSync:re===!0}),M="POP",I=!1,V=!1,J=!1,G=!1,xe==null||xe.resolve(),xe=null}async function It(F,Z){if(typeof F=="number"){e.history.go(F);return}let re=Ky(k.location,k.matches,f,F,Z==null?void 0:Z.fromRouteId,Z==null?void 0:Z.relative),{path:he,submission:Te,error:Be}=xT(!1,re,Z),nt=k.location,Ue=cd(k.location,he,Z&&Z.state);Ue={...Ue,...e.history.encodeLocation(Ue)};let Ze=Z&&Z.replace!=null?Z.replace:void 0,Je="PUSH";Ze===!0?Je="REPLACE":Ze===!1||Te!=null&&qr(Te.formMethod)&&Te.formAction===k.location.pathname+k.location.search&&(Je="REPLACE");let it=Z&&"preventScrollReset"in Z?Z.preventScrollReset===!0:void 0,Ke=(Z&&Z.flushSync)===!0,st=ll({currentLocation:nt,nextLocation:Ue,historyAction:Je});if(st){Xr(st,{state:"blocked",location:Ue,proceed(){Xr(st,{state:"proceeding",proceed:void 0,reset:void 0,location:Ue}),It(F,Z)},reset(){let Xe=new Map(k.blockers);Xe.set(st,Bu),ke({blockers:Xe})}});return}await gt(Je,Ue,{submission:Te,pendingError:Be,preventScrollReset:it,replace:Z&&Z.replace,enableViewTransition:Z&&Z.viewTransition,flushSync:Ke})}function Lt(){xe||(xe=JK()),$e(),ke({revalidation:"loading"});let F=xe.promise;return k.navigation.state==="submitting"?F:k.navigation.state==="idle"?(gt(k.historyAction,k.location,{startUninterruptedRevalidation:!0}),F):(gt(M||k.historyAction,k.navigation.location,{overrideNavigation:k.navigation,enableViewTransition:V===!0}),F)}async function gt(F,Z,re){$&&$.abort(),$=null,M=F,J=(re&&re.startUninterruptedRevalidation)===!0,xr(k.location,k.matches),I=(re&&re.preventScrollReset)===!0,V=(re&&re.enableViewTransition)===!0;let he=u||c,Te=re&&re.overrideNavigation,Be=re!=null&&re.initialHydration&&k.matches&&k.matches.length>0&&!D?k.matches:zo(he,Z,f),nt=(re&&re.flushSync)===!0;if(Be&&k.initialized&&!G&&GK(k.location,Z)&&!(re&&re.submission&&qr(re.submission.formMethod))){vt(Z,{matches:Be},{flushSync:nt});return}let Ue=ga(Be,he,Z.pathname);if(Ue.active&&Ue.matches&&(Be=Ue.matches),!Be){let{error:dn,notFoundMatches:Pt,route:Tt}=ma(Z.pathname);vt(Z,{matches:Pt,loaderData:{},errors:{[Tt.id]:dn}},{flushSync:nt});return}$=new AbortController;let Ze=tc(e.history,Z,$.signal,re&&re.submission),Je=new vT(e.unstable_getContext?await e.unstable_getContext():void 0),it;if(re&&re.pendingError)it=[Ts(Be).route.id,{type:"error",error:re.pendingError}];else if(re&&re.submission&&qr(re.submission.formMethod)){let dn=await At(Ze,Z,re.submission,Be,Je,Ue.active,re&&re.initialHydration===!0,{replace:re.replace,flushSync:nt});if(dn.shortCircuited)return;if(dn.pendingActionResult){let[Pt,Tt]=dn.pendingActionResult;if(Hr(Tt)&&ud(Tt.error)&&Tt.error.status===404){$=null,vt(Z,{matches:dn.matches,loaderData:{},errors:{[Pt]:Tt.error}});return}}Be=dn.matches||Be,it=dn.pendingActionResult,Te=sy(Z,re.submission),nt=!1,Ue.active=!1,Ze=tc(e.history,Ze.url,Ze.signal)}let{shortCircuited:Ke,matches:st,loaderData:Xe,errors:Wt}=await nn(Ze,Z,Be,Je,Ue.active,Te,re&&re.submission,re&&re.fetcherSubmission,re&&re.replace,re&&re.initialHydration===!0,nt,it);Ke||($=null,vt(Z,{matches:st||Be,...AT(it),loaderData:Xe,errors:Wt}))}async function At(F,Z,re,he,Te,Be,nt,Ue={}){$e();let Ze=YK(Z,re);if(ke({navigation:Ze},{flushSync:Ue.flushSync===!0}),Be){let Ke=await ro(he,Z.pathname,F.signal);if(Ke.type==="aborted")return{shortCircuited:!0};if(Ke.type==="error"){let st=Ts(Ke.partialMatches).route.id;return{matches:Ke.partialMatches,pendingActionResult:[st,{type:"error",error:Ke.error}]}}else if(Ke.matches)he=Ke.matches;else{let{notFoundMatches:st,error:Xe,route:Wt}=ma(Z.pathname);return{matches:st,pendingActionResult:[Wt.id,{type:"error",error:Xe}]}}}let Je,it=Qu(he,Z);if(!it.route.action&&!it.route.lazy)Je={type:"error",error:ui(405,{method:F.method,pathname:Z.pathname,routeId:it.route.id})};else{let Ke=sc(i,s,F,he,it,nt?[]:r,Te),st=await Pe(F,Ke,Te,null);if(Je=st[it.route.id],!Je){for(let Xe of he)if(st[Xe.route.id]){Je=st[Xe.route.id];break}}if(F.signal.aborted)return{shortCircuited:!0}}if(Os(Je)){let Ke;return Ue&&Ue.replace!=null?Ke=Ue.replace:Ke=ET(Je.response.headers.get("Location"),new URL(F.url),f)===k.location.pathname+k.location.search,await ge(F,Je,!0,{submission:re,replace:Ke}),{shortCircuited:!0}}if(Hr(Je)){let Ke=Ts(he,it.route.id);return(Ue&&Ue.replace)!==!0&&(M="PUSH"),{matches:he,pendingActionResult:[Ke.route.id,Je,it.route.id]}}return{matches:he,pendingActionResult:[it.route.id,Je]}}async function nn(F,Z,re,he,Te,Be,nt,Ue,Ze,Je,it,Ke){let st=Be||sy(Z,nt),Xe=nt||Ue||PT(st),Wt=!J&&!Je;if(Te){if(Wt){let nr=Ee(Ke);ke({navigation:st,...nr!==void 0?{actionData:nr}:{}},{flushSync:it})}let jt=await ro(re,Z.pathname,F.signal);if(jt.type==="aborted")return{shortCircuited:!0};if(jt.type==="error"){let nr=Ts(jt.partialMatches).route.id;return{matches:jt.partialMatches,loaderData:{},errors:{[nr]:jt.error}}}else if(jt.matches)re=jt.matches;else{let{error:nr,notFoundMatches:ji,route:Ci}=ma(Z.pathname);return{matches:ji,loaderData:{},errors:{[Ci.id]:nr}}}}let dn=u||c,{dsMatches:Pt,revalidatingFetchers:Tt}=bT(F,he,i,s,e.history,k,re,Xe,Z,Je?[]:r,Je===!0,G,K,ee,U,O,dn,f,e.patchRoutesOnNavigation!=null,Ke);if(z=++L,!e.dataStrategy&&!Pt.some(jt=>jt.shouldLoad)&&Tt.length===0){let jt=Si();return vt(Z,{matches:re,loaderData:{},errors:Ke&&Hr(Ke[1])?{[Ke[0]]:Ke[1].error}:null,...AT(Ke),...jt?{fetchers:new Map(k.fetchers)}:{}},{flushSync:it}),{shortCircuited:!0}}if(Wt){let jt={};if(!Te){jt.navigation=st;let nr=Ee(Ke);nr!==void 0&&(jt.actionData=nr)}Tt.length>0&&(jt.fetchers=De(Tt)),ke(jt,{flushSync:it})}Tt.forEach(jt=>{wt(jt.key),jt.controller&&P.set(jt.key,jt.controller)});let io=()=>Tt.forEach(jt=>wt(jt.key));$&&$.signal.addEventListener("abort",io);let{loaderResults:cr,fetcherResults:Zr}=await we(Pt,Tt,F,he);if(F.signal.aborted)return{shortCircuited:!0};$&&$.signal.removeEventListener("abort",io),Tt.forEach(jt=>P.delete(jt.key));let br=lh(cr);if(br)return await ge(F,br.result,!0,{replace:Ze}),{shortCircuited:!0};if(br=lh(Zr),br)return O.add(br.key),await ge(F,br.result,!0,{replace:Ze}),{shortCircuited:!0};let{loaderData:ao,errors:oo}=RT(k,re,cr,Ke,Tt,Zr);Je&&k.errors&&(oo={...k.errors,...oo});let $c=Si(),Jr=pa(z),va=$c||Jr||Tt.length>0;return{matches:re,loaderData:ao,errors:oo,...va?{fetchers:new Map(k.fetchers)}:{}}}function Ee(F){if(F&&!Hr(F[1]))return{[F[0]]:F[1].data};if(k.actionData)return Object.keys(k.actionData).length===0?null:k.actionData}function De(F){return F.forEach(Z=>{let re=k.fetchers.get(Z.key),he=Vu(void 0,re?re.data:void 0);k.fetchers.set(Z.key,he)}),new Map(k.fetchers)}async function Qe(F,Z,re,he){wt(F);let Te=(he&&he.flushSync)===!0,Be=u||c,nt=Ky(k.location,k.matches,f,re,Z,he==null?void 0:he.relative),Ue=zo(Be,nt,f),Ze=ga(Ue,Be,nt);if(Ze.active&&Ze.matches&&(Ue=Ze.matches),!Ue){ft(F,Z,ui(404,{pathname:nt}),{flushSync:Te});return}let{path:Je,submission:it,error:Ke}=xT(!0,nt,he);if(Ke){ft(F,Z,Ke,{flushSync:Te});return}let st=Qu(Ue,Je),Xe=new vT(e.unstable_getContext?await e.unstable_getContext():void 0),Wt=(he&&he.preventScrollReset)===!0;if(it&&qr(it.formMethod)){await Re(F,Z,Je,st,Ue,Xe,Ze.active,Te,Wt,it);return}U.set(F,{routeId:Z,path:Je}),await me(F,Z,Je,st,Ue,Xe,Ze.active,Te,Wt,it)}async function Re(F,Z,re,he,Te,Be,nt,Ue,Ze,Je){$e(),U.delete(F);function it(xn){if(!xn.route.action&&!xn.route.lazy){let so=ui(405,{method:Je.formMethod,pathname:re,routeId:Z});return ft(F,Z,so,{flushSync:Ue}),!0}return!1}if(!nt&&it(he))return;let Ke=k.fetchers.get(F);yt(F,KK(Je,Ke),{flushSync:Ue});let st=new AbortController,Xe=tc(e.history,re,st.signal,Je);if(nt){let xn=await ro(Te,re,Xe.signal,F);if(xn.type==="aborted")return;if(xn.type==="error"){ft(F,Z,xn.error,{flushSync:Ue});return}else if(xn.matches){if(Te=xn.matches,he=Qu(Te,re),it(he))return}else{ft(F,Z,ui(404,{pathname:re}),{flushSync:Ue});return}}P.set(F,st);let Wt=L,dn=sc(i,s,Xe,Te,he,r,Be),Tt=(await Pe(Xe,dn,Be,F))[he.route.id];if(Xe.signal.aborted){P.get(F)===st&&P.delete(F);return}if(ee.has(F)){if(Os(Tt)||Hr(Tt)){yt(F,No(void 0));return}}else{if(Os(Tt))if(P.delete(F),z>Wt){yt(F,No(void 0));return}else return O.add(F),yt(F,Vu(Je)),ge(Xe,Tt,!1,{fetcherSubmission:Je,preventScrollReset:Ze});if(Hr(Tt)){ft(F,Z,Tt.error);return}}let io=k.navigation.location||k.location,cr=tc(e.history,io,st.signal),Zr=u||c,br=k.navigation.state!=="idle"?zo(Zr,k.navigation.location,f):k.matches;bt(br,"Didn't find any matches after fetcher action");let ao=++L;H.set(F,ao);let oo=Vu(Je,Tt.data);k.fetchers.set(F,oo);let{dsMatches:$c,revalidatingFetchers:Jr}=bT(cr,Be,i,s,e.history,k,br,Je,io,r,!1,G,K,ee,U,O,Zr,f,e.patchRoutesOnNavigation!=null,[he.route.id,Tt]);Jr.filter(xn=>xn.key!==F).forEach(xn=>{let so=xn.key,Uc=k.fetchers.get(so),Sr=Vu(void 0,Uc?Uc.data:void 0);k.fetchers.set(so,Sr),wt(so),xn.controller&&P.set(so,xn.controller)}),ke({fetchers:new Map(k.fetchers)});let va=()=>Jr.forEach(xn=>wt(xn.key));st.signal.addEventListener("abort",va);let{loaderResults:jt,fetcherResults:nr}=await we($c,Jr,cr,Be);if(st.signal.aborted)return;if(st.signal.removeEventListener("abort",va),H.delete(F),P.delete(F),Jr.forEach(xn=>P.delete(xn.key)),k.fetchers.has(F)){let xn=No(Tt.data);k.fetchers.set(F,xn)}let ji=lh(jt);if(ji)return ge(cr,ji.result,!1,{preventScrollReset:Ze});if(ji=lh(nr),ji)return O.add(ji.key),ge(cr,ji.result,!1,{preventScrollReset:Ze});let{loaderData:Ci,errors:ns}=RT(k,br,jt,void 0,Jr,nr);pa(ao),k.navigation.state==="loading"&&ao>z?(bt(M,"Expected pending action"),$&&$.abort(),vt(k.navigation.location,{matches:br,loaderData:Ci,errors:ns,fetchers:new Map(k.fetchers)})):(ke({errors:ns,loaderData:DT(k.loaderData,Ci,br,ns),fetchers:new Map(k.fetchers)}),G=!1)}async function me(F,Z,re,he,Te,Be,nt,Ue,Ze,Je){let it=k.fetchers.get(F);yt(F,Vu(Je,it?it.data:void 0),{flushSync:Ue});let Ke=new AbortController,st=tc(e.history,re,Ke.signal);if(nt){let Tt=await ro(Te,re,st.signal,F);if(Tt.type==="aborted")return;if(Tt.type==="error"){ft(F,Z,Tt.error,{flushSync:Ue});return}else if(Tt.matches)Te=Tt.matches,he=Qu(Te,re);else{ft(F,Z,ui(404,{pathname:re}),{flushSync:Ue});return}}P.set(F,Ke);let Xe=L,Wt=sc(i,s,st,Te,he,r,Be),Pt=(await Pe(st,Wt,Be,F))[he.route.id];if(P.get(F)===Ke&&P.delete(F),!st.signal.aborted){if(ee.has(F)){yt(F,No(void 0));return}if(Os(Pt))if(z>Xe){yt(F,No(void 0));return}else{O.add(F),await ge(st,Pt,!1,{preventScrollReset:Ze});return}if(Hr(Pt)){ft(F,Z,Pt.error);return}yt(F,No(Pt.data))}}async function ge(F,Z,re,{submission:he,fetcherSubmission:Te,preventScrollReset:Be,replace:nt}={}){Z.response.headers.has("X-Remix-Revalidate")&&(G=!0);let Ue=Z.response.headers.get("Location");bt(Ue,"Expected a Location header on the redirect Response"),Ue=ET(Ue,new URL(F.url),f);let Ze=cd(k.location,Ue,{_isRedirect:!0});if(n){let Wt=!1;if(Z.response.headers.has("X-Remix-Reload-Document"))Wt=!0;else if(Fb.test(Ue)){const dn=gk(Ue,!0);Wt=dn.origin!==t.location.origin||vi(dn.pathname,f)==null}if(Wt){nt?t.location.replace(Ue):t.location.assign(Ue);return}}$=null;let Je=nt===!0||Z.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:it,formAction:Ke,formEncType:st}=k.navigation;!he&&!Te&&it&&Ke&&st&&(he=PT(k.navigation));let Xe=he||Te;if(PK.has(Z.response.status)&&Xe&&qr(Xe.formMethod))await gt(Je,Ze,{submission:{...Xe,formAction:Ue},preventScrollReset:Be||I,enableViewTransition:re?V:void 0});else{let Wt=sy(Ze,he);await gt(Je,Ze,{overrideNavigation:Wt,fetcherSubmission:Te,preventScrollReset:Be||I,enableViewTransition:re?V:void 0})}}async function Pe(F,Z,re,he){let Te,Be={};try{Te=await BK(p,F,Z,he,re,!1)}catch(nt){return Z.filter(Ue=>Ue.shouldLoad).forEach(Ue=>{Be[Ue.route.id]={type:"error",error:nt}}),Be}if(F.signal.aborted)return Be;for(let[nt,Ue]of Object.entries(Te))if(QK(Ue)){let Ze=Ue.result;Be[nt]={type:"redirect",response:HK(Ze,F,nt,Z,f)}}else Be[nt]=await FK(Ue);return Be}async function we(F,Z,re,he){let Te=Pe(re,F,he,null),Be=Promise.all(Z.map(async Ze=>{if(Ze.matches&&Ze.match&&Ze.request&&Ze.controller){let it=(await Pe(Ze.request,Ze.matches,he,Ze.key))[Ze.match.route.id];return{[Ze.key]:it}}else return Promise.resolve({[Ze.key]:{type:"error",error:ui(404,{pathname:Ze.path})}})})),nt=await Te,Ue=(await Be).reduce((Ze,Je)=>Object.assign(Ze,Je),{});return{loaderResults:nt,fetcherResults:Ue}}function $e(){G=!0,U.forEach((F,Z)=>{P.has(Z)&&K.add(Z),wt(Z)})}function yt(F,Z,re={}){k.fetchers.set(F,Z),ke({fetchers:new Map(k.fetchers)},{flushSync:(re&&re.flushSync)===!0})}function ft(F,Z,re,he={}){let Te=Ts(k.matches,Z);kt(F),ke({errors:{[Te.route.id]:re},fetchers:new Map(k.fetchers)},{flushSync:(he&&he.flushSync)===!0})}function Gt(F){return X.set(F,(X.get(F)||0)+1),ee.has(F)&&ee.delete(F),k.fetchers.get(F)||NK}function kt(F){let Z=k.fetchers.get(F);P.has(F)&&!(Z&&Z.state==="loading"&&H.has(F))&&wt(F),U.delete(F),H.delete(F),O.delete(F),ee.delete(F),K.delete(F),k.fetchers.delete(F)}function un(F){let Z=(X.get(F)||0)-1;Z<=0?(X.delete(F),ee.add(F)):X.set(F,Z),ke({fetchers:new Map(k.fetchers)})}function wt(F){let Z=P.get(F);Z&&(Z.abort(),P.delete(F))}function Vi(F){for(let Z of F){let re=Gt(Z),he=No(re.data);k.fetchers.set(Z,he)}}function Si(){let F=[],Z=!1;for(let re of O){let he=k.fetchers.get(re);bt(he,`Expected fetcher: ${re}`),he.state==="loading"&&(O.delete(re),F.push(re),Z=!0)}return Vi(F),Z}function pa(F){let Z=[];for(let[re,he]of H)if(he<F){let Te=k.fetchers.get(re);bt(Te,`Expected fetcher: ${re}`),Te.state==="loading"&&(wt(re),H.delete(re),Z.push(re))}return Vi(Z),Z.length>0}function Bn(F,Z){let re=k.blockers.get(F)||Bu;return Se.get(F)!==Z&&Se.set(F,Z),re}function wi(F){k.blockers.delete(F),Se.delete(F)}function Xr(F,Z){let re=k.blockers.get(F)||Bu;bt(re.state==="unblocked"&&Z.state==="blocked"||re.state==="blocked"&&Z.state==="blocked"||re.state==="blocked"&&Z.state==="proceeding"||re.state==="blocked"&&Z.state==="unblocked"||re.state==="proceeding"&&Z.state==="unblocked",`Invalid blocker state transition: ${re.state} -> ${Z.state}`);let he=new Map(k.blockers);he.set(F,Z),ke({blockers:he})}function ll({currentLocation:F,nextLocation:Z,historyAction:re}){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()),[Te,Be]=he[he.length-1],nt=k.blockers.get(Te);if(!(nt&&nt.state==="proceeding")&&Be({currentLocation:F,nextLocation:Z,historyAction:re}))return Te}function ma(F){let Z=ui(404,{pathname:F}),re=u||c,{matches:he,route:Te}=_T(re);return{notFoundMatches:he,route:Te,error:Z}}function no(F,Z,re){if(b=F,j=Z,S=re||null,!C&&k.navigation===oy){C=!0;let he=qn(k.location,k.matches);he!=null&&ke({restoreScrollPosition:he})}return()=>{b=null,j=null,S=null}}function Fi(F,Z){return S&&S(F,Z.map(he=>uK(he,k.loaderData)))||F.key}function xr(F,Z){if(b&&j){let re=Fi(F,Z);b[re]=j()}}function qn(F,Z){if(b){let re=Fi(F,Z),he=b[re];if(typeof he=="number")return he}return null}function ga(F,Z,re){if(e.patchRoutesOnNavigation)if(F){if(Object.keys(F[0].params).length>0)return{active:!0,matches:Sh(Z,re,f,!0)}}else return{active:!0,matches:Sh(Z,re,f,!0)||[]};return{active:!1,matches:null}}async function ro(F,Z,re,he){if(!e.patchRoutesOnNavigation)return{type:"success",matches:F};let Te=F;for(;;){let Be=u==null,nt=u||c,Ue=s;try{await e.patchRoutesOnNavigation({signal:re,path:Z,matches:Te,fetcherKey:he,patch:(it,Ke)=>{re.aborted||ST(it,Ke,nt,Ue,i)}})}catch(it){return{type:"error",error:it,partialMatches:Te}}finally{Be&&!re.aborted&&(c=[...c])}if(re.aborted)return{type:"aborted"};let Ze=zo(nt,Z,f);if(Ze)return{type:"success",matches:Ze};let Je=Sh(nt,Z,f,!0);if(!Je||Te.length===Je.length&&Te.every((it,Ke)=>it.route.id===Je[Ke].route.id))return{type:"success",matches:null};Te=Je}}function es(F){s={},u=Kh(F,i,void 0,s)}function ts(F,Z){let re=u==null;ST(F,Z,u||c,s,i),re&&(c=[...c],ke({}))}return A={get basename(){return f},get future(){return m},get state(){return k},get routes(){return c},get window(){return t},initialize:qe,subscribe:tt,enableScrollRestoration:no,navigate:It,fetch:Qe,revalidate:Lt,createHref:F=>e.history.createHref(F),encodeLocation:F=>e.history.encodeLocation(F),getFetcher:Gt,deleteFetcher:un,dispose:Me,getBlocker:Bn,deleteBlocker:wi,patchRoutes:ts,_internalFetchControllers:P,_internalSetRoutes:es},A}function IK(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ky(e,t,n,r,i,s){let c,u;if(i){c=[];for(let p of t)if(c.push(p),p.route.id===i){u=p;break}}else c=t,u=t[t.length-1];let f=Vb(r||".",Bb(c),vi(e.pathname,n)||e.pathname,s==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&u){let p=Hb(f.search);if(u.route.index&&!p)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&p){let m=new URLSearchParams(f.search),g=m.getAll("index");m.delete("index"),g.filter(b=>b).forEach(b=>m.append("index",b));let y=m.toString();f.search=y?`?${y}`:""}}return n!=="/"&&(f.pathname=f.pathname==="/"?n:oa([n,f.pathname])),Ho(f)}function xT(e,t,n){if(!n||!IK(n))return{path:t};if(n.formMethod&&!WK(n.formMethod))return{path:t,error:ui(405,{method:n.formMethod})};let r=()=>({path:t,error:ui(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),c=Dk(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!qr(s))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}
572
- `,""):String(n.body);return{path:t,submission:{formMethod:s,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!qr(s))return r();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:s,formAction:c,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return r()}}}bt(typeof FormData=="function","FormData is not available in this environment");let u,f;if(n.formData)u=Jy(n.formData),f=n.formData;else if(n.body instanceof FormData)u=Jy(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=TT(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=TT(u)}catch{return r()}let p={formMethod:s,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(qr(p.formMethod))return{path:t,submission:p};let m=to(t);return e&&m.search&&Hb(m.search)&&u.append("index",""),m.search=`?${u}`,{path:Ho(m),submission:p}}function bT(e,t,n,r,i,s,c,u,f,p,m,g,y,b,S,j,C,T,D,E){var J;let R=E?Hr(E[1])?E[1].error:E[1].data:void 0,A=i.createURL(s.location),k=i.createURL(f),M;if(m&&s.errors){let G=Object.keys(s.errors)[0];M=c.findIndex(K=>K.route.id===G)}else if(E&&Hr(E[1])){let G=E[0];M=c.findIndex(K=>K.route.id===G)-1}let I=E?E[1].statusCode:void 0,$=I&&I>=400,V={currentUrl:A,currentParams:((J=s.matches[0])==null?void 0:J.params)||{},nextUrl:k,nextParams:c[0].params,...u,actionResult:R,actionStatus:I},Y=c.map((G,K)=>{let{route:P}=G,L=null;if(M!=null&&K>M?L=!1:P.lazy?L=!0:P.loader==null?L=!1:m?L=Xy(P,s.loaderData,s.errors):LK(s.loaderData,s.matches[K],G)&&(L=!0),L!==null)return Zy(n,r,e,G,p,t,L);let z=$?!1:g||A.pathname+A.search===k.pathname+k.search||A.search!==k.search||zK(s.matches[K],G),H={...V,defaultShouldRevalidate:z},O=Jh(G,H);return Zy(n,r,e,G,p,t,O,H)}),Q=[];return S.forEach((G,K)=>{if(m||!c.some(ee=>ee.route.id===G.routeId)||b.has(K))return;let P=s.fetchers.get(K),L=P&&P.state!=="idle"&&P.data===void 0,z=zo(C,G.path,T);if(!z){if(D&&L)return;Q.push({key:K,routeId:G.routeId,path:G.path,matches:null,match:null,request:null,controller:null});return}if(j.has(K))return;let H=Qu(z,G.path),O=new AbortController,U=tc(i,G.path,O.signal),X=null;if(y.has(K))y.delete(K),X=sc(n,r,U,z,H,p,t);else if(L)g&&(X=sc(n,r,U,z,H,p,t));else{let ee={...V,defaultShouldRevalidate:$?!1:g};Jh(H,ee)&&(X=sc(n,r,U,z,H,p,t,ee))}X&&Q.push({key:K,routeId:G.routeId,path:G.path,matches:X,match:H,request:U,controller:O})}),{dsMatches:Y,revalidatingFetchers:Q}}function Xy(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 LK(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function zK(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Jh(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function ST(e,t,n,r,i){let s;if(e){let f=r[e];bt(f,`No route found to patch children into: routeId = ${e}`),f.children||(f.children=[]),s=f.children}else s=n;let c=t.filter(f=>!s.some(p=>jk(f,p))),u=Kh(c,i,[e||"_","patch",String((s==null?void 0:s.length)||"0")],r);s.push(...u)}function jk(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(s=>jk(n,s))}):!1}var wT=new WeakMap,Ck=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(bt(i,"No route found in manifest"),!i.lazy||typeof i.lazy!="object")return;let s=i.lazy[e];if(!s)return;let c=wT.get(i);c||(c={},wT.set(i,c));let u=c[e];if(u)return u;let f=(async()=>{let p=oK(e),g=i[e]!==void 0&&e!=="hasErrorBoundary";if(p)Mn(!p,"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 s();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},jT=new WeakMap;function $K(e,t,n,r,i){let s=n[e.id];if(bt(s,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=jT.get(s);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let g=(async()=>{bt(typeof e.lazy=="function","No lazy route function found");let y=await e.lazy(),b={};for(let S in y){let j=y[S];if(j===void 0)continue;let C=lK(S),D=s[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."):D?Mn(!D,`Route "${s.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(s,b),Object.assign(s,{...r(s),lazy:void 0})})();return jT.set(s,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=Ck({key:m,route:e,manifest:n,mapRouteProperties:r});g&&(u.push(g),m===t&&(f=g))}let p=u.length>0?Promise.all(u).then(()=>{}):void 0;return p==null||p.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:f}}async function CT(e){let t=e.matches.filter(i=>i.shouldLoad),n={};return(await Promise.all(t.map(i=>i.resolve()))).forEach((i,s)=>{n[t[s].route.id]=i}),n}async function UK(e){return e.matches.some(t=>t.route.unstable_middleware)?Ek(e,!1,()=>CT(e),(t,n)=>({[n]:{type:"error",result:t}})):CT(e)}async function Ek(e,t,n,r){let{matches:i,request:s,params:c,context:u}=e,f={handlerResult:void 0};try{let p=i.flatMap(g=>g.route.unstable_middleware?g.route.unstable_middleware.map(y=>[g.route.id,y]):[]),m=await Tk({request:s,params:c,context:u},p,t,f,n);return t?m:f.handlerResult}catch(p){if(!f.middlewareError)throw p;let m=await r(f.middlewareError.error,f.middlewareError.routeId);return f.handlerResult?Object.assign(f.handlerResult,m):m}}async function Tk(e,t,n,r,i,s=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[s];if(!u)return r.handlerResult=await i(),r.handlerResult;let[f,p]=u,m=!1,g,y=async()=>{if(m)throw new Error("You may only call `next()` once per middleware");m=!0,await Tk(e,t,n,r,i,s+1)};try{let b=await p({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 Rk(e,t,n,r,i){let s=Ck({key:"unstable_middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=$K(r.route,qr(n.method)?"action":"loader",t,e,i);return{middleware:s,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function Zy(e,t,n,r,i,s,c,u=null){let f=!1,p=Rk(e,t,n,r,i);return{...r,_lazyPromises:p,shouldLoad:c,unstable_shouldRevalidateArgs:u,unstable_shouldCallHandler(m){return f=!0,u?typeof m=="boolean"?Jh(r,{...u,defaultShouldRevalidate:m}):Jh(r,u):c},resolve(m){return f||c||m&&n.method==="GET"&&(r.route.lazy||r.route.loader)?VK({request:n,match:r,lazyHandlerPromise:p==null?void 0:p.handler,lazyRoutePromise:p==null?void 0:p.route,handlerOverride:m,scopedContext:s}):Promise.resolve({type:"data",result:void 0})}}}function sc(e,t,n,r,i,s,c,u=null){return r.map(f=>f.route.id!==i.route.id?{...f,shouldLoad:!1,unstable_shouldRevalidateArgs:u,unstable_shouldCallHandler:()=>!1,_lazyPromises:Rk(e,t,n,f,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Zy(e,t,n,f,s,c,!0,u))}async function BK(e,t,n,r,i,s){n.some(p=>{var m;return(m=p._lazyPromises)==null?void 0:m.middleware})&&await Promise.all(n.map(p=>{var m;return(m=p._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:p=>{let m=c;return Ek(m,!1,()=>p({...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(p=>{var m,g;return[(m=p._lazyPromises)==null?void 0:m.handler,(g=p._lazyPromises)==null?void 0:g.route]}))}catch{}return f}async function VK({request:e,match:t,lazyHandlerPromise:n,lazyRoutePromise:r,handlerOverride:i,scopedContext:s}){let c,u,f=qr(e.method),p=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 "${p}" [routeId: ${t.route.id}]`)):g({request:e,params:t.params,context:s},...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(p==="action"){let b=new URL(e.url),S=b.pathname+b.search;throw ui(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 ui(404,{pathname:b})}}catch(g){return{type:"error",result:g}}finally{u&&e.signal.removeEventListener("abort",u)}return c}async function FK(e){var r,i,s,c,u,f;let{result:t,type:n}=e;if(Ak(t)){let p;try{let m=t.headers.get("Content-Type");m&&/\bapplication\/json\b/.test(m)?t.body==null?p=null:p=await t.json():p=await t.text()}catch(m){return{type:"error",error:m}}return n==="error"?{type:"error",error:new Zh(t.status,t.statusText,p),statusCode:t.status,headers:t.headers}:{type:"data",data:p,statusCode:t.status,headers:t.headers}}return n==="error"?kT(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 Zh(((s=t.init)==null?void 0:s.status)||500,void 0,t.data),statusCode:ud(t)?t.status:void 0,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:ud(t)?t.status:void 0}:kT(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 HK(e,t,n,r,i){let s=e.headers.get("Location");if(bt(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Fb.test(s)){let c=r.slice(0,r.findIndex(u=>u.route.id===n)+1);s=Ky(new URL(t.url),c,i,s),e.headers.set("Location",s)}return e}function ET(e,t,n){if(Fb.test(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),s=vi(i.pathname,n)!=null;if(i.origin===t.origin&&s)return i.pathname+i.search+i.hash}return e}function tc(e,t,n,r){let i=e.createURL(Dk(t)).toString(),s={signal:n};if(r&&qr(r.formMethod)){let{formMethod:c,formEncType:u}=r;s.method=c.toUpperCase(),u==="application/json"?(s.headers=new Headers({"Content-Type":u}),s.body=JSON.stringify(r.json)):u==="text/plain"?s.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?s.body=Jy(r.formData):s.body=r.formData}return new Request(i,s)}function Jy(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function TT(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function qK(e,t,n,r=!1,i=!1){let s={},c=null,u,f=!1,p={},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(bt(!Os(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=Ts(e,y);c[j.route.id]==null&&(c[j.route.id]=S)}r||(s[y]=wk),f||(f=!0,u=ud(b.error)?b.error.status:500),b.headers&&(p[y]=b.headers)}else s[y]=b.data,b.statusCode&&b.statusCode!==200&&!f&&(u=b.statusCode),b.headers&&(p[y]=b.headers)}),m!==void 0&&n&&(c={[n[0]]:m},n[2]&&(s[n[2]]=void 0)),{loaderData:s,errors:c,statusCode:u||200,loaderHeaders:p}}function RT(e,t,n,r,i,s){let{loaderData:c,errors:u}=qK(t,n,r);return i.filter(f=>!f.matches||f.matches.some(p=>p.shouldLoad)).forEach(f=>{let{key:p,match:m,controller:g}=f,y=s[p];if(bt(y,"Did not find corresponding fetcher result"),!(g&&g.signal.aborted))if(Hr(y)){let b=Ts(e.matches,m==null?void 0:m.route.id);u&&u[b.route.id]||(u={...u,[b.route.id]:y.error}),e.fetchers.delete(p)}else if(Os(y))bt(!1,"Unhandled fetcher revalidation redirect");else{let b=No(y.data);e.fetchers.set(p,b)}}),{loaderData:c,errors:u}}function DT(e,t,n,r){let i=Object.entries(t).filter(([,s])=>s!==wk).reduce((s,[c,u])=>(s[c]=u,s),{});for(let s of n){let c=s.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&s.route.loader&&(i[c]=e[c]),r&&r.hasOwnProperty(c))break}return i}function AT(e){return e?Hr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ts(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 _T(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 ui(e,{pathname:t,routeId:n,method:r,type:i,message:s}={}){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 Zh(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(Os(i))return{key:r,result:i}}}function Dk(e){let t=typeof e=="string"?to(e):e;return Ho({...t,hash:""})}function GK(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function QK(e){return Ak(e.result)&&kK.has(e.result.status)}function Hr(e){return e.type==="error"}function Os(e){return(e&&e.type)==="redirect"}function kT(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Ak(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function WK(e){return _K.has(e.toUpperCase())}function qr(e){return DK.has(e.toUpperCase())}function Hb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Qu(e,t){let n=typeof t=="string"?to(t).search:t.search;if(e[e.length-1].route.index&&Hb(n||""))return e[e.length-1];let r=xk(e);return r[r.length-1]}function PT(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:s,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(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:s,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 sy(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 YK(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 Vu(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 KK(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 No(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 XK(e,t){try{let n=e.sessionStorage.getItem(Sk);if(n){let r=JSON.parse(n);for(let[i,s]of Object.entries(r||{}))s&&Array.isArray(s)&&t.set(i,new Set(s||[]))}}catch{}}function ZK(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(Sk,JSON.stringify(n))}catch(r){Mn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function JK(){let e,t,n=new Promise((r,i)=>{e=async s=>{r(s);try{await n}catch{}},t=async s=>{i(s);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var al=v.createContext(null);al.displayName="DataRouter";var Ld=v.createContext(null);Ld.displayName="DataRouterState";var qb=v.createContext({isTransitioning:!1});qb.displayName="ViewTransition";var _k=v.createContext(new Map);_k.displayName="Fetchers";var eX=v.createContext(null);eX.displayName="Await";var ha=v.createContext(null);ha.displayName="Navigation";var zd=v.createContext(null);zd.displayName="Location";var Bi=v.createContext({outlet:null,matches:[],isDataRoute:!1});Bi.displayName="Route";var Gb=v.createContext(null);Gb.displayName="RouteError";function tX(e,{relative:t}={}){bt($d(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=v.useContext(ha),{hash:i,pathname:s,search:c}=Ud(e,{relative:t}),u=s;return n!=="/"&&(u=s==="/"?n:oa([n,s])),r.createHref({pathname:u,search:c,hash:i})}function $d(){return v.useContext(zd)!=null}function Mr(){return bt($d(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(zd).location}var kk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Pk(e){v.useContext(ha).static||v.useLayoutEffect(e)}function wn(){let{isDataRoute:e}=v.useContext(Bi);return e?gX():nX()}function nX(){bt($d(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(al),{basename:t,navigator:n}=v.useContext(ha),{matches:r}=v.useContext(Bi),{pathname:i}=Mr(),s=JSON.stringify(Bb(r)),c=v.useRef(!1);return Pk(()=>{c.current=!0}),v.useCallback((f,p={})=>{if(Mn(c.current,kk),!c.current)return;if(typeof f=="number"){n.go(f);return}let m=Vb(f,JSON.parse(s),i,p.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:oa([t,m.pathname])),(p.replace?n.replace:n.push)(m,p.state,p)},[t,n,s,i,e])}var rX=v.createContext(null);function iX(e){let t=v.useContext(Bi).outlet;return t&&v.createElement(rX.Provider,{value:e},t)}function qt(){let{matches:e}=v.useContext(Bi),t=e[e.length-1];return t?t.params:{}}function Ud(e,{relative:t}={}){let{matches:n}=v.useContext(Bi),{pathname:r}=Mr(),i=JSON.stringify(Bb(n));return v.useMemo(()=>Vb(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function aX(e,t){return Nk(e,t)}function Nk(e,t,n,r){var T;bt($d(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=v.useContext(ha),{matches:s}=v.useContext(Bi),c=s[s.length-1],u=c?c.params:{},f=c?c.pathname:"/",p=c?c.pathnameBase:"/",m=c&&c.route;{let D=m&&m.path||"";Ok(f,!m||D.endsWith("*")||D.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${D}">) 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.
573
-
574
- Please change the parent <Route path="${D}"> to <Route path="${D==="/"?"*":`${D}/*`}">.`)}let g=Mr(),y;if(t){let D=typeof t=="string"?to(t):t;bt(p==="/"||((T=D.pathname)==null?void 0:T.startsWith(p)),`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 "${p}" but pathname "${D.pathname}" was given in the \`location\` prop.`),y=D}else y=g;let b=y.pathname||"/",S=b;if(p!=="/"){let D=p.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(D.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=uX(j&&j.map(D=>Object.assign({},D,{params:Object.assign({},u,D.params),pathname:oa([p,i.encodeLocation?i.encodeLocation(D.pathname).pathname:D.pathname]),pathnameBase:D.pathnameBase==="/"?p:oa([p,i.encodeLocation?i.encodeLocation(D.pathnameBase).pathname:D.pathnameBase])})),s,n,r);return t&&C?v.createElement(zd.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...y},navigationType:"POP"}},C):C}function oX(){let e=mX(),t=ud(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},s={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:s},"ErrorBoundary")," or"," ",v.createElement("code",{style:s},"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 sX=v.createElement(oX,null),lX=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(Bi.Provider,{value:this.props.routeContext},v.createElement(Gb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function cX({routeContext:e,match:t,children:n}){let r=v.useContext(al);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(Bi.Provider,{value:e},n)}function uX(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,s=n==null?void 0:n.errors;if(s!=null){let f=i.findIndex(p=>p.route.id&&(s==null?void 0:s[p.route.id])!==void 0);bt(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).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 p=i[f];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(u=f),p.route.id){let{loaderData:m,errors:g}=n,y=p.route.loader&&!m.hasOwnProperty(p.route.id)&&(!g||g[p.route.id]===void 0);if(p.route.lazy||y){c=!0,u>=0?i=i.slice(0,u+1):i=[i[0]];break}}}return i.reduceRight((f,p,m)=>{let g,y=!1,b=null,S=null;n&&(g=s&&p.route.id?s[p.route.id]:void 0,b=p.route.errorElement||sX,c&&(u<0&&m===0?(Ok("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,S=null):u===m&&(y=!0,S=p.route.hydrateFallbackElement||null)));let j=t.concat(i.slice(0,m+1)),C=()=>{let T;return g?T=b:y?T=S:p.route.Component?T=v.createElement(p.route.Component,null):p.route.element?T=p.route.element:T=f,v.createElement(cX,{match:p,routeContext:{outlet:f,matches:j,isDataRoute:n!=null},children:T})};return n&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?v.createElement(lX,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:C(),routeContext:{outlet:null,matches:j,isDataRoute:!0}}):C()},null)}function Qb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function dX(e){let t=v.useContext(al);return bt(t,Qb(e)),t}function fX(e){let t=v.useContext(Ld);return bt(t,Qb(e)),t}function hX(e){let t=v.useContext(Bi);return bt(t,Qb(e)),t}function Wb(e){let t=hX(e),n=t.matches[t.matches.length-1];return bt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function pX(){return Wb("useRouteId")}function mX(){var r;let e=v.useContext(Gb),t=fX("useRouteError"),n=Wb("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function gX(){let{router:e}=dX("useNavigate"),t=Wb("useNavigate"),n=v.useRef(!1);return Pk(()=>{n.current=!0}),v.useCallback(async(i,s={})=>{Mn(n.current,kk),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...s}))},[e,t])}var NT={};function Ok(e,t,n){!t&&!NT[e]&&(NT[e]=!0,Mn(!1,n))}var OT={};function MT(e,t){!e&&!OT[t]&&(OT[t]=!0,console.warn(t))}function vX(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 yX=["HydrateFallback","hydrateFallbackElement"],xX=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 bX({router:e,flushSync:t}){let[n,r]=v.useState(e.state),[i,s]=v.useState(),[c,u]=v.useState({isTransitioning:!1}),[f,p]=v.useState(),[m,g]=v.useState(),[y,b]=v.useState(),S=v.useRef(new Map),j=v.useCallback((E,{deletedFetchers:R,flushSync:A,viewTransitionOpts:k})=>{E.fetchers.forEach((I,$)=>{I.data!==void 0&&S.current.set($,I.data)}),R.forEach(I=>S.current.delete(I)),MT(A===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let M=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(MT(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&&A?t(()=>r(E)):v.startTransition(()=>r(E));return}if(t&&A){t(()=>{m&&(f&&f.resolve(),m.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:k.currentLocation,nextLocation:k.nextLocation})});let I=e.window.document.startViewTransition(()=>{t(()=>r(E))});I.finished.finally(()=>{t(()=>{p(void 0),g(void 0),s(void 0),u({isTransitioning:!1})})}),t(()=>g(I));return}m?(f&&f.resolve(),m.skipTransition(),b({state:E,currentLocation:k.currentLocation,nextLocation:k.nextLocation})):(s(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&&p(new xX)},[c]),v.useEffect(()=>{if(f&&i&&e.window){let E=i,R=f.promise,A=e.window.document.startViewTransition(async()=>{v.startTransition(()=>r(E)),await R});A.finished.finally(()=>{p(void 0),g(void 0),s(void 0),u({isTransitioning:!1})}),g(A)}},[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&&(s(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,A)=>e.navigate(E,{state:R,preventScrollReset:A==null?void 0:A.preventScrollReset}),replace:(E,R,A)=>e.navigate(E,{replace:!0,state:R,preventScrollReset:A==null?void 0:A.preventScrollReset})}),[e]),T=e.basename||"/",D=v.useMemo(()=>({router:e,navigator:C,static:!1,basename:T}),[e,C,T]);return v.createElement(v.Fragment,null,v.createElement(al.Provider,{value:D},v.createElement(Ld.Provider,{value:n},v.createElement(_k.Provider,{value:S.current},v.createElement(qb.Provider,{value:c},v.createElement(jX,{basename:T,location:n.location,navigationType:n.historyAction,navigator:C},v.createElement(SX,{routes:e.routes,future:e.future,state:n})))))),null)}var SX=v.memo(wX);function wX({routes:e,future:t,state:n}){return Nk(e,void 0,n,t)}function Yb(e){return iX(e.context)}function Fe(e){bt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function jX({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:s=!1}){bt(!$d(),"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:s,future:{}}),[c,i,s]);typeof n=="string"&&(n=to(n));let{pathname:f="/",search:p="",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:p,hash:m,state:g,key:y},navigationType:r}},[c,f,p,m,g,y,r]);return Mn(b!=null,`<Router basename="${c}"> is not able to match the URL "${f}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:v.createElement(ha.Provider,{value:u},v.createElement(zd.Provider,{children:t,value:b}))}function CX({children:e,location:t}){return aX(ex(e),t)}function ex(e,t=[]){let n=[];return v.Children.forEach(e,(r,i)=>{if(!v.isValidElement(r))return;let s=[...t,i];if(r.type===v.Fragment){n.push.apply(n,ex(r.props.children,s));return}bt(r.type===Fe,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),bt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let c={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,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=ex(r.props.children,s)),n.push(c)}),n}var wh="get",jh="application/x-www-form-urlencoded";function dm(e){return e!=null&&typeof e.tagName=="string"}function EX(e){return dm(e)&&e.tagName.toLowerCase()==="button"}function TX(e){return dm(e)&&e.tagName.toLowerCase()==="form"}function RX(e){return dm(e)&&e.tagName.toLowerCase()==="input"}function DX(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function AX(e,t){return e.button===0&&(!t||t==="_self")&&!DX(e)}function tx(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 _X(e,t){let n=tx(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(s=>{n.append(i,s)})}),n}var ch=null;function kX(){if(ch===null)try{new FormData(document.createElement("form"),0),ch=!1}catch{ch=!0}return ch}var PX=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ly(e){return e!=null&&!PX.has(e)?(Mn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${jh}"`),null):e}function NX(e,t){let n,r,i,s,c;if(TX(e)){let u=e.getAttribute("action");r=u?vi(u,t):null,n=e.getAttribute("method")||wh,i=ly(e.getAttribute("enctype"))||jh,s=new FormData(e)}else if(EX(e)||RX(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")||wh,i=ly(e.getAttribute("formenctype"))||ly(u.getAttribute("enctype"))||jh,s=new FormData(u,e),!kX()){let{name:p,type:m,value:g}=e;if(m==="image"){let y=p?`${p}.`:"";s.append(`${y}x`,"0"),s.append(`${y}y`,"0")}else p&&s.append(p,g)}}else{if(dm(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=wh,r=null,i=jh,c=e}return s&&i==="text/plain"&&(c=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:c}}function Kb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function OX(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 MX(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 IX(e,t,n){let r=await Promise.all(e.map(async i=>{let s=t.routes[i.route.id];if(s){let c=await OX(s,n);return c.links?c.links():[]}return[]}));return UX(r.flat(1).filter(MX).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function IT(e,t,n,r,i,s){let c=(f,p)=>n[p]?f.route.id!==n[p].route.id:!0,u=(f,p)=>{var m;return n[p].pathname!==f.pathname||((m=n[p].route.path)==null?void 0:m.endsWith("*"))&&n[p].params["*"]!==f.params["*"]};return s==="assets"?t.filter((f,p)=>c(f,p)||u(f,p)):s==="data"?t.filter((f,p)=>{var g;let m=r.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(c(f,p)||u(f,p))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 LX(e,t,{includeHydrateFallback:n}={}){return zX(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function zX(e){return[...new Set(e)]}function $X(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function UX(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let s=JSON.stringify($X(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var BX=new Set([100,101,204,205]);function VX(e,t){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n.pathname==="/"?n.pathname="_root.data":t&&vi(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.data`:n.pathname=`${n.pathname.replace(/\/$/,"")}.data`,n}function Mk(){let e=v.useContext(al);return Kb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function FX(){let e=v.useContext(Ld);return Kb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Xb=v.createContext(void 0);Xb.displayName="FrameworkContext";function Ik(){let e=v.useContext(Xb);return Kb(e,"You must render this element inside a <HydratedRouter> element"),e}function HX(e,t){let n=v.useContext(Xb),[r,i]=v.useState(!1),[s,c]=v.useState(!1),{onFocus:u,onBlur:f,onMouseEnter:p,onMouseLeave:m,onTouchStart:g}=t,y=v.useRef(null);v.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=T=>{T.forEach(D=>{c(D.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"?[s,y,{}]:[s,y,{onFocus:Fu(u,b),onBlur:Fu(f,S),onMouseEnter:Fu(p,b),onMouseLeave:Fu(m,S),onTouchStart:Fu(g,b)}]:[!1,y,{}]}function Fu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function qX({page:e,...t}){let{router:n}=Mk(),r=v.useMemo(()=>zo(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(QX,{page:e,matches:r,...t}):null}function GX(e){let{manifest:t,routeModules:n}=Ik(),[r,i]=v.useState([]);return v.useEffect(()=>{let s=!1;return IX(e,t,n).then(c=>{s||i(c)}),()=>{s=!0}},[e,t,n]),r}function QX({page:e,matches:t,...n}){let r=Mr(),{manifest:i,routeModules:s}=Ik(),{basename:c}=Mk(),{loaderData:u,matches:f}=FX(),p=v.useMemo(()=>IT(e,t,f,i,r,"data"),[e,t,f,i,r]),m=v.useMemo(()=>IT(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 D=i.routes[T.route.id];!D||!D.hasLoader||(!p.some(R=>R.route.id===T.route.id)&&T.route.id in u&&((E=s[T.route.id])!=null&&E.shouldRevalidate)||D.hasClientLoader?j=!0:S.add(T.route.id))}),S.size===0)return[];let C=VX(e,c);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,p,t,e,s]),y=v.useMemo(()=>LX(m,i),[m,i]),b=GX(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 WX(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Lk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Lk&&(window.__reactRouterVersion="7.6.3")}catch{}function YX(e,t){return MK({basename:t==null?void 0:t.basename,unstable_getContext:t==null?void 0:t.unstable_getContext,future:t==null?void 0:t.future,history:nK({window:t==null?void 0:t.window}),hydrationData:KX(),routes:e,mapRouteProperties:vX,hydrationRouteProperties:yX,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function KX(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:XX(e.errors)}),e}function XX(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 Zh(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let s=window[i.__subType];if(typeof s=="function")try{let c=new s(i.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let s=new Error(i.message);s.stack="",n[r]=s}}else n[r]=i;return n}var zk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$k=v.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:c,state:u,target:f,to:p,preventScrollReset:m,viewTransition:g,...y},b){let{basename:S}=v.useContext(ha),j=typeof p=="string"&&zk.test(p),C,T=!1;if(typeof p=="string"&&j&&(C=p,Lk))try{let $=new URL(window.location.href),V=p.startsWith("//")?new URL($.protocol+p):new URL(p),Y=vi(V.pathname,S);V.origin===$.origin&&Y!=null?p=Y+V.search+V.hash:T=!0}catch{Mn(!1,`<Link to="${p}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let D=tX(p,{relative:i}),[E,R,A]=HX(r,y),k=tZ(p,{replace:c,state:u,target:f,preventScrollReset:m,relative:i,viewTransition:g});function M($){t&&t($),$.defaultPrevented||k($)}let I=v.createElement("a",{...y,...A,href:C||D,onClick:T||s?t:M,ref:WX(b,R),target:f,"data-discover":!j&&n==="render"?"true":void 0});return E&&!j?v.createElement(v.Fragment,null,I,v.createElement(qX,{page:D})):I});$k.displayName="Link";var ZX=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:c,viewTransition:u,children:f,...p},m){let g=Ud(c,{relative:p.relative}),y=Mr(),b=v.useContext(Ld),{navigator:S,basename:j}=v.useContext(ha),C=b!=null&&oZ(g)&&u===!0,T=S.encodeLocation?S.encodeLocation(g).pathname:g.pathname,D=y.pathname,E=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(D=D.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 A=D===T||!i&&D.startsWith(T)&&D.charAt(R)==="/",k=E!=null&&(E===T||!i&&E.startsWith(T)&&E.charAt(T.length)==="/"),M={isActive:A,isPending:k,isTransitioning:C},I=A?t:void 0,$;typeof r=="function"?$=r(M):$=[r,A?"active":null,k?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let V=typeof s=="function"?s(M):s;return v.createElement($k,{...p,"aria-current":I,className:$,ref:m,style:V,to:c,viewTransition:u},typeof f=="function"?f(M):f)});ZX.displayName="NavLink";var JX=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:s,method:c=wh,action:u,onSubmit:f,relative:p,preventScrollReset:m,viewTransition:g,...y},b)=>{let S=iZ(),j=aZ(u,{relative:p}),C=c.toLowerCase()==="get"?"get":"post",T=typeof u=="string"&&zk.test(u),D=E=>{if(f&&f(E),E.defaultPrevented)return;E.preventDefault();let R=E.nativeEvent.submitter,A=(R==null?void 0:R.getAttribute("formmethod"))||c;S(R||E.currentTarget,{fetcherKey:t,method:A,navigate:n,replace:i,state:s,relative:p,preventScrollReset:m,viewTransition:g})};return v.createElement("form",{ref:b,method:C,action:j,onSubmit:r?f:D,...y,"data-discover":!T&&e==="render"?"true":void 0})});JX.displayName="Form";function eZ(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Uk(e){let t=v.useContext(al);return bt(t,eZ(e)),t}function tZ(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:s,viewTransition:c}={}){let u=wn(),f=Mr(),p=Ud(e,{relative:s});return v.useCallback(m=>{if(AX(m,t)){m.preventDefault();let g=n!==void 0?n:Ho(f)===Ho(p);u(e,{replace:g,state:r,preventScrollReset:i,relative:s,viewTransition:c})}},[f,u,p,n,r,t,e,i,s,c])}function Zb(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(tx(e)),n=v.useRef(!1),r=Mr(),i=v.useMemo(()=>_X(r.search,n.current?null:t.current),[r.search]),s=wn(),c=v.useCallback((u,f)=>{const p=tx(typeof u=="function"?u(i):u);n.current=!0,s("?"+p,f)},[s,i]);return[i,c]}var nZ=0,rZ=()=>`__${String(++nZ)}__`;function iZ(){let{router:e}=Uk("useSubmit"),{basename:t}=v.useContext(ha),n=pX();return v.useCallback(async(r,i={})=>{let{action:s,method:c,encType:u,formData:f,body:p}=NX(r,t);if(i.navigate===!1){let m=i.fetcherKey||rZ();await e.fetch(m,n,i.action||s,{preventScrollReset:i.preventScrollReset,formData:f,body:p,formMethod:i.method||c,formEncType:i.encType||u,flushSync:i.flushSync})}else await e.navigate(i.action||s,{preventScrollReset:i.preventScrollReset,formData:f,body:p,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 aZ(e,{relative:t}={}){let{basename:n}=v.useContext(ha),r=v.useContext(Bi);bt(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...Ud(e||".",{relative:t})},c=Mr();if(e==null){s.search=c.search;let u=new URLSearchParams(s.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();s.search=m?`?${m}`:""}}return(!e||e===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:oa([n,s.pathname])),Ho(s)}function oZ(e,t={}){let n=v.useContext(qb);bt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Uk("useViewTransitionState"),i=Ud(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=vi(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=vi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Xh(i.pathname,c)!=null||Xh(i.pathname,s)!=null}[...BX];const sZ=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 bc(e,t,n){const r=lZ(e),{webkitRelativePath:i}=e,s=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&LT(r,"path",s),LT(r,"relativePath",s),r}function lZ(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=sZ.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function LT(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var ol=(e,t,n)=>new Promise((r,i)=>{var s=f=>{try{u(n.next(f))}catch(p){i(p)}},c=f=>{try{u(n.throw(f))}catch(p){i(p)}},u=f=>f.done?r(f.value):Promise.resolve(f.value).then(s,c);u((n=n.apply(e,t)).next())});const cZ=[".DS_Store","Thumbs.db"];function uZ(e){return ol(this,null,function*(){return ep(e)&&dZ(e.dataTransfer)?mZ(e.dataTransfer,e.type):fZ(e)?hZ(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?pZ(e):[]})}function dZ(e){return ep(e)}function fZ(e){return ep(e)&&ep(e.target)}function ep(e){return typeof e=="object"&&e!==null}function hZ(e){return nx(e.target.files).map(t=>bc(t))}function pZ(e){return ol(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>bc(n))})}function mZ(e,t){return ol(this,null,function*(){if(e.items){const n=nx(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(gZ));return zT(Bk(r))}return zT(nx(e.files).map(n=>bc(n)))})}function zT(e){return e.filter(t=>cZ.indexOf(t.name)===-1)}function nx(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 gZ(e){if(typeof e.webkitGetAsEntry!="function")return $T(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?Vk(t):$T(e,t)}function Bk(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?Bk(n):[n]],[])}function $T(e,t){var n;if(typeof e.getAsFileSystemHandle=="function")return e.getAsFileSystemHandle().then(s=>ol(this,null,function*(){const c=yield s.getFile();return c.handle=s,bc(c)}));const r=e.getAsFile();if(!r)return Promise.reject(`${e} is not a File`);const i=bc(r,(n=t==null?void 0:t.fullPath)!=null?n:void 0);return Promise.resolve(i)}function vZ(e){return ol(this,null,function*(){return e.isDirectory?Vk(e):yZ(e)})}function Vk(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function s(){t.readEntries(c=>ol(this,null,function*(){if(c.length){const u=Promise.all(c.map(vZ));i.push(u),s()}else try{const u=yield Promise.all(i);n(u)}catch(u){r(u)}}),c=>{r(c)})}s()})}function yZ(e){return ol(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const i=bc(r,e.fullPath);t(i)},r=>{n(r)})})})}function cy(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(),s=i.replace(/\/.*$/,"");return n.some(c=>{const u=c.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?s===u.replace(/\/.*$/,""):i===u})}return!0}var xZ=Object.defineProperty,bZ=Object.defineProperties,SZ=Object.getOwnPropertyDescriptors,UT=Object.getOwnPropertySymbols,wZ=Object.prototype.hasOwnProperty,jZ=Object.prototype.propertyIsEnumerable,BT=(e,t,n)=>t in e?xZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,CZ=(e,t)=>{for(var n in t||(t={}))wZ.call(t,n)&&BT(e,n,t[n]);if(UT)for(var n of UT(t))jZ.call(t,n)&&BT(e,n,t[n]);return e},EZ=(e,t)=>bZ(e,SZ(t));const TZ=typeof cy=="function"?cy:cy.default,RZ="file-invalid-type",DZ="file-too-large",AZ="file-too-small",_Z="too-many-files",kZ=(e="")=>{const t=e.split(","),n=t.length>1?`one of ${t.join(", ")}`:t[0];return{code:RZ,message:`File type must be ${n}`}},VT=e=>({code:DZ,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),FT=e=>({code:AZ,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),PZ={code:_Z,message:"Too many files"};function Fk(e,t){const n=e.type==="application/x-moz-file"||TZ(e,t);return[n,n?null:kZ(t)]}function Hk(e,t,n){if(Rs(e.size))if(Rs(t)&&Rs(n)){if(e.size>n)return[!1,VT(n)];if(e.size<t)return[!1,FT(t)]}else{if(Rs(t)&&e.size<t)return[!1,FT(t)];if(Rs(n)&&e.size>n)return[!1,VT(n)]}return[!0,null]}function Rs(e){return e!=null}function NZ({files:e,accept:t,minSize:n,maxSize:r,multiple:i,maxFiles:s,validator:c}){return!i&&e.length>1||i&&s>=1&&e.length>s?!1:e.every(u=>{const[f]=Fk(u,t),[p]=Hk(u,n,r),m=c?c(u):null;return f&&p&&!m})}function tp(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 HT(e){e.preventDefault()}function OZ(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function MZ(e){return e.indexOf("Edge/")!==-1}function IZ(e=window.navigator.userAgent){return OZ(e)||MZ(e)}function Ki(...e){return(t,...n)=>e.some(r=>(!tp(t)&&r&&r(t,...n),tp(t)))}function LZ(){return"showOpenFilePicker"in window}function zZ(e){return Rs(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let i=!0;return qk(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(Gk))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),i=!1),i}).reduce((n,[r,i])=>EZ(CZ({},n),{[r]:i}),{})}]:e}function $Z(e){if(Rs(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>qk(t)||Gk(t)).join(",")}function UZ(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function BZ(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function qk(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function Gk(e){return/^.*\.[\w]+$/.test(e)}var VZ=Object.defineProperty,FZ=Object.defineProperties,HZ=Object.getOwnPropertyDescriptors,np=Object.getOwnPropertySymbols,Qk=Object.prototype.hasOwnProperty,Wk=Object.prototype.propertyIsEnumerable,qT=(e,t,n)=>t in e?VZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hr=(e,t)=>{for(var n in t||(t={}))Qk.call(t,n)&&qT(e,n,t[n]);if(np)for(var n of np(t))Wk.call(t,n)&&qT(e,n,t[n]);return e},Io=(e,t)=>FZ(e,HZ(t)),rp=(e,t)=>{var n={};for(var r in e)Qk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&np)for(var r of np(e))t.indexOf(r)<0&&Wk.call(e,r)&&(n[r]=e[r]);return n};const Jb=v.forwardRef((e,t)=>{var n=e,{children:r}=n,i=rp(n,["children"]);const s=Kk(i),{open:c}=s,u=rp(s,["open"]);return v.useImperativeHandle(t,()=>({open:c}),[c]),En.createElement(v.Fragment,null,r(Io(hr({},u),{open:c})))});Jb.displayName="Dropzone";const Yk={disabled:!1,getFilesFromEvent:uZ,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};Jb.defaultProps=Yk;Jb.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 rx={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Kk(e={}){const{accept:t,disabled:n,getFilesFromEvent:r,maxSize:i,minSize:s,multiple:c,maxFiles:u,onDragEnter:f,onDragLeave:p,onDragOver:m,onDrop:g,onDropAccepted:y,onDropRejected:b,onFileDialogCancel:S,onFileDialogOpen:j,useFsAccessApi:C,autoFocus:T,preventDropOnDocument:D,noClick:E,noKeyboard:R,noDrag:A,noDragEventsBubbling:k,onError:M,validator:I}=hr(hr({},Yk),e),$=v.useMemo(()=>$Z(t),[t]),V=v.useMemo(()=>zZ(t),[t]),Y=v.useMemo(()=>typeof j=="function"?j:GT,[j]),Q=v.useMemo(()=>typeof S=="function"?S:GT,[S]),J=v.useRef(null),G=v.useRef(null),[K,P]=v.useReducer(qZ,rx),{isFocused:L,isFileDialogActive:z}=K,H=v.useRef(typeof window<"u"&&window.isSecureContext&&C&&LZ()),O=()=>{!H.current&&z&&setTimeout(()=>{if(G.current){const{files:me}=G.current;me.length||(P({type:"closeDialog"}),Q())}},300)};v.useEffect(()=>(window.addEventListener("focus",O,!1),()=>{window.removeEventListener("focus",O,!1)}),[G,z,Q,H]);const U=v.useRef([]),X=me=>{J.current&&J.current.contains(me.target)||(me.preventDefault(),U.current=[])};v.useEffect(()=>(D&&(document.addEventListener("dragover",HT,!1),document.addEventListener("drop",X,!1)),()=>{D&&(document.removeEventListener("dragover",HT),document.removeEventListener("drop",X))}),[J,D]),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(),Ee(me),U.current=[...U.current,me.target],uh(me)&&Promise.resolve(r(me)).then(ge=>{if(tp(me)&&!k)return;const Pe=ge.length,we=Pe>0&&NZ({files:ge,accept:$,minSize:s,maxSize:i,multiple:c,maxFiles:u,validator:I}),$e=Pe>0&&!we;P({isDragAccept:we,isDragReject:$e,isDragActive:!0,type:"setDraggedFiles"}),f&&f(me)}).catch(ge=>ee(ge))},[r,f,ee,k,$,s,i,c,u,I]),be=v.useCallback(me=>{me.preventDefault(),me.persist(),Ee(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(),Ee(me);const ge=U.current.filter(we=>J.current&&J.current.contains(we)),Pe=ge.indexOf(me.target);Pe!==-1&&ge.splice(Pe,1),U.current=ge,!(ge.length>0)&&(P({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),uh(me)&&p&&p(me))},[J,p,k]),qe=v.useCallback((me,ge)=>{const Pe=[],we=[];me.forEach($e=>{const[yt,ft]=Fk($e,$),[Gt,kt]=Hk($e,s,i),un=I?I($e):null;if(yt&&Gt&&!un)Pe.push($e);else{let wt=[ft,kt];un&&(wt=wt.concat(un)),we.push({file:$e,errors:wt.filter(Vi=>Vi)})}}),(!c&&Pe.length>1||c&&u>=1&&Pe.length>u)&&(Pe.forEach($e=>{we.push({file:$e,errors:[PZ]})}),Pe.splice(0)),P({acceptedFiles:Pe,fileRejections:we,isDragReject:we.length>0,type:"setFiles"}),g&&g(Pe,we,ge),we.length>0&&b&&b(we,ge),Pe.length>0&&y&&y(Pe,ge)},[P,c,$,s,i,u,g,y,b,I]),Me=v.useCallback(me=>{me.preventDefault(),me.persist(),Ee(me),U.current=[],uh(me)&&Promise.resolve(r(me)).then(ge=>{tp(me)&&!k||qe(ge,me)}).catch(ge=>ee(ge)),P({type:"reset"})},[r,qe,ee,k]),tt=v.useCallback(()=>{if(H.current){P({type:"openDialog"}),Y();const me={multiple:c,types:V};window.showOpenFilePicker(me).then(ge=>r(ge)).then(ge=>{qe(ge,null),P({type:"closeDialog"})}).catch(ge=>{UZ(ge)?(Q(ge),P({type:"closeDialog"})):BZ(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,Q,C,qe,ee,V,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(),tt())},[J,tt]),vt=v.useCallback(()=>{P({type:"focus"})},[]),It=v.useCallback(()=>{P({type:"blur"})},[]),Lt=v.useCallback(()=>{E||(IZ()?setTimeout(tt,0):tt())},[E,tt]),gt=me=>n?null:me,At=me=>R?null:gt(me),nn=me=>A?null:gt(me),Ee=me=>{k&&me.stopPropagation()},De=v.useMemo(()=>(me={})=>{var ge=me,{refKey:Pe="ref",role:we,onKeyDown:$e,onFocus:yt,onBlur:ft,onClick:Gt,onDragEnter:kt,onDragOver:un,onDragLeave:wt,onDrop:Vi}=ge,Si=rp(ge,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return hr(hr({onKeyDown:At(Ki($e,ke)),onFocus:At(Ki(yt,vt)),onBlur:At(Ki(ft,It)),onClick:gt(Ki(Gt,Lt)),onDragEnter:nn(Ki(kt,Se)),onDragOver:nn(Ki(un,be)),onDragLeave:nn(Ki(wt,xe)),onDrop:nn(Ki(Vi,Me)),role:typeof we=="string"&&we!==""?we:"presentation",[Pe]:J},!n&&!R?{tabIndex:0}:{}),Si)},[J,ke,vt,It,Lt,Se,be,xe,Me,R,A,n]),Qe=v.useCallback(me=>{me.stopPropagation()},[]),Re=v.useMemo(()=>(me={})=>{var ge=me,{refKey:Pe="ref",onChange:we,onClick:$e}=ge,yt=rp(ge,["refKey","onChange","onClick"]);const ft={accept:$,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:gt(Ki(we,Me)),onClick:gt(Ki($e,Qe)),tabIndex:-1,[Pe]:G};return hr(hr({},ft),yt)},[G,t,c,Me,n]);return Io(hr({},K),{isFocused:L&&!n,getRootProps:De,getInputProps:Re,rootRef:J,inputRef:G,open:gt(tt)})}function qZ(e,t){switch(t.type){case"focus":return Io(hr({},e),{isFocused:!0});case"blur":return Io(hr({},e),{isFocused:!1});case"openDialog":return Io(hr({},rx),{isFileDialogActive:!0});case"closeDialog":return Io(hr({},e),{isFileDialogActive:!1});case"setDraggedFiles":return Io(hr({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Io(hr({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return hr({},rx);default:return e}}function GT(){}const[GZ,QZ]=vr("Dropzone component was not found in tree");function e1(e){const t=n=>{const{children:r,...i}=se(`Dropzone${qj(e)}`,{},n),s=QZ(),c=Fa(r)?r:o.jsx("span",{children:r});return s[e]?v.cloneElement(c,i):null};return t.displayName=`@mantine/dropzone/${qj(e)}`,t}const WZ=e1("accept"),YZ=e1("reject"),KZ=e1("idle");var dd={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const XZ={loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},ZZ=(e,{radius:t,variant:n,acceptColor:r,rejectColor:i})=>{const s=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),c=e.variantColorResolver({color:i||"red",theme:e,variant:n});return{root:{"--dropzone-radius":Vt(t),"--dropzone-accept-color":s.color,"--dropzone-accept-bg":s.background,"--dropzone-reject-color":c.color,"--dropzone-reject-bg":c.background}}},Zo=ve((e,t)=>{const n=se("Dropzone",XZ,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,radius:p,disabled:m,loading:g,multiple:y,maxSize:b,accept:S,children:j,onDropAny:C,onDrop:T,onReject:D,openRef:E,name:R,maxFiles:A,autoFocus:k,activateOnClick:M,activateOnDrag:I,dragEventsBubbling:$,activateOnKeyboard:V,onDragEnter:Y,onDragLeave:Q,onDragOver:J,onFileDialogCancel:G,onFileDialogOpen:K,preventDropOnDocument:P,useFsAccessApi:L,getFilesFromEvent:z,validator:H,rejectColor:O,acceptColor:U,enablePointerEvents:X,loaderProps:ee,inputProps:Se,mod:be,...xe}=n,qe=Ie({name:"Dropzone",classes:dd,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:ZZ}),{getRootProps:Me,getInputProps:tt,isDragAccept:ke,isDragReject:vt,isDragActive:It,open:Lt}=Kk({onDrop:C,onDropAccepted:T,onDropRejected:D,disabled:m||g,accept:Array.isArray(S)?S.reduce((Ee,De)=>({...Ee,[De]:[]}),{}):S,multiple:y,maxSize:b,maxFiles:A,autoFocus:k,noClick:!M,noDrag:!I,noDragEventsBubbling:!$,noKeyboard:!V,onDragEnter:Y,onDragLeave:Q,onDragOver:J,onFileDialogCancel:G,onFileDialogOpen:K,preventDropOnDocument:P,useFsAccessApi:L,validator:H,...z?{getFilesFromEvent:z}:null});Zu(E,Lt);const gt=It&&ke,At=It&&vt,nn=!gt&&!At;return o.jsx(GZ,{value:{accept:gt,reject:At,idle:nn},children:o.jsxs(ce,{...Me(),...qe("root",{focusable:!0}),...xe,mod:[{accept:gt,reject:At,idle:nn,disabled:m,loading:g,"activate-on-click":M},be],children:[o.jsx(Ep,{visible:g,overlayProps:{radius:p},unstyled:u,loaderProps:ee}),o.jsx("input",{...tt(Se),name:R}),o.jsx("div",{...qe("inner"),ref:t,"data-enable-pointer-events":X||void 0,children:j})]})})});Zo.classes=dd;Zo.displayName="@mantine/dropzone/Dropzone";Zo.Accept=WZ;Zo.Idle=KZ;Zo.Reject=YZ;const JZ={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Wr("max"),withinPortal:!0},t1=ve((e,t)=>{const n=se("DropzoneFullScreen",JZ,e),{classNames:r,className:i,style:s,styles:c,unstyled:u,vars:f,active:p,onDrop:m,onReject:g,zIndex:y,withinPortal:b,portalProps:S,...j}=n,C=Ie({name:"DropzoneFullScreen",classes:dd,props:n,className:i,style:s,classNames:r,styles:c,unstyled:u,rootSelector:"fullScreen"}),{resolvedClassNames:T,resolvedStyles:D}=Ys({classNames:r,styles:c,props:n}),[E,R]=v.useState(0),[A,{open:k,close:M}]=op(!1),I=V=>{var Y;(Y=V.dataTransfer)!=null&&Y.types.includes("Files")&&(R(Q=>Q+1),k())},$=()=>{R(V=>V-1)};return v.useEffect(()=>{E===0&&M()},[E]),v.useEffect(()=>{if(p)return document.addEventListener("dragenter",I,!1),document.addEventListener("dragleave",$,!1),()=>{document.removeEventListener("dragenter",I,!1),document.removeEventListener("dragleave",$,!1)}},[p]),o.jsx(Go,{...S,withinPortal:b,children:o.jsx(ce,{...C("fullScreen",{style:{opacity:A?1:0,pointerEvents:A?"all":"none",zIndex:y}}),ref:t,children:o.jsx(Zo,{...j,classNames:T,styles:D,unstyled:u,className:dd.dropzone,onDrop:V=>{m==null||m(V),M(),R(0)},onReject:V=>{g==null||g(V),M(),R(0)}})})})});t1.classes=dd;t1.displayName="@mantine/dropzone/DropzoneFullScreen";Zo.FullScreen=t1;const dh=Zo,eJ='{"resourceType": "Bundle"}';function uy({id:e,title:t,message:n,color:r,icon:i,withCloseButton:s=!1,method:c="show",loading:u}){di[c]({id:e,loading:u,title:t,message:n,color:r,icon:i,withCloseButton:s,autoClose:!1})}function tJ(){const e=Sn(),t=_e(),[n,r]=v.useState({}),i=v.useCallback(async(u,f)=>{const p="batch-upload";uy({id:p,title:"Batch Upload in Progress",message:"Your batch data is being uploaded. This may take a moment...",method:"show",loading:!0});try{r({});let m=JSON.parse(u);m.type!=="batch"&&m.type!=="transaction"&&(m=BA(m));const g=await t.executeBatch(m);r(y=>({...y,[f]:g})),uy({id:p,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:o.jsx(eo,{size:"1rem"}),withCloseButton:!0})}catch(m){uy({id:p,title:"Batch Upload Failed",color:"red",message:Ye(m),method:"update",icon:o.jsx(Hs,{size:"1rem"}),withCloseButton:!0})}},[t]),s=v.useCallback(async u=>{for(const f of u){const p=new FileReader;p.onload=m=>{var g;return i((g=m.target)==null?void 0:g.result,f.name)},p.readAsText(f)}},[i]),c=v.useCallback(async u=>{await i(u.input,"JSON Data")},[i]);return o.jsxs(ot,{children:[o.jsx(Le,{children:"Batch Create"}),o.jsxs(Ae,{children:["Use this page to create, read, or update multiple resources. For more details, see"," ",o.jsx(Nt,{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(n).length===0&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{children:"Input"}),o.jsxs(Et,{defaultValue:"upload",children:[o.jsxs(Et.List,{children:[o.jsx(Et.Tab,{value:"upload",children:"File Upload"}),o.jsx(Et.Tab,{value:"json",children:"JSON"})]}),o.jsx(Et.Panel,{value:"upload",pt:"xs",children:o.jsx(dh,{onDrop:s,accept:["application/json"],children:o.jsxs(je,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[o.jsx(dh.Accept,{children:o.jsx(IE,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),o.jsx(dh.Reject,{children:o.jsx(Hs,{size:50,stroke:1.5,color:e.colors.red[5]})}),o.jsx(dh.Idle,{children:o.jsx(IE,{size:50,stroke:1.5})}),o.jsxs("div",{children:[o.jsx(Ae,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),o.jsx(Ae,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),o.jsx(Et.Panel,{value:"json",pt:"xs",children:o.jsxs(pt,{onSubmit:c,children:[o.jsx(Dc,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:eJ,deserialize:JSON.parse}),o.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:o.jsx(Ne,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{children:"Output"}),o.jsxs(Et,{defaultValue:Object.keys(n)[0],children:[o.jsx(Et.List,{children:Object.keys(n).map(u=>o.jsx(Et.Tab,{value:u,children:u},u))}),Object.keys(n).map(u=>o.jsx(Et.Panel,{value:u,children:o.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[u],void 0,2)})},u))]}),o.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:o.jsx(Ne,{onClick:()=>r({}),children:"Start over"})})]})]})}function nJ(){const{resourceType:e}=qt(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(i=>!!i),[r]=xc("Questionnaire",`subject-type=${e}`);return r?r.length===0?o.jsxs(ot,{children:[o.jsxs(Le,{children:["No apps for ",e]}),o.jsx(mt,{to:`/${e}`,children:"Return to search page"})]}):o.jsx(ot,{children:o.jsx("div",{children:r.map(i=>o.jsxs("div",{children:[o.jsx("h3",{children:o.jsx(mt,{to:`/forms/${i.id}?subject=`+n.map(s=>`${e}/${s}`).join(","),children:i.name})}),o.jsx("p",{children:i.description})]},i.id))})}):o.jsx(gi,{})}function rJ(){const e=_e(),[t,n]=v.useState(),[r,i]=v.useState(!1);return o.jsx(ot,{width:450,children:o.jsxs(pt,{onSubmit:s=>{n(void 0),e.post("auth/changepassword",s).then(()=>i(!0)).catch(c=>n(Zt(c)))},children:[o.jsxs(er,{style:{flexDirection:"column"},children:[o.jsx(Ui,{size:32}),o.jsx(Le,{children:"Change password"})]}),!r&&o.jsxs(Ge,{gap:"xl",mt:"xl",children:[o.jsx(Ni,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:Ot(t,"oldPassword")}),o.jsx(Ni,{name:"newPassword",label:"New password",required:!0,error:Ot(t,"newPassword")}),o.jsx(Ni,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Ot(t,"confirmPassword")}),o.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:o.jsx(Ne,{type:"submit",children:"Change password"})})]}),r&&o.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const ix=["Form","JSON","Profiles"],iJ=["Profiles"],dy=ix[0].toLowerCase();function aJ(){const e=wn(),t=Sn(),{resourceType:n}=qt(),[r,i]=v.useState(()=>{const c=window.location.pathname.split("/").pop();return c&&ix.map(u=>u.toLowerCase()).includes(c)?c:dy});function s(c){var u;c||(c=dy),i(c),(u=e(`/${n}/new/${c}`))==null||u.catch(console.error)}return o.jsxs(o.Fragment,{children:[o.jsxs(mr,{children:[o.jsxs(Ae,{p:"md",fw:500,children:["New ",n]}),o.jsx(Yr,{children:o.jsx(Et,{defaultValue:dy,value:r,onChange:s,children:o.jsx(Et.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:ix.map(c=>o.jsx(Et.Tab,{value:c.toLowerCase(),px:"md",children:iJ.includes(c)?o.jsxs(je,{gap:"xs",wrap:"nowrap",children:[c,o.jsx(Cp,{color:t.primaryColor,size:"sm",children:"Beta"})]}):c},c))})})})]}),o.jsx(Yb,{})]})}function oJ(){return o.jsx(ot,{children:o.jsxs(Ge,{children:[o.jsx(Le,{order:1,children:"Unexpected Error"}),o.jsx(Ae,{children:"We're sorry, something went wrong."}),o.jsxs(Ae,{children:["Please contact ",o.jsx(Nt,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}function Xk(e){const t=Qt(e.resource);if(!t)return null;const n=[{key:"Type",value:o.jsx(mt,{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 s(c,u){Array.isArray(u)?u.forEach(f=>s(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=Va(t);c!==zt(t)&&r("Name",c)}return"category"in t&&s("Category",t.category),t.resourceType!=="Bot"&&"code"in t&&s("Code",t.code),"identifier"in t&&(Array.isArray(t.identifier)?t.identifier.forEach(i):i(t.identifier)),n.length===1&&n.push({key:"ID",value:t.id}),o.jsx(ht,{children:n.map((c,u)=>o.jsxs(ht.Entry,{children:[o.jsx(ht.Key,{children:c.key}),o.jsx(ht.Value,{children:c.value})]},`${c.key}-${u}`))})}function n1(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function sJ(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 Jo(e){var t;return Bs((t=e.getActiveLogin())==null?void 0:t.project)}function lJ(){const{id:e}=qt(),t=Mr(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,i=_e(),[s,c]=v.useState(!0),[u,f]=v.useState(),[p,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(A=>!!A);R.length===1&&E.entry.push({request:{method:"GET",url:R[0]}}),m(R)}i.executeBatch(E).then(R=>{var A,k,M,I,$,V,Y,Q;((M=(k=(A=R.entry)==null?void 0:A[0])==null?void 0:k.response)==null?void 0:M.status)!=="200"?S((V=($=(I=R.entry)==null?void 0:I[0])==null?void 0:$.response)==null?void 0:V.outcome):(f((Y=R.entry[0])==null?void 0:Y.resource),y((Q=R.entry[1])==null?void 0:Q.resource)),c(!1)}).catch(R=>{S(R),c(!1)})},[i,e,r]),b)return o.jsx(ot,{children:o.jsx("pre",{"data-testid":"error",children:JSON.stringify(b,void 0,2)})});if(j)return o.jsxs(ot,{children:[o.jsx(Le,{children:u==null?void 0:u.title}),o.jsx("p",{children:"Your response has been recorded."}),o.jsxs("ul",{children:[j.length===1&&o.jsx("li",{children:o.jsx(mt,{to:j[0],children:"Review your answers"})}),j.length>1&&o.jsxs("li",{children:["Review your answers:",o.jsx("ul",{children:j.map(E=>o.jsx("li",{children:o.jsx(mt,{to:E,children:zt(E)})},E.id))})]}),g&&o.jsx("li",{children:o.jsxs(mt,{to:g,children:["Back to ",Va(g)]})}),o.jsx("li",{children:o.jsx(mt,{to:"/",children:"Go back home"})})]})]});if(s||!u)return o.jsx(gi,{});const T=g&&n1(g);return o.jsxs(o.Fragment,{children:[o.jsxs(mr,{shadow:"xs",radius:0,children:[T&&o.jsx(W_,{patient:T}),g&&g.resourceType!=="Patient"&&o.jsx(Xk,{resource:g}),o.jsx(ce,{px:"xl",py:"md",children:o.jsxs(Ae,{children:[Va(u),p&&p.length>1&&o.jsxs(o.Fragment,{children:[" (for ",p.length," resources)"]})]})})]}),o.jsx(ot,{children:o.jsx(dk,{questionnaire:u,subject:g&&on(g),onSubmit:D})})]});async function D(E){const R=[];if(!p||p.length===0)R.push(await i.createResource(E));else for(const A of p)R.push(await i.createResource({...E,subject:{reference:A}}));C(R)}}const cJ="_paper_unw9o_1",uJ={paper:cJ},dJ={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function Zk(e,t){const n=e.resourceType||fJ(t),r=e.fields??hJ(n),i=e.filters??(e.resourceType?void 0:pJ(n)),s=e.sortRules??mJ(n),c=e.offset??0,u=e.count??Yp;return{...e,resourceType:n,fields:r,filters:i,sortRules:s,offset:c,count:u}}function fJ(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 hJ(e){const t=r1(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 pJ(e){var t;return(t=r1(e))==null?void 0:t.filters}function mJ(e){const t=r1(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function r1(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function gJ(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function vJ(e,t){const n={...e,count:1e3,offset:0},r=Zk(n,t.getUserConfiguration()),i=await t.search(r.resourceType,Uo({...r,total:"accurate",fields:void 0}));return BA(i)}function QT(){const e=_e(),t=wn(),n=Mr(),[r,i]=v.useState();return v.useEffect(()=>{var u;const s=IA(n.pathname+n.search),c=Zk(s,e.getUserConfiguration());n.pathname===`/${c.resourceType}`&&n.search===Uo(c)?(gJ(c),i(c)):(u=t(`/${c.resourceType}${Uo(c)}`))==null||u.catch(console.error)},[e,t,n]),!(r!=null&&r.resourceType)||!r.fields||r.fields.length===0?o.jsx(gi,{}):o.jsx(mr,{shadow:"xs",m:"md",p:"xs",className:uJ.paper,children:o.jsx(zc,{checkboxesEnabled:!0,search:r,onClick:s=>{var c;return(c=t(`/${s.resource.resourceType}/${s.resource.id}`))==null?void 0:c.catch(console.error)},onAuxClick:s=>window.open(`/${s.resource.resourceType}/${s.resource.id}`,"_blank"),onChange:s=>{var c;(c=t(`/${r.resourceType}${Uo(s.definition)}`))==null||c.catch(console.error)},onNew:()=>{var s;(s=t(dJ[r.resourceType]??`/${r.resourceType}/new`))==null||s.catch(console.error)},onExportCsv:()=>{const s=e.fhirUrl(r.resourceType,"$csv")+Uo(r);e.download(s).then(c=>{window.open(window.URL.createObjectURL(c),"_blank")}).catch(c=>Oe({color:"red",message:Ye(c),autoClose:!1}))},onExportTransactionBundle:async()=>{vJ(r,e).then(s=>u_(JSON.stringify(s,void 0,2))).catch(s=>Oe({color:"red",message:Ye(s),autoClose:!1}))},onDelete:s=>{window.confirm("Are you sure you want to delete these resources?")&&(e.invalidateSearches(r.resourceType),e.executeBatch({resourceType:"Bundle",type:"batch",entry:s.map(c=>({request:{method:"DELETE",url:`${r.resourceType}/${c}`}}))}).then(()=>i({...r})).catch(c=>Oe({color:"red",message:Ye(c),autoClose:!1})))},onBulk:s=>{var c;(c=t(`/bulk/${r.resourceType}?ids=${s.join(",")}`))==null||c.catch(console.error)}})})}function yJ(){const e=_e(),[t,n]=v.useState(),[r,i]=v.useState(void 0),[s,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:Ye(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:Ye(g),autoClose:!1}))},[e]),p=v.useCallback(async m=>e.post("auth/mfa/disable",{token:m.token}),[e]);return r===void 0?null:r?o.jsxs(ot,{children:[o.jsx(Un,{title:"Disable MFA",opened:s,onClose:()=>c(!1),children:o.jsx(S_,{onSubmit:async m=>{await p(m),c(!1),i(!1),Oe({id:"mfa-disabled",color:"green",title:"Success",message:"MFA disabled",icon:o.jsx(lF,{})}),u()}})}),o.jsxs(je,{children:[o.jsx(Le,{children:"MFA is enabled"}),o.jsx(Ne,{onClick:()=>c(!0),children:"Disable MFA"})]})]}):o.jsx(ot,{width:400,children:o.jsxs(pt,{onSubmit:f,children:[o.jsx(Le,{children:"Multi Factor Auth Setup"}),o.jsx(er,{children:o.jsx("img",{src:t,alt:"Multi Factor Auth QR Code"})}),o.jsx(ze,{name:"token",label:"Code"}),o.jsx(je,{justify:"flex-end",mt:"xl",children:o.jsx(Ne,{type:"submit",children:"Enroll"})})]})})}const fy={},ax={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__",awsTextractEnabled:fy==null?void 0:fy.MEDPLUM_AWS_TEXTRACT_ENABLED};function Bd(){return ax}function Jk(){return e4("registerEnabled")}function xJ(){return e4("awsTextractEnabled")}function e4(e){try{return ax[e]!==!1&&ax[e]!=="false"}catch{return!0}}function bJ(){var g,y;const e=wn(),[t]=Zb(),n=_e(),r=t.get("scope")||"openid",[i,s]=v.useState(),[c,u]=v.useState(!0),f=t.get("client_id"),p=t.get("login");if(v.useEffect(()=>{if(!f||f==="medplum-cli")return;async function b(){try{const S=await n.get(`/auth/clientinfo/${f}`);s(S)}catch(S){Oe({id:"clientinfofail",title:"Failed to retrieve client information.",color:"red",message:Ye(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 o.jsx(w_,{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:Bd().googleClientId,clientId:f||void 0,redirectUri:t.get("redirect_uri")||void 0,scope:r,nonce:t.get("nonce")||void 0,launch:t.get("launch")||void 0,codeChallenge:t.get("code_challenge")||void 0,codeChallengeMethod:t.get("code_challenge_method")||void 0,chooseScopes:r!=="openid",login:p||void 0,children:!c&&o.jsxs(o.Fragment,{children:[(g=i==null?void 0:i.logo)!=null&&g.url?o.jsx("img",{src:(y=i==null?void 0:i.logo)==null?void 0:y.url,alt:"Welcome Logo",height:60,style:{width:"auto"}}):o.jsx(Ui,{size:32}),o.jsx(Le,{children:(i==null?void 0:i.welcomeString)??"Sign in to Medplum"})]})})}function SJ(){const e=_e(),t=wn(),n=Bd();return v.useEffect(()=>{var r;e.getProfile()&&((r=t("/signin?project=new"))==null||r.catch(console.error))},[e,t]),Jk()?o.jsxs(HH,{type:"project",projectId:"new",onSuccess:()=>{window.location.href="/"},googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[o.jsx(Ui,{size:32}),o.jsx(Le,{children:"Create a new account"})]}):o.jsx(ot,{width:450,children:o.jsx(Ya,{icon:o.jsx(rl,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function wJ(){const e=wn(),t=_e(),[n,r]=v.useState(),[i,s]=v.useState(!1),c=Bd().recaptchaSiteKey;return v.useEffect(()=>{x_(c)},[c]),o.jsx(ot,{width:450,children:o.jsxs(pt,{onSubmit:async u=>{let f="";f=await b_(c),t.post("auth/resetpassword",{...u,recaptchaToken:f}).then(()=>s(!0)).catch(p=>r(Zt(p)))},children:[o.jsxs(Ge,{gap:"lg",mb:"xl",align:"center",children:[o.jsx(Ui,{size:32}),o.jsx(Le,{children:"Medplum Password Reset"})]}),o.jsxs(Ge,{gap:"xl",children:[o.jsx(Kr,{issues:Nd(n,void 0)}),!i&&o.jsxs(o.Fragment,{children:[o.jsx(ze,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:Ot(n,"email")}),o.jsxs(je,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[o.jsx(Nt,{component:"button",type:"button",color:"dimmed",onClick:()=>{var u;return(u=e("/register"))==null?void 0:u.catch(console.error)},size:"xs",children:"Register"}),o.jsx(Ne,{type:"submit",children:"Reset password"})]})]}),i&&o.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function jJ(){var s;const e=wn(),t=_e(),[n,r]=v.useState();v.useEffect(()=>{t.get("auth/me",{cache:"no-cache"}).then(r).catch(c=>Oe({color:"red",message:Ye(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:Ye(u),autoClose:!1}))}return n?o.jsxs(o.Fragment,{children:[o.jsxs(ot,{children:[o.jsx(Le,{children:"Security"}),o.jsxs(jb,{children:[o.jsx(La,{term:"ID",children:o.jsx(Nt,{href:`/${zt(n.profile)}`,children:n.profile.id})}),o.jsx(La,{term:"Resource Type",children:n.profile.resourceType}),o.jsx(La,{term:"Name",children:Nc((s=n.profile.name)==null?void 0:s[0])})]})]}),o.jsxs(ot,{children:[o.jsx(Le,{children:"Sessions"}),o.jsxs(ye,{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"OS"}),o.jsx("th",{children:"Browser"}),o.jsx("th",{children:"IP Address"}),o.jsx("th",{children:"Auth Method"}),o.jsx("th",{children:"Last Updated"}),o.jsx("th",{})]})}),o.jsx("tbody",{children:n.security.sessions.map(c=>o.jsxs("tr",{children:[o.jsx("td",{children:c.os}),o.jsx("td",{children:c.browser}),o.jsx("td",{children:c.remoteAddress}),o.jsx("td",{children:c.authMethod}),o.jsx("td",{children:gr(c.lastUpdated)}),o.jsx("td",{children:o.jsx(Nt,{href:"#",onClick:()=>i(c.id),children:"Revoke"})})]},c.id))})]})]}),o.jsxs(ot,{children:[o.jsx(Le,{children:"Password"}),o.jsx(Ne,{onClick:()=>{var c;return(c=e("/changepassword"))==null?void 0:c.catch(console.error)},children:"Change password"})]}),o.jsxs(ot,{children:[o.jsx(Le,{children:"Multi Factor Auth"}),o.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&o.jsx(Ne,{onClick:()=>{var c;return(c=e("/mfa"))==null?void 0:c.catch(console.error)},children:"Enroll"})]})]}):null}function CJ(){const{id:e,secret:t}=qt(),n=_e(),[r,i]=v.useState(),[s,c]=v.useState(!1),u=Nd(r,void 0);return o.jsxs(ot,{width:450,children:[o.jsx(Kr,{issues:u}),o.jsxs(pt,{onSubmit:f=>{if(f.password!==f.confirmPassword){i(ra("Passwords do not match","confirmPassword"));return}i(void 0);const p={id:e,secret:t,password:f.password};n.post("auth/setpassword",p).then(()=>c(!0)).catch(m=>i(Zt(m)))},children:[o.jsxs(er,{style:{flexDirection:"column"},children:[o.jsx(Ui,{size:32}),o.jsx(Le,{children:"Set password"})]}),!s&&o.jsxs(Ge,{children:[o.jsx(Ni,{name:"password",label:"New password",required:!0,error:Ot(r,"password")}),o.jsx(Ni,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Ot(r,"confirmPassword")}),o.jsx(je,{justify:"flex-end",mt:"xl",children:o.jsx(Ne,{type:"submit",children:"Set password"})})]}),s&&o.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",o.jsx(mt,{to:"/signin",children:"sign in"}),"."]})]})]})}function EJ(){const e=em(),t=wn(),[n]=Zb(),r=Bd(),i=v.useCallback(()=>{var c;const s=n.get("next");(c=t(s!=null&&s.startsWith("/")?s:"/"))==null||c.catch(console.error)},[n,t]);return v.useEffect(()=>{e&&n.has("next")&&i()},[e,n,i]),o.jsxs(w_,{onSuccess:()=>i(),onForgotPassword:()=>{var s;return(s=t("/resetpassword"))==null?void 0:s.catch(console.error)},onRegister:Jk()?()=>{var s;return(s=t("/register"))==null?void 0:s.catch(console.error)}:void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[o.jsx(Ui,{size:32}),o.jsx(Le,{children:"Sign in to Medplum"}),n.get("project")==="new"&&o.jsx("div",{children:"Sign in again to create a new project"})]})}function TJ(){const e=wn(),t=Mr(),[n,r]=v.useState(),[i,s]=v.useState(),[c,u]=v.useState();return v.useEffect(()=>{const f=Object.fromEntries(new URLSearchParams(t.search).entries());r(f.resourceType),s(f.query),u(JSON.parse(f.fields))},[t]),!n||!i||!c?null:o.jsx(VQ,{resourceType:n,checkboxesEnabled:!0,query:i,fields:c,onClick:f=>{var p;return(p=e(`/${n}/${f.resource.id}`))==null?void 0:p.catch(console.error)},onAuxClick:f=>window.open(`/${n}/${f.resource.id}`,"_blank"),onBulk:f=>{var p;(p=e(`/bulk/${n}?ids=${f.join(",")}`))==null||p.catch(console.error)}})}function fm(e){const t=_e(),n=Jo(t),r=wn(),[i,s]=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 o.jsx(zc,{search:i,onClick:c=>{var u;return(u=r(`/admin/members/${c.resource.id}`))==null?void 0:u.catch(console.error)},onChange:c=>s(c.definition),hideFilters:!0,hideToolbar:!0})}function RJ(){return o.jsxs(o.Fragment,{children:[o.jsx(Le,{children:"Bots"}),o.jsx(fm,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),o.jsx(je,{justify:"flex-end",children:o.jsx(mt,{to:"/admin/bots/new",children:"Create new bot"})})]})}function DJ(){return o.jsxs(o.Fragment,{children:[o.jsx(Le,{children:"Clients"}),o.jsx(fm,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),o.jsx(je,{justify:"flex-end",children:o.jsx(mt,{to:"/admin/clients/new",children:"Create new client"})})]})}function hm(e){return o.jsx(il,{resourceType:"AccessPolicy",name:e.name,defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{fa(t)?e.onChange(on(t)):e.onChange(void 0)}})}function AJ(){const e=_e(),t=Jo(e),[n,r]=v.useState(""),[i,s]=v.useState(""),[c,u]=v.useState(),[f,p]=v.useState(),[m,g]=v.useState(void 0);return o.jsxs(o.Fragment,{children:[o.jsx(Le,{children:"Create new Bot"}),o.jsxs(pt,{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:Ye(b),autoClose:!1}),p(Zt(b))})},children:[!m&&o.jsxs(Ge,{children:[o.jsx($t,{title:"Name",htmlFor:"name",outcome:f,children:o.jsx(ze,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:y=>r(y.currentTarget.value),error:Ot(f,"name")})}),o.jsx($t,{title:"Description",htmlFor:"description",outcome:f,children:o.jsx(ze,{id:"description",name:"description",onChange:y=>s(y.currentTarget.value),error:Ot(f,"description")})}),o.jsx($t,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:o.jsx(hm,{name:"accessPolicy",onChange:u})}),o.jsx(je,{justify:"flex-end",children:o.jsx(Ne,{type:"submit",children:"Create Bot"})})]}),m&&o.jsxs("div",{"data-testid":"success",children:[o.jsx(Ae,{children:"Bot created"}),o.jsxs(pr,{children:[o.jsx(pr.Item,{children:o.jsx(mt,{to:m,children:"Go to new bot"})}),o.jsx(pr.Item,{children:o.jsx(mt,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function _J(){const e=_e(),t=Jo(e),[n,r]=v.useState(""),[i,s]=v.useState(""),[c,u]=v.useState(""),[f,p]=v.useState(),[m,g]=v.useState(),[y,b]=v.useState(void 0);return o.jsxs(o.Fragment,{children:[o.jsx(Le,{children:"Create new Client"}),o.jsxs(pt,{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:Ye(j),autoClose:!1}),g(Zt(j))})},children:[!y&&o.jsxs(Ge,{children:[o.jsx($t,{title:"Name",htmlFor:"name",outcome:m,children:o.jsx(ze,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:S=>r(S.currentTarget.value),error:Ot(m,"name")})}),o.jsx($t,{title:"Description",htmlFor:"description",outcome:m,children:o.jsx(ze,{id:"description",name:"description",onChange:S=>s(S.currentTarget.value),error:Ot(m,"description")})}),o.jsx($t,{title:"Redirect URI",htmlFor:"redirectUri",outcome:m,children:o.jsx(ze,{id:"redirectUri",name:"redirectUri",onChange:S=>u(S.currentTarget.value),error:Ot(m,"redirectUri")})}),o.jsx($t,{title:"Access Policy",htmlFor:"accessPolicy",outcome:m,children:o.jsx(hm,{name:"accessPolicy",onChange:p})}),o.jsx(je,{justify:"flex-end",children:o.jsx(Ne,{type:"submit",children:"Create Client"})})]}),y&&o.jsxs("div",{"data-testid":"success",children:[o.jsx(Ae,{children:"Client created"}),o.jsxs(pr,{children:[o.jsx(pr.Item,{children:o.jsx(mt,{to:y,children:"Go to new client"})}),o.jsx(pr.Item,{children:o.jsx(mt,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function kJ(e){return o.jsx(il,{resourceType:"UserConfiguration",name:e.name,defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{fa(t)?e.onChange(on(t)):e.onChange(void 0)}})}function PJ(){const{membershipId:e}=qt(),t=_e(),n=Jo(t),r=wn(),i=t.get(`admin/projects/${n}/members/${e}`).read(),[s,c]=v.useState(i.accessPolicy),[u,f]=v.useState(i.userConfiguration),[p,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(Zt(C)))}return o.jsxs(o.Fragment,{children:[o.jsx(Le,{children:"Edit membership"}),o.jsx("h3",{children:o.jsx(oc,{value:i.profile,link:!0})}),o.jsxs(pt,{onSubmit:()=>{const C={...i,accessPolicy:s,userConfiguration:u,admin:p};t.post(`admin/projects/${n}/members/${e}`,C).then(()=>S(!0)).catch(T=>y(Zt(T)))},children:[!b&&o.jsxs(Ge,{children:[o.jsx($t,{title:"Access Policy",htmlFor:"accessPolicy",outcome:g,children:o.jsx(hm,{name:"accessPolicy",defaultValue:s,onChange:c})}),o.jsx($t,{title:"User Configuration",htmlFor:"userConfiguration",outcome:g,children:o.jsx(kJ,{name:"userConfiguration",defaultValue:u,onChange:f})}),o.jsx($t,{title:"Admin",htmlFor:"admin",outcome:g,children:o.jsx(zn,{id:"admin",name:"admin",defaultChecked:p,onChange:C=>m(C.currentTarget.checked)})}),o.jsxs(je,{justify:"flex-end",mt:"xl",children:[o.jsx(Ne,{type:"submit",children:"Save"}),o.jsx(Ne,{type:"button",color:"red",variant:"outline",onClick:j,children:"Remove user"})]})]}),b&&o.jsxs("div",{"data-testid":"success",children:[o.jsx("p",{children:"User updated"}),o.jsx("pre",{children:JSON.stringify(g,void 0,2)}),o.jsxs("p",{children:["Click ",o.jsx(mt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function NJ(){const e=_e(),[t,n]=v.useState(e.getProject()),[r,i]=v.useState(),[s,c]=v.useState(),[u,f]=v.useState(!1),[p,m]=v.useState(void 0),g=v.useCallback(y=>{const b={resourceType:y.resourceType,firstName:y.firstName,lastName:y.lastName,email:y.email,sendEmail:y.sendEmail==="on",accessPolicy:r,admin:y.isAdmin==="on",scope:y.isProjectScoped==="on"?"project":"server"};return e.invite(t==null?void 0:t.id,b).then(S=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),qp(S)?c(S):m(S),f(b.sendEmail??!1),Oe({color:"green",message:"Invite success"})}).catch(S=>{Oe({color:"red",message:Ye(S),autoClose:!1}),c(Zt(S))})},[e,t,r]);return o.jsxs(pt,{onSubmit:g,children:[!p&&!s&&o.jsxs(Ge,{children:[o.jsx(Le,{children:"Invite new member"}),e.isSuperAdmin()&&o.jsx($t,{title:"Project",htmlFor:"project",outcome:s,children:o.jsx(il,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),o.jsx(ln,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:Ot(s,"resourceType")}),o.jsx(ze,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:Ot(s,"firstName")}),o.jsx(ze,{name:"lastName",label:"Last Name",required:!0,error:Ot(s,"lastName")}),o.jsx(ze,{name:"email",type:"email",label:"Email",required:!0,error:Ot(s,"email")}),o.jsx($t,{title:"Access Policy",htmlFor:"accessPolicy",outcome:s,children:o.jsx(hm,{name:"accessPolicy",onChange:i})}),o.jsx(zn,{name:"sendEmail",label:"Send email",defaultChecked:!0}),o.jsx(zn,{name:"isAdmin",label:"Admin"}),o.jsx(zn,{name:"isProjectScoped",label:"Project scoped"}),o.jsx(je,{justify:"flex-end",children:o.jsx(Or,{children:"Invite"})})]}),s&&o.jsxs("div",{"data-testid":"success",children:[o.jsx("p",{children:"User created, email couldn't be sent"}),o.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),o.jsxs("p",{children:["Click ",o.jsx(mt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),p&&o.jsxs("div",{"data-testid":"success",children:[o.jsx(Ae,{children:"User created"}),u&&o.jsx(Ae,{children:"Email sent"}),o.jsxs(pr,{children:[o.jsx(pr.Item,{children:o.jsx(mt,{to:p,children:"Go to new membership"})}),o.jsx(pr.Item,{children:o.jsx(mt,{to:p.profile,children:"Go to new profile"})}),o.jsx(pr.Item,{children:o.jsx(mt,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function OJ(){return o.jsxs(o.Fragment,{children:[o.jsx(Le,{children:"Patients"}),o.jsx(fm,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),o.jsx(je,{justify:"flex-end",children:o.jsx(mt,{to:"/admin/invite",children:"Invite new patient"})})]})}function MJ(){const e=_e();if(!e.isLoading()&&!e.isProjectAdmin())return o.jsx(Kr,{outcome:Q0});function t(n){e.post("admin/projects/setpassword",n).then(()=>Oe({color:"green",message:"Done"})).catch(r=>Oe({color:"red",message:Ye(r),autoClose:!1}))}return o.jsxs(ot,{width:600,children:[o.jsx(Le,{order:1,children:"Project Admin"}),o.jsx(Cn,{my:"lg"}),o.jsx(Le,{order:2,children:"Force Set Password"}),o.jsx(Ae,{children:"Sets the password for the specified user in this project."}),o.jsx(Ae,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),o.jsx(pt,{onSubmit:t,children:o.jsxs(Ge,{children:[o.jsx(ze,{name:"email",label:"Email",required:!0}),o.jsx(Ni,{name:"password",label:"Password",required:!0}),o.jsx(Ne,{type:"submit",children:"Force Set Password"})]})})]})}function WT(){const e=_e(),t=Jo(e),n=e.get(`admin/projects/${t}`).read();return o.jsxs(o.Fragment,{children:[o.jsx(Le,{children:"Details"}),o.jsxs(jb,{children:[o.jsx(La,{term:"ID",children:n.project.id}),o.jsx(La,{term:"Name",children:n.project.name})]})]})}const YT=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function IJ(){const e=wn(),n=Mr().pathname.replace("/admin/","")||YT[0],r=_e(),i=Jo(r),s=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 o.jsxs(o.Fragment,{children:[o.jsxs(mr,{children:[o.jsx(ht,{children:o.jsxs(ht.Entry,{children:[o.jsx(ht.Key,{children:"Project"}),o.jsx(ht.Value,{children:s.project.name})]})}),o.jsx(Yr,{children:o.jsx(Et,{value:n.toLowerCase(),onChange:c,children:o.jsx(Et.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:YT.map(u=>o.jsx(Et.Tab,{value:u.toLowerCase(),children:u},u))})})})]}),o.jsx(ot,{children:o.jsx(Yb,{})})]})}function LJ(){const e=_e(),t=Jo(e),n=e.get(`admin/projects/${t}`).read(),[r,i]=v.useState(!1),[s,c]=v.useState();return v.useEffect(()=>{e.requestSchema("Project").then(()=>i(!0)).catch(console.log)},[e]),v.useEffect(()=>{n&&c(Qr(n.project.secret||[]))},[e,n]),!r||!s?o.jsx("div",{children:"Loading..."}):o.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:u=>{u.preventDefault(),e.post(`admin/projects/${t}/secrets`,s).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>Oe({color:"green",message:"Saved"})).catch(console.log)},children:[o.jsx(Le,{children:"Project Secrets"}),o.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),o.jsx(Md,{property:Yo("Project","secret"),name:"secret",path:"Project.secret",defaultValue:s,onChange:c,outcome:void 0}),o.jsx(Ne,{type:"submit",children:"Save"})]})}function zJ(){const e=_e(),t=Jo(e),n=e.get(`admin/projects/${t}`).read(),[r,i]=v.useState(!1),[s,c]=v.useState();return v.useEffect(()=>{e.requestSchema("Project").then(()=>i(!0)).catch(console.log)},[e]),v.useEffect(()=>{n&&c(Qr(n.project.site||[]))},[e,n]),!r||!s?o.jsx("div",{children:"Loading..."}):o.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:u=>{u.preventDefault(),e.post(`admin/projects/${t}/sites`,s).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>Oe({color:"green",message:"Saved"})).catch(f=>{var m,g,y,b;const p=Zt(f);Oe({color:"red",message:`Error ${(g=(m=p.issue)==null?void 0:m[0].details)==null?void 0:g.text} ${(b=(y=p.issue)==null?void 0:y[0].expression)==null?void 0:b[0]}`,autoClose:!1})})},children:[o.jsx(Le,{children:"Project Sites"}),o.jsx("p",{children:"Use project sites configure your project on a separate domain."}),o.jsx(Md,{property:Yo("Project","site"),name:"site",path:"Project.site",defaultValue:s,onChange:c,outcome:void 0}),o.jsx(Ne,{type:"submit",children:"Save"})]})}function t4(e,t,n,r){const i=Date.now().toString();Oe({id:i,loading:!0,title:t,message:"Running...",autoClose:!1,withCloseButton:!1});const s={method:"POST",pollStatusOnAccepted:!0};return r&&(s.body=JSON.stringify(r)),e.startAsyncRequest(n,s).then(c=>{var f,p,m;let u="Done";return c.resourceType==="AsyncJob"?u=o.jsx(mt,{to:c,children:"View AsyncJob"}):c.resourceType==="OperationOutcome"&&((m=(p=(f=c.issue)==null?void 0:f[0])==null?void 0:p.details)!=null&&m.text)&&(u=o.jsx(Ae,{children:c.issue[0].details.text})),di.update({id:i,color:"green",title:t,message:u,icon:o.jsx(eo,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c}).catch(c=>{throw di.update({id:i,color:"red",title:t,message:Ye(c),icon:o.jsx(Hs,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c})}function Ss(e,t,n,r){t4(e,t,n,r).catch(()=>{})}const n4="System AsyncJob",r4="Post-deploy Migrations",fh=[r4,n4];function $J(){const e=_e(),[t,n]=v.useState(fh[0]);function r(i){i||(i=fh[0]),fh.includes(i)&&n(i)}return!e.isLoading()&&!e.isSuperAdmin()?o.jsx(Kr,{outcome:Q0}):o.jsx(Ic,{miw:"1600",maw:"2000",children:o.jsxs(nm,{children:[o.jsx(Le,{order:1,children:"AsyncJob Dashboard"}),o.jsxs(Et,{keepMounted:!1,value:t,onChange:r,children:[o.jsx(Et.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:fh.map(i=>o.jsx(Et.Tab,{value:i,children:i},i))}),o.jsx(Et.Panel,{value:n4,pt:"md",children:o.jsx(BJ,{})}),o.jsx(Et.Panel,{value:r4,pt:"md",children:o.jsx(FJ,{})})]})]})})}const UJ={resourceType:"AsyncJob",fields:["id","_lastUpdated","request","status","type"],filters:[{code:"_project",operator:ue.MISSING,value:"true"}],sortRules:[{code:"_lastUpdated",descending:!0}]};function BJ(){const e=wn(),[t]=v.useState(UJ);return o.jsxs(Ge,{children:[o.jsx(mt,{to:`/${t.resourceType}/${Uo(t)}`,children:"Show in search page"}),o.jsx(zc,{checkboxesEnabled:!1,search:t,onClick:n=>{var r;return(r=e(KT(n.resource)))==null?void 0:r.catch(console.error)},onAuxClick:n=>window.open(KT(n.resource),"_blank")})]})}const VJ={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 FJ(){const e=_e(),[t,n]=v.useState(),[r,i]=v.useState(),[s,c]=v.useState([]),[u,f]=v.useState(0),[p,m]=v.useState([]);v.useEffect(()=>{const j="info";m(C=>C.includes(j)?C:[...C,j]),e.get("admin/super/migrations",{cache:"no-cache"}).then(C=>{C.postDeployMigrations.sort((T,D)=>D-T),n(C)}).catch(C=>{Oe({color:"red",message:Ye(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",Uo({...VJ,total:"accurate",fields:void 0}),{cache:"no-cache"}).then(C=>{var T;i((T=C.entry)==null?void 0:T.map(D=>D.resource))})).catch(C=>{i(void 0),Oe({color:"red",message:Ye(C),autoClose:!1})}).finally(()=>m(C=>C.filter(T=>T!==j)))},[e,u]);function g(){f(j=>j+1)}function y(j){t4(e,"Run Pending Data Migration","admin/super/migrate",{dataVersion:j}).finally(()=>{g()}).catch(()=>{}),g()}const b=p.length>0;function S(j,{isLoading:C}){return o.jsxs("div",{style:{position:"relative"},children:[o.jsx(Ep,{visible:C}),o.jsxs(ye,{children:[o.jsx(ye.Thead,{children:o.jsxs(ye.Tr,{children:[o.jsx(ye.Th,{children:"Version"}),o.jsx(ye.Th,{children:"Action"}),o.jsx(ye.Th,{children:"Status"}),o.jsx(ye.Th,{children:"AsyncJob"}),o.jsx(ye.Th,{children:"Last Updated"}),o.jsx(ye.Th,{children:"Request Time"}),o.jsx(ye.Th,{children:"Duration"}),o.jsx(ye.Th,{children:"Attempts"})]})}),o.jsx(ye.Tbody,{children:j()})]})]})}return o.jsxs(o.Fragment,{children:[o.jsx(Ne,{size:"xs",mb:"xs",variant:"subtle",leftSection:o.jsx(o_,{size:14}),onClick:g,loading:b,children:"Refresh"}),S(()=>{var j;if(!b){if(!t)return o.jsx(ye.Tr,{children:o.jsx(ye.Td,{colSpan:6,children:"Failed to load migration info"})});if(!r)return o.jsx(ye.Tr,{children:o.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:D,asyncJobs:E}=HJ(C,r??[],t==null?void 0:t.pendingPostDeployMigration),R=s.includes(C),A=C===(t==null?void 0:t.pendingPostDeployMigration)&&(!D||(D==null?void 0:D.status)==="error"),k=[o.jsxs(ye.Tr,{children:[o.jsx(ye.Td,{children:C}),o.jsx(ye.Td,{children:A&&o.jsx(Ne,{color:"green",size:"xs",onClick:()=>y(C),children:"Start"})}),o.jsx(ye.Td,{children:T}),o.jsx(ye.Td,{children:D&&o.jsx(mt,{to:`/AsyncJob/${D==null?void 0:D.id}`,children:D==null?void 0:D.id})}),o.jsx(ye.Td,{children:(M=D==null?void 0:D.meta)==null?void 0:M.lastUpdated}),o.jsx(ye.Td,{children:D==null?void 0:D.requestTime}),o.jsx(ye.Td,{children:XT(D)}),o.jsx(ye.Td,{display:"flex",children:o.jsxs(je,{gap:"xs",children:[E.length?E.length:"",R&&E.length>1&&o.jsx(Ne,{leftSection:o.jsx(wF,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(I=>I.includes(C)?I.filter($=>$!==C):I),children:"Hide all"}),!R&&E.length>1&&o.jsx(Ne,{leftSection:o.jsx(a_,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(I=>I.includes(C)?I:[...I,C]),children:"Show all"})]})})]},C)];return R&&k.push(...E.filter(I=>I.id!==(D==null?void 0:D.id)).map(I=>{var $;return o.jsxs(ye.Tr,{bg:"gray.1",children:[o.jsx(ye.Td,{children:C}),o.jsx(ye.Td,{}),o.jsx(ye.Td,{children:I.status}),o.jsx(ye.Td,{children:o.jsx(mt,{to:`/AsyncJob/${I.id}`,children:I.id})}),o.jsx(ye.Td,{children:($=I.meta)==null?void 0:$.lastUpdated}),o.jsx(ye.Td,{children:I.requestTime}),o.jsx(ye.Td,{children:XT(I)}),o.jsx(ye.Td,{})]},I.id)})),k})},{isLoading:b})]})}function HJ(e,t,n){const r=t.filter(c=>c.dataVersion===e),i=r.find(c=>c.status==="completed")??r[0];let s;return n===0?s=(i==null?void 0:i.status)??"completed":e>n?s=(i==null?void 0:i.status)??"pending":e===n?s=(i==null?void 0:i.status)??"next":s=(i==null?void 0:i.status)??"completed",{status:s,asyncJob:i,asyncJobs:r}}function KT(e){return`/${e.resourceType}/${e.id}`}function XT(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),s=new Date(n).getTime()-r.getTime();if(s<1e3)return`${s.toFixed(0)}ms`;const c=s/1e3;return c<60?`${c.toFixed(2)}s`:c<3600?`${(c/60).toFixed(2)}m`:`${(c/3600).toFixed(2)}h`}function qJ(){const e=_e(),[t,{open:n,close:r}]=op(!1),[i,s]=v.useState(""),[c,u]=v.useState();if(!e.isLoading()&&!e.isSuperAdmin())return o.jsx(Kr,{outcome:Q0});function f(){Ss(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function p(){Ss(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function m(){Ss(e,"Rebuilding Value Sets","admin/super/valuesets")}function g(A){Ss(e,"Reindexing Resources","admin/super/reindex",A)}function y(){Ss(e,"Reload Cron Resources","admin/super/reloadcron")}function b(){Ss(e,"Run Pending Data Migration","admin/super/migrate")}function S(A){e.post("admin/super/removebotidjobsfromqueue",A).then(()=>Oe({color:"green",message:"Done"})).catch(k=>Oe({color:"red",message:Ye(k),autoClose:!1}))}function j(A){e.post("admin/super/purge",{...A,before:Tb(A.before)}).then(()=>Oe({color:"green",message:"Done"})).catch(k=>Oe({color:"red",message:Ye(k),autoClose:!1}))}function C(A){e.post("admin/super/setpassword",A).then(()=>Oe({color:"green",message:"Done"})).catch(k=>Oe({color:"red",message:Ye(k),autoClose:!1}))}function T(A){e.post("fhir/R4/$db-stats",A.tableNames?{resourceType:"Parameters",parameter:[{name:"tableNames",valueString:A.tableNames}]}:void 0).then(k=>{var M,I;s("Database Stats"),u(o.jsx("pre",{children:(I=(M=k.parameter)==null?void 0:M.find($=>$.name==="tableString"))==null?void 0:I.valueString})),n()}).catch(k=>Oe({color:"red",message:Ye(k),autoClose:!1}))}function D(){e.post("fhir/R4/$db-invalid-indexes").then(A=>{var k;s("Database Invalid Indexes"),u(o.jsx("pre",{children:(k=A.parameter)==null?void 0:k.filter(M=>M.name==="invalidIndex").map(M=>M.valueString).join(`
575
- `)})),n()}).catch(A=>Oe({color:"red",message:Ye(A),autoClose:!1}))}function E(){e.post("fhir/R4/$db-schema-diff").then(A=>{var k,M;s("Schema Diff"),u(o.jsx("pre",{children:(M=(k=A.parameter)==null?void 0:k.find(I=>I.name==="migrationString"))==null?void 0:M.valueString})),n()}).catch(A=>Oe({color:"red",message:Ye(A),autoClose:!1}))}function R(){Ss(e,"Reconcile Schema Diff","admin/super/reconcile-db-schema-drift")}return o.jsxs(ot,{width:600,children:[o.jsx(Le,{order:1,children:"Super Admin"}),o.jsx(Cn,{my:"lg"}),o.jsx(Le,{order:2,children:"Structure Definitions"}),o.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."}),o.jsx(pt,{children:o.jsx(Ne,{onClick:f,children:"Rebuild StructureDefinitions"})}),o.jsx(Cn,{my:"lg"}),o.jsx(Le,{order:2,children:"Search Parameters"}),o.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."}),o.jsx(pt,{children:o.jsx(Ne,{onClick:p,children:"Rebuild SearchParameters"})}),o.jsx(Cn,{my:"lg"}),o.jsx(Le,{order:2,children:"Value Sets"}),o.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."}),o.jsx(pt,{children:o.jsx(Ne,{onClick:m,children:"Rebuild ValueSets"})}),o.jsx(Cn,{my:"lg"}),o.jsx(Le,{order:2,children:"Run Pending Data Migration"}),o.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."}),o.jsx(pt,{onSubmit:b,children:o.jsx(Ge,{children:o.jsx(Ne,{type:"submit",children:"Start Migration"})})}),o.jsx(Cn,{my:"lg"}),o.jsx(Le,{order:2,children:"Reindex Resources"}),o.jsx("p",{children:"When Medplum changes how resources are indexed, the system may require a reindex for old resources to be indexed properly."}),o.jsx(pt,{onSubmit:g,children:o.jsxs(Ge,{children:[o.jsx($t,{title:"Resource Type",htmlFor:"resourceType",children:o.jsx(ze,{id:"resourceType",name:"resourceType",placeholder:"Reindex Resource Type"})}),o.jsx($t,{title:"Search Filter",htmlFor:"filter",children:o.jsx(ze,{id:"filter",name:"filter",placeholder:"e.g. name=Sam&birthdate=lt2000-01-01"})}),o.jsx($t,{title:"Max Resource Version",htmlFor:"maxResourceVersion",children:o.jsx(GJ,{})}),o.jsx(Ne,{type:"submit",children:"Reindex"})]})}),o.jsx(Cn,{my:"lg"}),o.jsx(Le,{order:2,children:"Purge Resources"}),o.jsx("p",{children:"As system generated resources accumulate, the system may require a purge to remove old resources."}),o.jsx(pt,{onSubmit:j,children:o.jsxs(Ge,{children:[o.jsx($t,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:o.jsx(ln,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),o.jsx($t,{title:"Purge Before",htmlFor:"before",children:o.jsx(aa,{name:"before",placeholder:"Before Date"})}),o.jsx(Ne,{type:"submit",children:"Purge"})]})}),o.jsx(Cn,{my:"lg"}),o.jsx(Le,{order:2,children:"Remove Bot ID Jobs from Queue"}),o.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),o.jsx(pt,{onSubmit:S,children:o.jsxs(Ge,{children:[o.jsx($t,{title:"Bot ID",children:o.jsx(ze,{name:"botId",placeholder:"Bot Id"})}),o.jsx(Ne,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),o.jsx(Cn,{my:"lg"}),o.jsx(Le,{order:2,children:"Force Set Password"}),o.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.'}),o.jsx(pt,{onSubmit:C,children:o.jsxs(Ge,{children:[o.jsx(ze,{name:"email",label:"Email",required:!0}),o.jsx(Ni,{name:"password",label:"Password",required:!0}),o.jsx(ze,{name:"projectId",label:"Project ID"}),o.jsx(Ne,{type:"submit",children:"Force Set Password"})]})}),o.jsx(Cn,{my:"lg"}),o.jsx(Le,{order:2,children:"Database Stats"}),o.jsx("p",{children:"Query current table statistics from the database."}),o.jsx(pt,{onSubmit:T,children:o.jsxs(Ge,{children:[o.jsx($t,{title:"Table Names (comma-delimited)",htmlFor:"tableNames",children:o.jsx(ze,{id:"tableNames",name:"tableNames",placeholder:"Observation,Observation_History"})}),o.jsx(Ne,{type:"submit",children:"Get Database Stats"})]})}),o.jsx(Cn,{my:"lg"}),o.jsx(Le,{order:2,children:"Database Invalid Indexes"}),o.jsx("p",{children:"Query invalid indexes from the database."}),o.jsx(pt,{onSubmit:D,children:o.jsx(Ge,{children:o.jsx(Ne,{type:"submit",children:"Get Database Invalid Indexes"})})}),o.jsx(Cn,{my:"lg"}),o.jsx(Le,{order:2,children:"Database Schema Drift"}),o.jsx("p",{children:"Show the schema migration needed to match the expected database schema."}),o.jsxs(or,{children:[o.jsx(or.Col,{span:6,children:o.jsx(pt,{onSubmit:E,children:o.jsx(Ge,{children:o.jsx(Ne,{type:"submit",children:"Get Schema Drift"})})})}),o.jsx(or.Col,{span:6,children:o.jsx(pt,{onSubmit:R,children:o.jsx(Ge,{children:o.jsx(Ne,{type:"submit",children:"Reconcile Schema Drift"})})})})]}),o.jsx(Cn,{my:"lg"}),o.jsx(Le,{order:2,children:"Reload Cron Resources"}),o.jsx("p",{children:"Obliterates the cron queue and rebuilds all the cron job schedulers for cron resources (eg. cron bots)."}),o.jsx(pt,{onSubmit:y,children:o.jsx(Ge,{children:o.jsx(Ne,{type:"submit",children:"Reload Cron Resources"})})}),o.jsx(Un,{opened:t,onClose:r,title:i,centered:!0,size:"auto",children:c})]})}function GJ(){const[e,t]=v.useState("outdated");return o.jsxs(o.Fragment,{children:[o.jsx(ln,{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"&&o.jsx(Ip,{required:!0,name:"maxResourceVersion",placeholder:"Max Resource Version",min:0})]})}function QJ(){return o.jsxs(o.Fragment,{children:[o.jsx(Le,{children:"Users"}),o.jsx(fm,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),o.jsx(je,{justify:"flex-end",children:o.jsx(mt,{to:"/admin/invite",children:"Invite new user"})})]})}function WJ(){const[e]=xc("ObservationDefinition","_count=100");return e?o.jsxs(ye,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Category"}),o.jsx("th",{children:"Code"}),o.jsx("th",{children:"Method"}),o.jsx("th",{children:"Unit"}),o.jsx("th",{children:"Precision"}),o.jsx("th",{children:"Ranges"})]})}),o.jsx("tbody",{children:e.map(t=>{var n,r,i,s;return o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx(ia,{value:(n=t.category)==null?void 0:n[0]})}),o.jsx("td",{children:o.jsx(ia,{value:t.code})}),o.jsx("td",{children:o.jsx(ia,{value:t.method})}),o.jsx("td",{children:(i=(r=t.quantitativeDetails)==null?void 0:r.unit)==null?void 0:i.text}),o.jsx("td",{children:(s=t.quantitativeDetails)==null?void 0:s.decimalPrecision}),o.jsx("td",{children:o.jsx(ox,{ranges:t.qualifiedInterval})})]},t.id)})})]}):o.jsx(gi,{})}function ox(e){const{ranges:t}=e;if(!t)return null;const n=ZT(t.map(i=>i.gender));if(n.length>1)return ad(n),o.jsx(o.Fragment,{children:n.map(i=>{var s;return o.jsxs(v.Fragment,{children:[o.jsx("div",{children:o.jsx("strong",{children:Hn(i)})}),o.jsx(ox,{ranges:(s=e.ranges)==null?void 0:s.filter(c=>c.gender===i)})]},i)})});const r=ZT(t.map(i=>i.age&&od(i.age)));return r.length>1?(ad(r),o.jsx(o.Fragment,{children:r.map(i=>{var s;return o.jsxs(v.Fragment,{children:[o.jsx("div",{children:o.jsx("strong",{children:Hn(i)})}),o.jsx(ox,{ranges:(s=e.ranges)==null?void 0:s.filter(c=>od(c.age)===i)})]},i)})})):o.jsx(o.Fragment,{children:t.map(i=>o.jsx("table",{children:o.jsx("tbody",{children:o.jsxs("tr",{children:[o.jsx("td",{children:i.condition}),o.jsx("td",{children:o.jsx(Eb,{value:i.range})})]})})},`range-${i.condition}`))})}function ZT(e){return[...new Set(e.filter(t=>!!t))]}function YJ(){const[e]=xc("ActivityDefinition","_count=100"),[t]=xc("ObservationDefinition","_count=100");return!e||!t?o.jsx(gi,{}):o.jsxs(ye,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Category"}),o.jsx("th",{children:"Assay"}),e.map(n=>o.jsx("th",{children:n.name},n.id))]})}),o.jsx("tbody",{children:t.map(n=>{var r;return o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx(ia,{value:(r=n.category)==null?void 0:r[0]})}),o.jsx("td",{children:o.jsx(ia,{value:n.code})}),e.map(i=>{var s;return o.jsx("td",{children:(s=i.observationResultRequirement)!=null&&s.find(c=>{var u;return(u=c.reference)==null?void 0:u.includes(n.id)})?"✅":""},i.id)})]},n.id)})})]})}function KJ(e){var c;const t=_e(),[n,r]=v.useState(),[i,s]=v.useState();return i?o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"Request group created successfully."}),o.jsxs("ul",{children:[o.jsxs("li",{children:["Go to the"," ",o.jsx(mt,{to:i,suffix:"checklist",children:"Request Group"})]}),o.jsxs("li",{children:["Back to the ",o.jsx(mt,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):o.jsx(pt,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueString:n==null?void 0:n.reference}]}).then(s).catch(console.log)},children:o.jsxs(Ge,{children:[o.jsxs(Le,{children:['Start "',e.planDefinition.title,'"']}),o.jsxs(Ae,{children:["Use the ",o.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),o.jsx(Ae,{children:"The following tasks will be created:"}),o.jsx("ul",{children:(c=e.planDefinition.action)==null?void 0:c.map((u,f)=>{var p;return o.jsxs("li",{children:[((p=u.definitionCanonical)==null?void 0:p.startsWith("Questionnaire/"))&&"Questionnaire request: ",u.title&&o.jsx(o.Fragment,{children:u.title}),u.code&&o.jsx(ia,{value:u.code[0]})]},`action-${f}`)})}),o.jsx($t,{title:"Subject",children:o.jsx(Od,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),o.jsx(je,{justify:"flex-end",mt:"xl",children:o.jsx(Ne,{type:"submit",children:"Go"})})]})})}function XJ(){const{resourceType:e,id:t}=qt(),n=Qt({reference:e+"/"+t});return n?o.jsx(ot,{children:o.jsx(KJ,{planDefinition:n})}):null}function ZJ(){const{resourceType:e,id:t}=qt(),n=Qt({reference:e+"/"+t}),[r,i]=xc("Questionnaire","subject-type="+e),[s,c]=xc("ClientApplication",{_count:1e3});if(!n||i||c)return o.jsx(gi,{});const u=s==null?void 0:s.filter(m=>JJ(e)&&!!m.launchUri);if((!r||r.length===0)&&(!u||u.length===0))return o.jsxs(ot,{children:[o.jsx(Le,{children:"Apps"}),o.jsxs("p",{children:["No apps found. Contact your administrator or ",o.jsx("a",{href:"mailto:support@medplum.com",children:"Medplum Support"})," to add automation here."]})]});let f,p;return n.resourceType==="Patient"?f=on(n):n.resourceType==="Encounter"&&(f=n.subject,p=on(n)),o.jsxs(ot,{children:[r==null?void 0:r.map(m=>o.jsxs("div",{children:[o.jsx(Le,{order:3,children:o.jsx(mt,{to:`/forms/${m.id}?subject=${zt(n)}`,children:m.title||m.name})}),o.jsx(Ae,{children:m.description})]},m.id)),u==null?void 0:u.map(m=>o.jsxs("div",{children:[o.jsx(Le,{order:3,children:o.jsx(QY,{client:m,patient:f,encounter:p,children:m.name})}),o.jsx(Ae,{children:m.description})]},m.id))]})}function JJ(e){return e==="Patient"||e==="Encounter"}function eee(){const{resourceType:e,id:t}=qt(),n=wn(),[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 o.jsx(ot,{children:o.jsx(zc,{search:r,onClick:s=>{var c;return(c=n(`/${s.resource.resourceType}/${s.resource.id}`))==null?void 0:c.catch(console.error)},onChange:s=>i(s.definition),hideFilters:!0})})}function tee(){const e=_e(),{resourceType:t,id:n}=qt(),r=e.readHistory(t,n).read();return o.jsx(ot,{children:o.jsx(IY,{history:r})})}const nee="_hl7Input_k5xm3_1",ree={hl7Input:nee};function iee(e){return o.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 aee(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),o.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=>{Yu(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const oee=`{
576
- "resourceType": "Patient",
577
- "name": [
578
- {
579
- "given": [
580
- "Alice"
581
- ],
582
- "family": "Smith"
583
- }
584
- ]
585
- }`,see="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 lee(){const e=_e(),{id:t}=qt(),[n,r]=v.useState(),[i,s]=v.useState(),[c,u]=v.useState(oee),[f,p]=v.useState(see),[m,g]=v.useState(hn.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),s(await cee(e,k))}).catch(k=>Oe({color:"red",message:Ye(k),autoClose:!1}))},[e,t]);const C=v.useCallback(async()=>Yu(y.current,{command:"getValue"}),[]),T=v.useCallback(async()=>Yu(y.current,{command:"getOutput"}),[]),D=v.useCallback(async()=>m===hn.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(),I=await T(),$=await e.createAttachment({data:M,filename:"index.ts",contentType:"text/typescript"}),V=await e.createAttachment({data:I,filename:"index.js",contentType:"text/typescript"}),Y=[{op:"add",path:"/sourceCode",value:$},{op:"add",path:"/executableCode",value:V}];await e.patchResource("Bot",t,Y),Oe({color:"green",message:"Saved"})}catch(M){Oe({color:"red",message:Ye(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:Ye(M),autoClose:!1})}finally{j(!1)}},[e,t]),A=v.useCallback(async k=>{k.preventDefault(),k.stopPropagation(),j(!0);try{const M=await D(),I=await e.post(e.fhirUrl("Bot",t,"$execute"),M,m);await Yu(b.current,{command:"setValue",value:I}),Oe({color:"green",message:"Success"})}catch(M){Oe({color:"red",message:Ye(M),autoClose:!1})}finally{j(!1)}},[e,t,D,m]);return!n||i===void 0?null:o.jsxs(or,{m:0,gutter:0,style:{overflow:"hidden"},children:[o.jsx(or.Col,{span:8,children:o.jsxs(mr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[o.jsx(aee,{iframeRef:y,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:i,minHeight:"528px"}),o.jsxs(je,{justify:"flex-end",gap:"xs",children:[o.jsx(Ne,{type:"button",onClick:E,loading:S,leftSection:o.jsx(dF,{size:"1rem"}),children:"Save"}),o.jsx(Ne,{type:"button",onClick:R,loading:S,leftSection:o.jsx(mb,{size:"1rem"}),children:"Deploy"}),o.jsx(Ne,{type:"button",onClick:A,loading:S,leftSection:o.jsx(TF,{size:"1rem"}),children:"Execute"})]})]})}),o.jsxs(or.Col,{span:4,children:[o.jsxs(mr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[o.jsx(ln,{data:[{label:"FHIR",value:hn.FHIR_JSON},{label:"HL7",value:hn.HL7_V2}],onChange:k=>g(k.currentTarget.value)}),m===hn.FHIR_JSON?o.jsx(Dc,{value:c,onChange:k=>u(k),autosize:!0,minRows:15}):o.jsx("textarea",{className:ree.hl7Input,value:f,onChange:k=>p(k.currentTarget.value),rows:15})]}),o.jsx(mr,{m:2,p:"xs",shadow:"md",children:o.jsx(iee,{iframeRef:b,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function cee(e,t){var n,r,i;if((n=t.sourceCode)!=null&&n.url){const s=(i=(r=t.sourceCode.url)==null?void 0:r.split("/"))==null?void 0:i.find(wA);return(await e.download(e.fhirUrl("Binary",s))).text()}return t.code??""}function sl(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function uee(){const e=_e(),{resourceType:t,id:n}=qt(),r={reference:t+"/"+n},i=v.useCallback(s=>{e.updateResource(sl(s)).then(()=>{Oe({color:"green",message:"Success"})}).catch(c=>{Oe({color:"red",message:Ye(c),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return o.jsx(ot,{children:o.jsx(oW,{value:r,onSubmit:i})});case"Questionnaire":return o.jsx(ot,{children:o.jsx(QW,{questionnaire:r,onSubmit:i})});default:return null}}function dee(){const{resourceType:e,id:t}=qt(),n=Qt({reference:e+"/"+t}),r=wn();return n?o.jsx(ot,{children:o.jsx(yY,{value:n,onStart:(i,s)=>{var c;return(c=r(`/forms/${Bs(s)}`))==null?void 0:c.catch(console.error)},onEdit:(i,s,c)=>{var u;return(u=r(`/${c.reference}}`))==null?void 0:u.catch(console.error)}})}):null}function fee(){const e=_e(),{resourceType:t,id:n}=qt(),r=wn();return o.jsxs(ot,{children:[o.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),o.jsx(Ne,{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:Ye(i),autoClose:!1}))},children:"Delete"})]})}const hee="_selectProfileBtn_tbaz6_1",pee="_chevron_tbaz6_13",JT={selectProfileBtn:hee,chevron:pee};function mee(){var f,p;const{resourceType:e,id:t}=qt(),n=Qt({reference:e+"/"+t}),[r,i]=v.useState(),s=yd({onDropdownClose:()=>s.resetSelectedOption()}),c=v.useMemo(()=>{var m;if(Tn((m=n==null?void 0:n.meta)==null?void 0:m.profile))return[o.jsx(ct.Option,{value:"",children:"None"},""),...n.meta.profile.map(g=>o.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])},[(p=n==null?void 0:n.meta)==null?void 0:p.profile]),!n)return null;let u;return Tn(c)&&(u=o.jsx(je,{justify:"flex-end",children:o.jsxs(Ge,{align:"flex-end",gap:"xs",children:[o.jsxs(ct,{store:s,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:m=>{i(m),s.closeDropdown()},children:[o.jsx(ct.Target,{children:o.jsx(tr,{onClick:()=>s.toggleDropdown(),children:o.jsxs(d0,{fw:"bold",fs:"sm",className:JT.selectProfileBtn,children:[o.jsx("span",{children:"Pick profile"}),o.jsx(pb,{stroke:1.5,className:JT.chevron})]})})}),o.jsx(ct.Dropdown,{w:"max-content",children:o.jsx(ct.Options,{children:c})})]}),o.jsx(ce,{children:r?o.jsxs(o.Fragment,{children:[o.jsx(Ae,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),o.jsx(Ae,{span:!0,size:"sm",children:r||"Nothing selected"})]}):o.jsx(Ae,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),o.jsx(ot,{children:o.jsxs(Ge,{gap:"xl",children:[u,o.jsx(Pb,{value:n,profileUrl:r})]})})}function gee(){const e=_e(),{resourceType:t,id:n}=qt(),[r,i]=v.useState(),[s,c]=v.useState(),u=wn(),[f,p]=v.useState();v.useEffect(()=>{e.readResource(t,n).then(b=>{i(Qr(b)),c(Qr(b))}).catch(b=>{p(Zt(b)),Oe({color:"red",message:Ye(b),autoClose:!1})})},[e,t,n]);const m=v.useCallback(b=>{p(void 0),e.updateResource(sl(b)).then(()=>{var S;(S=u(`/${t}/${n}/details`))==null||S.catch(console.error),Oe({id:"succes",color:"green",message:"Success"})}).catch(S=>{p(Zt(S)),Oe({color:"red",message:Ye(S),autoClose:!1})})},[e,t,n,u]),g=v.useCallback(b=>{p(void 0);const S=$_.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=>{p(Zt(j)),Oe({color:"red",message:Ye(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 s?o.jsx(ot,{children:o.jsx(Yh,{defaultValue:s,onSubmit:m,onPatch:g,onDelete:y,outcome:f})}):null}function vee(){const{resourceType:e,id:t}=qt(),n=Qt({reference:e+"/"+t});return n?o.jsx(ot,{maw:700,children:n.resourceType==="Patient"?o.jsx(eW,{patient:n}):o.jsx(Ya,{icon:o.jsx(rl,{size:16}),title:"Unsupported export type",color:"red",children:"This page is only supported for Patient resources"})}):null}function i4({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,i=_e(),[s,c]=v.useState();return v.useEffect(()=>{i.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(u=>{c(u.filter(Sq))}).catch(console.error)},[i,n,r]),o.jsx(Et,{value:t==null?void 0:t.url,onChange:u=>{const f=s==null?void 0:s.find(p=>p.url===u);f&&n(f)},children:o.jsx(Et.List,{children:s==null?void 0:s.map(u=>{var m,g;const f=(g=(m=e.meta)==null?void 0:m.profile)==null?void 0:g.includes(u.url),p=f?"This profile is present in this resource's meta.profile property.":"This profile is not included in this resource's meta.profile property.";return o.jsx(Et.Tab,{value:u.url,title:p,rightSection:f&&o.jsx(q0,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:o.jsx(zF,{size:"90%"})}),children:u.title||u.name},u.url)})})})}function a4(e,t){const n=_e(),r=wn();return{defaultValue:{resourceType:e},handleSubmit:c=>{t&&t(void 0),n.createResource(c).then(u=>r("/"+u.resourceType+"/"+u.id)).catch(u=>{t&&t(Zt(u)),Oe({color:"red",message:Ye(u),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function hy(){const{resourceType:e}=qt(),t=Mr(),[n,r]=v.useState(),{defaultValue:i,handleSubmit:s}=a4(e,r),[c,u]=v.useState(),f=t.pathname.toLowerCase().endsWith("profiles"),p=v.useCallback(m=>{const g=sl(m);c&&RA(g,c.url),s(g)},[c,s]);return f?o.jsx(ot,{children:o.jsxs(Ge,{children:[o.jsx(i4,{resource:i,currentProfile:c,onChange:u}),c?o.jsx(Yh,{defaultValue:i,onSubmit:p,outcome:n,profileUrl:c.url},c.url):o.jsx(Ae,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):o.jsx(ot,{children:o.jsx(Yh,{defaultValue:i,onSubmit:s,outcome:n})})}function yee(){const e=_e(),{resourceType:t,id:n}=qt(),r=e.readHistory(t,n).read();return o.jsx(ot,{children:o.jsx(FY,{history:r})})}function xee(){const{resourceType:e}=qt(),[t,n]=v.useState(),{defaultValue:r,handleSubmit:i}=a4(e,n),s=v.useCallback(c=>{i(JSON.parse(c["new-resource"]))},[i]);return o.jsxs(ot,{children:[t&&o.jsx(Kr,{outcome:t}),o.jsxs(pt,{onSubmit:s,children:[o.jsx(Dc,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:Ii(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),o.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:o.jsx(Ne,{type:"submit",children:"OK"})})]})]})}function bee(){const e=_e(),{resourceType:t,id:n}=qt(),r=Qt({reference:t+"/"+n}),i=wn(),[s,c]=v.useState(),u=v.useCallback(f=>{e.updateResource(sl(JSON.parse(f.resource))).then(()=>{var p;c(void 0),(p=i(`/${t}/${n}/details`))==null||p.catch(console.error),Oe({color:"green",message:"Success"})}).catch(p=>{Oe({color:"red",message:Ye(p),autoClose:!1})})},[e,t,n,i]);return r?o.jsxs(ot,{children:[s&&o.jsx(Kr,{outcome:s}),o.jsxs(pt,{onSubmit:u,children:[o.jsx(Dc,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:Ii(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),o.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:o.jsx(Ne,{type:"submit",children:"OK"})})]})]}):null}function See(){const{resourceType:e,id:t}=qt();return Qt({reference:e+"/"+t})?o.jsxs(ot,{children:[o.jsxs(Ya,{icon:o.jsx(rl,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",o.jsx("br",{}),o.jsx(Nt,{href:`/forms/${t}`,children:`/forms/${t}`})]}),o.jsx(dk,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function wee(){const e=_e(),{resourceType:t,id:n}=qt(),[r,i]=v.useState(),[s,c]=v.useState();return v.useEffect(()=>{e.readResource(t,n).then(u=>i(Qr(u))).catch(u=>{Oe({color:"red",message:Ye(u)})})},[e,t,n]),r?o.jsxs(ot,{children:[o.jsxs(Le,{order:2,children:["Available ",t," profiles"]}),o.jsx(Ge,{children:o.jsxs(o.Fragment,{children:[o.jsx(i4,{resource:r,currentProfile:s,onChange:c}),s?o.jsx(jee,{profile:s,resource:r,onResourceUpdated:u=>i(u)},s.url):o.jsx(Ae,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const jee=({profile:e,resource:t,onResourceUpdated:n})=>{const r=_e(),[i,s]=v.useState(),[c,u]=v.useState(()=>{var p,m;return(m=(p=t.meta)==null?void 0:p.profile)==null?void 0:m.includes(e.url)}),f=v.useCallback(p=>{s(void 0);const m=sl(p);c?RA(m,e.url):mU(m,e.url),r.updateResource(m).then(g=>{n(g),Oe({color:"green",message:"Success"})}).catch(g=>{s(Zt(g)),Oe({color:"red",message:Ye(g),autoClose:!1})})},[r,e.url,n,c]);return o.jsxs(Ge,{children:[o.jsx(jd,{size:"md",checked:c,label:`Conform resource to ${e.title}`,onChange:p=>u(p.currentTarget.checked),"data-testid":"profile-toggle"}),c?o.jsx(Yh,{profileUrl:e.url,defaultValue:t,onSubmit:f,outcome:i}):o.jsx("form",{noValidate:!0,onSubmit:p=>{p.preventDefault(),f(t)},children:o.jsx(je,{justify:"flex-end",mt:"xl",children:o.jsx(Ne,{type:"submit",children:"OK"})})})]})},o4={"Create Only":"create","Update Only":"update","Delete Only":"delete","All Interactions":void 0},Cee=Object.keys(o4);function Eee(){const e=_e(),{id:t}=qt(),n=Qt({reference:`Questionnaire/${t}`}),[r,i]=v.useState(),[s,c]=v.useState("create"),[u,f]=v.useState(0),p=e.searchResources("Subscription","status=active&_count=100").read().filter(g=>Tee(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},${zt(n)}`:zt(n)}`,channel:{type:"rest-hook",endpoint:zt(r)},...s?{extension:[{url:"https://medplum.com/fhir/StructureDefinition/subscription-supported-interaction",valueCode:s}]}:void 0}).then(()=>{i(void 0),f(Date.now()),e.invalidateSearches("Subscription"),Oe({color:"green",message:"Success"})}).catch(g=>Oe({color:"red",message:Ye(g),autoClose:!1}))}return o.jsxs(ot,{children:[o.jsx(Le,{children:"Bots"}),o.jsxs(Ge,{children:[p.length===0&&o.jsx("p",{children:"No bots found."}),p.map(g=>{var y;return o.jsxs("div",{children:[o.jsx("h3",{children:o.jsx(Lc,{value:{reference:(y=g.channel)==null?void 0:y.endpoint},link:!0})}),o.jsxs("p",{children:["Criteria: ",g.criteria]})]},g.id)})]}),o.jsx(Cn,{}),o.jsxs(Ge,{mt:10,children:[o.jsx(pd,{size:"lg",htmlFor:"bot",children:"Connect to bot"}),o.jsxs(je,{children:[o.jsx(il,{name:"bot",resourceType:"Bot",onChange:g=>i(g)}),o.jsx(Ne,{onClick:m,children:"Connect"})]}),o.jsx(je,{children:o.jsx(ln,{name:"subscription-trigger-event",defaultValue:"Create Only",label:"Subscription Trigger Event",data:Cee,onChange:g=>c(o4[g.target.value])})})]}),o.jsx("div",{style:{display:"none"},children:u})]})}function Tee(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(zt(t))||(t.url?n.includes(t.url):!1))}function Ree(){const{id:e}=qt(),t=wn(),r=_e().readReference({reference:`Questionnaire/${e}`}).read(),[i,s]=v.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:ue.EQUALS,value:r.url?`${r.url},Questionnaire/${e}`:`Questionnaire/${e}`}],fields:["id","_lastUpdated"]});return o.jsx(ot,{children:o.jsx(zc,{search:i,onClick:c=>{var u;return(u=t(`/${c.resource.resourceType}/${c.resource.id}`))==null?void 0:u.catch(console.error)},onChange:c=>s(c.definition),hideFilters:!0,hideToolbar:!0})})}function Dee(){const e=_e(),{resourceType:t,id:n}=qt(),r=Qt({reference:t+"/"+n}),i=v.useCallback(s=>{e.updateResource(sl(s)).then(()=>{Oe({color:"green",message:"Success"})}).catch(c=>{Oe({color:"red",message:Ye(c),autoClose:!1})})},[e]);return r?o.jsx(ot,{children:o.jsx(uY,{onSubmit:i,definition:r})}):null}function Aee(){const{resourceType:e,id:t}=qt(),n=Qt({reference:e+"/"+t});return n?o.jsx(ot,{children:e==="MeasureReport"?o.jsx(ZQ,{measureReport:n}):o.jsx(kb,{value:n})}):null}const _ee="_container_1ue98_1",kee="_entry_1ue98_14",Pee="_active_1ue98_21",py={container:_ee,entry:kee,active:Pee};function Nee(e){const t=_e(),n=Qt(e.value),[r,i]=v.useState();return v.useEffect(()=>{if(!n)return;const s=n1(n);if(!s)return;const c="reference"in s?s.reference:zt(s);t.search("ServiceRequest","subject="+c).then(u=>{const p=(u.entry??[]).map(m=>m.resource);U_(p),p.reverse(),i(p)}).catch(u=>Oe({color:"red",message:Ye(u),autoClose:!1}))},[t,n]),r?o.jsx("div",{"data-testid":"quick-service-requests",className:py.container,children:r.map(s=>{var c,u,f,p,m,g,y;return o.jsxs("div",{className:Ut(py.entry,{[py.active]:s.id===(n==null?void 0:n.id)}),children:[o.jsx("p",{children:o.jsx(mt,{to:s,children:Oee(s)})}),((u=(c=s.category)==null?void 0:c[0])==null?void 0:u.text)&&o.jsx("p",{children:(f=s.category[0])==null?void 0:f.text}),((g=(m=(p=s.code)==null?void 0:p.coding)==null?void 0:m[0])==null?void 0:g.code)&&o.jsx("p",{children:(y=s.code.coding[0])==null?void 0:y.code}),o.jsx("p",{children:Mee(s)})]},s.id)})}):null}function Oee(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function Mee(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const Iee="_container_1l2dh_1",Lee={container:Iee};function zee(e){var i,s,c,u;const t=Qt(e.valueSet);if(!t)return null;const n=[""],r=(u=(c=(s=(i=t.compose)==null?void 0:i.include)==null?void 0:s[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),o.jsx("div",{className:Lee.container,children:o.jsx(ln,{defaultValue:e.defaultValue,onChange:f=>e.onChange(f.currentTarget.value),data:n})})}function $ee(e){var n,r;const t=Qt(e.specimen);return t?o.jsxs(ht,{children:[o.jsxs(ht.Entry,{children:[o.jsx(ht.Key,{children:"Type"}),o.jsx(ht.Value,{children:"Specimen"})]}),o.jsxs(ht.Entry,{children:[o.jsx(ht.Key,{children:"Collected"}),o.jsx(ht.Value,{children:gr((n=t.collection)==null?void 0:n.collectedDateTime)})]}),o.jsxs(ht.Entry,{children:[o.jsx(ht.Key,{children:"Specimen Age"}),o.jsx(ht.Value,{children:Uee(t)})]}),(r=t.collection)!=null&&r.collectedDateTime&&t.receivedTime?o.jsxs(ht.Entry,{children:[o.jsx(ht.Key,{children:"Specimen Stability"}),o.jsx(ht.Value,{children:Bee(t)})]}):o.jsx(o.Fragment,{})]}):null}function Uee(e){var i;const t=(i=e.collection)==null?void 0:i.collectedDateTime;if(!t)return;const n=new Date(t);return s4(l4(n,new Date))}function Bee(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 s4(l4(t,n))}function s4(e){return e.toString().padStart(3,"0")+"D"}function l4(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function Vee(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 Fee(){var D,E,R,A,k,M,I;const e=_e(),{resourceType:t,id:n}=qt(),r={reference:t+"/"+n},i=wn(),[s,c]=v.useState(),u=Qt(r,c),f=Vee(t),[p,m]=v.useState(()=>{const $=window.location.pathname.split("/").pop();return $&&f.map(V=>V.toLowerCase()).includes($)?$:f[0].toLowerCase()});async function g(){var Y,Q;const V=(Q=(Y=(await e.readHistory(t,n)).entry)==null?void 0:Y.find(J=>!!J.resource))==null?void 0:Q.resource;V?y(V):Oe({color:"red",message:"No history to restore",autoClose:!1})}function y($){e.updateResource(sl($)).then(()=>{c(void 0),Oe({color:"green",message:"Success"})}).catch(V=>{Oe({color:"red",message:Ye(V),autoClose:!1})})}if(s)return j8(s)?o.jsxs(ot,{children:[o.jsx(Le,{children:"Deleted"}),o.jsx("p",{children:"The resource was deleted."}),o.jsx(Ne,{color:"red",onClick:g,children:"Restore"})]}):o.jsx(Kr,{outcome:s});function b($){var V;$||($=f[0].toLowerCase()),m($),(V=i(`/${t}/${n}/${$}`))==null||V.catch(console.error)}function S($){const V=u,Y=V.orderDetail||[];Y.length===0&&Y.push({}),Y[0].text!==$&&(Y[0].text=$,y({...V,orderDetail:Y}))}const j=u&&n1(u),C=u&&sJ(u),T=(R=(E=(D=e.getUserConfiguration())==null?void 0:D.option)==null?void 0:E.find($=>$.id==="statusValueSet"))==null?void 0:R.valueString;return o.jsxs(o.Fragment,{children:[(u==null?void 0:u.resourceType)==="ServiceRequest"&&T&&o.jsx(zee,{valueSet:{reference:T},defaultValue:(k=(A=u.orderDetail)==null?void 0:A[0])==null?void 0:k.text,onChange:S},zt(u)+"-"+((I=(M=u.orderDetail)==null?void 0:M[0])==null?void 0:I.text)),u&&o.jsx(Nee,{value:u}),u&&o.jsxs(mr,{children:[j&&o.jsx(W_,{patient:j}),C&&o.jsx($ee,{specimen:C}),t!=="Patient"&&o.jsx(Xk,{resource:r}),o.jsx(Yr,{children:o.jsx(Et,{value:p.toLowerCase(),onChange:b,children:o.jsx(Et.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:f.map($=>o.jsx(Et.Tab,{value:$.toLowerCase(),children:$},$))})})})]}),o.jsx(Yb,{})]})}function eR(){var T,D,E,R;const e=wn(),{resourceType:t,id:n,versionId:r,tab:i}=qt(),s=_e(),[c,u]=v.useState(!0),[f,p]=v.useState(),[m,g]=v.useState();if(v.useEffect(()=>{g(void 0),u(!0),s.readHistory(t,n).then(A=>p(A)).then(()=>u(!1)).catch(A=>{g(A),u(!1)})},[s,t,n]),c)return o.jsx(gi,{});if(!f)return o.jsxs(ot,{children:[o.jsx(Le,{children:"Resource not found"}),o.jsx(mt,{to:`/${t}`,children:"Return to search page"})]});const y=f.entry??[],b=y.findIndex(A=>{var k,M;return((M=(k=A.resource)==null?void 0:k.meta)==null?void 0:M.versionId)===r});if(b===-1)return o.jsxs(ot,{children:[o.jsx(Le,{children:"Version not found"}),o.jsx(mt,{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 o.jsxs(Et,{value:i||C,onChange:A=>{var k;return(k=e(`/${t}/${n}/_history/${r}/${A||C}`))==null?void 0:k.catch(console.error)},children:[o.jsxs(mr,{children:[o.jsx(Ic,{fluid:!0,p:"md",children:o.jsx(Ae,{children:`${t} ${n}`})}),o.jsxs(Et.List,{children:[o.jsx(Et.Tab,{value:"diff",children:"Diff"}),o.jsx(Et.Tab,{value:"raw",children:"Raw"})]})]}),o.jsxs(ot,{children:[m&&o.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)}),o.jsx(Et.Panel,{value:"diff",children:j?o.jsxs(o.Fragment,{children:[o.jsxs("ul",{children:[o.jsxs("li",{children:["Current: ",(T=S.meta)==null?void 0:T.versionId]}),o.jsxs("li",{children:["Previous:"," ",o.jsx(mt,{to:`/${t}/${n}/_history/${(D=j.meta)==null?void 0:D.versionId}`,children:(E=j.meta)==null?void 0:E.versionId})]})]}),o.jsx($Y,{original:j,revised:S})]}):o.jsxs(o.Fragment,{children:[o.jsxs("ul",{children:[o.jsxs("li",{children:["Current: ",(R=S.meta)==null?void 0:R.versionId]}),o.jsx("li",{children:"Previous: (none)"})]}),o.jsx("pre",{children:JSON.stringify(S,void 0,2)})]})}),o.jsx(Et.Panel,{value:"raw",children:o.jsx("pre",{children:JSON.stringify(S,void 0,2)})})]})]})}function Hee(){const{resourceType:e,id:t}=qt(),n=wn(),[r,i]=v.useState({resourceType:"Subscription",filters:[{code:"url",operator:ue.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return o.jsx(ot,{children:o.jsx(IQ,{search:r,onClick:s=>{var c;return(c=n(`/${s.resource.resourceType}/${s.resource.id}`))==null?void 0:c.catch(console.error)},onChange:s=>i(s.definition),hideFilters:!0})})}function qee(e){const t=_e(),{resource:n,opened:r,onClose:i}=e,[s,c]=v.useState(!1),[u,f]=v.useState(),[p,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:s&&u?zt(u):void 0,verbose:p}),Oe({color:"green",message:"Done"}),i()}catch(y){Oe({color:"red",message:Ye(y),autoClose:!1})}},[t,n,i,s,u,p]);return o.jsx(Un,{opened:r,onClose:i,title:"Resend Subscriptions",children:o.jsx(pt,{onSubmit:g,children:o.jsxs(Ge,{children:[o.jsx(zn,{label:"Choose subscription (all subscriptions by default)",onChange:y=>c(y.currentTarget.checked)}),s&&o.jsx(il,{name:"subscription",resourceType:"Subscription",placeholder:"Subscription",onChange:f}),o.jsx(zn,{label:"Verbose mode",onChange:y=>m(y.currentTarget.checked)}),o.jsx(je,{justify:"flex-end",children:o.jsx(Ne,{type:"submit",children:"Resend"})})]})})})}function tR(){const e=_e(),t=Jp(),{resourceType:n,id:r}=qt(),i={reference:n+"/"+r},[s,c]=v.useState(),u=op(!1);function f(D,E){return e.updateResource({...D,priority:E})}function p(D,E){f(D,"stat").then(E).catch(console.error)}function m(D,E){f(D,"routine").then(E).catch(console.error)}function g(D){t(`/${D.resourceType}/${D.id}`)}function y(D){t(`/${D.resourceType}/${D.id}/edit`)}function b(D){t(`/${D.resourceType}/${D.id}/delete`)}function S(D){c(D),u[1].open()}function j(D){var E;t(`/${D.resourceType}/${D.id}/_history/${(E=D.meta)==null?void 0:E.versionId}`)}function C(D,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(D.resourceType,D.id,"$aws-textract"),{}).then(()=>{E(),As({id:R,title:"AWS Textract Successful",message:"Text successfully extracted.",color:"green",icon:o.jsx(eo,{size:"1rem"}),loading:!1,withCloseButton:!0})}).catch(A=>As({id:R,title:"AWS Textract Error",color:"red",message:Ye(A),icon:o.jsx(Hs,{size:"1rem"}),loading:!1,withCloseButton:!0}))}function T(D){var P;const{primaryResource:E,currentResource:R,reloadTimeline:A}=D,k=R.resourceType===E.resourceType&&R.id===E.id,M=R.resourceType==="Communication"&&R.priority!=="stat",I=R.resourceType==="Communication"&&R.priority==="stat",$=k,V=!k,Y=!k,Q=!k,J=(P=e.getProjectMembership())==null?void 0:P.admin,G=J,K=xJ()&&(R.resourceType==="DocumentReference"||R.resourceType==="Media");return o.jsxs(Ce.Dropdown,{children:[o.jsx(Ce.Label,{children:"Resource"}),M&&o.jsx(Ce.Item,{leftSection:o.jsx(CF,{size:14}),onClick:()=>p(R,A),"aria-label":`Pin ${zt(R)}`,children:"Pin"}),I&&o.jsx(Ce.Item,{leftSection:o.jsx(EF,{size:14}),onClick:()=>m(R,A),"aria-label":`Unpin ${zt(R)}`,children:"Unpin"}),V&&o.jsx(Ce.Item,{leftSection:o.jsx(ME,{size:14}),onClick:()=>g(R),"aria-label":`Details ${zt(R)}`,children:"Details"}),$&&o.jsx(Ce.Item,{leftSection:o.jsx(ME,{size:14}),onClick:()=>j(R),"aria-label":`Details ${zt(R)}`,children:"Details"}),Y&&o.jsx(Ce.Item,{leftSection:o.jsx(n_,{size:14}),onClick:()=>y(R),"aria-label":`Edit ${zt(R)}`,children:"Edit"}),J&&o.jsxs(o.Fragment,{children:[o.jsx(Ce.Divider,{}),o.jsx(Ce.Label,{children:"Admin"}),G&&o.jsx(Ce.Item,{leftSection:o.jsx(DF,{size:14}),onClick:()=>S(R),"aria-label":`Resend Subscriptions ${zt(R)}`,children:"Resend Subscriptions"})]}),K&&o.jsxs(o.Fragment,{children:[o.jsx(Ce.Divider,{}),o.jsx(Ce.Label,{children:"AWS AI"}),o.jsx(Ce.Item,{leftSection:o.jsx(IF,{size:14}),onClick:()=>C(R,A),"aria-label":`AWS Textract ${zt(R)}`,children:"AWS Textract"})]}),Q&&o.jsxs(o.Fragment,{children:[o.jsx(Ce.Divider,{}),o.jsx(Ce.Label,{children:"Danger zone"}),o.jsx(Ce.Item,{color:"red",leftSection:o.jsx(yb,{size:14}),onClick:()=>b(R),"aria-label":`Delete ${zt(R)}`,children:"Delete"})]})]})}return o.jsxs(o.Fragment,{children:[n==="Encounter"&&o.jsx(HG,{encounter:i,getMenu:T}),n==="Patient"&&o.jsx(rW,{patient:i,getMenu:T}),n==="ServiceRequest"&&o.jsx(GY,{serviceRequest:i,getMenu:T}),n!=="Encounter"&&n!=="Patient"&&n!=="ServiceRequest"&&o.jsx(FG,{resource:i,getMenu:T}),o.jsx(qee,{resource:s,opened:u[0],onClose:u[1].close},`resend-subscriptions-${s==null?void 0:s.id}`)]})}function Gee(e){const{opened:t,close:n,version:r,loadingStatus:i,handleStatus:s,handleUpgrade:c}=e,[u,f]=v.useState(),[p,m]=v.useState(!1);return v.useEffect(()=>{t&&(u||LV("app-tools-page").then(f).catch(console.error),s())},[t,u,s]),u&&r&&!i?r==="unknown"?o.jsx("p",{children:"Unable to determine the current version of the agent. Check the network connectivity of the agent."}):r.startsWith(u)?o.jsxs("p",{children:["This agent is already on the latest version (",u,")."]}):o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:["Are you sure you want to upgrade this agent from version ",r," to version ",u,"?"]}),o.jsxs(je,{children:[o.jsx(Ne,{onClick:()=>{c(p),n()},"aria-label":"Confirm upgrade",children:"Confirm Upgrade"}),o.jsx(zn,{label:"Force",onChange:g=>m(g.currentTarget.checked)})]})]}):o.jsx(gi,{})}function Qee(){const e=_e(),{id:t}=qt(),n=v.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,i]=v.useState(!1),[s,c]=v.useState(!1),[u,f]=v.useState(!1),[p,m]=v.useState(),[g,y]=v.useState(),[b,S]=v.useState(),[j,C]=v.useState(),[T,D]=v.useState(!1),[E,R]=v.useState(!1),[A,{open:k,close:M}]=op(!1);v.useEffect(()=>{if(r||s||u||T){R(!0);return}R(!1)},[r,s,u,T]);const I=v.useCallback(()=>{i(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(G=>{var K,P,L,z,H,O;m((P=(K=G.parameter)==null?void 0:K.find(U=>U.name==="status"))==null?void 0:P.valueCode),y((z=(L=G.parameter)==null?void 0:L.find(U=>U.name==="version"))==null?void 0:z.valueString),S((O=(H=G.parameter)==null?void 0:H.find(U=>U.name==="lastUpdated"))==null?void 0:O.valueInstant)}).catch(G=>J(Ye(G))).finally(()=>i(!1))},[e,t]),$=v.useCallback(G=>{const K=G.host,P=G.pingCount||1;K&&(D(!0),e.pushToAgent(n,K,`PING ${P}`,hn.PING,!0).then(L=>C(L)).catch(L=>J(Ye(L))).finally(()=>D(!1)))},[e,n]),V=v.useCallback(()=>{c(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(G=>{Q("Agent config reloaded successfully.")}).catch(G=>J(Ye(G))).finally(()=>c(!1))},[e,t]),Y=v.useCallback(G=>{f(!0),e.get(e.fhirUrl("Agent",t,"$upgrade",`?force=${G}`),{cache:"reload"}).then(K=>{Q("Agent upgraded successfully.")}).catch(K=>J(Ye(K))).finally(()=>f(!1))},[e,t]);function Q(G){Oe({color:"green",title:"Success",icon:o.jsx(eo,{size:"1rem"}),message:G})}function J(G){Oe({color:"red",title:"Error",message:G,autoClose:!1})}return o.jsxs(ot,{children:[o.jsx(Un,{opened:A,onClose:M,title:"Upgrade Agent",centered:!0,children:o.jsx(Gee,{opened:A,close:M,version:g,loadingStatus:r,handleStatus:I,handleUpgrade:Y})}),o.jsx(Le,{order:1,children:"Agent Tools"}),o.jsxs("div",{style:{marginBottom:10},children:["Agent: ",o.jsx(Lc,{value:n,link:!0})]}),o.jsx(Cn,{my:"lg"}),o.jsx(Le,{order:2,children:"Agent Status"}),o.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."}),o.jsx(Ne,{onClick:I,loading:r,disabled:E&&!r,children:"Get Status"}),!r&&p&&o.jsx(ye,{children:o.jsxs(ye.Tbody,{children:[o.jsxs(ye.Tr,{children:[o.jsx(ye.Td,{children:"Status"}),o.jsx(ye.Td,{children:o.jsx(am,{status:p})})]}),o.jsxs(ye.Tr,{children:[o.jsx(ye.Td,{children:"Version"}),o.jsx(ye.Td,{children:g})]}),o.jsxs(ye.Tr,{children:[o.jsx(ye.Td,{children:"Last Updated"}),o.jsx(ye.Td,{children:gr(b,void 0,{timeZoneName:"longOffset"})})]})]})}),o.jsx(Cn,{my:"lg"}),o.jsx(Le,{order:2,children:"Reload Config"}),o.jsx("p",{children:"Reload the configuration of this agent, syncing it with the current version of the Agent resource on the Medplum server."}),o.jsx(Ne,{onClick:V,loading:s,disabled:E&&!s,"aria-label":"Reload config",children:"Reload Config"}),o.jsx(Cn,{my:"lg"}),o.jsx(Le,{order:2,children:"Upgrade Agent"}),o.jsx("p",{children:"Upgrade the version of this agent, to either the latest (default) or a specified version."}),o.jsx(Ne,{onClick:k,loading:u,disabled:E&&!u,"aria-label":"Upgrade agent",children:"Upgrade"}),o.jsx(Cn,{my:"lg"}),o.jsx(Le,{order:2,children:"Ping from Agent"}),o.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."}),o.jsx(pt,{onSubmit:$,children:o.jsxs(je,{children:[o.jsx(ze,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:o.jsx(_n,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:T,disabled:E&&!T,children:o.jsx(_F,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),o.jsx(Ip,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!T&&j&&o.jsxs(o.Fragment,{children:[o.jsx(Le,{order:5,mt:"sm",mb:0,children:"Last Ping"}),o.jsx("pre",{children:j})]})]})}function Wee(){return o.jsx(CX,{children:o.jsxs(Fe,{errorElement:o.jsx(oJ,{}),children:[o.jsx(Fe,{path:"/signin",element:o.jsx(EJ,{})}),o.jsx(Fe,{path:"/oauth",element:o.jsx(bJ,{})}),o.jsx(Fe,{path:"/resetpassword",element:o.jsx(wJ,{})}),o.jsx(Fe,{path:"/setpassword/:id/:secret",element:o.jsx(CJ,{})}),o.jsx(Fe,{path:"/register",element:o.jsx(SJ,{})}),o.jsx(Fe,{path:"/changepassword",element:o.jsx(rJ,{})}),o.jsx(Fe,{path:"/security",element:o.jsx(jJ,{})}),o.jsx(Fe,{path:"/mfa",element:o.jsx(yJ,{})}),o.jsx(Fe,{path:"/batch",element:o.jsx(tJ,{})}),o.jsx(Fe,{path:"/bulk/:resourceType",element:o.jsx(nJ,{})}),o.jsx(Fe,{path:"/smart",element:o.jsx(TJ,{})}),o.jsx(Fe,{path:"/forms/:id",element:o.jsx(lJ,{})}),o.jsx(Fe,{path:"/admin/super",element:o.jsx(qJ,{})}),o.jsx(Fe,{path:"/admin/super/asyncjob",element:o.jsx($J,{})}),o.jsx(Fe,{path:"/admin/config",element:o.jsx(MJ,{})}),o.jsxs(Fe,{path:"/admin",element:o.jsx(IJ,{}),children:[o.jsx(Fe,{path:"patients",element:o.jsx(OJ,{})}),o.jsx(Fe,{path:"bots/new",element:o.jsx(AJ,{})}),o.jsx(Fe,{path:"bots",element:o.jsx(RJ,{})}),o.jsx(Fe,{path:"clients/new",element:o.jsx(_J,{})}),o.jsx(Fe,{path:"clients",element:o.jsx(DJ,{})}),o.jsx(Fe,{path:"details",element:o.jsx(WT,{})}),o.jsx(Fe,{path:"invite",element:o.jsx(NJ,{})}),o.jsx(Fe,{path:"users",element:o.jsx(QJ,{})}),o.jsx(Fe,{path:"project",element:o.jsx(WT,{})}),o.jsx(Fe,{path:"secrets",element:o.jsx(LJ,{})}),o.jsx(Fe,{path:"sites",element:o.jsx(zJ,{})}),o.jsx(Fe,{path:"members/:membershipId",element:o.jsx(PJ,{})})]}),o.jsx(Fe,{path:"/lab/assays",element:o.jsx(WJ,{})}),o.jsx(Fe,{path:"/lab/panels",element:o.jsx(YJ,{})}),o.jsx(Fe,{path:"/:resourceType/:id/_history/:versionId/:tab",element:o.jsx(eR,{})}),o.jsx(Fe,{path:"/:resourceType/:id/_history/:versionId",element:o.jsx(eR,{})}),o.jsxs(Fe,{path:"/:resourceType/new",element:o.jsx(aJ,{}),children:[o.jsx(Fe,{index:!0,element:o.jsx(hy,{})}),o.jsx(Fe,{path:"form",element:o.jsx(hy,{})}),o.jsx(Fe,{path:"json",element:o.jsx(xee,{})}),o.jsx(Fe,{path:"profiles",element:o.jsx(hy,{})})]}),o.jsxs(Fe,{path:"/:resourceType/:id",element:o.jsx(Fee,{}),children:[o.jsx(Fe,{index:!0,element:o.jsx(tR,{})}),o.jsx(Fe,{path:"apply",element:o.jsx(XJ,{})}),o.jsx(Fe,{path:"apps",element:o.jsx(ZJ,{})}),o.jsx(Fe,{path:"event",element:o.jsx(eee,{})}),o.jsx(Fe,{path:"blame",element:o.jsx(tee,{})}),o.jsx(Fe,{path:"bots",element:o.jsx(Eee,{})}),o.jsx(Fe,{path:"builder",element:o.jsx(uee,{})}),o.jsx(Fe,{path:"checklist",element:o.jsx(dee,{})}),o.jsx(Fe,{path:"delete",element:o.jsx(fee,{})}),o.jsx(Fe,{path:"details",element:o.jsx(mee,{})}),o.jsx(Fe,{path:"edit",element:o.jsx(gee,{})}),o.jsx(Fe,{path:"editor",element:o.jsx(lee,{})}),o.jsx(Fe,{path:"history",element:o.jsx(yee,{})}),o.jsx(Fe,{path:"json",element:o.jsx(bee,{})}),o.jsx(Fe,{path:"preview",element:o.jsx(See,{})}),o.jsx(Fe,{path:"responses",element:o.jsx(Ree,{})}),o.jsx(Fe,{path:"report",element:o.jsx(Aee,{})}),o.jsx(Fe,{path:"ranges",element:o.jsx(Dee,{})}),o.jsx(Fe,{path:"subscriptions",element:o.jsx(Hee,{})}),o.jsx(Fe,{path:"timeline",element:o.jsx(tR,{})}),o.jsx(Fe,{path:"tools",element:o.jsx(Qee,{})}),o.jsx(Fe,{path:"profiles",element:o.jsx(wee,{})}),o.jsx(Fe,{path:"export",element:o.jsx(vee,{})})]}),o.jsx(Fe,{path:"/:resourceType",element:o.jsx(QT,{})}),o.jsx(Fe,{path:"/",element:o.jsx(QT,{})})]})})}function Yee(){const e=_e(),t=e.getUserConfiguration(),n=Mr(),[r]=Zb();return e.isLoading()?o.jsx(gi,{}):o.jsx(_H,{logo:o.jsx(Ui,{size:24}),pathname:n.pathname,searchParams:r,version:qA,menus:Kee(t),displayAddBookmark:!!(t!=null&&t.id),children:o.jsx(v.Suspense,{fallback:o.jsx(gi,{}),children:o.jsx(Wee,{})})})}function Kee(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(s=>({label:s.name,href:s.target,icon:Xee(s.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:o.jsx(yF,{})}]}),t}const nR={Patient:NF,Practitioner:gF,Organization:oF,ServiceRequest:RF,DiagnosticReport:AF,Questionnaire:mF,admin:rF,AccessPolicy:vF,Subscription:LF,batch:jF,Observation:SF};function Xee(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in nR){const n=nR[t];return o.jsx(n,{})}}catch{}return o.jsx(Hp,{w:30})}"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.getRegistrations().then(e=>Promise.all(e.map(t=>t.unregister()))).catch(e=>console.error("SW registration failed: ",e))});async function Zee(){const e=Bd(),t=new GA({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=YX([{path:"*",element:o.jsx(Yee,{})}]),i=c=>r.navigate(c);ZY.createRoot(document.getElementById("root")).render(o.jsx(v.StrictMode,{children:o.jsx(zV,{medplum:t,navigate:i,children:o.jsxs(RR,{theme:n,children:[o.jsx(Za,{position:"bottom-right"}),o.jsx(bX,{router:r})]})})}))}Zee().catch(console.error);
586
- //# sourceMappingURL=index-DSdcgbUx.js.map