@medplum/app 5.0.7 → 5.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-8KRX5leM.js +263 -0
- package/dist/assets/index-8KRX5leM.js.map +1 -0
- package/dist/assets/{index-DW9C_fts.css → index-DGVHfiA6.css} +1 -1
- package/dist/index.html +3 -3
- package/package.json +10 -10
- package/dist/assets/index-CjxNlO-J.js +0 -263
- package/dist/assets/index-CjxNlO-J.js.map +0 -1
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
function eM(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(r,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function Xp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wy={exports:{}},od={};var eE;function tM(){if(eE)return od;eE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var c=null;if(s!==void 0&&(c=""+s),o.key!==void 0&&(c=""+o.key),"key"in o){s={};for(var d in o)d!=="key"&&(s[d]=o[d])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:c,ref:o!==void 0?o:null,props:s}}return od.Fragment=t,od.jsx=n,od.jsxs=n,od}var tE;function nM(){return tE||(tE=1,wy.exports=tM()),wy.exports}var a=nM(),So=function(){return So=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},So.apply(this,arguments)};function P2(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function wl(e,t,n,r){function o(s){return s instanceof n?s:new n(function(c){c(s)})}return new(n||(n=Promise))(function(s,c){function d(m){try{p(r.next(m))}catch(g){c(g)}}function f(m){try{p(r.throw(m))}catch(g){c(g)}}function p(m){m.done?s(m.value):o(m.value).then(d,f)}p((r=r.apply(e,t||[])).next())})}function rM(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var jy={exports:{}},mt={};var nE;function iM(){if(nE)return mt;nE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function b(M){return M===null||typeof M!="object"?null:(M=y&&M[y]||M["@@iterator"],typeof M=="function"?M:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,C={};function E(M,F,ae){this.props=M,this.context=F,this.refs=C,this.updater=ae||S}E.prototype.isReactComponent={},E.prototype.setState=function(M,F){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,F,"setState")},E.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function R(){}R.prototype=E.prototype;function T(M,F,ae){this.props=M,this.context=F,this.refs=C,this.updater=ae||S}var _=T.prototype=new R;_.constructor=T,j(_,E.prototype),_.isPureReactComponent=!0;var k=Array.isArray;function L(){}var A={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function z(M,F,ae){var de=ae.ref;return{$$typeof:e,type:M,key:F,ref:de!==void 0?de:null,props:ae}}function B(M,F){return z(M.type,F,M.props)}function G(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function Y(M){var F={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(ae){return F[ae]})}var J=/\/+/g;function U(M,F){return typeof M=="object"&&M!==null&&M.key!=null?Y(""+M.key):F.toString(36)}function W(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(L,L):(M.status="pending",M.then(function(F){M.status==="pending"&&(M.status="fulfilled",M.value=F)},function(F){M.status==="pending"&&(M.status="rejected",M.reason=F)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function O(M,F,ae,de,xe){var Se=typeof M;(Se==="undefined"||Se==="boolean")&&(M=null);var Ce=!1;if(M===null)Ce=!0;else switch(Se){case"bigint":case"string":case"number":Ce=!0;break;case"object":switch(M.$$typeof){case e:case t:Ce=!0;break;case m:return Ce=M._init,O(Ce(M._payload),F,ae,de,xe)}}if(Ce)return xe=xe(M),Ce=de===""?"."+U(M,0):de,k(xe)?(ae="",Ce!=null&&(ae=Ce.replace(J,"$&/")+"/"),O(xe,F,ae,"",function(dt){return dt})):xe!=null&&(G(xe)&&(xe=B(xe,ae+(xe.key==null||M&&M.key===xe.key?"":(""+xe.key).replace(J,"$&/")+"/")+Ce)),F.push(xe)),1;Ce=0;var Ke=de===""?".":de+":";if(k(M))for(var Ae=0;Ae<M.length;Ae++)de=M[Ae],Se=Ke+U(de,Ae),Ce+=O(de,F,ae,Se,xe);else if(Ae=b(M),typeof Ae=="function")for(M=Ae.call(M),Ae=0;!(de=M.next()).done;)de=de.value,Se=Ke+U(de,Ae++),Ce+=O(de,F,ae,Se,xe);else if(Se==="object"){if(typeof M.then=="function")return O(W(M),F,ae,de,xe);throw F=String(M),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return Ce}function I(M,F,ae){if(M==null)return M;var de=[],xe=0;return O(M,de,"","",function(Se){return F.call(ae,Se,xe++)}),de}function $(M){if(M._status===-1){var F=M._result;F=F(),F.then(function(ae){(M._status===0||M._status===-1)&&(M._status=1,M._result=ae)},function(ae){(M._status===0||M._status===-1)&&(M._status=2,M._result=ae)}),M._status===-1&&(M._status=0,M._result=F)}if(M._status===1)return M._result.default;throw M._result}var H=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},K={map:I,forEach:function(M,F,ae){I(M,function(){F.apply(this,arguments)},ae)},count:function(M){var F=0;return I(M,function(){F++}),F},toArray:function(M){return I(M,function(F){return F})||[]},only:function(M){if(!G(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return mt.Activity=g,mt.Children=K,mt.Component=E,mt.Fragment=n,mt.Profiler=o,mt.PureComponent=T,mt.StrictMode=r,mt.Suspense=f,mt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,mt.__COMPILER_RUNTIME={__proto__:null,c:function(M){return A.H.useMemoCache(M)}},mt.cache=function(M){return function(){return M.apply(null,arguments)}},mt.cacheSignal=function(){return null},mt.cloneElement=function(M,F,ae){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var de=j({},M.props),xe=M.key;if(F!=null)for(Se in F.key!==void 0&&(xe=""+F.key),F)!N.call(F,Se)||Se==="key"||Se==="__self"||Se==="__source"||Se==="ref"&&F.ref===void 0||(de[Se]=F[Se]);var Se=arguments.length-2;if(Se===1)de.children=ae;else if(1<Se){for(var Ce=Array(Se),Ke=0;Ke<Se;Ke++)Ce[Ke]=arguments[Ke+2];de.children=Ce}return z(M.type,xe,de)},mt.createContext=function(M){return M={$$typeof:c,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:s,_context:M},M},mt.createElement=function(M,F,ae){var de,xe={},Se=null;if(F!=null)for(de in F.key!==void 0&&(Se=""+F.key),F)N.call(F,de)&&de!=="key"&&de!=="__self"&&de!=="__source"&&(xe[de]=F[de]);var Ce=arguments.length-2;if(Ce===1)xe.children=ae;else if(1<Ce){for(var Ke=Array(Ce),Ae=0;Ae<Ce;Ae++)Ke[Ae]=arguments[Ae+2];xe.children=Ke}if(M&&M.defaultProps)for(de in Ce=M.defaultProps,Ce)xe[de]===void 0&&(xe[de]=Ce[de]);return z(M,Se,xe)},mt.createRef=function(){return{current:null}},mt.forwardRef=function(M){return{$$typeof:d,render:M}},mt.isValidElement=G,mt.lazy=function(M){return{$$typeof:m,_payload:{_status:-1,_result:M},_init:$}},mt.memo=function(M,F){return{$$typeof:p,type:M,compare:F===void 0?null:F}},mt.startTransition=function(M){var F=A.T,ae={};A.T=ae;try{var de=M(),xe=A.S;xe!==null&&xe(ae,de),typeof de=="object"&&de!==null&&typeof de.then=="function"&&de.then(L,H)}catch(Se){H(Se)}finally{F!==null&&ae.types!==null&&(F.types=ae.types),A.T=F}},mt.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},mt.use=function(M){return A.H.use(M)},mt.useActionState=function(M,F,ae){return A.H.useActionState(M,F,ae)},mt.useCallback=function(M,F){return A.H.useCallback(M,F)},mt.useContext=function(M){return A.H.useContext(M)},mt.useDebugValue=function(){},mt.useDeferredValue=function(M,F){return A.H.useDeferredValue(M,F)},mt.useEffect=function(M,F){return A.H.useEffect(M,F)},mt.useEffectEvent=function(M){return A.H.useEffectEvent(M)},mt.useId=function(){return A.H.useId()},mt.useImperativeHandle=function(M,F,ae){return A.H.useImperativeHandle(M,F,ae)},mt.useInsertionEffect=function(M,F){return A.H.useInsertionEffect(M,F)},mt.useLayoutEffect=function(M,F){return A.H.useLayoutEffect(M,F)},mt.useMemo=function(M,F){return A.H.useMemo(M,F)},mt.useOptimistic=function(M,F){return A.H.useOptimistic(M,F)},mt.useReducer=function(M,F,ae){return A.H.useReducer(M,F,ae)},mt.useRef=function(M){return A.H.useRef(M)},mt.useState=function(M){return A.H.useState(M)},mt.useSyncExternalStore=function(M,F,ae){return A.H.useSyncExternalStore(M,F,ae)},mt.useTransition=function(){return A.H.useTransition()},mt.version="19.2.1",mt}var rE;function mb(){return rE||(rE=1,jy.exports=iM()),jy.exports}var v=mb();const Pn=Xp(v),gb=eM({__proto__:null,default:Pn},[v]);var op="right-scroll-bar-position",ap="width-before-scroll-bar",oM="with-scroll-bars-hidden",aM="--removed-body-scroll-bar-size";function Cy(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function sM(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var lM=typeof window<"u"?v.useLayoutEffect:v.useEffect,iE=new WeakMap;function cM(e,t){var n=sM(null,function(r){return e.forEach(function(o){return Cy(o,r)})});return lM(function(){var r=iE.get(n);if(r){var o=new Set(r),s=new Set(e),c=n.current;o.forEach(function(d){s.has(d)||Cy(d,null)}),s.forEach(function(d){o.has(d)||Cy(d,c)})}iE.set(n,e)},[e]),n}function uM(e){return e}function dM(e,t){t===void 0&&(t=uM);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var c=t(s,r);return n.push(c),function(){n=n.filter(function(d){return d!==c})}},assignSyncMedium:function(s){for(r=!0;n.length;){var c=n;n=[],c.forEach(s)}n={push:function(d){return s(d)},filter:function(){return n}}},assignMedium:function(s){r=!0;var c=[];if(n.length){var d=n;n=[],d.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 o}function fM(e){e===void 0&&(e={});var t=dM(null);return t.options=So({async:!0,ssr:!1},e),t}var N2=function(e){var t=e.sideCar,n=P2(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,So({},n))};N2.isSideCarExport=!0;function hM(e,t){return e.useMedium(t),N2}var O2=fM(),Ey=function(){},Jp=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:Ey,onWheelCapture:Ey,onTouchMoveCapture:Ey}),o=r[0],s=r[1],c=e.forwardProps,d=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,E=e.as,R=E===void 0?"div":E,T=e.gapMode,_=P2(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=y,L=cM([n,t]),A=So(So({},_),o);return v.createElement(v.Fragment,null,m&&v.createElement(k,{sideCar:O2,removeScrollBar:p,shards:g,noRelative:b,noIsolation:S,inert:j,setCallbacks:s,allowPinchZoom:!!C,lockRef:n,gapMode:T}),c?v.cloneElement(v.Children.only(d),So(So({},A),{ref:L})):v.createElement(R,So({},A,{className:f,ref:L}),d))});Jp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Jp.classNames={fullWidth:ap,zeroRight:op};var pM=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function mM(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=pM();return t&&e.setAttribute("nonce",t),e}function gM(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function vM(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var yM=function(){var e=0,t=null;return{add:function(n){e==0&&(t=mM())&&(gM(t,n),vM(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},xM=function(){var e=yM();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},M2=function(){var e=xM(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},bM={left:0,top:0,right:0,gap:0},Ty=function(e){return parseInt(e||"",10)||0},SM=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ty(n),Ty(r),Ty(o)]},wM=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return bM;var t=SM(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])}},jM=M2(),Nc="data-scroll-locked",CM=function(e,t,n,r){var o=e.left,s=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
|
|
2
|
+
.`.concat(oM,` {
|
|
3
|
+
overflow: hidden `).concat(r,`;
|
|
4
|
+
padding-right: `).concat(d,"px ").concat(r,`;
|
|
5
|
+
}
|
|
6
|
+
body[`).concat(Nc,`] {
|
|
7
|
+
overflow: hidden `).concat(r,`;
|
|
8
|
+
overscroll-behavior: contain;
|
|
9
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
10
|
+
padding-left: `.concat(o,`px;
|
|
11
|
+
padding-top: `).concat(s,`px;
|
|
12
|
+
padding-right: `).concat(c,`px;
|
|
13
|
+
margin-left:0;
|
|
14
|
+
margin-top:0;
|
|
15
|
+
margin-right: `).concat(d,"px ").concat(r,`;
|
|
16
|
+
`),n==="padding"&&"padding-right: ".concat(d,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.`).concat(op,` {
|
|
20
|
+
right: `).concat(d,"px ").concat(r,`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.`).concat(ap,` {
|
|
24
|
+
margin-right: `).concat(d,"px ").concat(r,`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.`).concat(op," .").concat(op,` {
|
|
28
|
+
right: 0 `).concat(r,`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.`).concat(ap," .").concat(ap,` {
|
|
32
|
+
margin-right: 0 `).concat(r,`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
body[`).concat(Nc,`] {
|
|
36
|
+
`).concat(aM,": ").concat(d,`px;
|
|
37
|
+
}
|
|
38
|
+
`)},oE=function(){var e=parseInt(document.body.getAttribute(Nc)||"0",10);return isFinite(e)?e:0},EM=function(){v.useEffect(function(){return document.body.setAttribute(Nc,(oE()+1).toString()),function(){var e=oE()-1;e<=0?document.body.removeAttribute(Nc):document.body.setAttribute(Nc,e.toString())}},[])},TM=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;EM();var s=v.useMemo(function(){return wM(o)},[o]);return v.createElement(jM,{styles:CM(s,!t,o,n?"":"!important")})},Sx=!1;if(typeof window<"u")try{var zh=Object.defineProperty({},"passive",{get:function(){return Sx=!0,!0}});window.addEventListener("test",zh,zh),window.removeEventListener("test",zh,zh)}catch{Sx=!1}var vc=Sx?{passive:!1}:!1,RM=function(e){return e.tagName==="TEXTAREA"},L2=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!RM(e)&&n[t]==="visible")},_M=function(e){return L2(e,"overflowY")},AM=function(e){return L2(e,"overflowX")},aE=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=I2(e,r);if(o){var s=z2(e,r),c=s[1],d=s[2];if(c>d)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},DM=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},kM=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},I2=function(e,t){return e==="v"?_M(t):AM(t)},z2=function(e,t){return e==="v"?DM(t):kM(t)},PM=function(e,t){return e==="h"&&t==="rtl"?-1:1},NM=function(e,t,n,r,o){var s=PM(e,window.getComputedStyle(t).direction),c=s*r,d=n.target,f=t.contains(d),p=!1,m=c>0,g=0,y=0;do{if(!d)break;var b=z2(e,d),S=b[0],j=b[1],C=b[2],E=j-C-s*S;(S||E)&&I2(e,d)&&(g+=E,y+=S);var R=d.parentNode;d=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!f&&d!==document.body||f&&(t.contains(d)||t===d));return(m&&Math.abs(g)<1||!m&&Math.abs(y)<1)&&(p=!0),p},$h=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sE=function(e){return[e.deltaX,e.deltaY]},lE=function(e){return e&&"current"in e?e.current:e},OM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},MM=function(e){return`
|
|
39
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
40
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
41
|
+
`)},LM=0,yc=[];function IM(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),o=v.useState(LM++)[0],s=v.useState(M2)[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(o));var j=rM([e.lockRef.current],(e.shards||[]).map(lE),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var d=v.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var E=$h(j),R=n.current,T="deltaX"in j?j.deltaX:R[0]-E[0],_="deltaY"in j?j.deltaY:R[1]-E[1],k,L=j.target,A=Math.abs(T)>Math.abs(_)?"h":"v";if("touches"in j&&A==="h"&&L.type==="range")return!1;var N=window.getSelection(),z=N&&N.anchorNode,B=z?z===L||z.contains(L):!1;if(B)return!1;var G=aE(A,L);if(!G)return!0;if(G?k=A:(k=A==="v"?"h":"v",G=aE(A,L)),!G)return!1;if(!r.current&&"changedTouches"in j&&(T||_)&&(r.current=k),!k)return!0;var Y=r.current||k;return NM(Y,C,j,Y==="h"?T:_)},[]),f=v.useCallback(function(j){var C=j;if(!(!yc.length||yc[yc.length-1]!==s)){var E="deltaY"in C?sE(C):$h(C),R=t.current.filter(function(k){return k.name===C.type&&(k.target===C.target||C.target===k.shadowParent)&&OM(k.delta,E)})[0];if(R&&R.should){C.cancelable&&C.preventDefault();return}if(!R){var T=(c.current.shards||[]).map(lE).filter(Boolean).filter(function(k){return k.contains(C.target)}),_=T.length>0?d(C,T[0]):!c.current.noIsolation;_&&C.cancelable&&C.preventDefault()}}},[]),p=v.useCallback(function(j,C,E,R){var T={name:j,delta:C,target:E,should:R,shadowParent:zM(E)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(_){return _!==T})},1)},[]),m=v.useCallback(function(j){n.current=$h(j),r.current=void 0},[]),g=v.useCallback(function(j){p(j.type,sE(j),j.target,d(j,e.lockRef.current))},[]),y=v.useCallback(function(j){p(j.type,$h(j),j.target,d(j,e.lockRef.current))},[]);v.useEffect(function(){return yc.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",f,vc),document.addEventListener("touchmove",f,vc),document.addEventListener("touchstart",m,vc),function(){yc=yc.filter(function(j){return j!==s}),document.removeEventListener("wheel",f,vc),document.removeEventListener("touchmove",f,vc),document.removeEventListener("touchstart",m,vc)}},[]);var b=e.removeScrollBar,S=e.inert;return v.createElement(v.Fragment,null,S?v.createElement(s,{styles:MM(o)}):null,b?v.createElement(TM,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function zM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const $M=hM(O2,IM);var ul=v.forwardRef(function(e,t){return v.createElement(Jp,So({},e,{ref:t,sideCar:$M}))});ul.classNames=Jp.classNames;function fn(e){return Object.keys(e)}function Ry(e){return e&&typeof e=="object"&&!Array.isArray(e)}function vb(e,t){const n={...e},r=t;return Ry(e)&&Ry(t)&&Object.keys(t).forEach(o=>{Ry(r[o])&&o in e?n[o]=vb(n[o],r[o]):n[o]=r[o]}),n}function UM(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function BM(e){return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:e.match(/^calc\((.*?)\)$/)?.[1].split("*")[0].trim()}function wd(e){const t=BM(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 cE(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function $2(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r==="0")return`0${e}`;if(typeof r=="number"){const o=`${r/16}${e}`;return t?cE(o):o}if(typeof r=="string"){if(r===""||r.startsWith("calc(")||r.startsWith("clamp(")||r.includes("rgba("))return r;if(r.includes(","))return r.split(",").map(s=>n(s)).join(",");if(r.includes(" "))return r.split(" ").map(s=>n(s)).join(" ");const o=r.replace("px","");if(!Number.isNaN(Number(o))){const s=`${Number(o)/16}${e}`;return t?cE(s):s}}return r}return n}const le=$2("rem",{shouldScale:!0}),yp=$2("em");function ys(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function U2(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 Io(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==v.Fragment:!1}function Er(e){const t=v.createContext(null);return[({children:o,value:s})=>a.jsx(t.Provider,{value:s,children:o}),()=>{const o=v.useContext(t);if(o===null)throw new Error(e);return o}]}function zo(e=null){const t=v.createContext(e);return[({children:o,value:s})=>a.jsx(t.Provider,{value:s,children:o}),()=>v.useContext(t)]}function uE(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function xp(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function VM(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 FM(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 HM(e,t,n){return xp(e,n)===xp(t,n)}function yb({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:o=!1,dir:s="rtl",orientation:c}){return d=>{n?.(d);const f=Array.from(xp(d.currentTarget,e)?.querySelectorAll(t)||[]).filter(S=>HM(d.currentTarget,S,e)),p=f.findIndex(S=>d.currentTarget===S),m=FM(p,f,r),g=VM(p,f,r),y=s==="rtl"?g:m,b=s==="rtl"?m:g;switch(d.key){case"ArrowRight":{c==="horizontal"&&(d.stopPropagation(),d.preventDefault(),f[y].focus(),o&&f[y].click());break}case"ArrowLeft":{c==="horizontal"&&(d.stopPropagation(),d.preventDefault(),f[b].focus(),o&&f[b].click());break}case"ArrowUp":{c==="vertical"&&(d.stopPropagation(),d.preventDefault(),f[g].focus(),o&&f[g].click());break}case"ArrowDown":{c==="vertical"&&(d.stopPropagation(),d.preventDefault(),f[m].focus(),o&&f[m].click());break}case"Home":{d.stopPropagation(),d.preventDefault(),!f[0].disabled&&f[0].focus();break}case"End":{d.stopPropagation(),d.preventDefault();const S=f.length-1;!f[S].disabled&&f[S].focus();break}}}}const qM={app:100,modal:200,popover:300,overlay:400,max:9999};function Lr(e){return qM[e]}const bp=()=>{};function GM(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||bp:n=>{n.key==="Escape"&&(e(n),t.onTrigger?.())}}function st(e,t="size",n=!0){if(e!==void 0)return U2(e)?n?le(e):e:`var(--${t}-${e})`}function qn(e){return st(e,"mantine-spacing")}function Ht(e){return e===void 0?"var(--mantine-radius-default)":st(e,"mantine-radius")}function Gn(e){return st(e,"mantine-font-size")}function B2(e){return st(e,"mantine-line-height",!1)}function xb(e){if(e)return st(e,"mantine-shadow",!1)}function ir(e,t){return n=>{e?.(n),t?.(n)}}function bb(e,t){return e in t?wd(t[e]):wd(e)}function jd(e,t){const n=e.map(r=>({value:r,px:bb(r,t)}));return n.sort((r,o)=>r.px-o.px),n}function Yi(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function QM(e,t,n){return n?Array.from(xp(n,t)?.querySelectorAll(e)||[]).findIndex(r=>r===n):null}function xd(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 Sp(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function WM(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 o=0;o<r;o+=1){const s=n[o];if(!(s in t)||e[s]!==t[s]&&!(Number.isNaN(e[s])&&Number.isNaN(t[s])))return!1}return!0}function dE(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Xs(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>((...n)=>t.current?.(...n)),[])}function Zp(e,t){const{delay:n,flushOnUnmount:r,leading:o}=typeof t=="number"?{delay:t,flushOnUnmount:!1,leading:!1}:t,s=Xs(e),c=v.useRef(0),d=v.useMemo(()=>{const f=Object.assign((...p)=>{window.clearTimeout(c.current);const m=f._isFirstCall;f._isFirstCall=!1;function g(){window.clearTimeout(c.current),c.current=0,f._isFirstCall=!0}if(o&&m){s(...p);const S=()=>{g()},j=()=>{c.current!==0&&(g(),s(...p))},C=()=>{g()};f.flush=j,f.cancel=C,c.current=window.setTimeout(S,n);return}if(o&&!m){const S=()=>{c.current!==0&&(g(),s(...p))},j=()=>{g()};f.flush=S,f.cancel=j;const C=()=>{g()};c.current=window.setTimeout(C,n);return}const y=()=>{c.current!==0&&(g(),s(...p))},b=()=>{g()};f.flush=y,f.cancel=b,c.current=window.setTimeout(y,n)},{flush:()=>{},cancel:()=>{},_isFirstCall:!0});return f},[s,n,o]);return v.useEffect(()=>()=>{r?d.flush():d.cancel()},[d,r]),d}const YM=["mousedown","touchstart"];function KM(e,t,n){const r=v.useRef(null),o=t||YM;return v.useEffect(()=>{const s=c=>{const{target:d}=c??{};if(Array.isArray(n)){const f=!document.body.contains(d)&&d?.tagName!=="HTML";n.every(m=>!!m&&!c.composedPath().includes(m))&&!f&&e(c)}else r.current&&!r.current.contains(d)&&e(c)};return o.forEach(c=>document.addEventListener(c,s)),()=>{o.forEach(c=>document.removeEventListener(c,s))}},[r,e,n]),r}function V2(e={timeout:2e3}){const[t,n]=v.useState(null),[r,o]=v.useState(!1),[s,c]=v.useState(null),d=m=>{window.clearTimeout(s),c(window.setTimeout(()=>o(!1),e.timeout)),o(m)};return{copy:m=>{"clipboard"in navigator?navigator.clipboard.writeText(m).then(()=>d(!0)).catch(g=>n(g)):n(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{o(!1),n(null),window.clearTimeout(s)},error:t,copied:r}}function XM(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function JM(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function F2(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=v.useState(n?t:JM(e));return v.useEffect(()=>{try{const s=window.matchMedia(e);return o(s.matches),XM(s,c=>o(c.matches))}catch{return}},[e]),r||!1}function ZM(e,t){return F2("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const Jc=typeof document<"u"?v.useLayoutEffect:v.useEffect;function hs(e,t){const n=v.useRef(!1);v.useEffect(()=>()=>{n.current=!1},[]),v.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function H2({opened:e,shouldReturnFocus:t=!0}){const n=v.useRef(null),r=()=>{n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&n.current?.focus({preventScroll:!0})};return hs(()=>{let o=-1;const s=c=>{c.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",s),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",s)}},[e,t]),r}const e4=/input|select|textarea|button|object/,q2="a, input, select, textarea, button, object, [tabindex]";function t4(e){return e.style.display==="none"}function n4(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(t4(n))return!1;n=n.parentNode}return!0}function G2(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function wx(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(G2(e));return(e4.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&n4(e)}function Q2(e){const t=G2(e);return(Number.isNaN(t)||t>=0)&&wx(e)}function r4(e){return Array.from(e.querySelectorAll(q2)).filter(Q2)}function i4(e,t){const n=r4(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();let s=r===o.activeElement||e===o.activeElement;const c=o.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 o4(e=!0){const t=v.useRef(null),n=o=>{let s=o.querySelector("[data-autofocus]");if(!s){const c=Array.from(o.querySelectorAll(q2));s=c.find(Q2)||c.find(wx)||null,!s&&wx(o)&&(s=o)}s&&s.focus({preventScroll:!0})},r=v.useCallback(o=>{e&&o!==null&&t.current!==o&&(o?(setTimeout(()=>{o.getRootNode()&&n(o)}),t.current=o):t.current=null)},[e]);return v.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const o=s=>{s.key==="Tab"&&t.current&&i4(t.current,s)};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e]),r}const a4=e=>(e+1)%1e6;function s4(){const[,e]=v.useReducer(a4,0);return e}const l4=Pn.useId||(()=>{});function c4(){const e=l4();return e?`mantine-${e.replace(/:/g,"")}`:""}function mr(e){const t=c4(),[n,r]=v.useState(t);return Jc(()=>{r(Sp())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function W2(e,t,n){v.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function Cd(e,t){if(typeof e=="function")return e(t);typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function u4(...e){const t=new Map;return n=>{if(e.forEach(r=>{const o=Cd(r,n);o&&t.set(r,o)}),t.size>0)return()=>{e.forEach(r=>{const o=t.get(r);o&&typeof o=="function"?o():Cd(r,null)}),t.clear()}}}function $n(...e){return v.useCallback(u4(...e),e)}function tr({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,s]=v.useState(t!==void 0?t:n),c=(d,...f)=>{s(d),r?.(d,...f)};return e!==void 0?[e,r,!0]:[o,c,!1]}function ts(e,t){const n=t-e+1;return Array.from({length:n},(r,o)=>o+e)}const Uh="dots";function d4({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:o=1,onChange:s}){const c=Math.max(Math.trunc(e),0),[d,f]=tr({value:r,onChange:s,defaultValue:o,finalValue:o}),p=j=>{j<=0?f(1):j>c?f(c):f(j)},m=()=>p(d+1),g=()=>p(d-1),y=()=>p(1),b=()=>p(c);return{range:v.useMemo(()=>{if(t*2+3+n*2>=c)return ts(1,c);const C=Math.max(d-t,n),E=Math.min(d+t,c-n),R=C>n+2,T=E<c-(n+1);if(!R&&T){const _=t*2+n+2;return[...ts(1,_),Uh,...ts(c-(n-1),c)]}if(R&&!T){const _=n+1+2*t;return[...ts(1,n),Uh,...ts(c-_,c)]}return[...ts(1,n),Uh,...ts(C,E),Uh,...ts(c-n+1,c)]},[c,t,d]),active:d,setPage:p,next:m,previous:g,first:y,last:b}}function Sb(e,t){return F2("(prefers-reduced-motion: reduce)",e,t)}function f4(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(!WM(e[n],t[n]))return!1;return!0}function h4(e){const t=v.useRef([]),n=v.useRef(0);return f4(t.current,e)||(t.current=e,n.current+=1),[n.current]}function p4(e,t){v.useEffect(e,h4(t))}const m4={" ":"space",ArrowLeft:"arrowleft",ArrowRight:"arrowright",ArrowUp:"arrowup",ArrowDown:"arrowdown",Escape:"escape",Esc:"escape",esc:"escape",Enter:"enter",Tab:"tab",Backspace:"backspace",Delete:"delete",Insert:"insert",Home:"home",End:"end",PageUp:"pageup",PageDown:"pagedown","+":"plus","-":"minus","*":"asterisk","/":"slash"};function Bh(e){const t=e.replace("Key","").toLowerCase();return m4[e]||t}function g4(e){const t=e.toLowerCase().split("+").map(s=>s.trim()),n={alt:t.includes("alt"),ctrl:t.includes("ctrl"),meta:t.includes("meta"),mod:t.includes("mod"),shift:t.includes("shift"),plus:t.includes("[plus]")},r=["alt","ctrl","meta","shift","mod"],o=t.find(s=>!r.includes(s));return{...n,key:o==="[plus]"?"+":o}}function v4(e,t,n){const{alt:r,ctrl:o,meta:s,mod:c,shift:d,key:f}=e,{altKey:p,ctrlKey:m,metaKey:g,shiftKey:y,key:b,code:S}=t;if(r!==p)return!1;if(c){if(!m&&!g)return!1}else if(o!==m||s!==g)return!1;return d!==y?!1:!!(f&&(n?Bh(S)===Bh(f):Bh(b??S)===Bh(f)))}function y4(e,t){return n=>v4(g4(e),n,t)}function x4(e,t,n=!1){return e.target instanceof HTMLElement?(n||!e.target.isContentEditable)&&!t.includes(e.target.tagName):!0}function b4(e,t=["INPUT","TEXTAREA","SELECT"],n=!1){v.useEffect(()=>{const r=o=>{e.forEach(([s,c,d={preventDefault:!0,usePhysicalKeys:!1}])=>{y4(s,d.usePhysicalKeys)(o)&&x4(o,t,n)&&(d.preventDefault&&o.preventDefault(),c(o))})};return document.documentElement.addEventListener("keydown",r),()=>document.documentElement.removeEventListener("keydown",r)},[e])}function Zc(e=!1,t={}){const[n,r]=v.useState(e),o=v.useCallback(()=>{r(d=>d||(t.onOpen?.(),!0))},[t.onOpen]),s=v.useCallback(()=>{r(d=>d&&(t.onClose?.(),!1))},[t.onClose]),c=v.useCallback(()=>{n?s():o()},[s,o,n]);return[n,{open:o,close:s,toggle:c}]}function S4(e,t,n={autoInvoke:!1}){const r=v.useRef(null),o=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&&o(),s),[s,o]),{start:o,clear:s}}function w4(e,t,n){const r=v.useRef(null),o=v.useRef(null);return v.useEffect(()=>{const s=typeof n=="function"?n():n;return(s||o.current)&&(r.current=new MutationObserver(e),r.current.observe(s||o.current,t)),()=>{r.current?.disconnect()}},[e,t]),o}function j4(){const[e,t]=v.useState(!1);return v.useEffect(()=>t(!0),[]),e}var C4={};function Y2(){return typeof process<"u"&&C4?"production":"development"}function em(e){const t=Pn.version;return typeof Pn.version!="string"||t.startsWith("18.")?e?.ref:e?.props?.ref}function sp(e,t=document){const n=t.querySelector(e);if(n)return n;const r=t.querySelectorAll("*");for(let o=0;o<r.length;o+=1){const s=r[o];if(s.shadowRoot){const c=sp(e,s.shadowRoot);if(c)return c}}return null}function is(e,t=document){const n=[],r=t.querySelectorAll(e);n.push(...Array.from(r));const o=t.querySelectorAll("*");for(let s=0;s<o.length;s+=1){const c=o[s];if(c.shadowRoot){const d=is(e,c.shadowRoot);n.push(...d)}}return n}function ns(e){if(!e)return document;const t=e.getRootNode();return t instanceof ShadowRoot||t instanceof Document?t:document}function K2(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=K2(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function $t(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=K2(e))&&(r&&(r+=" "),r+=t);return r}const E4={};function T4(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,o])=>{t[r]?t[r]=$t(t[r],o):t[r]=o})}),t}function qd({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||E4);return T4(s)}function Ed({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 wb=v.createContext(null);function Sa(){const e=v.useContext(wb);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function R4(){return Sa().cssVariablesResolver}function _4(){return Sa().classNamesPrefix}function tm(){return Sa().getStyleNonce}function A4(){return Sa().withStaticClasses}function D4(){return Sa().headless}function k4(){return Sa().stylesTransform?.sx}function P4(){return Sa().stylesTransform?.styles}function nm(){return Sa().env||"default"}function N4(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function O4(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,o=n>>8&255,s=n&255;return{r,g:o,b:s,a:1}}function M4(e){const[t,n,r,o]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:o===void 0?1:o}}function L4(e){const t=/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i,n=e.match(t);if(!n)return{r:0,g:0,b:0,a:1};const r=parseInt(n[1],10),o=parseInt(n[2],10)/100,s=parseInt(n[3],10)/100,c=n[5]?parseFloat(n[5]):void 0,d=(1-Math.abs(2*s-1))*o,f=r/60,p=d*(1-Math.abs(f%2-1)),m=s-d/2;let g,y,b;return f>=0&&f<1?(g=d,y=p,b=0):f>=1&&f<2?(g=p,y=d,b=0):f>=2&&f<3?(g=0,y=d,b=p):f>=3&&f<4?(g=0,y=p,b=d):f>=4&&f<5?(g=p,y=0,b=d):(g=d,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 jb(e){return N4(e)?O4(e):e.startsWith("rgb")?M4(e):e.startsWith("hsl")?L4(e):{r:0,g:0,b:0,a:1}}function Vh(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:o,a:s}=jb(e),c=1-t,d=f=>Math.round(f*c);return`rgba(${d(n)}, ${d(r)}, ${d(o)}, ${s})`}function Td(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function _y(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function I4(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function z4(e){if(e.startsWith("oklch("))return(I4(e)||0)/100;const{r:t,g:n,b:r}=jb(e),o=t/255,s=n/255,c=r/255,d=_y(o),f=_y(s),p=_y(c);return .2126*d+.7152*f+.0722*p}function ad(e,t=.179){return e.startsWith("var(")?!1:z4(e)>t}function Wr({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:ad(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:ad(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:ad(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,o]=e.split("."),s=o?Number(o):void 0,c=r in t.colors;if(c){const d=s!==void 0?t.colors[r][s]:t.colors[r][Td(t,n||"light")];return{color:r,value:d,shade:s,isThemeColor:c,isLight:ad(d,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${s}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:c,isLight:ad(e,t.luminanceThreshold),shade:s,variable:void 0}}function Kt(e,t){const n=Wr({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function jx(e,t){const n={from:e?.from||t.defaultGradient.from,to:e?.to||t.defaultGradient.to,deg:e?.deg??t.defaultGradient.deg??0},r=Kt(n.from,t),o=Kt(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${o} 100%)`}function Ai(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const s=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${s}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:o}=jb(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const xc=Ai,$4=({color:e,theme:t,variant:n,gradient:r,autoContrast:o})=>{const s=Wr({color:e,theme:t}),c=typeof o=="boolean"?o:t.autoContrast;if(n==="none")return{background:"transparent",hover:"transparent",color:"inherit",border:"none"};if(n==="filled"){const d=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:d,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:d,border:`${le(1)} solid transparent`}:{background:e,hover:Vh(e,.1),color:d,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 d=t.colors[s.color][s.shade];return{background:Ai(d,.1),hover:Ai(d,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:Ai(e,.1),hover:Ai(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:Ai(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:Ai(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 d=t.colors[s.color][s.shade];return{background:"transparent",hover:Ai(d,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:"transparent",hover:Ai(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:Vh(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Vh(t.white,.01),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Vh(t.white,.01),color:e,border:`${le(1)} solid transparent`}:n==="gradient"?{background:jx(r,t),hover:jx(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)`}:{}},U4={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"]},fE="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",Cb={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:U4,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:$4,autoContrast:!1,luminanceThreshold:.3,fontFamily:fE,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:fE,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 hE(e){return e==="auto"||e==="dark"||e==="light"}function B4({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 hE(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&&hE(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const V4="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",pE="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function Ay(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function mE(e){if(!(e.primaryColor in e.colors))throw new Error(V4);if(typeof e.primaryShade=="object"&&(!Ay(e.primaryShade.dark)||!Ay(e.primaryShade.light)))throw new Error(pE);if(typeof e.primaryShade=="number"&&!Ay(e.primaryShade))throw new Error(pE)}function F4(e,t){if(!t)return mE(e),e;const n=vb(e,t);return t.fontFamily&&!t.headings?.fontFamily&&(n.headings.fontFamily=t.fontFamily),mE(n),n}const Eb=v.createContext(null),H4=()=>v.useContext(Eb)||Cb;function En(){const e=v.useContext(Eb);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 X2({theme:e,children:t,inherit:n=!0}){const r=H4(),o=v.useMemo(()=>F4(n?r:Cb,e),[e,r,n]);return a.jsx(Eb.Provider,{value:o,children:t})}X2.displayName="@mantine/core/MantineThemeProvider";function q4(){const e=En(),t=tm(),n=fn(e.breakpoints).reduce((r,o)=>{const s=e.breakpoints[o].includes("px"),c=wd(e.breakpoints[o]),d=s?`${c-.1}px`:yp(c-.1),f=s?`${c}px`:yp(c);return`${r}@media (max-width: ${d}) {.mantine-visible-from-${o} {display: none !important;}}@media (min-width: ${f}) {.mantine-hidden-from-${o} {display: none !important;}}`},"");return a.jsx("style",{"data-mantine-styles":"classes",nonce:t?.(),dangerouslySetInnerHTML:{__html:n}})}function Dy(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function sd(e,t){return(Array.isArray(e)?e:[e]).reduce((r,o)=>`${o}{${r}}`,t)}function G4(e,t){const n=Dy(e.variables),r=n?sd(t,n):"",o=Dy(e.dark),s=Dy(e.light),c=o?sd(t===":host"?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,o):"",d=s?sd(t===":host"?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,s):"";return`${r}
|
|
42
|
+
|
|
43
|
+
${c}
|
|
44
|
+
|
|
45
|
+
${d}`}function wa({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&Wr({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function gE(e,t){return wa({color:e.colors[e.primaryColor][Td(e,t)],theme:e,autoContrast:null})}function Fh({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:o=!0}){if(!e.colors[t])return{};if(n==="light"){const d=Td(e,"light"),f={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${d})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${d===9?8:d+1})`,[`--mantine-color-${r}-light`]:xc(e.colors[t][d],.1),[`--mantine-color-${r}-light-hover`]:xc(e.colors[t][d],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${d})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${d})`,[`--mantine-color-${r}-outline-hover`]:xc(e.colors[t][d],.05)};return o?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...f}:f}const s=Td(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`]:xc(e.colors[t][Math.max(0,s-2)],.15),[`--mantine-color-${r}-light-hover`]:xc(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`]:xc(e.colors[t][Math.max(s-4,0)],.05)};return o?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...c}:c}function Q4(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function bc(e,t,n){fn(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const J2=e=>{const t=Td(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:le(e.defaultRadius),r={variables:{"--mantine-z-index-app":"100","--mantine-z-index-modal":"200","--mantine-z-index-popover":"300","--mantine-z-index-overlay":"400","--mantine-z-index-max":"9999","--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--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-color-scheme":"light","--mantine-primary-color-contrast":gE(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)","--mantine-color-disabled":"var(--mantine-color-gray-2)","--mantine-color-disabled-color":"var(--mantine-color-gray-5)","--mantine-color-disabled-border":"var(--mantine-color-gray-3)"},dark:{"--mantine-color-scheme":"dark","--mantine-primary-color-contrast":gE(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)","--mantine-color-disabled":"var(--mantine-color-dark-6)","--mantine-color-disabled-color":"var(--mantine-color-dark-3)","--mantine-color-disabled-border":"var(--mantine-color-dark-4)"}};bc(r.variables,e.breakpoints,"breakpoint"),bc(r.variables,e.spacing,"spacing"),bc(r.variables,e.fontSizes,"font-size"),bc(r.variables,e.lineHeights,"line-height"),bc(r.variables,e.shadows,"shadow"),bc(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((s,c)=>{r.variables[`--mantine-primary-color-${c}`]=`var(--mantine-color-${e.primaryColor}-${c})`}),fn(e.colors).forEach(s=>{const c=e.colors[s];if(Q4(c)){Object.assign(r.light,Fh({theme:e,name:c.name,color:c.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,Fh({theme:e,name:c.name,color:c.dark,colorScheme:"dark",withColorValues:!0}));return}c.forEach((d,f)=>{r.variables[`--mantine-color-${s}-${f}`]=d}),Object.assign(r.light,Fh({theme:e,color:s,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,Fh({theme:e,color:s,colorScheme:"dark",withColorValues:!1}))});const o=e.headings.sizes;return fn(o).forEach(s=>{r.variables[`--mantine-${s}-font-size`]=o[s].fontSize,r.variables[`--mantine-${s}-line-height`]=o[s].lineHeight,r.variables[`--mantine-${s}-font-weight`]=o[s].fontWeight||e.headings.fontWeight}),r};function W4({theme:e,generator:t}){const n=J2(e),r=t?.(e);return r?vb(n,r):n}const ky=J2(Cb);function Y4(e){const t={variables:{},light:{},dark:{}};return fn(e.variables).forEach(n=>{ky.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),fn(e.light).forEach(n=>{ky.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),fn(e.dark).forEach(n=>{ky.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function K4(e){return`
|
|
46
|
+
${e}[data-mantine-color-scheme="dark"] { --mantine-color-scheme: dark; }
|
|
47
|
+
${e}[data-mantine-color-scheme="light"] { --mantine-color-scheme: light; }
|
|
48
|
+
`}function Z2({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=En(),r=tm(),o=R4(),s=W4({theme:n,generator:o}),c=e===":root"&&t,d=c?Y4(s):s,f=G4(d,e);return f?a.jsx("style",{"data-mantine-styles":!0,nonce:r?.(),dangerouslySetInnerHTML:{__html:`${f}${c?"":K4(e)}`}}):null}Z2.displayName="@mantine/CssVariables";function Sc(e,t){const n=typeof window<"u"&&"matchMedia"in window&&window.matchMedia("(prefers-color-scheme: dark)")?.matches,r=e!=="auto"?e:n?"dark":"light";t()?.setAttribute("data-mantine-color-scheme",r)}function X4({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const o=v.useRef(null),[s,c]=v.useState(()=>e.get(t)),d=r||s,f=v.useCallback(m=>{r||(Sc(m,n),c(m),e.set(m))},[e.set,d,r]),p=v.useCallback(()=>{c(t),Sc(t,n),e.clear()},[e.clear,t]);return v.useEffect(()=>(e.subscribe(f),e.unsubscribe),[e.subscribe,e.unsubscribe]),Jc(()=>{Sc(e.get(t),n)},[]),v.useEffect(()=>{if(r)return Sc(r,n),()=>{};r===void 0&&Sc(s,n),typeof window<"u"&&"matchMedia"in window&&(o.current=window.matchMedia("(prefers-color-scheme: dark)"));const m=g=>{s==="auto"&&Sc(g.matches?"dark":"light",n)};return o.current?.addEventListener("change",m),()=>o.current?.removeEventListener("change",m)},[s,r]),{colorScheme:d,setColorScheme:f,clearColorScheme:p}}function J4({respectReducedMotion:e,getRootElement:t}){Jc(()=>{e&&t()?.setAttribute("data-respect-reduced-motion","true")},[e])}function e_({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:o=!0,deduplicateCssVariables:s=!0,withCssVariables:c=!0,cssVariablesSelector:d=":root",classNamesPrefix:f="mantine",colorSchemeManager:p=B4(),defaultColorScheme:m="light",getRootElement:g=()=>document.documentElement,cssVariablesResolver:y,forceColorScheme:b,stylesTransform:S,env:j}){const{colorScheme:C,setColorScheme:E,clearColorScheme:R}=X4({defaultColorScheme:m,forceColorScheme:b,manager:p,getRootElement:g});return J4({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:g}),a.jsx(wb.Provider,{value:{colorScheme:C,setColorScheme:E,clearColorScheme:R,getRootElement:g,classNamesPrefix:f,getStyleNonce:n,cssVariablesResolver:y,cssVariablesSelector:d,withStaticClasses:r,stylesTransform:S,env:j},children:a.jsxs(X2,{theme:e,children:[c&&a.jsx(Z2,{cssVariablesSelector:d,deduplicateCssVariables:s}),o&&a.jsx(q4,{}),t]})})}e_.displayName="@mantine/core/MantineProvider";function jl({classNames:e,styles:t,props:n,stylesCtx:r}){const o=En();return{resolvedClassNames:qd({theme:o,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:Ed({theme:o,styles:t,props:n,stylesCtx:r||void 0})}}const Z4={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function e5({theme:e,options:t,unstyled:n}){return $t(t?.focusable&&!n&&(e.focusClassName||Z4[e.focusRing]),t?.active&&!n&&e.activeClassName)}function t5({selector:e,stylesCtx:t,options:n,props:r,theme:o}){return qd({theme:o,classNames:n?.classNames,props:n?.props||r,stylesCtx:t})[e]}function vE({selector:e,stylesCtx:t,theme:n,classNames:r,props:o}){return qd({theme:n,classNames:r,props:o,stylesCtx:t})[e]}function n5({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function r5({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function i5({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(o=>`${t}-${o}-${n}`)}function o5({themeName:e,theme:t,selector:n,props:r,stylesCtx:o}){return e.map(s=>qd({theme:t,classNames:t.components[s]?.classNames,props:r,stylesCtx:o})?.[n])}function a5({options:e,classes:t,selector:n,unstyled:r}){return e?.variant&&!r?t[`${n}--${e.variant}`]:void 0}function s5({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:o,classNames:s,classes:c,unstyled:d,className:f,rootSelector:p,props:m,stylesCtx:g,withStaticClasses:y,headless:b,transformedStyles:S}){return $t(e5({theme:e,options:t,unstyled:d||b}),o5({theme:e,themeName:n,selector:r,props:m,stylesCtx:g}),a5({options:t,classes:c,selector:r,unstyled:d}),vE({selector:r,stylesCtx:g,theme:e,classNames:s,props:m}),vE({selector:r,stylesCtx:g,theme:e,classNames:S,props:m}),t5({selector:r,stylesCtx:g,options:t,props:m,theme:e}),n5({rootSelector:p,selector:r,className:f}),r5({selector:r,classes:c,unstyled:d||b}),y&&!b&&i5({themeName:n,classNamesPrefix:o,selector:r,withStaticClass:t?.withStaticClass}),t?.className)}function l5({theme:e,themeName:t,props:n,stylesCtx:r,selector:o}){return t.map(s=>Ed({theme:e,styles:e.components[s]?.styles,props:n,stylesCtx:r})[o]).reduce((s,c)=>({...s,...c}),{})}function Cx({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Cx({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function c5(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...ys(n[r])}}),t),{})}function u5({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:o,selector:s,themeName:c,headless:d}){return c5([d?{}:t?.(n,r,o),...c.map(f=>n.components?.[f]?.vars?.(n,r,o)),e?.(n,r,o)])?.[s]}function d5({theme:e,themeName:t,selector:n,options:r,props:o,stylesCtx:s,rootSelector:c,styles:d,style:f,vars:p,varsResolver:m,headless:g,withStylesTransform:y}){return{...!y&&l5({theme:e,themeName:t,props:o,stylesCtx:s,selector:n}),...!y&&Ed({theme:e,styles:d,props:o,stylesCtx:s})[n],...!y&&Ed({theme:e,styles:r?.styles,props:r?.props||o,stylesCtx:s})[n],...u5({theme:e,props:o,stylesCtx:s,vars:p,varsResolver:m,selector:n,themeName:t,headless:g}),...c===n?Cx({style:f,theme:e}):null,...Cx({style:r?.style,theme:e})}}function f5({props:e,stylesCtx:t,themeName:n}){const r=En(),o=P4()?.();return{getTransformedStyles:c=>o?[...c.map(f=>o(f,{props:e,theme:r,ctx:t})),...n.map(f=>o(r.components[f]?.styles,{props:e,theme:r,ctx:t}))].filter(Boolean):[],withStylesTransform:!!o}}function Ie({name:e,classes:t,props:n,stylesCtx:r,className:o,style:s,rootSelector:c="root",unstyled:d,classNames:f,styles:p,vars:m,varsResolver:g,attributes:y}){const b=En(),S=_4(),j=A4(),C=D4(),E=(Array.isArray(e)?e:[e]).filter(_=>_),{withStylesTransform:R,getTransformedStyles:T}=f5({props:n,stylesCtx:r,themeName:E});return(_,k)=>({className:s5({theme:b,options:k,themeName:E,selector:_,classNamesPrefix:S,classNames:f,classes:t,unstyled:d,className:o,rootSelector:c,props:n,stylesCtx:r,withStaticClasses:j,headless:C,transformedStyles:T([k?.styles,p])}),style:d5({theme:b,themeName:E,selector:_,options:k,props:n,stylesCtx:r,rootSelector:c,styles:p,style:s,vars:m,varsResolver:g,headless:C,withStylesTransform:R}),...y?.[_]})}function Cl(e,t){return typeof e=="boolean"?e:t.autoContrast}function yE(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 h5({keepTransitions:e}={}){const t=v.useRef(bp),n=v.useRef(-1),r=v.useContext(wb),o=tm(),s=v.useRef(o?.());if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const c=g=>{r.setColorScheme(g),t.current=e?()=>{}:yE(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},d=()=>{r.clearColorScheme(),t.current=e?()=>{}:yE(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},f=ZM("light",{getInitialValueInEffect:!1}),p=r.colorScheme==="auto"?f:r.colorScheme,m=v.useCallback(()=>c(p==="light"?"dark":"light"),[c,p]);return v.useEffect(()=>()=>{t.current?.(),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:c,clearColorScheme:d,toggleColorScheme:m}}function oe(e,t,n){const r=En(),o=r.components[e]?.defaultProps,s=typeof o=="function"?o(r):o;return{...t,...s,...ys(n)}}function Py(e){return fn(e).reduce((t,n)=>e[n]!==void 0?`${t}${UM(n)}:${e[n]};`:t,"").trim()}function p5({selector:e,styles:t,media:n,container:r}){const o=t?Py(t):"",s=Array.isArray(n)?n.map(d=>`@media${d.query}{${e}{${Py(d.styles)}}}`):[],c=Array.isArray(r)?r.map(d=>`@container ${d.query}{${e}{${Py(d.styles)}}}`):[];return`${o?`${e}{${o}}`:""}${s.join("")}${c.join("")}`.trim()}function El(e){const t=tm();return a.jsx("style",{"data-mantine-styles":"inline",nonce:t?.(),dangerouslySetInnerHTML:{__html:p5(e)}})}function ja(e){const{m:t,mx:n,my:r,mt:o,mb:s,ml:c,mr:d,me:f,ms:p,p:m,px:g,py:y,pt:b,pb:S,pl:j,pr:C,pe:E,ps:R,bd:T,bdrs:_,bg:k,c:L,opacity:A,ff:N,fz:z,fw:B,lts:G,ta:Y,lh:J,fs:U,tt:W,td:O,w:I,miw:$,maw:H,h:K,mih:M,mah:F,bgsz:ae,bgp:de,bgr:xe,bga:Se,pos:Ce,top:Ke,left:Ae,bottom:dt,right:Ct,inset:ot,display:it,flex:pt,hiddenFrom:Et,visibleFrom:wt,lightHidden:Te,darkHidden:_e,sx:Le,...Me}=e;return{styleProps:ys({m:t,mx:n,my:r,mt:o,mb:s,ml:c,mr:d,me:f,ms:p,p:m,px:g,py:y,pt:b,pb:S,pl:j,pr:C,pe:E,ps:R,bd:T,bg:k,c:L,opacity:A,ff:N,fz:z,fw:B,lts:G,ta:Y,lh:J,fs:U,tt:W,td:O,w:I,miw:$,maw:H,h:K,mih:M,mah:F,bgsz:ae,bgp:de,bgr:xe,bga:Se,pos:Ce,top:Ke,left:Ae,bottom:dt,right:Ct,inset:ot,display:it,flex:pt,bdrs:_,hiddenFrom:Et,visibleFrom:wt,lightHidden:Te,darkHidden:_e,sx:Le}),rest:Me}}const m5={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"},bdrs:{type:"radius",property:"borderRadius"},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 Tb(e,t){const n=Wr({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 g5(e,t){const n=Wr({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:Tb(e,t)}function v5(e,t){if(typeof e=="number")return le(e);if(typeof e=="string"){const[n,r,...o]=e.split(" ").filter(c=>c.trim()!=="");let s=`${le(n)}`;return r&&(s+=` ${r}`),o.length>0&&(s+=` ${Tb(o.join(" "),t)}`),s.trim()}return e}const xE={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 y5(e){return typeof e=="string"&&e in xE?xE[e]:e}const x5=["h1","h2","h3","h4","h5","h6"];function b5(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&x5.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?le(e):e}function S5(e){return e}const w5=["h1","h2","h3","h4","h5","h6"];function j5(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&w5.includes(e)?`var(--mantine-${e}-line-height)`:e}function C5(e,t){return typeof e=="string"&&e in t.radius?`var(--mantine-radius-${e})`:typeof e=="number"||typeof e=="string"?le(e):e}function E5(e){return typeof e=="number"?le(e):e}function T5(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 Ny={color:Tb,textColor:g5,fontSize:b5,spacing:T5,radius:C5,identity:S5,size:E5,lineHeight:j5,fontFamily:y5,border:v5};function bE(e){return e.replace("(min-width: ","").replace("em)","")}function R5({media:e,...t}){const r=Object.keys(e).sort((o,s)=>Number(bE(o))-Number(bE(s))).map(o=>({query:o,styles:e[o]}));return{...t,media:r}}function _5(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function A5(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function D5(e){return typeof e=="object"&&e!==null?fn(e).filter(t=>t!=="base"):[]}function k5(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function t_({styleProps:e,data:t,theme:n}){return R5(fn(e).reduce((r,o)=>{if(o==="hiddenFrom"||o==="visibleFrom"||o==="sx")return r;const s=t[o],c=Array.isArray(s.property)?s.property:[s.property],d=A5(e[o]);if(!_5(e[o]))return c.forEach(p=>{r.inlineStyles[p]=Ny[s.type](d,n)}),r;r.hasResponsiveStyles=!0;const f=D5(e[o]);return c.forEach(p=>{d!=null&&(r.styles[p]=Ny[s.type](d,n)),f.forEach(m=>{const g=`(min-width: ${n.breakpoints[m]})`;r.media[g]={...r.media[g],[p]:Ny[s.type](k5(e[o],m),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function Gd(){return`__m__-${v.useId().replace(/[:«»]/g,"")}`}function n_(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...n_(r,t)}),{}):typeof e=="function"?e(t):e??{}}function r_(e){return e.startsWith("data-")?e:`data-${e}`}function P5(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 i_(e){return e?typeof e=="string"?{[r_(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...i_(n)}),{}):P5(e):null}function Ex(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Ex(r,t)}),{}):typeof e=="function"?e(t):e??{}}function N5({theme:e,style:t,vars:n,styleProps:r}){const o=Ex(t,e),s=Ex(n,e);return{...o,...s,...r}}const o_=v.forwardRef(({component:e,style:t,__vars:n,className:r,variant:o,mod:s,size:c,hiddenFrom:d,visibleFrom:f,lightHidden:p,darkHidden:m,renderRoot:g,__size:y,...b},S)=>{const j=En(),C=e||"div",{styleProps:E,rest:R}=ja(b),_=k4()?.()?.(E.sx),k=Gd(),L=t_({styleProps:E,theme:j,data:m5}),A={ref:S,style:N5({theme:j,style:t,vars:n,styleProps:L.inlineStyles}),className:$t(r,_,{[k]:L.hasResponsiveStyles,"mantine-light-hidden":p,"mantine-dark-hidden":m,[`mantine-hidden-from-${d}`]:d,[`mantine-visible-from-${f}`]:f}),"data-variant":o,"data-size":U2(c)?void 0:c||void 0,size:y,...i_(s),...R};return a.jsxs(a.Fragment,{children:[L.hasResponsiveStyles&&a.jsx(El,{selector:`.${k}`,styles:L.styles,media:L.media}),typeof g=="function"?g(A):a.jsx(C,{...A})]})});o_.displayName="@mantine/core/Box";const ce=o_;function a_(e){return e}function O5(e){const t=e;return n=>{const r=v.forwardRef((o,s)=>a.jsx(t,{...n,...o,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r}}function ge(e){const t=v.forwardRef(e);return t.extend=a_,t.withProps=n=>{const r=v.forwardRef((o,s)=>a.jsx(t,{...n,...o,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t}function or(e){const t=v.forwardRef(e);return t.withProps=n=>{const r=v.forwardRef((o,s)=>a.jsx(t,{...n,...o,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t.extend=a_,t}const M5=v.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function xs(){return v.useContext(M5)}var Oy={exports:{}},vr={};var SE;function L5(){if(SE)return vr;SE=1;var e=mb();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},o=Symbol.for("react.portal");function s(f,p,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,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 d(f,p){if(f==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return vr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,vr.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)},vr.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()}},vr.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))},vr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},vr.preinit=function(f,p){if(typeof f=="string"&&p&&typeof p.as=="string"){var m=p.as,g=d(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})}},vr.preinitModule=function(f,p){if(typeof f=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var m=d(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)},vr.preload=function(f,p){if(typeof f=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var m=p.as,g=d(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})}},vr.preloadModule=function(f,p){if(typeof f=="string")if(p){var m=d(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)},vr.requestFormReset=function(f){r.d.r(f)},vr.unstable_batchedUpdates=function(f,p){return f(p)},vr.useFormState=function(f,p,m){return c.H.useFormState(f,p,m)},vr.useFormStatus=function(){return c.H.useHostTransitionStatus()},vr.version="19.2.1",vr}var wE;function s_(){if(wE)return Oy.exports;wE=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Oy.exports=L5(),Oy.exports}var Rb=s_();const md=Xp(Rb);function rm(){return typeof window<"u"}function eu(e){return l_(e)?(e.nodeName||"").toLowerCase():"#document"}function Qr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $o(e){var t;return(t=(l_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function l_(e){return rm()?e instanceof Node||e instanceof Qr(e).Node:!1}function wn(e){return rm()?e instanceof Element||e instanceof Qr(e).Element:!1}function di(e){return rm()?e instanceof HTMLElement||e instanceof Qr(e).HTMLElement:!1}function Tx(e){return!rm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Qr(e).ShadowRoot}const I5=new Set(["inline","contents"]);function Qd(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ni(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!I5.has(o)}const z5=new Set(["table","td","th"]);function $5(e){return z5.has(eu(e))}const U5=[":popover-open",":modal"];function im(e){return U5.some(t=>{try{return e.matches(t)}catch{return!1}})}const B5=["transform","translate","scale","rotate","perspective"],V5=["transform","translate","scale","rotate","perspective","filter"],F5=["paint","layout","strict","content"];function _b(e){const t=om(),n=wn(e)?Ni(e):e;return B5.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)||V5.some(r=>(n.willChange||"").includes(r))||F5.some(r=>(n.contain||"").includes(r))}function H5(e){let t=ga(e);for(;di(t)&&!pa(t);){if(_b(t))return t;if(im(t))return null;t=ga(t)}return null}function om(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const q5=new Set(["html","body","#document"]);function pa(e){return q5.has(eu(e))}function Ni(e){return Qr(e).getComputedStyle(e)}function am(e){return wn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ga(e){if(eu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Tx(e)&&e.host||$o(e);return Tx(t)?t.host:t}function c_(e){const t=ga(e);return pa(t)?e.ownerDocument?e.ownerDocument.body:e.body:di(t)&&Qd(t)?t:c_(t)}function ma(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=c_(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),c=Qr(o);if(s){const d=Rx(c);return t.concat(c,c.visualViewport||[],Qd(o)?o:[],d&&n?ma(d):[])}return t.concat(o,ma(o,[],n))}function Rx(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const G5=["top","right","bottom","left"],Zi=Math.min,br=Math.max,wp=Math.round,Hh=Math.floor,Co=e=>({x:e,y:e}),Q5={left:"right",right:"left",bottom:"top",top:"bottom"},W5={start:"end",end:"start"};function _x(e,t,n){return br(e,Zi(t,n))}function ko(e,t){return typeof e=="function"?e(t):e}function eo(e){return e.split("-")[0]}function tu(e){return e.split("-")[1]}function Ab(e){return e==="x"?"y":"x"}function Db(e){return e==="y"?"height":"width"}const Y5=new Set(["top","bottom"]);function Ki(e){return Y5.has(eo(e))?"y":"x"}function kb(e){return Ab(Ki(e))}function K5(e,t,n){n===void 0&&(n=!1);const r=tu(e),o=kb(e),s=Db(o);let c=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=jp(c)),[c,jp(c)]}function X5(e){const t=jp(e);return[Ax(e),t,Ax(t)]}function Ax(e){return e.replace(/start|end/g,t=>W5[t])}const jE=["left","right"],CE=["right","left"],J5=["top","bottom"],Z5=["bottom","top"];function e9(e,t,n){switch(e){case"top":case"bottom":return n?t?CE:jE:t?jE:CE;case"left":case"right":return t?J5:Z5;default:return[]}}function t9(e,t,n,r){const o=tu(e);let s=e9(eo(e),n==="start",r);return o&&(s=s.map(c=>c+"-"+o),t&&(s=s.concat(s.map(Ax)))),s}function jp(e){return e.replace(/left|right|bottom|top/g,t=>Q5[t])}function n9(e){return{top:0,right:0,bottom:0,left:0,...e}}function Pb(e){return typeof e!="number"?n9(e):{top:e,right:e,bottom:e,left:e}}function $c(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function r9(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function i9(){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 o9(){return/apple/i.test(navigator.vendor)}function a9(){return r9().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function s9(){return i9().includes("jsdom/")}const EE="data-floating-ui-focusable",l9="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function TE(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 Rd(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Tx(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ac(e){return"composedPath"in e?e.composedPath()[0]:e.target}function My(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 c9(e){return e.matches("html,body")}function tl(e){return e?.ownerDocument||document}function u9(e){return di(e)&&e.matches(l9)}function d9(e){if(!e||s9())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function f9(e){return e?e.hasAttribute(EE)?e:e.querySelector("["+EE+"]")||e:null}function lp(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...lp(e,o.id,n)])}function h9(e){return"nativeEvent"in e}function Dx(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}var p9=typeof document<"u",m9=function(){},Eo=p9?v.useLayoutEffect:m9;const g9={...gb};function qh(e){const t=v.useRef(e);return Eo(()=>{t.current=e}),t}const v9=g9.useInsertionEffect,y9=v9||(e=>e());function wo(e){const t=v.useRef(()=>{});return y9(()=>{t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function RE(e,t,n){let{reference:r,floating:o}=e;const s=Ki(t),c=kb(t),d=Db(c),f=eo(t),p=s==="y",m=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,y=r[d]/2-o[d]/2;let b;switch(f){case"top":b={x:m,y:r.y-o.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-o.width,y:g};break;default:b={x:r.x,y:r.y}}switch(tu(t)){case"start":b[c]-=y*(n&&p?-1:1);break;case"end":b[c]+=y*(n&&p?-1:1);break}return b}const x9=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:c}=n,d=s.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let p=await c.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:g}=RE(p,r,f),y=r,b={},S=0;for(let j=0;j<d.length;j++){const{name:C,fn:E}=d[j],{x:R,y:T,data:_,reset:k}=await E({x:m,y:g,initialPlacement:r,placement:y,strategy:o,middlewareData:b,rects:p,platform:c,elements:{reference:e,floating:t}});m=R??m,g=T??g,b={...b,[C]:{...b[C],..._}},k&&S<=50&&(S++,typeof k=="object"&&(k.placement&&(y=k.placement),k.rects&&(p=k.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:o}):k.rects),{x:m,y:g}=RE(p,y,f)),j=-1)}return{x:m,y:g,placement:y,strategy:o,middlewareData:b}};async function _d(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:c,elements:d,strategy:f}=e,{boundary:p="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:y=!1,padding:b=0}=ko(t,e),S=Pb(b),C=d[y?g==="floating"?"reference":"floating":g],E=$c(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(d.floating)),boundary:p,rootBoundary:m,strategy:f})),R=g==="floating"?{x:r,y:o,width:c.floating.width,height:c.floating.height}:c.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d.floating)),_=await(s.isElement==null?void 0:s.isElement(T))?await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1}:{x:1,y:1},k=$c(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:R,offsetParent:T,strategy:f}):R);return{top:(E.top-k.top+S.top)/_.y,bottom:(k.bottom-E.bottom+S.bottom)/_.y,left:(E.left-k.left+S.left)/_.x,right:(k.right-E.right+S.right)/_.x}}const b9=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:c,elements:d,middlewareData:f}=t,{element:p,padding:m=0}=ko(e,t)||{};if(p==null)return{};const g=Pb(m),y={x:n,y:r},b=kb(o),S=Db(b),j=await c.getDimensions(p),C=b==="y",E=C?"top":"left",R=C?"bottom":"right",T=C?"clientHeight":"clientWidth",_=s.reference[S]+s.reference[b]-y[b]-s.floating[S],k=y[b]-s.reference[b],L=await(c.getOffsetParent==null?void 0:c.getOffsetParent(p));let A=L?L[T]:0;(!A||!await(c.isElement==null?void 0:c.isElement(L)))&&(A=d.floating[T]||s.floating[S]);const N=_/2-k/2,z=A/2-j[S]/2-1,B=Zi(g[E],z),G=Zi(g[R],z),Y=B,J=A-j[S]-G,U=A/2-j[S]/2+N,W=_x(Y,U,J),O=!f.arrow&&tu(o)!=null&&U!==W&&s.reference[S]/2-(U<Y?B:G)-j[S]/2<0,I=O?U<Y?U-Y:U-J:0;return{[b]:y[b]+I,data:{[b]:W,centerOffset:U-W-I,...O&&{alignmentOffset:I}},reset:O}}}),S9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:c,initialPlacement:d,platform:f,elements:p}=t,{mainAxis:m=!0,crossAxis:g=!0,fallbackPlacements:y,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:j=!0,...C}=ko(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const E=eo(o),R=Ki(d),T=eo(d)===d,_=await(f.isRTL==null?void 0:f.isRTL(p.floating)),k=y||(T||!j?[jp(d)]:X5(d)),L=S!=="none";!y&&L&&k.push(...t9(d,j,S,_));const A=[d,...k],N=await _d(t,C),z=[];let B=((r=s.flip)==null?void 0:r.overflows)||[];if(m&&z.push(N[E]),g){const U=K5(o,c,_);z.push(N[U[0]],N[U[1]])}if(B=[...B,{placement:o,overflows:z}],!z.every(U=>U<=0)){var G,Y;const U=(((G=s.flip)==null?void 0:G.index)||0)+1,W=A[U];if(W&&(!(g==="alignment"?R!==Ki(W):!1)||B.every($=>Ki($.placement)===R?$.overflows[0]>0:!0)))return{data:{index:U,overflows:B},reset:{placement:W}};let O=(Y=B.filter(I=>I.overflows[0]<=0).sort((I,$)=>I.overflows[1]-$.overflows[1])[0])==null?void 0:Y.placement;if(!O)switch(b){case"bestFit":{var J;const I=(J=B.filter($=>{if(L){const H=Ki($.placement);return H===R||H==="y"}return!0}).map($=>[$.placement,$.overflows.filter(H=>H>0).reduce((H,K)=>H+K,0)]).sort(($,H)=>$[1]-H[1])[0])==null?void 0:J[0];I&&(O=I);break}case"initialPlacement":O=d;break}if(o!==O)return{reset:{placement:O}}}return{}}}};function _E(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function AE(e){return G5.some(t=>e[t]>=0)}const w9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ko(e,t);switch(r){case"referenceHidden":{const s=await _d(t,{...o,elementContext:"reference"}),c=_E(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:AE(c)}}}case"escaped":{const s=await _d(t,{...o,altBoundary:!0}),c=_E(s,n.floating);return{data:{escapedOffsets:c,escaped:AE(c)}}}default:return{}}}}};function u_(e){const t=Zi(...e.map(s=>s.left)),n=Zi(...e.map(s=>s.top)),r=br(...e.map(s=>s.right)),o=br(...e.map(s=>s.bottom));return{x:t,y:n,width:r-t,height:o-n}}function j9(e){const t=e.slice().sort((o,s)=>o.y-s.y),n=[];let r=null;for(let o=0;o<t.length;o++){const s=t[o];!r||s.y-r.y>r.height/2?n.push([s]):n[n.length-1].push(s),r=s}return n.map(o=>$c(u_(o)))}const C9=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:s,strategy:c}=t,{padding:d=2,x:f,y:p}=ko(e,t),m=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),g=j9(m),y=$c(u_(m)),b=Pb(d);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 B=g[0],G=g[g.length-1],Y=eo(n)==="top",J=B.top,U=G.bottom,W=Y?B.left:G.left,O=Y?B.right:G.right,I=O-W,$=U-J;return{top:J,bottom:U,left:W,right:O,width:I,height:$,x:W,y:J}}const C=eo(n)==="left",E=br(...g.map(B=>B.right)),R=Zi(...g.map(B=>B.left)),T=g.filter(B=>C?B.left===R:B.right===E),_=T[0].top,k=T[T.length-1].bottom,L=R,A=E,N=A-L,z=k-_;return{top:_,bottom:k,left:L,right:A,width:N,height:z,x:L,y:_}}return y}const j=await s.getElementRects({reference:{getBoundingClientRect:S},floating:r.floating,strategy:c});return o.reference.x!==j.reference.x||o.reference.y!==j.reference.y||o.reference.width!==j.reference.width||o.reference.height!==j.reference.height?{reset:{rects:j}}:{}}}},d_=new Set(["left","top"]);async function E9(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),c=eo(n),d=tu(n),f=Ki(n)==="y",p=d_.has(c)?-1:1,m=s&&f?-1:1,g=ko(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 d&&typeof S=="number"&&(b=d==="end"?S*-1:S),f?{x:b*m,y:y*p}:{x:y*p,y:b*m}}const T9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:c,middlewareData:d}=t,f=await E9(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:o+f.x,y:s+f.y,data:{...f,placement:c}}}}},R9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:d={fn:C=>{let{x:E,y:R}=C;return{x:E,y:R}}},...f}=ko(e,t),p={x:n,y:r},m=await _d(t,f),g=Ki(eo(o)),y=Ab(g);let b=p[y],S=p[g];if(s){const C=y==="y"?"top":"left",E=y==="y"?"bottom":"right",R=b+m[C],T=b-m[E];b=_x(R,b,T)}if(c){const C=g==="y"?"top":"left",E=g==="y"?"bottom":"right",R=S+m[C],T=S-m[E];S=_x(R,S,T)}const j=d.fn({...t,[y]:b,[g]:S});return{...j,data:{x:j.x-n,y:j.y-r,enabled:{[y]:s,[g]:c}}}}}},_9=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:c}=t,{offset:d=0,mainAxis:f=!0,crossAxis:p=!0}=ko(e,t),m={x:n,y:r},g=Ki(o),y=Ab(g);let b=m[y],S=m[g];const j=ko(d,t),C=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(f){const T=y==="y"?"height":"width",_=s.reference[y]-s.floating[T]+C.mainAxis,k=s.reference[y]+s.reference[T]-C.mainAxis;b<_?b=_:b>k&&(b=k)}if(p){var E,R;const T=y==="y"?"width":"height",_=d_.has(eo(o)),k=s.reference[g]-s.floating[T]+(_&&((E=c.offset)==null?void 0:E[g])||0)+(_?0:C.crossAxis),L=s.reference[g]+s.reference[T]+(_?0:((R=c.offset)==null?void 0:R[g])||0)-(_?C.crossAxis:0);S<k?S=k:S>L&&(S=L)}return{[y]:b,[g]:S}}}},A9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:c,elements:d}=t,{apply:f=()=>{},...p}=ko(e,t),m=await _d(t,p),g=eo(o),y=tu(o),b=Ki(o)==="y",{width:S,height:j}=s.floating;let C,E;g==="top"||g==="bottom"?(C=g,E=y===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(E=g,C=y==="end"?"top":"bottom");const R=j-m.top-m.bottom,T=S-m.left-m.right,_=Zi(j-m[C],R),k=Zi(S-m[E],T),L=!t.middlewareData.shift;let A=_,N=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(N=T),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=R),L&&!y){const B=br(m.left,0),G=br(m.right,0),Y=br(m.top,0),J=br(m.bottom,0);b?N=S-2*(B!==0||G!==0?B+G:br(m.left,m.right)):A=j-2*(Y!==0||J!==0?Y+J:br(m.top,m.bottom))}await f({...t,availableWidth:N,availableHeight:A});const z=await c.getDimensions(d.floating);return S!==z.width||j!==z.height?{reset:{rects:!0}}:{}}}};function f_(e){const t=Ni(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=di(e),s=o?e.offsetWidth:n,c=o?e.offsetHeight:r,d=wp(n)!==s||wp(r)!==c;return d&&(n=s,r=c),{width:n,height:r,$:d}}function Nb(e){return wn(e)?e:e.contextElement}function Oc(e){const t=Nb(e);if(!di(t))return Co(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=f_(t);let c=(s?wp(n.width):n.width)/r,d=(s?wp(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const D9=Co(0);function h_(e){const t=Qr(e);return!om()||!t.visualViewport?D9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function k9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Qr(e)?!1:t}function dl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Nb(e);let c=Co(1);t&&(r?wn(r)&&(c=Oc(r)):c=Oc(e));const d=k9(s,n,r)?h_(s):Co(0);let f=(o.left+d.x)/c.x,p=(o.top+d.y)/c.y,m=o.width/c.x,g=o.height/c.y;if(s){const y=Qr(s),b=r&&wn(r)?Qr(r):r;let S=y,j=Rx(S);for(;j&&r&&b!==S;){const C=Oc(j),E=j.getBoundingClientRect(),R=Ni(j),T=E.left+(j.clientLeft+parseFloat(R.paddingLeft))*C.x,_=E.top+(j.clientTop+parseFloat(R.paddingTop))*C.y;f*=C.x,p*=C.y,m*=C.x,g*=C.y,f+=T,p+=_,S=Qr(j),j=Rx(S)}}return $c({width:m,height:g,x:f,y:p})}function sm(e,t){const n=am(e).scrollLeft;return t?t.left+n:dl($o(e)).left+n}function p_(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-sm(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function P9(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",c=$o(r),d=t?im(t.floating):!1;if(r===c||d&&s)return n;let f={scrollLeft:0,scrollTop:0},p=Co(1);const m=Co(0),g=di(r);if((g||!g&&!s)&&((eu(r)!=="body"||Qd(c))&&(f=am(r)),di(r))){const b=dl(r);p=Oc(r),m.x=b.x+r.clientLeft,m.y=b.y+r.clientTop}const y=c&&!g&&!s?p_(c,f):Co(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 N9(e){return Array.from(e.getClientRects())}function O9(e){const t=$o(e),n=am(e),r=e.ownerDocument.body,o=br(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=br(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+sm(e);const d=-n.scrollTop;return Ni(r).direction==="rtl"&&(c+=br(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:c,y:d}}const DE=25;function M9(e,t){const n=Qr(e),r=$o(e),o=n.visualViewport;let s=r.clientWidth,c=r.clientHeight,d=0,f=0;if(o){s=o.width,c=o.height;const m=om();(!m||m&&t==="fixed")&&(d=o.offsetLeft,f=o.offsetTop)}const p=sm(r);if(p<=0){const m=r.ownerDocument,g=m.body,y=getComputedStyle(g),b=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,S=Math.abs(r.clientWidth-g.clientWidth-b);S<=DE&&(s-=S)}else p<=DE&&(s+=p);return{width:s,height:c,x:d,y:f}}const L9=new Set(["absolute","fixed"]);function I9(e,t){const n=dl(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=di(e)?Oc(e):Co(1),c=e.clientWidth*s.x,d=e.clientHeight*s.y,f=o*s.x,p=r*s.y;return{width:c,height:d,x:f,y:p}}function kE(e,t,n){let r;if(t==="viewport")r=M9(e,n);else if(t==="document")r=O9($o(e));else if(wn(t))r=I9(t,n);else{const o=h_(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return $c(r)}function m_(e,t){const n=ga(e);return n===t||!wn(n)||pa(n)?!1:Ni(n).position==="fixed"||m_(n,t)}function z9(e,t){const n=t.get(e);if(n)return n;let r=ma(e,[],!1).filter(d=>wn(d)&&eu(d)!=="body"),o=null;const s=Ni(e).position==="fixed";let c=s?ga(e):e;for(;wn(c)&&!pa(c);){const d=Ni(c),f=_b(c);!f&&d.position==="fixed"&&(o=null),(s?!f&&!o:!f&&d.position==="static"&&!!o&&L9.has(o.position)||Qd(c)&&!f&&m_(e,c))?r=r.filter(m=>m!==c):o=d,c=ga(c)}return t.set(e,r),r}function $9(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const c=[...n==="clippingAncestors"?im(t)?[]:z9(t,this._c):[].concat(n),r],d=c[0],f=c.reduce((p,m)=>{const g=kE(t,m,o);return p.top=br(g.top,p.top),p.right=Zi(g.right,p.right),p.bottom=Zi(g.bottom,p.bottom),p.left=br(g.left,p.left),p},kE(t,d,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function U9(e){const{width:t,height:n}=f_(e);return{width:t,height:n}}function B9(e,t,n){const r=di(t),o=$o(t),s=n==="fixed",c=dl(e,!0,s,t);let d={scrollLeft:0,scrollTop:0};const f=Co(0);function p(){f.x=sm(o)}if(r||!r&&!s)if((eu(t)!=="body"||Qd(o))&&(d=am(t)),r){const b=dl(t,!0,s,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}else o&&p();s&&!r&&o&&p();const m=o&&!r&&!s?p_(o,d):Co(0),g=c.left+d.scrollLeft-f.x-m.x,y=c.top+d.scrollTop-f.y-m.y;return{x:g,y,width:c.width,height:c.height}}function Ly(e){return Ni(e).position==="static"}function PE(e,t){if(!di(e)||Ni(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $o(e)===n&&(n=n.ownerDocument.body),n}function g_(e,t){const n=Qr(e);if(im(e))return n;if(!di(e)){let o=ga(e);for(;o&&!pa(o);){if(wn(o)&&!Ly(o))return o;o=ga(o)}return n}let r=PE(e,t);for(;r&&$5(r)&&Ly(r);)r=PE(r,t);return r&&pa(r)&&Ly(r)&&!_b(r)?n:r||H5(e)||n}const V9=async function(e){const t=this.getOffsetParent||g_,n=this.getDimensions,r=await n(e.floating);return{reference:B9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function F9(e){return Ni(e).direction==="rtl"}const H9={convertOffsetParentRelativeRectToViewportRelativeRect:P9,getDocumentElement:$o,getClippingRect:$9,getOffsetParent:g_,getElementRects:V9,getClientRects:N9,getDimensions:U9,getScale:Oc,isElement:wn,isRTL:F9};function v_(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function q9(e,t){let n=null,r;const o=$o(e);function s(){var d;clearTimeout(r),(d=n)==null||d.disconnect(),n=null}function c(d,f){d===void 0&&(d=!1),f===void 0&&(f=1),s();const p=e.getBoundingClientRect(),{left:m,top:g,width:y,height:b}=p;if(d||t(),!y||!b)return;const S=Hh(g),j=Hh(o.clientWidth-(m+y)),C=Hh(o.clientHeight-(g+b)),E=Hh(m),T={rootMargin:-S+"px "+-j+"px "+-C+"px "+-E+"px",threshold:br(0,Zi(1,f))||1};let _=!0;function k(L){const A=L[0].intersectionRatio;if(A!==f){if(!_)return c();A?c(!1,A):r=setTimeout(()=>{c(!1,1e-7)},1e3)}A===1&&!v_(p,e.getBoundingClientRect())&&c(),_=!1}try{n=new IntersectionObserver(k,{...T,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,T)}n.observe(e)}return c(!0),s}function kx(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,p=Nb(e),m=o||s?[...p?ma(p):[],...ma(t)]:[];m.forEach(E=>{o&&E.addEventListener("scroll",n,{passive:!0}),s&&E.addEventListener("resize",n)});const g=p&&d?q9(p,n):null;let y=-1,b=null;c&&(b=new ResizeObserver(E=>{let[R]=E;R&&R.target===p&&b&&(b.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var T;(T=b)==null||T.observe(t)})),n()}),p&&!f&&b.observe(p),b.observe(t));let S,j=f?dl(e):null;f&&C();function C(){const E=dl(e);j&&!v_(j,E)&&n(),j=E,S=requestAnimationFrame(C)}return n(),()=>{var E;m.forEach(R=>{o&&R.removeEventListener("scroll",n),s&&R.removeEventListener("resize",n)}),g?.(),(E=b)==null||E.disconnect(),b=null,f&&cancelAnimationFrame(S)}}const G9=T9,Q9=R9,W9=S9,Y9=A9,K9=w9,NE=b9,X9=C9,J9=_9,Z9=(e,t,n)=>{const r=new Map,o={platform:H9,...n},s={...o.platform,_c:r};return x9(e,t,{...o,platform:s})};var eL=typeof document<"u",tL=function(){},cp=eL?v.useLayoutEffect:tL;function Cp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Cp(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Cp(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function y_(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function OE(e,t){const n=y_(e);return Math.round(t*n)/n}function Iy(e){const t=v.useRef(e);return cp(()=>{t.current=e}),t}function nL(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:c}={},transform:d=!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);Cp(y,r)||b(r);const[S,j]=v.useState(null),[C,E]=v.useState(null),R=v.useCallback($=>{$!==L.current&&(L.current=$,j($))},[]),T=v.useCallback($=>{$!==A.current&&(A.current=$,E($))},[]),_=s||S,k=c||C,L=v.useRef(null),A=v.useRef(null),N=v.useRef(m),z=f!=null,B=Iy(f),G=Iy(o),Y=Iy(p),J=v.useCallback(()=>{if(!L.current||!A.current)return;const $={placement:t,strategy:n,middleware:y};G.current&&($.platform=G.current),Z9(L.current,A.current,$).then(H=>{const K={...H,isPositioned:Y.current!==!1};U.current&&!Cp(N.current,K)&&(N.current=K,Rb.flushSync(()=>{g(K)}))})},[y,t,n,G,Y]);cp(()=>{p===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,g($=>({...$,isPositioned:!1})))},[p]);const U=v.useRef(!1);cp(()=>(U.current=!0,()=>{U.current=!1}),[]),cp(()=>{if(_&&(L.current=_),k&&(A.current=k),_&&k){if(B.current)return B.current(_,k,J);J()}},[_,k,J,B,z]);const W=v.useMemo(()=>({reference:L,floating:A,setReference:R,setFloating:T}),[R,T]),O=v.useMemo(()=>({reference:_,floating:k}),[_,k]),I=v.useMemo(()=>{const $={position:n,left:0,top:0};if(!O.floating)return $;const H=OE(O.floating,m.x),K=OE(O.floating,m.y);return d?{...$,transform:"translate("+H+"px, "+K+"px)",...y_(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:K}},[n,d,O.floating,m.x,m.y]);return v.useMemo(()=>({...m,update:J,refs:W,elements:O,floatingStyles:I}),[m,J,W,O,I])}const rL=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?NE({element:r.current,padding:o}).fn(n):{}:r?NE({element:r,padding:o}).fn(n):{}}}},x_=(e,t)=>({...G9(e),options:[e,t]}),Ob=(e,t)=>({...Q9(e),options:[e,t]}),ME=(e,t)=>({...J9(e),options:[e,t]}),Ep=(e,t)=>({...W9(e),options:[e,t]}),iL=(e,t)=>({...Y9(e),options:[e,t]}),oL=(e,t)=>({...K9(e),options:[e,t]}),bd=(e,t)=>({...X9(e),options:[e,t]}),b_=(e,t)=>({...rL(e),options:[e,t]});function S_(e){const t=v.useRef(void 0),n=v.useCallback(r=>{const o=e.map(s=>{if(s!=null){if(typeof s=="function"){const c=s,d=c(r);return typeof d=="function"?d:()=>{c(null)}}return s.current=r,()=>{s.current=null}}});return()=>{o.forEach(s=>s?.())}},e);return v.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const aL="data-floating-ui-focusable",LE="active",IE="selected",sL={...gb};let zE=!1,lL=0;const $E=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+lL++;function cL(){const[e,t]=v.useState(()=>zE?$E():void 0);return Eo(()=>{e==null&&t($E())},[]),v.useEffect(()=>{zE=!0},[]),e}const uL=sL.useId,w_=uL||cL;function dL(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const fL=v.createContext(null),hL=v.createContext(null),Mb=()=>{var e;return((e=v.useContext(fL))==null?void 0:e.id)||null},Lb=()=>v.useContext(hL);function Ib(e){return"data-floating-ui-"+e}function _i(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const UE=Ib("safe-polygon");function up(e,t,n){if(n&&!Dx(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function zy(e){return typeof e=="function"?e():e}function pL(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:c}=e,{enabled:d=!0,delay:f=0,handleClose:p=null,mouseOnly:m=!1,restMs:g=0,move:y=!0}=t,b=Lb(),S=Mb(),j=qh(p),C=qh(f),E=qh(n),R=qh(g),T=v.useRef(),_=v.useRef(-1),k=v.useRef(),L=v.useRef(-1),A=v.useRef(!0),N=v.useRef(!1),z=v.useRef(()=>{}),B=v.useRef(!1),G=wo(()=>{var I;const $=(I=o.current.openEvent)==null?void 0:I.type;return $?.includes("mouse")&&$!=="mousedown"});v.useEffect(()=>{if(!d)return;function I($){let{open:H}=$;H||(_i(_),_i(L),A.current=!0,B.current=!1)}return s.on("openchange",I),()=>{s.off("openchange",I)}},[d,s]),v.useEffect(()=>{if(!d||!j.current||!n)return;function I(H){G()&&r(!1,H,"hover")}const $=tl(c.floating).documentElement;return $.addEventListener("mouseleave",I),()=>{$.removeEventListener("mouseleave",I)}},[c.floating,n,r,d,j,G]);const Y=v.useCallback(function(I,$,H){$===void 0&&($=!0),H===void 0&&(H="hover");const K=up(C.current,"close",T.current);K&&!k.current?(_i(_),_.current=window.setTimeout(()=>r(!1,I,H),K)):$&&(_i(_),r(!1,I,H))},[C,r]),J=wo(()=>{z.current(),k.current=void 0}),U=wo(()=>{if(N.current){const I=tl(c.floating).body;I.style.pointerEvents="",I.removeAttribute(UE),N.current=!1}}),W=wo(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);v.useEffect(()=>{if(!d)return;function I(F){if(_i(_),A.current=!1,m&&!Dx(T.current)||zy(R.current)>0&&!up(C.current,"open"))return;const ae=up(C.current,"open",T.current);ae?_.current=window.setTimeout(()=>{E.current||r(!0,F,"hover")},ae):n||r(!0,F,"hover")}function $(F){if(W()){U();return}z.current();const ae=tl(c.floating);if(_i(L),B.current=!1,j.current&&o.current.floatingContext){n||_i(_),k.current=j.current({...o.current.floatingContext,tree:b,x:F.clientX,y:F.clientY,onClose(){U(),J(),W()||Y(F,!0,"safe-polygon")}});const xe=k.current;ae.addEventListener("mousemove",xe),z.current=()=>{ae.removeEventListener("mousemove",xe)};return}(T.current!=="touch"||!Rd(c.floating,F.relatedTarget))&&Y(F)}function H(F){W()||o.current.floatingContext&&(j.current==null||j.current({...o.current.floatingContext,tree:b,x:F.clientX,y:F.clientY,onClose(){U(),J(),W()||Y(F)}})(F))}function K(){_i(_)}function M(F){W()||Y(F,!1)}if(wn(c.domReference)){const F=c.domReference,ae=c.floating;return n&&F.addEventListener("mouseleave",H),y&&F.addEventListener("mousemove",I,{once:!0}),F.addEventListener("mouseenter",I),F.addEventListener("mouseleave",$),ae&&(ae.addEventListener("mouseleave",H),ae.addEventListener("mouseenter",K),ae.addEventListener("mouseleave",M)),()=>{n&&F.removeEventListener("mouseleave",H),y&&F.removeEventListener("mousemove",I),F.removeEventListener("mouseenter",I),F.removeEventListener("mouseleave",$),ae&&(ae.removeEventListener("mouseleave",H),ae.removeEventListener("mouseenter",K),ae.removeEventListener("mouseleave",M))}}},[c,d,e,m,y,Y,J,U,r,n,E,b,C,j,o,W,R]),Eo(()=>{var I;if(d&&n&&(I=j.current)!=null&&(I=I.__options)!=null&&I.blockPointerEvents&&G()){N.current=!0;const H=c.floating;if(wn(c.domReference)&&H){var $;const K=tl(c.floating).body;K.setAttribute(UE,"");const M=c.domReference,F=b==null||($=b.nodesRef.current.find(ae=>ae.id===S))==null||($=$.context)==null?void 0:$.elements.floating;return F&&(F.style.pointerEvents=""),K.style.pointerEvents="none",M.style.pointerEvents="auto",H.style.pointerEvents="auto",()=>{K.style.pointerEvents="",M.style.pointerEvents="",H.style.pointerEvents=""}}}},[d,n,S,c,b,j,G]),Eo(()=>{n||(T.current=void 0,B.current=!1,J(),U())},[n,J,U]),v.useEffect(()=>()=>{J(),_i(_),_i(L),U()},[d,c.domReference,J,U]);const O=v.useMemo(()=>{function I($){T.current=$.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove($){const{nativeEvent:H}=$;function K(){!A.current&&!E.current&&r(!0,H,"hover")}m&&!Dx(T.current)||n||zy(R.current)===0||B.current&&$.movementX**2+$.movementY**2<2||(_i(L),T.current==="touch"?K():(B.current=!0,L.current=window.setTimeout(K,zy(R.current))))}}},[m,r,n,E,R]);return v.useMemo(()=>d?{reference:O}:{},[d,O])}const Px=()=>{},j_=v.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Px,setState:Px,isInstantPhase:!1}),mL=()=>v.useContext(j_);function gL(e){const{children:t,delay:n,timeoutMs:r=0}=e,[o,s]=v.useReducer((f,p)=>({...f,...p}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=v.useRef(null),d=v.useCallback(f=>{s({currentId:f})},[]);return Eo(()=>{o.currentId?c.current===null?c.current=o.currentId:o.isInstantPhase||s({isInstantPhase:!0}):(o.isInstantPhase&&s({isInstantPhase:!1}),c.current=null)},[o.currentId,o.isInstantPhase]),a.jsx(j_.Provider,{value:v.useMemo(()=>({...o,setState:s,setCurrentId:d}),[o,d]),children:t})}function vL(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:s,enabled:c=!0}=t,d=s??o,f=mL(),{currentId:p,setCurrentId:m,initialDelay:g,setState:y,timeoutMs:b}=f;return Eo(()=>{c&&p&&(y({delay:{open:1,close:up(g,"close")}}),p!==d&&r(!1))},[c,d,r,y,p,g]),Eo(()=>{function S(){r(!1),y({delay:g,currentId:null})}if(c&&p&&!n&&p===d){if(b){const j=window.setTimeout(S,b);return()=>{clearTimeout(j)}}S()}},[c,n,y,p,d,r,g,b]),Eo(()=>{c&&(m===Px||!n||m(d))},[c,n,m,d]),f}const yL={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},xL={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},BE=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function bL(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:c=!0,escapeKey:d=!0,outsidePress:f=!0,outsidePressEvent:p="pointerdown",referencePress:m=!1,referencePressEvent:g="pointerdown",ancestorScroll:y=!1,bubbles:b,capture:S}=t,j=Lb(),C=wo(typeof f=="function"?f:()=>!1),E=typeof f=="function"?C:f,R=v.useRef(!1),{escapeKey:T,outsidePress:_}=BE(b),{escapeKey:k,outsidePress:L}=BE(S),A=v.useRef(!1),N=wo(U=>{var W;if(!n||!c||!d||U.key!=="Escape"||A.current)return;const O=(W=s.current.floatingContext)==null?void 0:W.nodeId,I=j?lp(j.nodesRef.current,O):[];if(!T&&(U.stopPropagation(),I.length>0)){let $=!0;if(I.forEach(H=>{var K;if((K=H.context)!=null&&K.open&&!H.context.dataRef.current.__escapeKeyBubbles){$=!1;return}}),!$)return}r(!1,h9(U)?U.nativeEvent:U,"escape-key")}),z=wo(U=>{var W;const O=()=>{var I;N(U),(I=Ac(U))==null||I.removeEventListener("keydown",O)};(W=Ac(U))==null||W.addEventListener("keydown",O)}),B=wo(U=>{var W;const O=s.current.insideReactTree;s.current.insideReactTree=!1;const I=R.current;if(R.current=!1,p==="click"&&I||O||typeof E=="function"&&!E(U))return;const $=Ac(U),H="["+Ib("inert")+"]",K=tl(o.floating).querySelectorAll(H);let M=wn($)?$:null;for(;M&&!pa(M);){const xe=ga(M);if(pa(xe)||!wn(xe))break;M=xe}if(K.length&&wn($)&&!c9($)&&!Rd($,o.floating)&&Array.from(K).every(xe=>!Rd(M,xe)))return;if(di($)&&J){const xe=pa($),Se=Ni($),Ce=/auto|scroll/,Ke=xe||Ce.test(Se.overflowX),Ae=xe||Ce.test(Se.overflowY),dt=Ke&&$.clientWidth>0&&$.scrollWidth>$.clientWidth,Ct=Ae&&$.clientHeight>0&&$.scrollHeight>$.clientHeight,ot=Se.direction==="rtl",it=Ct&&(ot?U.offsetX<=$.offsetWidth-$.clientWidth:U.offsetX>$.clientWidth),pt=dt&&U.offsetY>$.clientHeight;if(it||pt)return}const F=(W=s.current.floatingContext)==null?void 0:W.nodeId,ae=j&&lp(j.nodesRef.current,F).some(xe=>{var Se;return My(U,(Se=xe.context)==null?void 0:Se.elements.floating)});if(My(U,o.floating)||My(U,o.domReference)||ae)return;const de=j?lp(j.nodesRef.current,F):[];if(de.length>0){let xe=!0;if(de.forEach(Se=>{var Ce;if((Ce=Se.context)!=null&&Ce.open&&!Se.context.dataRef.current.__outsidePressBubbles){xe=!1;return}}),!xe)return}r(!1,U,"outside-press")}),G=wo(U=>{var W;const O=()=>{var I;B(U),(I=Ac(U))==null||I.removeEventListener(p,O)};(W=Ac(U))==null||W.addEventListener(p,O)});v.useEffect(()=>{if(!n||!c)return;s.current.__escapeKeyBubbles=T,s.current.__outsidePressBubbles=_;let U=-1;function W(K){r(!1,K,"ancestor-scroll")}function O(){window.clearTimeout(U),A.current=!0}function I(){U=window.setTimeout(()=>{A.current=!1},om()?5:0)}const $=tl(o.floating);d&&($.addEventListener("keydown",k?z:N,k),$.addEventListener("compositionstart",O),$.addEventListener("compositionend",I)),E&&$.addEventListener(p,L?G:B,L);let H=[];return y&&(wn(o.domReference)&&(H=ma(o.domReference)),wn(o.floating)&&(H=H.concat(ma(o.floating))),!wn(o.reference)&&o.reference&&o.reference.contextElement&&(H=H.concat(ma(o.reference.contextElement)))),H=H.filter(K=>{var M;return K!==((M=$.defaultView)==null?void 0:M.visualViewport)}),H.forEach(K=>{K.addEventListener("scroll",W,{passive:!0})}),()=>{d&&($.removeEventListener("keydown",k?z:N,k),$.removeEventListener("compositionstart",O),$.removeEventListener("compositionend",I)),E&&$.removeEventListener(p,L?G:B,L),H.forEach(K=>{K.removeEventListener("scroll",W)}),window.clearTimeout(U)}},[s,o,d,E,p,n,r,y,c,T,_,N,k,z,B,L,G]),v.useEffect(()=>{s.current.insideReactTree=!1},[s,E,p]);const Y=v.useMemo(()=>({onKeyDown:N,...m&&{[yL[g]]:U=>{r(!1,U.nativeEvent,"reference-press")},...g!=="click"&&{onClick(U){r(!1,U.nativeEvent,"reference-press")}}}}),[N,r,m,g]),J=v.useMemo(()=>({onKeyDown:N,onMouseDown(){R.current=!0},onMouseUp(){R.current=!0},[xL[p]]:()=>{s.current.insideReactTree=!0}}),[N,p,s]);return v.useMemo(()=>c?{reference:Y,floating:J}:{},[c,Y,J])}function SL(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=w_(),s=v.useRef({}),[c]=v.useState(()=>dL()),d=Mb()!=null,[f,p]=v.useState(r.reference),m=wo((b,S,j)=>{s.current.openEvent=b?S:void 0,c.emit("openchange",{open:b,event:S,reason:j,nested:d}),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:o,refs:g}),[t,m,y,c,o,g])}function zb(e){e===void 0&&(e={});const{nodeId:t}=e,n=SL({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,c]=v.useState(null),[d,f]=v.useState(null),m=o?.domReference||s,g=v.useRef(null),y=Lb();Eo(()=>{m&&(g.current=m)},[m]);const b=nL({...e,elements:{...o,...d&&{reference:d}}}),S=v.useCallback(T=>{const _=wn(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),getClientRects:()=>T.getClientRects(),contextElement:T}:T;f(_),b.refs.setReference(_)},[b.refs]),j=v.useCallback(T=>{(wn(T)||T===null)&&(g.current=T,c(T)),(wn(b.refs.reference.current)||b.refs.reference.current===null||T!==null&&!wn(T))&&b.refs.setReference(T)},[b.refs]),C=v.useMemo(()=>({...b.refs,setReference:j,setPositionReference:S,domReference:g}),[b.refs,j,S]),E=v.useMemo(()=>({...b.elements,domReference:m}),[b.elements,m]),R=v.useMemo(()=>({...b,...r,refs:C,elements:E,nodeId:t}),[b,C,E,t,r]);return Eo(()=>{r.dataRef.current.floatingContext=R;const T=y?.nodesRef.current.find(_=>_.id===t);T&&(T.context=R)}),v.useMemo(()=>({...b,context:R,refs:C,elements:E}),[b,C,E,R])}function $y(){return a9()&&o9()}function wL(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:c}=e,{enabled:d=!0,visibleOnly:f=!0}=t,p=v.useRef(!1),m=v.useRef(-1),g=v.useRef(!0);v.useEffect(()=>{if(!d)return;const b=Qr(c.domReference);function S(){!n&&di(c.domReference)&&c.domReference===TE(tl(c.domReference))&&(p.current=!0)}function j(){g.current=!0}function C(){g.current=!1}return b.addEventListener("blur",S),$y()&&(b.addEventListener("keydown",j,!0),b.addEventListener("pointerdown",C,!0)),()=>{b.removeEventListener("blur",S),$y()&&(b.removeEventListener("keydown",j,!0),b.removeEventListener("pointerdown",C,!0))}},[c.domReference,n,d]),v.useEffect(()=>{if(!d)return;function b(S){let{reason:j}=S;(j==="reference-press"||j==="escape-key")&&(p.current=!0)}return o.on("openchange",b),()=>{o.off("openchange",b)}},[o,d]),v.useEffect(()=>()=>{_i(m)},[]);const y=v.useMemo(()=>({onMouseLeave(){p.current=!1},onFocus(b){if(p.current)return;const S=Ac(b.nativeEvent);if(f&&wn(S)){if($y()&&!b.relatedTarget){if(!g.current&&!u9(S))return}else if(!d9(S))return}r(!0,b.nativeEvent,"focus")},onBlur(b){p.current=!1;const S=b.relatedTarget,j=b.nativeEvent,C=wn(S)&&S.hasAttribute(Ib("focus-guard"))&&S.getAttribute("data-type")==="outside";m.current=window.setTimeout(()=>{var E;const R=TE(c.domReference?c.domReference.ownerDocument:document);!S&&R===c.domReference||Rd((E=s.current.floatingContext)==null?void 0:E.refs.floating.current,R)||Rd(c.domReference,R)||C||r(!1,j,"focus")})}}),[s,c.domReference,r,f]);return v.useMemo(()=>d?{reference:y}:{},[d,y])}function Uy(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[LE]:c,[IE]:d,...f}=e;s=f}return{...n==="floating"&&{tabIndex:-1,[aL]:""},...s,...t.map(c=>{const d=c?c[n]:null;return typeof d=="function"?e?d(e):null:d}).concat(e).reduce((c,d)=>(d&&Object.entries(d).forEach(f=>{let[p,m]=f;if(!(o&&[LE,IE].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 jL(e){e===void 0&&(e=[]);const t=e.map(d=>d?.reference),n=e.map(d=>d?.floating),r=e.map(d=>d?.item),o=v.useCallback(d=>Uy(d,e,"reference"),t),s=v.useCallback(d=>Uy(d,e,"floating"),n),c=v.useCallback(d=>Uy(d,e,"item"),r);return v.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:c}),[o,s,c])}const CL=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function EL(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:s,floatingId:c}=e,{enabled:d=!0,role:f="dialog"}=t,p=w_(),m=((n=s.domReference)==null?void 0:n.id)||p,g=v.useMemo(()=>{var R;return((R=f9(s.floating))==null?void 0:R.id)||c},[s.floating,c]),y=(r=CL.get(f))!=null?r:f,S=Mb()!=null,j=v.useMemo(()=>y==="tooltip"||f==="label"?{["aria-"+(f==="label"?"labelledby":"describedby")]:o?g:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":y==="alertdialog"?"dialog":y,"aria-controls":o?g:void 0,...y==="listbox"&&{role:"combobox"},...y==="menu"&&{id:m},...y==="menu"&&S&&{role:"menuitem"},...f==="select"&&{"aria-autocomplete":"none"},...f==="combobox"&&{"aria-autocomplete":"list"}},[y,g,S,o,m,f]),C=v.useMemo(()=>{const R={id:g,...y&&{role:y}};return y==="tooltip"||f==="label"?R:{...R,...y==="menu"&&{"aria-labelledby":m}}},[y,g,m,f]),E=v.useCallback(R=>{let{active:T,selected:_}=R;const k={role:"option",...T&&{id:g+"-fui-option"}};switch(f){case"select":case"combobox":return{...k,"aria-selected":_}}return{}},[g,f]);return v.useMemo(()=>d?{reference:j,floating:C,item:E}:{},[d,j,C,E])}const[TL,Li]=Er("ScrollArea.Root component was not found in tree");function Uc(e,t){const n=Xs(t);Jc(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const RL=v.forwardRef((e,t)=>{const{style:n,...r}=e,o=Li(),[s,c]=v.useState(0),[d,f]=v.useState(0),p=!!(s&&d);return Uc(o.scrollbarX,()=>{const m=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(m),f(m)}),Uc(o.scrollbarY,()=>{const m=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(m),c(m)}),p?a.jsx("div",{...r,ref:t,style:{...n,width:s,height:d}}):null}),_L=v.forwardRef((e,t)=>{const n=Li(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?a.jsx(RL,{...e,ref:t}):null}),AL={scrollHideDelay:1e3,type:"hover"},C_=v.forwardRef((e,t)=>{const{type:n,scrollHideDelay:r,scrollbars:o,getStyles:s,...c}=oe("ScrollAreaRoot",AL,e),[d,f]=v.useState(null),[p,m]=v.useState(null),[g,y]=v.useState(null),[b,S]=v.useState(null),[j,C]=v.useState(null),[E,R]=v.useState(0),[T,_]=v.useState(0),[k,L]=v.useState(!1),[A,N]=v.useState(!1),z=$n(t,B=>f(B));return a.jsx(TL,{value:{type:n,scrollHideDelay:r,scrollArea:d,viewport:p,onViewportChange:m,content:g,onContentChange:y,scrollbarX:b,onScrollbarXChange:S,scrollbarXEnabled:k,onScrollbarXEnabledChange:L,scrollbarY:j,onScrollbarYChange:C,scrollbarYEnabled:A,onScrollbarYEnabledChange:N,onCornerWidthChange:R,onCornerHeightChange:_,getStyles:s},children:a.jsx(ce,{...c,ref:z,__vars:{"--sa-corner-width":o!=="xy"?"0px":`${E}px`,"--sa-corner-height":o!=="xy"?"0px":`${T}px`}})})});C_.displayName="@mantine/core/ScrollAreaRoot";function E_(e,t){const n=e/t;return Number.isNaN(n)?0:n}function lm(e){const t=E_(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function T_(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 DL(e,[t,n]){return Math.min(n,Math.max(t,e))}function VE(e,t,n="ltr"){const r=lm(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,c=t.content-t.viewport,d=s-r,f=n==="ltr"?[0,c]:[c*-1,0],p=DL(e,f);return T_([0,c],[0,d])(p)}function kL(e,t,n,r="ltr"){const o=lm(n),s=o/2,c=t||s,d=o-c,f=n.scrollbar.paddingStart+c,p=n.scrollbar.size-n.scrollbar.paddingEnd-d,m=n.content-n.viewport,g=r==="ltr"?[0,m]:[m*-1,0];return T_([f,p],g)(e)}function R_(e,t){return e>0&&e<t}function us(e){return e?parseInt(e,10):0}function ll(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e?.(r),(n===!1||!r.defaultPrevented)&&t?.(r)}}const[PL,__]=Er("ScrollAreaScrollbar was not found in tree"),A_=v.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:p,onResize:m,...g}=e,y=Li(),[b,S]=v.useState(null),j=$n(t,N=>S(N)),C=v.useRef(null),E=v.useRef(""),{viewport:R}=y,T=n.content-n.viewport,_=Xs(p),k=Xs(d),L=Zp(m,10),A=N=>{if(C.current){const z=N.clientX-C.current.left,B=N.clientY-C.current.top;f({x:z,y:B})}};return v.useEffect(()=>{const N=z=>{const B=z.target;b?.contains(B)&&_(z,T)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[R,b,T,_]),v.useEffect(k,[n,k]),Uc(b,L),Uc(y.content,L),a.jsx(PL,{value:{scrollbar:b,hasThumb:r,onThumbChange:Xs(o),onThumbPointerUp:Xs(s),onThumbPositionChange:k,onThumbPointerDown:Xs(c)},children:a.jsx("div",{...g,ref:j,"data-mantine-scrollbar":!0,style:{position:"absolute",...g.style},onPointerDown:ll(e.onPointerDown,N=>{N.preventDefault(),N.button===0&&(N.target.setPointerCapture(N.pointerId),C.current=b.getBoundingClientRect(),E.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",A(N))}),onPointerMove:ll(e.onPointerMove,A),onPointerUp:ll(e.onPointerUp,N=>{const z=N.target;z.hasPointerCapture(N.pointerId)&&(N.preventDefault(),z.releasePointerCapture(N.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=E.current,C.current=null}})})}),D_=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...s}=e,c=Li(),[d,f]=v.useState(),p=v.useRef(null),m=$n(t,p,c.onScrollbarXChange);return v.useEffect(()=>{p.current&&f(getComputedStyle(p.current))},[p]),a.jsx(A_,{"data-orientation":"horizontal",...s,ref:m,sizes:n,style:{...o,"--sa-thumb-width":`${lm(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),R_(b,y)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&d&&r({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:us(d.paddingLeft),paddingEnd:us(d.paddingRight)}})}})});D_.displayName="@mantine/core/ScrollAreaScrollbarX";const k_=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...s}=e,c=Li(),[d,f]=v.useState(),p=v.useRef(null),m=$n(t,p,c.onScrollbarYChange);return v.useEffect(()=>{p.current&&f(window.getComputedStyle(p.current))},[]),a.jsx(A_,{...s,"data-orientation":"vertical",ref:m,sizes:n,style:{"--sa-thumb-height":`${lm(n)}px`,...o},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),R_(b,y)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&d&&r({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:us(d.paddingTop),paddingEnd:us(d.paddingBottom)}})}})});k_.displayName="@mantine/core/ScrollAreaScrollbarY";const cm=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:o}=xs(),s=Li(),c=v.useRef(null),d=v.useRef(0),[f,p]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=E_(f.viewport,f.content),g={...r,sizes:f,onSizesChange:p,hasThumb:m>0&&m<1,onThumbChange:b=>{c.current=b},onThumbPointerUp:()=>{d.current=0},onThumbPointerDown:b=>{d.current=b}},y=(b,S)=>kL(b,d.current,f,S);return n==="horizontal"?a.jsx(D_,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&c.current){const b=s.viewport.scrollLeft,S=VE(b,f,o);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,o))}}):n==="vertical"?a.jsx(k_,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&c.current){const b=s.viewport.scrollTop,S=VE(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});cm.displayName="@mantine/core/ScrollAreaScrollbarVisible";const $b=v.forwardRef((e,t)=>{const n=Li(),{forceMount:r,...o}=e,[s,c]=v.useState(!1),d=e.orientation==="horizontal",f=Zp(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;c(d?p:m)}},10);return Uc(n.viewport,f),Uc(n.content,f),r||s?a.jsx(cm,{"data-state":s?"visible":"hidden",...o,ref:t}):null});$b.displayName="@mantine/core/ScrollAreaScrollbarAuto";const P_=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Li(),[s,c]=v.useState(!1);return v.useEffect(()=>{const{scrollArea:d}=o;let f=0;if(d){const p=()=>{window.clearTimeout(f),c(!0)},m=()=>{f=window.setTimeout(()=>c(!1),o.scrollHideDelay)};return d.addEventListener("pointerenter",p),d.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),d.removeEventListener("pointerenter",p),d.removeEventListener("pointerleave",m)}}},[o.scrollArea,o.scrollHideDelay]),n||s?a.jsx($b,{"data-state":s?"visible":"hidden",...r,ref:t}):null});P_.displayName="@mantine/core/ScrollAreaScrollbarHover";const NL=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Li(),s=e.orientation==="horizontal",[c,d]=v.useState("hidden"),f=Zp(()=>d("idle"),100);return v.useEffect(()=>{if(c==="idle"){const p=window.setTimeout(()=>d("hidden"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[c,o.scrollHideDelay]),v.useEffect(()=>{const{viewport:p}=o,m=s?"scrollLeft":"scrollTop";if(p){let g=p[m];const y=()=>{const b=p[m];g!==b&&(d("scrolling"),f()),g=b};return p.addEventListener("scroll",y),()=>p.removeEventListener("scroll",y)}},[o.viewport,s,f]),n||c!=="hidden"?a.jsx(cm,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ll(e.onPointerEnter,()=>d("interacting")),onPointerLeave:ll(e.onPointerLeave,()=>d("idle"))}):null}),Nx=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Li(),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:c}=o,d=e.orientation==="horizontal";return v.useEffect(()=>(d?s(!0):c(!0),()=>{d?s(!1):c(!1)}),[d,s,c]),o.type==="hover"?a.jsx(P_,{...r,ref:t,forceMount:n}):o.type==="scroll"?a.jsx(NL,{...r,ref:t,forceMount:n}):o.type==="auto"?a.jsx($b,{...r,ref:t,forceMount:n}):o.type==="always"?a.jsx(cm,{...r,ref:t}):null});Nx.displayName="@mantine/core/ScrollAreaScrollbar";function OL(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function o(){const s={left:e.scrollLeft,top:e.scrollTop},c=n.left!==s.left,d=n.top!==s.top;(c||d)&&t(),n=s,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)}const N_=v.forwardRef((e,t)=>{const{style:n,...r}=e,o=Li(),s=__(),{onThumbPositionChange:c}=s,d=$n(t,m=>s.onThumbChange(m)),f=v.useRef(void 0),p=Zp(()=>{f.current&&(f.current(),f.current=void 0)},100);return v.useEffect(()=>{const{viewport:m}=o;if(m){const g=()=>{if(p(),!f.current){const y=OL(m,c);f.current=y,c()}};return c(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[o.viewport,p,c]),a.jsx("div",{"data-state":s.hasThumb?"visible":"hidden",...r,ref:d,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:ll(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:ll(e.onPointerUp,s.onThumbPointerUp)})});N_.displayName="@mantine/core/ScrollAreaThumb";const Ox=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=__();return n||o.hasThumb?a.jsx(N_,{ref:t,...r}):null});Ox.displayName="@mantine/core/ScrollAreaThumb";const O_=v.forwardRef(({children:e,style:t,...n},r)=>{const o=Li(),s=$n(r,o.onViewportChange);return a.jsx(ce,{...n,ref:s,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t},children:a.jsx("div",{...o.getStyles("content"),ref:o.onContentChange,children:e})})});O_.displayName="@mantine/core/ScrollAreaViewport";var Ub={root:"m_d57069b5",content:"m_b1336c6",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const M_={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},ML=(e,{scrollbarSize:t,overscrollBehavior:n})=>({root:{"--scrollarea-scrollbar-size":le(t),"--scrollarea-over-scroll-behavior":n}}),Yr=ge((e,t)=>{const n=oe("ScrollArea",M_,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,scrollbarSize:f,vars:p,type:m,scrollHideDelay:g,viewportProps:y,viewportRef:b,onScrollPositionChange:S,children:j,offsetScrollbars:C,scrollbars:E,onBottomReached:R,onTopReached:T,overscrollBehavior:_,attributes:k,...L}=n,[A,N]=v.useState(!1),[z,B]=v.useState(!1),[G,Y]=v.useState(!1),J=Ie({name:"ScrollArea",props:n,classes:Ub,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:k,vars:p,varsResolver:ML}),U=v.useRef(null),W=S_([b,U]);return v.useEffect(()=>{if(!U.current||C!=="present")return;const O=U.current,I=new ResizeObserver(()=>{const{scrollHeight:$,clientHeight:H,scrollWidth:K,clientWidth:M}=O;B($>H),Y(K>M)});return I.observe(O),()=>I.disconnect()},[U,C]),a.jsxs(C_,{getStyles:J,type:m==="never"?"always":m,scrollHideDelay:g,ref:t,scrollbars:E,...J("root"),...L,children:[a.jsx(O_,{...y,...J("viewport",{style:y?.style}),ref:W,"data-offset-scrollbars":C===!0?"xy":C||void 0,"data-scrollbars":E||void 0,"data-horizontal-hidden":C==="present"&&!G?"true":void 0,"data-vertical-hidden":C==="present"&&!z?"true":void 0,onScroll:O=>{y?.onScroll?.(O),S?.({x:O.currentTarget.scrollLeft,y:O.currentTarget.scrollTop});const{scrollTop:I,scrollHeight:$,clientHeight:H}=O.currentTarget;I-($-H)>=-.6&&R?.(),I===0&&T?.()},children:j}),(E==="xy"||E==="x")&&a.jsx(Nx,{...J("scrollbar"),orientation:"horizontal","data-hidden":m==="never"||C==="present"&&!G?!0:void 0,forceMount:!0,onMouseEnter:()=>N(!0),onMouseLeave:()=>N(!1),children:a.jsx(Ox,{...J("thumb")})}),(E==="xy"||E==="y")&&a.jsx(Nx,{...J("scrollbar"),orientation:"vertical","data-hidden":m==="never"||C==="present"&&!z?!0:void 0,forceMount:!0,onMouseEnter:()=>N(!0),onMouseLeave:()=>N(!1),children:a.jsx(Ox,{...J("thumb")})}),a.jsx(_L,{...J("corner"),"data-hovered":A||void 0,"data-hidden":m==="never"||void 0})]})});Yr.displayName="@mantine/core/ScrollArea";const um=ge((e,t)=>{const{children:n,classNames:r,styles:o,scrollbarSize:s,scrollHideDelay:c,type:d,dir:f,offsetScrollbars:p,viewportRef:m,onScrollPositionChange:g,unstyled:y,variant:b,viewportProps:S,scrollbars:j,style:C,vars:E,onBottomReached:R,onTopReached:T,onOverflowChange:_,...k}=oe("ScrollAreaAutosize",M_,e),L=v.useRef(null),A=S_([m,L]),[N,z]=v.useState(!1),B=v.useRef(!1);return v.useEffect(()=>{if(!_)return;const G=L.current;if(!G)return;const Y=()=>{const U=G.scrollHeight>G.clientHeight;U!==N&&(B.current?_?.(U):(B.current=!0,U&&_?.(!0)),z(U))};Y();const J=new ResizeObserver(Y);return J.observe(G),()=>J.disconnect()},[_,N]),a.jsx(ce,{...k,ref:t,style:[{display:"flex",overflow:"hidden"},C],children:a.jsx(ce,{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden",...j==="y"&&{minWidth:0},...j==="x"&&{minHeight:0},...j==="xy"&&{minWidth:0,minHeight:0},...j===!1&&{minWidth:0,minHeight:0}},children:a.jsx(Yr,{classNames:r,styles:o,scrollHideDelay:c,scrollbarSize:s,type:d,dir:f,offsetScrollbars:p,viewportRef:A,onScrollPositionChange:g,unstyled:y,variant:b,viewportProps:S,vars:E,scrollbars:j,onBottomReached:R,onTopReached:T,"data-autosize":"true",children:n})})})});Yr.classes=Ub;um.displayName="@mantine/core/ScrollAreaAutosize";um.classes=Ub;Yr.Autosize=um;var L_={root:"m_87cf2631"};const LL={__staticSelector:"UnstyledButton"},In=or((e,t)=>{const n=oe("UnstyledButton",LL,e),{className:r,component:o="button",__staticSelector:s,unstyled:c,classNames:d,styles:f,style:p,attributes:m,...g}=n,y=Ie({name:s,props:n,classes:L_,className:r,style:p,classNames:d,styles:f,unstyled:c,attributes:m});return a.jsx(ce,{...y("root",{focusable:!0}),component:o,ref:t,type:o==="button"?"button":void 0,...g})});In.classes=L_;In.displayName="@mantine/core/UnstyledButton";var I_={root:"m_515a97f8"};const Bb=ge((e,t)=>{const n=oe("VisuallyHidden",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,attributes:p,...m}=n,g=Ie({name:"VisuallyHidden",classes:I_,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:p});return a.jsx(ce,{component:"span",ref:t,...g("root"),...m})});Bb.classes=I_;Bb.displayName="@mantine/core/VisuallyHidden";var z_={root:"m_1b7284a3"};const IL=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:Ht(t),"--paper-shadow":xb(n)}}),Nr=or((e,t)=>{const n=oe("Paper",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,withBorder:f,vars:p,radius:m,shadow:g,variant:y,mod:b,attributes:S,...j}=n,C=Ie({name:"Paper",props:n,classes:z_,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:S,vars:p,varsResolver:IL});return a.jsx(ce,{ref:t,mod:[{"data-with-border":f},b],...C("root"),variant:y,...j})});Nr.classes=z_;Nr.displayName="@mantine/core/Paper";function FE(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function HE(e,t,n,r,o){return e==="center"||r==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:n}:e==="start"?{[o==="ltr"?"left":"right"]:n}:{}}const zL={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function $L({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:s,arrowY:c,dir:d}){const[f,p="center"]=e.split("-"),m={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[zL[f]]:r},g=-t/2;return f==="left"?{...m,...FE(p,c,n,o),right:g,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:f==="right"?{...m,...FE(p,c,n,o),left:g,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:f==="top"?{...m,...HE(p,s,n,o,d),bottom:g,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:f==="bottom"?{...m,...HE(p,s,n,o,d),top:g,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const Tp=v.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,visible:s,arrowX:c,arrowY:d,style:f,...p},m)=>{const{dir:g}=xs();return s?a.jsx("div",{...p,ref:m,style:{...f,...$L({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,dir:g,arrowX:c,arrowY:d})}}):null});Tp.displayName="@mantine/core/FloatingArrow";function $_(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),o=n==="right"?"left":"right";return r===void 0?o:`${o}-${r}`}return t}var U_={root:"m_9814e45f"};const UL={zIndex:Lr("modal")},BL=(e,{gradient:t,color:n,backgroundOpacity:r,blur:o,radius:s,zIndex:c})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&Ai(n||"#000",r??.6)||void 0,"--overlay-filter":o?`blur(${le(o)})`:void 0,"--overlay-radius":s===void 0?void 0:Ht(s),"--overlay-z-index":c?.toString()}}),Bc=or((e,t)=>{const n=oe("Overlay",UL,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,fixed:p,center:m,children:g,radius:y,zIndex:b,gradient:S,blur:j,color:C,backgroundOpacity:E,mod:R,attributes:T,..._}=n,k=Ie({name:"Overlay",props:n,classes:U_,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:T,vars:f,varsResolver:BL});return a.jsx(ce,{ref:t,...k("root"),mod:[{center:m,fixed:p},R],..._,children:g})});Bc.classes=U_;Bc.displayName="@mantine/core/Overlay";function By(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 VL({target:e,reuseTargetNode:t,...n}){if(e)return typeof e=="string"?document.querySelector(e)||By(n):e;if(t){const r=document.querySelector("[data-mantine-shared-portal-node]");if(r)return r;const o=By(n);return o.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(o),o}return By(n)}const FL={reuseTargetNode:!0},B_=ge((e,t)=>{const{children:n,target:r,reuseTargetNode:o,...s}=oe("Portal",FL,e),[c,d]=v.useState(!1),f=v.useRef(null);return Jc(()=>(d(!0),f.current=VL({target:r,reuseTargetNode:o,...s}),Cd(t,f.current),!r&&!o&&f.current&&document.body.appendChild(f.current),()=>{!r&&!o&&f.current&&document.body.removeChild(f.current)}),[r]),!c||!f.current?null:Rb.createPortal(a.jsx(a.Fragment,{children:n}),f.current)});B_.displayName="@mantine/core/Portal";const va=ge(({withinPortal:e=!0,children:t,...n},r)=>nm()==="test"||!e?a.jsx(a.Fragment,{children:t}):a.jsx(B_,{ref:r,...n,children:t}));va.displayName="@mantine/core/OptionalPortal";const ld=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),Gh={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:{...ld("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...ld("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...ld("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...ld("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...ld("top"),common:{transformOrigin:"top right"}}},qE={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function HL({transition:e,state:t,duration:n,timingFunction:r}){const o={WebkitBackfaceVisibility:"hidden",transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in Gh?{transitionProperty:Gh[e].transitionProperty,...o,...Gh[e].common,...Gh[e][qE[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[qE[t]]}}function qL({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:s,onEntered:c,onExited:d,enterDelay:f,exitDelay:p}){const m=En(),g=Sb(),y=m.respectReducedMotion?g:!1,[b,S]=v.useState(y?0:e),[j,C]=v.useState(r?"entered":"exited"),E=v.useRef(-1),R=v.useRef(-1),T=v.useRef(-1);function _(){window.clearTimeout(E.current),window.clearTimeout(R.current),cancelAnimationFrame(T.current)}const k=A=>{_();const N=A?o:s,z=A?c:d,B=y?0:A?e:t;S(B),B===0?(typeof N=="function"&&N(),typeof z=="function"&&z(),C(A?"entered":"exited")):T.current=requestAnimationFrame(()=>{md.flushSync(()=>{C(A?"pre-entering":"pre-exiting")}),T.current=requestAnimationFrame(()=>{typeof N=="function"&&N(),C(A?"entering":"exiting"),E.current=window.setTimeout(()=>{typeof z=="function"&&z(),C(A?"entered":"exited")},B)})})},L=A=>{if(_(),typeof(A?f:p)!="number"){k(A);return}R.current=window.setTimeout(()=>{k(A)},A?f:p)};return hs(()=>{L(r)},[r]),v.useEffect(()=>()=>{_()},[]),{transitionDuration:b,transitionStatus:j,transitionTimingFunction:n||"ease"}}function to({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:o,children:s,timingFunction:c="ease",onExit:d,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:y}){const b=nm(),{transitionDuration:S,transitionStatus:j,transitionTimingFunction:C}=qL({mounted:o,exitDuration:r,duration:n,timingFunction:c,onExit:d,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:y});return S===0||b==="test"?o?a.jsx(a.Fragment,{children:s({})}):e?s({display:"none"}):null:j==="exited"?e?s({display:"none"}):null:a.jsx(a.Fragment,{children:s(HL({transition:t,duration:S,state:j,timingFunction:C}))})}to.displayName="@mantine/core/Transition";const[GL,V_]=Er("Popover component was not found in the tree");function dm({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const o=o4(t),s=$n(o,r);return Io(e)?v.cloneElement(e,{[n]:s}):e}function F_(e){return a.jsx(Bb,{tabIndex:-1,"data-autofocus":!0,...e})}dm.displayName="@mantine/core/FocusTrap";F_.displayName="@mantine/core/FocusTrapInitialFocus";dm.InitialFocus=F_;var H_={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const Vb=ge((e,t)=>{const n=oe("PopoverDropdown",null,e),{className:r,style:o,vars:s,children:c,onKeyDownCapture:d,variant:f,classNames:p,styles:m,...g}=n,y=V_(),b=H2({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:a.jsx(va,{...y.portalProps,withinPortal:y.withinPortal,children:a.jsx(to,{mounted:y.opened,...y.transitionProps,transition:y.transitionProps?.transition||"fade",duration:y.transitionProps?.duration??150,keepMounted:y.keepMounted,exitDuration:typeof y.transitionProps?.exitDuration=="number"?y.transitionProps.exitDuration:y.transitionProps?.duration,children:C=>a.jsx(dm,{active:y.trapFocus&&y.opened,innerRef:j,children:a.jsxs(ce,{...S,...g,variant:f,onKeyDownCapture:GM(()=>{y.onClose?.(),y.onDismiss?.()},{active:y.closeOnEscape,onTrigger:b,onKeyDown:d}),"data-position":y.placement,"data-fixed":y.floatingStrategy==="fixed"||void 0,...y.getStyles("dropdown",{className:r,props:n,classNames:p,styles:m,style:[{...C,zIndex:y.zIndex,top:y.y??0,left:y.x??0,width:y.width==="target"?void 0:le(y.width),...y.referenceHidden?{display:"none"}:null},y.resolvedStyles.dropdown,m?.dropdown,o]}),children:[c,a.jsx(Tp,{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})})]})})})})});Vb.classes=H_;Vb.displayName="@mantine/core/PopoverDropdown";const QL={refProp:"ref",popupType:"dialog"},q_=ge((e,t)=>{const{children:n,refProp:r,popupType:o,...s}=oe("PopoverTarget",QL,e);if(!Io(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,d=V_(),f=$n(d.reference,em(n),t),p=d.withRoles?{"aria-haspopup":o,"aria-expanded":d.opened,"aria-controls":d.getDropdownId(),id:d.getTargetId()}:{};return v.cloneElement(n,{...c,...p,...d.targetProps,className:$t(d.targetProps.className,c.className,n.props.className),[r]:f,...d.controlled?null:{onClick:()=>{d.onToggle(),n.props.onClick?.()}}})});q_.displayName="@mantine/core/PopoverTarget";function WL(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 YL(e,t,n){const r=WL(e.middlewares),o=[x_(e.offset),oL()];return e.dropdownVisible&&n!=="test"&&e.preventPositionChangeWhenVisible&&(r.flip=!1),r.shift&&o.push(Ob(typeof r.shift=="boolean"?{limiter:ME(),padding:5}:{limiter:ME(),padding:5,...r.shift})),r.flip&&o.push(typeof r.flip=="boolean"?Ep():Ep(r.flip)),r.inline&&o.push(typeof r.inline=="boolean"?bd():bd(r.inline)),o.push(b_({element:e.arrowRef,padding:e.arrowOffset})),(r.size||e.width==="target")&&o.push(iL({...typeof r.size=="boolean"?{}:r.size,apply({rects:s,availableWidth:c,availableHeight:d,...f}){const m=t().refs.floating.current?.style??{};r.size&&(typeof r.size=="object"&&r.size.apply?r.size.apply({rects:s,availableWidth:c,availableHeight:d,...f}):Object.assign(m,{maxWidth:`${c}px`,maxHeight:`${d}px`})),e.width==="target"&&Object.assign(m,{width:`${s.reference.width}px`})}})),o}function KL(e){const t=nm(),[n,r]=tr({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),o=v.useRef(n),s=()=>{n&&!e.disabled&&r(!1)},c=()=>{e.disabled||r(!n)},d=zb({strategy:e.strategy,placement:e.preventPositionChangeWhenVisible?e.positionRef.current:e.position,middleware:YL(e,()=>d,t),whileElementsMounted:e.keepMounted?void 0:kx});return v.useEffect(()=>{if(!(!d.refs.reference.current||!d.refs.floating.current)&&n)return kx(d.refs.reference.current,d.refs.floating.current,d.update)},[n,d.update]),hs(()=>{e.onPositionChange?.(d.placement),e.positionRef.current=d.placement},[d.placement,e.preventPositionChangeWhenVisible]),hs(()=>{n!==o.current&&(n?e.onOpen?.():e.onClose?.()),o.current=n},[n,e.onClose,e.onOpen]),hs(()=>{let f=-1;return n&&(f=window.setTimeout(()=>e.setDropdownVisible(!0),4)),()=>{window.clearTimeout(f)}},[n,e.position]),{floating:d,controlled:typeof e.opened=="boolean",opened:n,onClose:s,onToggle:c}}const XL={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,hideDetached:!0,clickOutsideEvents:["mousedown","touchstart"],zIndex:Lr("popover"),__staticSelector:"Popover",width:"max-content"},JL=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:Ht(t),"--popover-shadow":xb(n)}});function Kr(e){const t=oe("Popover",XL,e),{children:n,position:r,offset:o,onPositionChange:s,positionDependencies:c,opened:d,transitionProps:f,onExitTransitionEnd:p,onEnterTransitionEnd:m,width:g,middlewares:y,withArrow:b,arrowSize:S,arrowOffset:j,arrowRadius:C,arrowPosition:E,unstyled:R,classNames:T,styles:_,closeOnClickOutside:k,withinPortal:L,portalProps:A,closeOnEscape:N,clickOutsideEvents:z,trapFocus:B,onClose:G,onDismiss:Y,onOpen:J,onChange:U,zIndex:W,radius:O,shadow:I,id:$,defaultOpened:H,__staticSelector:K,withRoles:M,disabled:F,returnFocus:ae,variant:de,keepMounted:xe,vars:Se,floatingStrategy:Ce,withOverlay:Ke,overlayProps:Ae,hideDetached:dt,attributes:Ct,preventPositionChangeWhenVisible:ot,...it}=t,pt=Ie({name:K,props:t,classes:H_,classNames:T,styles:_,unstyled:R,attributes:Ct,rootSelector:"dropdown",vars:Se,varsResolver:JL}),{resolvedStyles:Et}=jl({classNames:T,styles:_,props:t}),[wt,Te]=v.useState(d??H??!1),_e=v.useRef(r),Le=v.useRef(null),[Me,lt]=v.useState(null),[nt,ft]=v.useState(null),{dir:pe}=xs(),Ve=nm(),je=mr($),ke=KL({middlewares:y,width:g,position:$_(pe,r),offset:typeof o=="number"?o+(b?S/2:0):o,arrowRef:Le,arrowOffset:j,onPositionChange:s,positionDependencies:c,opened:d,defaultOpened:H,onChange:U,onOpen:J,onClose:G,onDismiss:Y,strategy:Ce,dropdownVisible:wt,setDropdownVisible:Te,positionRef:_e,disabled:F,preventPositionChangeWhenVisible:ot,keepMounted:xe});KM(()=>{k&&(ke.onClose(),Y?.())},z,[Me,nt]);const At=v.useCallback(ln=>{lt(ln),ke.floating.refs.setReference(ln)},[ke.floating.refs.setReference]),gn=v.useCallback(ln=>{ft(ln),ke.floating.refs.setFloating(ln)},[ke.floating.refs.setFloating]),vn=v.useCallback(()=>{f?.onExited?.(),p?.(),Te(!1),ot||(_e.current=r)},[f?.onExited,p,ot,r]),Bn=v.useCallback(()=>{f?.onEntered?.(),m?.()},[f?.onEntered,m]);return a.jsxs(GL,{value:{returnFocus:ae,disabled:F,controlled:ke.controlled,reference:At,floating:gn,x:ke.floating.x,y:ke.floating.y,arrowX:ke.floating?.middlewareData?.arrow?.x,arrowY:ke.floating?.middlewareData?.arrow?.y,opened:ke.opened,arrowRef:Le,transitionProps:{...f,onExited:vn,onEntered:Bn},width:g,withArrow:b,arrowSize:S,arrowOffset:j,arrowRadius:C,arrowPosition:E,placement:ke.floating.placement,trapFocus:B,withinPortal:L,portalProps:A,zIndex:W,radius:O,shadow:I,closeOnEscape:N,onDismiss:Y,onClose:ke.onClose,onToggle:ke.onToggle,getTargetId:()=>`${je}-target`,getDropdownId:()=>`${je}-dropdown`,withRoles:M,targetProps:it,__staticSelector:K,classNames:T,styles:_,unstyled:R,variant:de,keepMounted:xe,getStyles:pt,resolvedStyles:Et,floatingStrategy:Ce,referenceHidden:dt&&Ve!=="test"?ke.floating.middlewareData.hide?.referenceHidden:!1},children:[n,Ke&&a.jsx(to,{transition:"fade",mounted:ke.opened,duration:f?.duration||250,exitDuration:f?.exitDuration||250,children:ln=>a.jsx(va,{withinPortal:L,children:a.jsx(Bc,{...Ae,...pt("overlay",{className:Ae?.className,style:[ln,Ae?.style]})})})})]})}Kr.Target=q_;Kr.Dropdown=Vb;Kr.displayName="@mantine/core/Popover";Kr.extend=e=>e;var Xi={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 G_=v.forwardRef(({className:e,...t},n)=>a.jsxs(ce,{component:"span",className:$t(Xi.barsLoader,e),...t,ref:n,children:[a.jsx("span",{className:Xi.bar}),a.jsx("span",{className:Xi.bar}),a.jsx("span",{className:Xi.bar})]}));G_.displayName="@mantine/core/Bars";const Q_=v.forwardRef(({className:e,...t},n)=>a.jsxs(ce,{component:"span",className:$t(Xi.dotsLoader,e),...t,ref:n,children:[a.jsx("span",{className:Xi.dot}),a.jsx("span",{className:Xi.dot}),a.jsx("span",{className:Xi.dot})]}));Q_.displayName="@mantine/core/Dots";const W_=v.forwardRef(({className:e,...t},n)=>a.jsx(ce,{component:"span",className:$t(Xi.ovalLoader,e),...t,ref:n}));W_.displayName="@mantine/core/Oval";const Y_={bars:G_,oval:W_,dots:Q_},ZL={loaders:Y_,type:"oval"},eI=(e,{size:t,color:n})=>({root:{"--loader-size":st(t,"loader-size"),"--loader-color":n?Kt(n,e):void 0}}),jr=ge((e,t)=>{const n=oe("Loader",ZL,e),{size:r,color:o,type:s,vars:c,className:d,style:f,classNames:p,styles:m,unstyled:g,loaders:y,variant:b,children:S,attributes:j,...C}=n,E=Ie({name:"Loader",props:n,classes:Xi,className:d,style:f,classNames:p,styles:m,unstyled:g,attributes:j,vars:c,varsResolver:eI});return S?a.jsx(ce,{...E("root"),ref:t,...C,children:S}):a.jsx(ce,{...E("root"),ref:t,component:y[s],variant:b,size:r,...C})});jr.defaultLoaders=Y_;jr.classes=Xi;jr.displayName="@mantine/core/Loader";var nu={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const GE={orientation:"horizontal"},tI=(e,{borderWidth:t})=>({group:{"--ai-border-width":le(t)}}),Fb=ge((e,t)=>{const n=oe("ActionIconGroup",GE,e),{className:r,style:o,classNames:s,styles:c,unstyled:d,orientation:f,vars:p,borderWidth:m,variant:g,mod:y,attributes:b,...S}=oe("ActionIconGroup",GE,e),j=Ie({name:"ActionIconGroup",props:n,classes:nu,className:r,style:o,classNames:s,styles:c,unstyled:d,attributes:b,vars:p,varsResolver:tI,rootSelector:"group"});return a.jsx(ce,{...j("group"),ref:t,variant:g,mod:[{"data-orientation":f},y],role:"group",...S})});Fb.classes=nu;Fb.displayName="@mantine/core/ActionIconGroup";const nI=(e,{radius:t,color:n,gradient:r,variant:o,autoContrast:s,size:c})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:s});return{groupSection:{"--section-height":st(c,"section-height"),"--section-padding-x":st(c,"section-padding-x"),"--section-fz":Gn(c),"--section-radius":t===void 0?void 0:Ht(t),"--section-bg":n||o?d.background:void 0,"--section-color":d.color,"--section-bd":n||o?d.border:void 0}}},Hb=ge((e,t)=>{const n=oe("ActionIconGroupSection",null,e),{className:r,style:o,classNames:s,styles:c,unstyled:d,vars:f,variant:p,gradient:m,radius:g,autoContrast:y,attributes:b,...S}=n,j=Ie({name:"ActionIconGroupSection",props:n,classes:nu,className:r,style:o,classNames:s,styles:c,unstyled:d,attributes:b,vars:f,varsResolver:nI,rootSelector:"groupSection"});return a.jsx(ce,{...j("groupSection"),ref:t,variant:p,...S})});Hb.classes=nu;Hb.displayName="@mantine/core/ActionIconGroupSection";const rI=(e,{size:t,radius:n,variant:r,gradient:o,color:s,autoContrast:c})=>{const d=e.variantColorResolver({color:s||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:c});return{root:{"--ai-size":st(t,"ai-size"),"--ai-radius":n===void 0?void 0:Ht(n),"--ai-bg":s||r?d.background:void 0,"--ai-hover":s||r?d.hover:void 0,"--ai-hover-color":s||r?d.hoverColor:void 0,"--ai-color":d.color,"--ai-bd":s||r?d.border:void 0}}},Dn=or((e,t)=>{const n=oe("ActionIcon",null,e),{className:r,unstyled:o,variant:s,classNames:c,styles:d,style:f,loading:p,loaderProps:m,size:g,color:y,radius:b,__staticSelector:S,gradient:j,vars:C,children:E,disabled:R,"data-disabled":T,autoContrast:_,mod:k,attributes:L,...A}=n,N=Ie({name:["ActionIcon",S],props:n,className:r,style:f,classes:nu,classNames:c,styles:d,unstyled:o,attributes:L,vars:C,varsResolver:rI});return a.jsxs(In,{...N("root",{active:!R&&!p&&!T}),...A,unstyled:o,variant:s,size:g,disabled:R||p,ref:t,mod:[{loading:p,disabled:R||T},k],children:[typeof p=="boolean"&&a.jsx(to,{mounted:p,transition:"slide-down",duration:150,children:z=>a.jsx(ce,{component:"span",...N("loader",{style:z}),"aria-hidden":!0,children:a.jsx(jr,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...m})})}),a.jsx(ce,{component:"span",mod:{loading:p},...N("icon"),children:E})]})});Dn.classes=nu;Dn.displayName="@mantine/core/ActionIcon";Dn.Group=Fb;Dn.GroupSection=Hb;const K_=v.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...n},r)=>a.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:a.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"})}));K_.displayName="@mantine/core/CloseIcon";var X_={root:"m_86a44da5","root--subtle":"m_220c80f2"};const iI={variant:"subtle"},oI=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":st(t,"cb-size"),"--cb-radius":n===void 0?void 0:Ht(n),"--cb-icon-size":le(r)}}),bs=or((e,t)=>{const n=oe("CloseButton",iI,e),{iconSize:r,children:o,vars:s,radius:c,className:d,classNames:f,style:p,styles:m,unstyled:g,"data-disabled":y,disabled:b,variant:S,icon:j,mod:C,attributes:E,__staticSelector:R,...T}=n,_=Ie({name:R||"CloseButton",props:n,className:d,style:p,classes:X_,classNames:f,styles:m,unstyled:g,attributes:E,vars:s,varsResolver:oI});return a.jsxs(In,{ref:t,...T,unstyled:g,variant:S,disabled:b,mod:[{disabled:b||y},C],..._("root",{variant:S,active:!b&&!y}),children:[j||a.jsx(K_,{}),o]})});bs.classes=X_;bs.displayName="@mantine/core/CloseButton";function aI(e){return v.Children.toArray(e).filter(Boolean)}var J_={root:"m_4081bf90"};const sI={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},lI=(e,{grow:t,preventGrowOverflow:n,gap:r,align:o,justify:s,wrap:c},{childWidth:d})=>({root:{"--group-child-width":t&&n?d:void 0,"--group-gap":qn(r),"--group-align":o,"--group-justify":s,"--group-wrap":c}}),ye=ge((e,t)=>{const n=oe("Group",sI,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,children:f,gap:p,align:m,justify:g,wrap:y,grow:b,preventGrowOverflow:S,vars:j,variant:C,__size:E,mod:R,attributes:T,..._}=n,k=aI(f),L=k.length,A=qn(p??"md"),z={childWidth:`calc(${100/L}% - (${A} - ${A} / ${L}))`},B=Ie({name:"Group",props:n,stylesCtx:z,className:o,style:s,classes:J_,classNames:r,styles:c,unstyled:d,attributes:T,vars:j,varsResolver:lI});return a.jsx(ce,{...B("root"),ref:t,variant:C,mod:[{grow:b},R],size:E,..._,children:k})});ye.classes=J_;ye.displayName="@mantine/core/Group";const[cI,Ca]=Er("ModalBase component was not found in tree");function uI({opened:e,transitionDuration:t}){const[n,r]=v.useState(e),o=v.useRef(-1),c=Sb()?0:t;return v.useEffect(()=>(e?(r(!0),window.clearTimeout(o.current)):c===0?r(!1):o.current=window.setTimeout(()=>r(!1),c),()=>window.clearTimeout(o.current)),[e,c]),n}function dI({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:o,onClose:s,returnFocus:c}){const d=mr(e),[f,p]=v.useState(!1),[m,g]=v.useState(!1),y=typeof t?.duration=="number"?t?.duration:200,b=uI({opened:n,transitionDuration:y});return W2("keydown",S=>{S.key==="Escape"&&o&&!S.isComposing&&n&&S.target?.getAttribute("data-mantine-stop-propagation")!=="true"&&s()},{capture:!0}),H2({opened:n,shouldReturnFocus:r&&c}),{_id:d,titleMounted:f,bodyMounted:m,shouldLockScroll:b,setTitleMounted:p,setBodyMounted:g}}const Z_=v.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:o,onExitTransitionEnd:s,onEnterTransitionEnd:c,trapFocus:d,closeOnEscape:f,returnFocus:p,closeOnClickOutside:m,withinPortal:g,portalProps:y,lockScroll:b,children:S,zIndex:j,shadow:C,padding:E,__vars:R,unstyled:T,removeScrollProps:_,...k},L)=>{const{_id:A,titleMounted:N,bodyMounted:z,shouldLockScroll:B,setTitleMounted:G,setBodyMounted:Y}=dI({id:r,transitionProps:o,opened:t,trapFocus:d,closeOnEscape:f,onClose:n,returnFocus:p}),{key:J,...U}=_||{};return a.jsx(va,{...y,withinPortal:g,children:a.jsx(cI,{value:{opened:t,onClose:n,closeOnClickOutside:m,onExitTransitionEnd:s,onEnterTransitionEnd:c,transitionProps:{...o,keepMounted:e},getTitleId:()=>`${A}-title`,getBodyId:()=>`${A}-body`,titleMounted:N,bodyMounted:z,setTitleMounted:G,setBodyMounted:Y,trapFocus:d,closeOnEscape:f,zIndex:j,unstyled:T},children:a.jsx(ul,{enabled:B&&b,...U,children:a.jsx(ce,{ref:L,...k,__vars:{...R,"--mb-z-index":(j||Lr("modal")).toString(),"--mb-shadow":xb(C),"--mb-padding":qn(E)},children:S})},J)})})});Z_.displayName="@mantine/core/ModalBase";function fI(){const e=Ca();return v.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var Vc={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const eA=v.forwardRef(({className:e,...t},n)=>{const r=fI(),o=Ca();return a.jsx(ce,{ref:n,...t,id:r,className:$t({[Vc.body]:!o.unstyled},e)})});eA.displayName="@mantine/core/ModalBaseBody";const tA=v.forwardRef(({className:e,onClick:t,...n},r)=>{const o=Ca();return a.jsx(bs,{ref:r,...n,onClick:s=>{o.onClose(),t?.(s)},className:$t({[Vc.close]:!o.unstyled},e),unstyled:o.unstyled})});tA.displayName="@mantine/core/ModalBaseCloseButton";const nA=v.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:o,...s},c)=>{const d=Ca();return a.jsx(to,{mounted:d.opened,transition:"pop",...d.transitionProps,onExited:()=>{d.onExitTransitionEnd?.(),d.transitionProps?.onExited?.()},onEntered:()=>{d.onEnterTransitionEnd?.(),d.transitionProps?.onEntered?.()},...e,children:f=>a.jsx("div",{...n,className:$t({[Vc.inner]:!d.unstyled},n.className),children:a.jsx(dm,{active:d.opened&&d.trapFocus,innerRef:c,children:a.jsx(Nr,{...s,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":d.bodyMounted?d.getBodyId():void 0,"aria-labelledby":d.titleMounted?d.getTitleId():void 0,style:[o,f],className:$t({[Vc.content]:!d.unstyled},t),unstyled:d.unstyled,children:s.children})})})})});nA.displayName="@mantine/core/ModalBaseContent";const rA=v.forwardRef(({className:e,...t},n)=>{const r=Ca();return a.jsx(ce,{component:"header",ref:n,className:$t({[Vc.header]:!r.unstyled},e),...t})});rA.displayName="@mantine/core/ModalBaseHeader";const hI={duration:200,timingFunction:"ease",transition:"fade"};function pI(e){const t=Ca();return{...hI,...t.transitionProps,...e}}const iA=v.forwardRef(({onClick:e,transitionProps:t,style:n,visible:r,...o},s)=>{const c=Ca(),d=pI(t);return a.jsx(to,{mounted:r!==void 0?r:c.opened,...d,transition:"fade",children:f=>a.jsx(Bc,{ref:s,fixed:!0,style:[n,f],zIndex:c.zIndex,unstyled:c.unstyled,onClick:p=>{e?.(p),c.closeOnClickOutside&&c.onClose()},...o})})});iA.displayName="@mantine/core/ModalBaseOverlay";function mI(){const e=Ca();return v.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const oA=v.forwardRef(({className:e,...t},n)=>{const r=mI(),o=Ca();return a.jsx(ce,{component:"h2",ref:n,className:$t({[Vc.title]:!o.unstyled},e),...t,id:r})});oA.displayName="@mantine/core/ModalBaseTitle";function gI({children:e}){return a.jsx(a.Fragment,{children:e})}const[vI,yI]=zo({size:"sm"}),aA=ge((e,t)=>{const n=oe("InputClearButton",null,e),{size:r,variant:o,vars:s,classNames:c,styles:d,...f}=n,p=yI(),{resolvedClassNames:m,resolvedStyles:g}=jl({classNames:c,styles:d,props:n});return a.jsx(bs,{variant:o||"transparent",ref:t,size:r||p?.size||"sm",classNames:m,styles:g,__staticSelector:"InputClearButton",style:{pointerEvents:"all",background:"var(--input-bg)",...f.style},...f})});aA.displayName="@mantine/core/InputClearButton";const xI={xs:7,sm:8,md:10,lg:12,xl:15};function bI({__clearable:e,__clearSection:t,rightSection:n,__defaultRightSection:r,size:o="sm"}){const s=e&&t;return s&&(n||r)?a.jsxs("div",{"data-combined-clear-section":!0,style:{display:"flex",gap:2,alignItems:"center",paddingInlineEnd:xI[o]},children:[s,n||r]}):n===null?null:n||s||r}const[SI,ru]=zo({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var Ii={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 wI=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${Gn(t)} - ${le(2)})`}}),fm=ge((e,t)=>{const n=oe("InputDescription",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,size:p,__staticSelector:m,__inheritStyles:g=!0,attributes:y,variant:b,...S}=oe("InputDescription",null,n),j=ru(),C=Ie({name:["InputWrapper",m],props:n,classes:Ii,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:y,rootSelector:"description",vars:f,varsResolver:wI}),E=g&&j?.getStyles||C;return a.jsx(ce,{component:"p",ref:t,variant:b,size:p,...E("description",j?.getStyles?{className:o,style:s}:void 0),...S})});fm.classes=Ii;fm.displayName="@mantine/core/InputDescription";const jI=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${Gn(t)} - ${le(2)})`}}),hm=ge((e,t)=>{const n=oe("InputError",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,size:p,attributes:m,__staticSelector:g,__inheritStyles:y=!0,variant:b,...S}=n,j=Ie({name:["InputWrapper",g],props:n,classes:Ii,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:m,rootSelector:"error",vars:f,varsResolver:jI}),C=ru(),E=y&&C?.getStyles||j;return a.jsx(ce,{component:"p",ref:t,variant:b,size:p,...E("error",C?.getStyles?{className:o,style:s}:void 0),...S})});hm.classes=Ii;hm.displayName="@mantine/core/InputError";const QE={labelElement:"label"},CI=(e,{size:t})=>({label:{"--input-label-size":Gn(t),"--input-asterisk-color":void 0}}),Wd=ge((e,t)=>{const n=oe("InputLabel",QE,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,labelElement:p,size:m,required:g,htmlFor:y,onMouseDown:b,children:S,__staticSelector:j,variant:C,mod:E,attributes:R,...T}=oe("InputLabel",QE,n),_=Ie({name:["InputWrapper",j],props:n,classes:Ii,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:R,rootSelector:"label",vars:f,varsResolver:CI}),k=ru(),L=k?.getStyles||_;return a.jsxs(ce,{...L("label",k?.getStyles?{className:o,style:s}:void 0),component:p,variant:C,size:m,ref:t,htmlFor:p==="label"?y:void 0,mod:[{required:g},E],onMouseDown:A=>{b?.(A),!A.defaultPrevented&&A.detail>1&&A.preventDefault()},...T,children:[S,g&&a.jsx("span",{...L("required"),"aria-hidden":!0,children:" *"})]})});Wd.classes=Ii;Wd.displayName="@mantine/core/InputLabel";const qb=ge((e,t)=>{const n=oe("InputPlaceholder",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,__staticSelector:p,variant:m,error:g,mod:y,attributes:b,...S}=n,j=Ie({name:["InputPlaceholder",p],props:n,classes:Ii,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:b,rootSelector:"placeholder"});return a.jsx(ce,{...j("placeholder"),mod:[{error:!!g},y],component:"span",variant:m,ref:t,...S})});qb.classes=Ii;qb.displayName="@mantine/core/InputPlaceholder";function EI(e,{hasDescription:t,hasError:n}){const r=e.findIndex(f=>f==="input"),o=e.slice(0,r),s=e.slice(r+1),c=t&&o.includes("description")||n&&o.includes("error");return{offsetBottom:t&&s.includes("description")||n&&s.includes("error"),offsetTop:c}}const TI={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},RI=(e,{size:t})=>({label:{"--input-label-size":Gn(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${Gn(t)} - ${le(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${Gn(t)} - ${le(2)})`}}),Yd=ge((e,t)=>{const n=oe("InputWrapper",TI,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,size:p,variant:m,__staticSelector:g,inputContainer:y,inputWrapperOrder:b,label:S,error:j,description:C,labelProps:E,descriptionProps:R,errorProps:T,labelElement:_,children:k,withAsterisk:L,id:A,required:N,__stylesApiProps:z,mod:B,attributes:G,...Y}=n,J=Ie({name:["InputWrapper",g],props:z||n,classes:Ii,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:G,vars:f,varsResolver:RI}),U={size:p,variant:m,__staticSelector:g},W=mr(A),O=typeof L=="boolean"?L:N,I=T?.id||`${W}-error`,$=R?.id||`${W}-description`,H=W,K=!!j&&typeof j!="boolean",M=!!C,F=`${K?I:""} ${M?$:""}`,ae=F.trim().length>0?F.trim():void 0,de=E?.id||`${W}-label`,xe=S&&a.jsx(Wd,{labelElement:_,id:de,htmlFor:H,required:O,...U,...E,children:S},"label"),Se=M&&a.jsx(fm,{...R,...U,size:R?.size||U.size,id:R?.id||$,children:C},"description"),Ce=a.jsx(v.Fragment,{children:y(k)},"input"),Ke=K&&v.createElement(hm,{...T,...U,size:T?.size||U.size,key:"error",id:T?.id||I},j),Ae=b.map(dt=>{switch(dt){case"label":return xe;case"input":return Ce;case"description":return Se;case"error":return Ke;default:return null}});return a.jsx(SI,{value:{getStyles:J,describedBy:ae,inputId:H,labelId:de,...EI(b,{hasDescription:M,hasError:K})},children:a.jsx(ce,{ref:t,variant:m,size:p,mod:[{error:!!j},B],...J("root"),...Y,children:Ae})})});Yd.classes=Ii;Yd.displayName="@mantine/core/InputWrapper";const _I={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0,size:"sm"},AI=(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":st(t.size,"input-height"),"--input-fz":Gn(t.size),"--input-radius":t.radius===void 0?void 0:Ht(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?st(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),pn=or((e,t)=>{const n=oe("Input",_I,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,required:f,__staticSelector:p,__stylesApiProps:m,size:g,wrapperProps:y,error:b,disabled:S,leftSection:j,leftSectionProps:C,leftSectionWidth:E,rightSection:R,rightSectionProps:T,rightSectionWidth:_,rightSectionPointerEvents:k,leftSectionPointerEvents:L,variant:A,vars:N,pointer:z,multiline:B,radius:G,id:Y,withAria:J,withErrorStyles:U,mod:W,inputSize:O,attributes:I,__clearSection:$,__clearable:H,__defaultRightSection:K,...M}=n,{styleProps:F,rest:ae}=ja(M),de=ru(),xe={offsetBottom:de?.offsetBottom,offsetTop:de?.offsetTop},Se=Ie({name:["Input",p],props:m||n,classes:Ii,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:I,stylesCtx:xe,rootSelector:"wrapper",vars:N,varsResolver:AI}),Ce=J?{required:f,disabled:S,"aria-invalid":!!b,"aria-describedby":de?.describedBy,id:de?.inputId||Y}:{},Ke=bI({__clearable:H,__clearSection:$,rightSection:R,__defaultRightSection:K,size:g});return a.jsx(vI,{value:{size:g||"sm"},children:a.jsxs(ce,{...Se("wrapper"),...F,...y,mod:[{error:!!b&&U,pointer:z,disabled:S,multiline:B,"data-with-right-section":!!Ke,"data-with-left-section":!!j},W],variant:A,size:g,children:[j&&a.jsx("div",{...C,"data-position":"left",...Se("section",{className:C?.className,style:C?.style}),children:j}),a.jsx(ce,{component:"input",...ae,...Ce,ref:t,required:f,mod:{disabled:S,error:!!b&&U},variant:A,__size:O,...Se("input")}),Ke&&a.jsx("div",{...T,"data-position":"right",...Se("section",{className:T?.className,style:T?.style}),children:Ke})]})})});pn.classes=Ii;pn.Wrapper=Yd;pn.Label=Wd;pn.Error=hm;pn.Description=fm;pn.Placeholder=qb;pn.ClearButton=aA;pn.displayName="@mantine/core/Input";function DI(e,t,n){const r=oe(e,t,n),{label:o,description:s,error:c,required:d,classNames:f,styles:p,className:m,unstyled:g,__staticSelector:y,__stylesApiProps:b,errorProps:S,labelProps:j,descriptionProps:C,wrapperProps:E,id:R,size:T,style:_,inputContainer:k,inputWrapperOrder:L,withAsterisk:A,variant:N,vars:z,mod:B,attributes:G,...Y}=r,{styleProps:J,rest:U}=ja(Y),W={label:o,description:s,error:c,required:d,classNames:f,className:m,__staticSelector:y,__stylesApiProps:b||r,errorProps:S,labelProps:j,descriptionProps:C,unstyled:g,styles:p,size:T,style:_,inputContainer:k,inputWrapperOrder:L,withAsterisk:A,variant:N,id:R,mod:B,attributes:G,...E};return{...U,classNames:f,styles:p,unstyled:g,wrapperProps:{...W,...J},inputProps:{required:d,classNames:f,styles:p,unstyled:g,size:T,__staticSelector:y,__stylesApiProps:b||r,error:c,variant:N,id:R,attributes:G}}}const kI={__staticSelector:"InputBase",withAria:!0,size:"sm"},Ir=or((e,t)=>{const{inputProps:n,wrapperProps:r,...o}=DI("InputBase",kI,e);return a.jsx(pn.Wrapper,{...r,children:a.jsx(pn,{...n,...o,ref:t})})});Ir.classes={...pn.classes,...pn.Wrapper.classes};Ir.displayName="@mantine/core/InputBase";const PI={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 sA={root:"m_8bffd616"};const no=or((e,t)=>{const n=oe("Flex",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,gap:p,rowGap:m,columnGap:g,align:y,justify:b,wrap:S,direction:j,attributes:C,...E}=n,R=Ie({name:"Flex",classes:sA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:C,vars:f}),T=En(),_=Gd(),k=t_({styleProps:{gap:p,rowGap:m,columnGap:g,align:y,justify:b,wrap:S,direction:j},theme:T,data:PI});return a.jsxs(a.Fragment,{children:[k.hasResponsiveStyles&&a.jsx(El,{selector:`.${_}`,styles:k.styles,media:k.media}),a.jsx(ce,{ref:t,...R("root",{className:_,style:ys(k.inlineStyles)}),...E})]})});no.classes=sA;no.displayName="@mantine/core/Flex";function NI(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 OI({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const o=v.useRef(-1),[s,c]=v.useState(!1),[d,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),E=us(j.borderTopWidth)+us(C.borderTopWidth),R=us(j.borderLeftWidth)+us(C.borderLeftWidth),T={top:b.top-S.top-E,left:b.left-S.left-R,width:b.width,height:b.height};n.current.style.transform=`translateY(${T.top}px) translateX(${T.left}px)`,n.current.style.width=`${T.width}px`,n.current.style.height=`${T.height}px`},m=()=>{window.clearTimeout(o.current),n.current&&(n.current.style.transitionDuration="0ms"),p(),o.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)),()=>{g.current?.disconnect(),y.current?.disconnect()}},[t,e]),v.useEffect(()=>{if(t){const b=S=>{NI(S.target,t)&&(m(),f(!1))};return t.addEventListener("transitionend",b),()=>{t.removeEventListener("transitionend",b)}}},[t]),S4(()=>{Y2()!=="test"&&c(!0)},20,{autoInvoke:!0}),w4(b=>{b.forEach(S=>{S.type==="attributes"&&S.attributeName==="dir"&&m()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:s,hidden:d}}var lA={root:"m_96b553a6"};const MI=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),Gb=ge((e,t)=>{const n=oe("FloatingIndicator",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,target:p,parent:m,transitionDuration:g,mod:y,displayAfterTransitionEnd:b,attributes:S,...j}=n,C=Ie({name:"FloatingIndicator",classes:lA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:S,vars:f,varsResolver:MI}),E=v.useRef(null),{initialized:R,hidden:T}=OI({target:p,parent:m,ref:E,displayAfterTransitionEnd:b}),_=$n(t,E);return!p||!m?null:a.jsx(ce,{ref:_,mod:[{initialized:R,hidden:T},y],...C("root"),...j})});Gb.displayName="@mantine/core/FloatingIndicator";Gb.classes=lA;function cA({open:e,close:t,openDelay:n,closeDelay:r}){const o=v.useRef(-1),s=v.useRef(-1),c=()=>{window.clearTimeout(o.current),window.clearTimeout(s.current)},d=()=>{c(),n===0||n===void 0?e():o.current=window.setTimeout(e,n)},f=()=>{c(),r===0||r===void 0?t():s.current=window.setTimeout(t,r)};return v.useEffect(()=>c,[]),{openDropdown:d,closeDropdown:f}}function uA({style:e,size:t=16,...n}){return a.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...e,width:le(t),height:le(t),display:"block"},...n,children:a.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"})})}uA.displayName="@mantine/core/AccordionChevron";var dA={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 LI=(e,{radius:t,color:n,variant:r,autoContrast:o})=>{const s=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||"light",autoContrast:o});return{root:{"--alert-radius":t===void 0?void 0:Ht(t),"--alert-bg":n||r?s.background:void 0,"--alert-color":s.color,"--alert-bd":n||r?s.border:void 0}}},Uo=ge((e,t)=>{const n=oe("Alert",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,radius:p,color:m,title:g,children:y,id:b,icon:S,withCloseButton:j,onClose:C,closeButtonLabel:E,variant:R,autoContrast:T,role:_,attributes:k,...L}=n,A=Ie({name:"Alert",classes:dA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:k,vars:f,varsResolver:LI}),N=mr(b),z=g&&`${N}-title`||void 0,B=`${N}-body`;return a.jsx(ce,{id:N,...A("root",{variant:R}),variant:R,ref:t,role:_||"alert",...L,"aria-describedby":y?B:void 0,"aria-labelledby":g?z:void 0,children:a.jsxs("div",{...A("wrapper"),children:[S&&a.jsx("div",{...A("icon"),children:S}),a.jsxs("div",{...A("body"),children:[g&&a.jsx("div",{...A("title"),"data-with-close-button":j||void 0,children:a.jsx("span",{id:z,...A("label"),children:g})}),y&&a.jsx("div",{id:B,...A("message"),"data-variant":R,children:y})]}),j&&a.jsx(bs,{...A("closeButton"),onClick:C,variant:"transparent",size:16,iconSize:16,"aria-label":E,unstyled:d})]})})});Uo.classes=dA;Uo.displayName="@mantine/core/Alert";var fA={root:"m_b6d8b162"};function II(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const zI={inherit:!1},$I=(e,{variant:t,lineClamp:n,gradient:r,size:o,color:s})=>({root:{"--text-fz":Gn(o),"--text-lh":B2(o),"--text-gradient":t==="gradient"?jx(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":s?Kt(s,e):void 0}}),Ee=or((e,t)=>{const n=oe("Text",zI,e),{lineClamp:r,truncate:o,inline:s,inherit:c,gradient:d,span:f,__staticSelector:p,vars:m,className:g,style:y,classNames:b,styles:S,unstyled:j,variant:C,mod:E,size:R,attributes:T,..._}=n,k=Ie({name:["Text",p],props:n,classes:fA,className:g,style:y,classNames:b,styles:S,unstyled:j,attributes:T,vars:m,varsResolver:$I});return a.jsx(ce,{...k("root",{focusable:!0}),ref:t,component:f?"span":"p",variant:C,mod:[{"data-truncate":II(o),"data-line-clamp":typeof r=="number","data-inline":s,"data-inherit":c},E],size:R,..._})});Ee.classes=fA;Ee.displayName="@mantine/core/Text";var hA={root:"m_849cf0da"};const UI={underline:"hover"},Nt=or((e,t)=>{const{underline:n,className:r,unstyled:o,mod:s,...c}=oe("Anchor",UI,e);return a.jsx(Ee,{component:"a",ref:t,className:$t({[hA.root]:!o},r),...c,mod:[{underline:n},s],__staticSelector:"Anchor",unstyled:o})});Nt.classes=hA;Nt.displayName="@mantine/core/Anchor";const[BI,iu]=Er("AppShell was not found in tree");var Ss={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const Qb=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:d,withBorder:f,zIndex:p,mod:m,...g}=oe("AppShellAside",null,e),y=iu();return y.disabled?null:a.jsx(ce,{component:"aside",ref:t,mod:[{"with-border":f??y.withBorder},m],...y.getStyles("aside",{className:$t({[ul.classNames.zeroRight]:y.offsetScrollbars},r),classNames:n,styles:s,style:o}),...g,__vars:{"--app-shell-aside-z-index":`calc(${p??y.zIndex} + 1)`}})});Qb.classes=Ss;Qb.displayName="@mantine/core/AppShellAside";const Wb=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:d,withBorder:f,zIndex:p,mod:m,...g}=oe("AppShellFooter",null,e),y=iu();return y.disabled?null:a.jsx(ce,{component:"footer",ref:t,mod:[{"with-border":f??y.withBorder},m],...y.getStyles("footer",{className:$t({[ul.classNames.zeroRight]:y.offsetScrollbars},r),classNames:n,styles:s,style:o}),...g,__vars:{"--app-shell-footer-z-index":(p??y.zIndex)?.toString()}})});Wb.classes=Ss;Wb.displayName="@mantine/core/AppShellFooter";const Yb=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:d,withBorder:f,zIndex:p,mod:m,...g}=oe("AppShellHeader",null,e),y=iu();return y.disabled?null:a.jsx(ce,{component:"header",ref:t,mod:[{"with-border":f??y.withBorder},m],...y.getStyles("header",{className:$t({[ul.classNames.zeroRight]:y.offsetScrollbars},r),classNames:n,styles:s,style:o}),...g,__vars:{"--app-shell-header-z-index":(p??y.zIndex)?.toString()}})});Yb.classes=Ss;Yb.displayName="@mantine/core/AppShellHeader";const Kb=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=oe("AppShellMain",null,e),f=iu();return a.jsx(ce,{component:"main",ref:t,...f.getStyles("main",{className:r,style:o,classNames:n,styles:s}),...d})});Kb.classes=Ss;Kb.displayName="@mantine/core/AppShellMain";function Kd(e){return typeof e=="object"?e.base:e}function Xd(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 Jd(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function VI({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:o}){const s=r?.width,c="translateX(var(--app-shell-aside-width))",d="translateX(calc(var(--app-shell-aside-width) * -1))";if(r?.breakpoint&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},n[r?.breakpoint]["--app-shell-aside-width"]="100%",n[r?.breakpoint]["--app-shell-aside-offset"]="0px"),Xd(s)){const f=le(Kd(s));e["--app-shell-aside-width"]=f,e["--app-shell-aside-offset"]=f}if(Jd(s)&&(typeof s.base<"u"&&(e["--app-shell-aside-width"]=le(s.base),e["--app-shell-aside-offset"]=le(s.base)),fn(s).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-aside-width"]=le(s[f]),t[f]["--app-shell-aside-offset"]=le(s[f]))})),r?.collapsed?.desktop){const f=r.breakpoint;t[f]=t[f]||{},t[f]["--app-shell-aside-transform"]=c,t[f]["--app-shell-aside-transform-rtl"]=d,t[f]["--app-shell-aside-offset"]="0px !important",t[f]["--app-shell-aside-scroll-locked-visibility"]="hidden"}if(r?.collapsed?.mobile){const f=bb(r.breakpoint,o.breakpoints)-.1;n[f]=n[f]||{},n[f]["--app-shell-aside-width"]="100%",n[f]["--app-shell-aside-offset"]="0px",n[f]["--app-shell-aside-transform"]=c,n[f]["--app-shell-aside-transform-rtl"]=d,n[f]["--app-shell-aside-scroll-locked-visibility"]="hidden"}}function FI({baseStyles:e,minMediaStyles:t,footer:n}){const r=n?.height,o="translateY(var(--app-shell-footer-height))",s=n?.offset??!0;if(Xd(r)){const c=le(Kd(r));e["--app-shell-footer-height"]=c,s&&(e["--app-shell-footer-offset"]=c)}Jd(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=le(r.base),s&&(e["--app-shell-footer-offset"]=le(r.base))),fn(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?.collapsed&&(e["--app-shell-footer-transform"]=o,e["--app-shell-footer-offset"]="0px !important")}function HI({baseStyles:e,minMediaStyles:t,header:n}){const r=n?.height,o="translateY(calc(var(--app-shell-header-height) * -1))",s=n?.offset??!0;if(Xd(r)){const c=le(Kd(r));e["--app-shell-header-height"]=c,s&&(e["--app-shell-header-offset"]=c)}Jd(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=le(r.base),s&&(e["--app-shell-header-offset"]=le(r.base))),fn(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?.collapsed&&(e["--app-shell-header-transform"]=o,e["--app-shell-header-offset"]="0px !important")}function qI({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:o}){const s=r?.width,c="translateX(calc(var(--app-shell-navbar-width) * -1))",d="translateX(var(--app-shell-navbar-width))";if(r?.breakpoint&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},n[r?.breakpoint]["--app-shell-navbar-width"]="100%",n[r?.breakpoint]["--app-shell-navbar-offset"]="0px"),Xd(s)){const f=le(Kd(s));e["--app-shell-navbar-width"]=f,e["--app-shell-navbar-offset"]=f}if(Jd(s)&&(typeof s.base<"u"&&(e["--app-shell-navbar-width"]=le(s.base),e["--app-shell-navbar-offset"]=le(s.base)),fn(s).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-navbar-width"]=le(s[f]),t[f]["--app-shell-navbar-offset"]=le(s[f]))})),r?.collapsed?.desktop){const f=r.breakpoint;t[f]=t[f]||{},t[f]["--app-shell-navbar-transform"]=c,t[f]["--app-shell-navbar-transform-rtl"]=d,t[f]["--app-shell-navbar-offset"]="0px !important"}if(r?.collapsed?.mobile){const f=bb(r.breakpoint,o.breakpoints)-.1;n[f]=n[f]||{},n[f]["--app-shell-navbar-width"]="100%",n[f]["--app-shell-navbar-offset"]="0px",n[f]["--app-shell-navbar-transform"]=c,n[f]["--app-shell-navbar-transform-rtl"]=d}}function Vy(e){return Number(e)===0?"0px":qn(e)}function GI({padding:e,baseStyles:t,minMediaStyles:n}){Xd(e)&&(t["--app-shell-padding"]=Vy(Kd(e))),Jd(e)&&(e.base&&(t["--app-shell-padding"]=Vy(e.base)),fn(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=Vy(e[r]))}))}function QI({navbar:e,header:t,footer:n,aside:r,padding:o,theme:s}){const c={},d={},f={};qI({baseStyles:f,minMediaStyles:c,maxMediaStyles:d,navbar:e,theme:s}),VI({baseStyles:f,minMediaStyles:c,maxMediaStyles:d,aside:r,theme:s}),HI({baseStyles:f,minMediaStyles:c,header:t}),FI({baseStyles:f,minMediaStyles:c,footer:n}),GI({baseStyles:f,minMediaStyles:c,padding:o});const p=jd(fn(c),s.breakpoints).map(y=>({query:`(min-width: ${yp(y.px)})`,styles:c[y.value]})),m=jd(fn(d),s.breakpoints).map(y=>({query:`(max-width: ${yp(y.px)})`,styles:d[y.value]})),g=[...p,...m];return{baseStyles:f,media:g}}function WI({navbar:e,header:t,aside:n,footer:r,padding:o}){const s=En(),c=Sa(),{media:d,baseStyles:f}=QI({navbar:e,header:t,footer:r,aside:n,padding:o,theme:s});return a.jsx(El,{media:d,styles:f,selector:c.cssVariablesSelector})}const Xb=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:d,withBorder:f,zIndex:p,mod:m,...g}=oe("AppShellNavbar",null,e),y=iu();return y.disabled?null:a.jsx(ce,{component:"nav",ref:t,mod:[{"with-border":f??y.withBorder},m],...y.getStyles("navbar",{className:r,classNames:n,styles:s,style:o}),...g,__vars:{"--app-shell-navbar-z-index":`calc(${p??y.zIndex} + 1)`}})});Xb.classes=Ss;Xb.displayName="@mantine/core/AppShellNavbar";const Jb=or((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,grow:d,mod:f,...p}=oe("AppShellSection",null,e),m=iu();return a.jsx(ce,{ref:t,mod:[{grow:d},f],...m.getStyles("section",{className:r,style:o,classNames:n,styles:s}),...p})});Jb.classes=Ss;Jb.displayName="@mantine/core/AppShellSection";function YI({transitionDuration:e,disabled:t}){const[n,r]=v.useState(!0),o=v.useRef(-1),s=v.useRef(-1);return W2("resize",()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),200)}),Jc(()=>{r(!0),clearTimeout(s.current),s.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),e||0)},[t,e]),n}const KI={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Lr("app")},XI=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),Sr=ge((e,t)=>{const n=oe("AppShell",KI,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,navbar:p,withBorder:m,padding:g,transitionDuration:y,transitionTimingFunction:b,header:S,zIndex:j,layout:C,disabled:E,aside:R,footer:T,offsetScrollbars:_=!0,mod:k,attributes:L,...A}=n,N=Ie({name:"AppShell",classes:Ss,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:L,vars:f,varsResolver:XI}),z=YI({disabled:E,transitionDuration:y});return a.jsxs(BI,{value:{getStyles:N,withBorder:m,zIndex:j,disabled:E,offsetScrollbars:_},children:[a.jsx(WI,{navbar:p,header:S,aside:R,footer:T,padding:g}),a.jsx(ce,{ref:t,...N("root"),mod:[{resizing:z,layout:C,disabled:E},k],...A})]})});Sr.classes=Ss;Sr.displayName="@mantine/core/AppShell";Sr.Navbar=Xb;Sr.Header=Yb;Sr.Main=Kb;Sr.Aside=Qb;Sr.Footer=Wb;Sr.Section=Jb;function pA(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=>pA(t))}:e}function mA(e){return e?e.map(t=>pA(t)):[]}function gA(e){return e.reduce((t,n)=>"group"in n?{...t,...gA(n.items)}:(t[n.value]=n,t),{})}var Or={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",optionsDropdownCheckPlaceholder:"m_a530ee0a"};const JI={error:null},ZI=(e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":st(t,"combobox-chevron-size"),"--combobox-chevron-color":n?Kt(n,e):void 0}}),pm=ge((e,t)=>{const n=oe("ComboboxChevron",JI,e),{size:r,error:o,style:s,className:c,classNames:d,styles:f,unstyled:p,vars:m,mod:g,...y}=n,b=Ie({name:"ComboboxChevron",classes:Or,props:n,style:s,className:c,classNames:d,styles:f,unstyled:p,vars:m,varsResolver:ZI,rootSelector:"chevron"});return a.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:o},g],ref:t,children:a.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"})})});pm.classes=Or;pm.displayName="@mantine/core/ComboboxChevron";const[e7,zi]=Er("Combobox component was not found in tree"),vA=v.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...o},s)=>a.jsx(pn.ClearButton,{ref:s,tabIndex:-1,"aria-hidden":!0,...o,onMouseDown:c=>{c.preventDefault(),t?.(c)},onClick:c=>{r(),n?.(c)}}));vA.displayName="@mantine/core/ComboboxClearButton";const Zb=ge((e,t)=>{const{classNames:n,styles:r,className:o,style:s,hidden:c,...d}=oe("ComboboxDropdown",null,e),f=zi();return a.jsx(Kr.Dropdown,{...d,ref:t,role:"presentation","data-hidden":c||void 0,...f.getStyles("dropdown",{className:o,style:s,classNames:n,styles:r})})});Zb.classes=Or;Zb.displayName="@mantine/core/ComboboxDropdown";const t7={refProp:"ref"},yA=ge((e,t)=>{const{children:n,refProp:r}=oe("ComboboxDropdownTarget",t7,e);if(zi(),!Io(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 a.jsx(Kr.Target,{ref:t,refProp:r,children:n})});yA.displayName="@mantine/core/ComboboxDropdownTarget";const e0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=oe("ComboboxEmpty",null,e),f=zi();return a.jsx(ce,{ref:t,...f.getStyles("empty",{className:r,classNames:n,styles:s,style:o}),...d})});e0.classes=Or;e0.displayName="@mantine/core/ComboboxEmpty";function t0({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:o,autoComplete:s}){const c=zi(),[d,f]=v.useState(null),p=g=>{if(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()):o==="button"&&(g.preventDefault(),c.store.openDropdown("keyboard"))}g.key==="Escape"&&c.store.closeDropdown("keyboard"),g.nativeEvent.code==="Space"&&o==="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?c.store.listId:void 0,"aria-activedescendant":c.store.dropdownOpened&&d||void 0,autoComplete:s,"data-expanded":c.store.dropdownOpened||void 0,"data-mantine-stop-propagation":c.store.dropdownOpened||void 0}:{},onKeyDown:p}}const n7={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},xA=ge((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:s,withExpandedAttribute:c,targetType:d,autoComplete:f,...p}=oe("ComboboxEventsTarget",n7,e);if(!Io(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=zi(),g=t0({targetType:d,withAriaAttributes:s,withKeyboardNavigation:o,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f});return v.cloneElement(n,{...g,...p,[r]:$n(t,m.store.targetRef,em(n))})});xA.displayName="@mantine/core/ComboboxEventsTarget";const n0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=oe("ComboboxFooter",null,e),f=zi();return a.jsx(ce,{ref:t,...f.getStyles("footer",{className:r,classNames:n,style:o,styles:s}),...d,onMouseDown:p=>{p.preventDefault()}})});n0.classes=Or;n0.displayName="@mantine/core/ComboboxFooter";const r0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,children:d,label:f,id:p,...m}=oe("ComboboxGroup",null,e),g=zi(),y=mr(p);return a.jsxs(ce,{ref:t,role:"group","aria-labelledby":f?y:void 0,...g.getStyles("group",{className:r,classNames:n,style:o,styles:s}),...m,children:[f&&a.jsx("div",{id:y,...g.getStyles("groupLabel",{classNames:n,styles:s}),children:f}),d]})});r0.classes=Or;r0.displayName="@mantine/core/ComboboxGroup";const i0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=oe("ComboboxHeader",null,e),f=zi();return a.jsx(ce,{ref:t,...f.getStyles("header",{className:r,classNames:n,style:o,styles:s}),...d,onMouseDown:p=>{p.preventDefault()}})});i0.classes=Or;i0.displayName="@mantine/core/ComboboxHeader";function bA({value:e,valuesDivider:t=",",...n}){return a.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}bA.displayName="@mantine/core/ComboboxHiddenInput";const o0=ge((e,t)=>{const n=oe("ComboboxOption",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,onClick:f,id:p,active:m,onMouseDown:g,onMouseOver:y,disabled:b,selected:S,mod:j,...C}=n,E=zi(),R=v.useId(),T=p||R;return a.jsx(ce,{...E.getStyles("option",{className:o,classNames:r,styles:c,style:s}),...C,ref:t,id:T,mod:["combobox-option",{"combobox-active":m,"combobox-disabled":b,"combobox-selected":S},j],role:"option",onClick:_=>{b?_.preventDefault():(E.onOptionSubmit?.(n.value,n),f?.(_))},onMouseDown:_=>{_.preventDefault(),g?.(_)},onMouseOver:_=>{E.resetSelectionOnOptionHover&&E.store.resetSelectedOption(),y?.(_)}})});o0.classes=Or;o0.displayName="@mantine/core/ComboboxOption";const a0=ge((e,t)=>{const n=oe("ComboboxOptions",null,e),{classNames:r,className:o,style:s,styles:c,id:d,onMouseDown:f,labelledBy:p,...m}=n,g=zi(),y=mr(d);return v.useEffect(()=>{g.store.setListId(y)},[y]),a.jsx(ce,{ref:t,...g.getStyles("options",{className:o,style:s,classNames:r,styles:c}),...m,id:y,role:"listbox","aria-labelledby":p,onMouseDown:b=>{b.preventDefault(),f?.(b)}})});a0.classes=Or;a0.displayName="@mantine/core/ComboboxOptions";const r7={withAriaAttributes:!0,withKeyboardNavigation:!0},s0=ge((e,t)=>{const n=oe("ComboboxSearch",r7,e),{classNames:r,styles:o,unstyled:s,vars:c,withAriaAttributes:d,onKeyDown:f,withKeyboardNavigation:p,size:m,...g}=n,y=zi(),b=y.getStyles("search"),S=t0({targetType:"input",withAriaAttributes:d,withKeyboardNavigation:p,withExpandedAttribute:!1,onKeyDown:f,autoComplete:"off"});return a.jsx(pn,{ref:$n(t,y.store.searchRef),classNames:[{input:b.className},r],styles:[{input:b.style},o],size:m||y.size,...S,...g,__staticSelector:"Combobox"})});s0.classes=Or;s0.displayName="@mantine/core/ComboboxSearch";const i7={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},SA=ge((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:s,withExpandedAttribute:c,targetType:d,autoComplete:f,...p}=oe("ComboboxTarget",i7,e);if(!Io(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=zi(),g=t0({targetType:d,withAriaAttributes:s,withKeyboardNavigation:o,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f}),y=v.cloneElement(n,{...g,...p});return a.jsx(Kr.Target,{ref:$n(t,m.store.targetRef),children:y})});SA.displayName="@mantine/core/ComboboxTarget";function o7(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 a7(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 s7(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function Tl({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:o,loop:s=!0,scrollBehavior:c="instant"}={}){const[d,f]=tr({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((O="unknown")=>{d||(f(!0),o?.(O))},[f,o,d]),E=v.useCallback((O="unknown")=>{d&&(f(!1),r?.(O))},[f,r,d]),R=v.useCallback((O="unknown")=>{d?E(O):C(O)},[E,C,d]),T=v.useCallback(()=>{const O=ns(y.current),I=sp(`#${p.current} [data-combobox-selected]`,O);I?.removeAttribute("data-combobox-selected"),I?.removeAttribute("aria-selected")},[]),_=v.useCallback(O=>{const I=ns(y.current),$=sp(`#${p.current}`,I),H=$?is("[data-combobox-option]",$):null;if(!H)return null;const K=O>=H.length?0:O<0?H.length-1:O;return m.current=K,H?.[K]&&!H[K].hasAttribute("data-combobox-disabled")?(T(),H[K].setAttribute("data-combobox-selected","true"),H[K].setAttribute("aria-selected","true"),H[K].scrollIntoView({block:"nearest",behavior:c}),H[K].id):null},[c,T]),k=v.useCallback(()=>{const O=ns(y.current),I=sp(`#${p.current} [data-combobox-active]`,O);if(I){const H=is(`#${p.current} [data-combobox-option]`,O).findIndex(K=>K===I);return _(H)}return _(0)},[_]),L=v.useCallback(()=>{const O=ns(y.current),I=is(`#${p.current} [data-combobox-option]`,O);return _(a7(m.current,I,s))},[_,s]),A=v.useCallback(()=>{const O=ns(y.current),I=is(`#${p.current} [data-combobox-option]`,O);return _(o7(m.current,I,s))},[_,s]),N=v.useCallback(()=>{const O=ns(y.current),I=is(`#${p.current} [data-combobox-option]`,O);return _(s7(I))},[_]),z=v.useCallback((O="selected",I)=>{j.current=window.setTimeout(()=>{const $=ns(y.current),H=is(`#${p.current} [data-combobox-option]`,$),K=H.findIndex(M=>M.hasAttribute(`data-combobox-${O}`));m.current=K,I?.scrollIntoView&&H[K]?.scrollIntoView({block:"nearest",behavior:c})},0)},[]),B=v.useCallback(()=>{m.current=-1,T()},[T]),G=v.useCallback(()=>{const O=ns(y.current);is(`#${p.current} [data-combobox-option]`,O)?.[m.current]?.click()},[]),Y=v.useCallback(O=>{p.current=O},[]),J=v.useCallback(()=>{b.current=window.setTimeout(()=>g.current?.focus(),0)},[]),U=v.useCallback(()=>{S.current=window.setTimeout(()=>y.current?.focus(),0)},[]),W=v.useCallback(()=>m.current,[]);return v.useEffect(()=>()=>{window.clearTimeout(b.current),window.clearTimeout(S.current),window.clearTimeout(j.current)},[]),{dropdownOpened:d,openDropdown:C,closeDropdown:E,toggleDropdown:R,selectedOptionIndex:m.current,getSelectedOptionIndex:W,selectOption:_,selectFirstOption:N,selectActiveOption:k,selectNextOption:L,selectPreviousOption:A,resetSelectedOption:B,updateSelectedOptionIndex:z,listId:p.current,setListId:Y,clickSelectedOption:G,searchRef:g,focusSearchInput:J,targetRef:y,focusTarget:U}}const l7={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0},size:"sm"},c7=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":Gn(t),"--combobox-option-padding":st(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:le(n),"--combobox-option-fz":Gn(t),"--combobox-option-padding":st(t,"combobox-option-padding")}});function Ye(e){const t=oe("Combobox",l7,e),{classNames:n,styles:r,unstyled:o,children:s,store:c,vars:d,onOptionSubmit:f,onClose:p,size:m,dropdownPadding:g,resetSelectionOnOptionHover:y,__staticSelector:b,readOnly:S,attributes:j,...C}=t,E=Tl(),R=c||E,T=Ie({name:b||"Combobox",classes:Or,props:t,classNames:n,styles:r,unstyled:o,attributes:j,vars:d,varsResolver:c7}),_=()=>{p?.(),R.closeDropdown()};return a.jsx(e7,{value:{getStyles:T,store:R,onOptionSubmit:f,size:m,resetSelectionOnOptionHover:y,readOnly:S},children:a.jsx(Kr,{opened:R.dropdownOpened,preventPositionChangeWhenVisible:!0,...C,onChange:k=>!k&&_(),withRoles:!1,unstyled:o,children:s})})}const u7=e=>e;Ye.extend=u7;Ye.classes=Or;Ye.displayName="@mantine/core/Combobox";Ye.Target=SA;Ye.Dropdown=Zb;Ye.Options=a0;Ye.Option=o0;Ye.Search=s0;Ye.Empty=e0;Ye.Chevron=pm;Ye.Footer=n0;Ye.Header=i0;Ye.EventsTarget=xA;Ye.DropdownTarget=yA;Ye.Group=r0;Ye.ClearButton=vA;Ye.HiddenInput=bA;var wA={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const jA=wA,mm=v.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:o,unstyled:s,children:c,label:d,description:f,id:p,disabled:m,error:g,size:y,labelPosition:b="left",bodyElement:S="div",labelElement:j="label",variant:C,style:E,vars:R,mod:T,attributes:_,...k},L)=>{const A=Ie({name:e,props:t,className:n,style:E,classes:wA,classNames:r,styles:o,unstyled:s,attributes:_});return a.jsx(ce,{...A("root"),ref:L,__vars:{"--label-fz":Gn(y),"--label-lh":st(y,"label-lh")},mod:[{"label-position":b},T],variant:C,size:y,...k,children:a.jsxs(ce,{component:S,htmlFor:S==="label"?p:void 0,...A("body"),children:[c,a.jsxs("div",{...A("labelWrapper"),"data-disabled":m||void 0,children:[d&&a.jsx(ce,{component:j,htmlFor:j==="label"?p:void 0,...A("label"),"data-disabled":m||void 0,children:d}),f&&a.jsx(pn.Description,{size:y,__inheritStyles:!1,...A("description"),children:f}),g&&typeof g!="boolean"&&a.jsx(pn.Error,{size:y,__inheritStyles:!1,...A("error"),children:g})]})]})})});mm.displayName="@mantine/core/InlineInput";const CA=v.createContext(null),d7=CA.Provider,EA=()=>v.useContext(CA),[f7,h7]=zo();var TA={card:"m_26775b0a"};const p7={withBorder:!0},m7=(e,{radius:t})=>({card:{"--card-radius":Ht(t)}}),l0=ge((e,t)=>{const n=oe("CheckboxCard",p7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,checked:p,mod:m,withBorder:g,value:y,onClick:b,defaultChecked:S,onChange:j,attributes:C,...E}=n,R=Ie({name:"CheckboxCard",classes:TA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:C,vars:f,varsResolver:m7,rootSelector:"card"}),T=EA(),_=typeof p=="boolean"?p:T?T.value.includes(y||""):void 0,[k,L]=tr({value:_,defaultValue:S,finalValue:!1,onChange:j});return a.jsx(f7,{value:{checked:k},children:a.jsx(In,{ref:t,mod:[{"with-border":g,checked:k},m],...R("card"),...E,role:"checkbox","aria-checked":k,onClick:A=>{b?.(A),T?.onChange(y||""),L(!k)}})})});l0.displayName="@mantine/core/CheckboxCard";l0.classes=TA;function c0({children:e,role:t}){const n=ru();return n?a.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):a.jsx(a.Fragment,{children:e})}const u0=ge((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:s,wrapperProps:c,children:d,readOnly:f,disabled:p,...m}=oe("CheckboxGroup",null,e),[g,y]=tr({value:n,defaultValue:r,finalValue:[],onChange:o}),b=S=>{const j=typeof S=="string"?S:S.currentTarget.value;!f&&y(g.includes(j)?g.filter(C=>C!==j):[...g,j])};return a.jsx(d7,{value:{value:g,onChange:b,size:s,disabled:p},children:a.jsx(pn.Wrapper,{size:s,ref:t,...c,...m,labelElement:"div",__staticSelector:"CheckboxGroup",children:a.jsx(c0,{role:"group",children:d})})})});u0.classes=pn.Wrapper.classes;u0.displayName="@mantine/core/CheckboxGroup";function Zd({size:e,style:t,...n}){const r=e!==void 0?{width:le(e),height:le(e),...t}:t;return a.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n,children:a.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 RA({indeterminate:e,...t}){return e?a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t,children:a.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):a.jsx(Zd,{...t})}var _A={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const g7={icon:RA,variant:"filled"},v7=(e,{radius:t,color:n,size:r,iconColor:o,variant:s,autoContrast:c})=>{const d=Wr({color:n||e.primaryColor,theme:e}),f=d.isThemeColor&&d.shade===void 0?`var(--mantine-color-${d.color}-outline)`:d.color;return{indicator:{"--checkbox-size":st(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Ht(t),"--checkbox-color":s==="outline"?f:Kt(n,e),"--checkbox-icon-color":o?Kt(o,e):Cl(c,e)?wa({color:n,theme:e,autoContrast:c}):void 0}}},d0=ge((e,t)=>{const n=oe("CheckboxIndicator",g7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,icon:p,indeterminate:m,radius:g,color:y,iconColor:b,autoContrast:S,checked:j,mod:C,variant:E,disabled:R,attributes:T,..._}=n,k=Ie({name:"CheckboxIndicator",classes:_A,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:T,vars:f,varsResolver:v7,rootSelector:"indicator"}),L=h7(),A=typeof j=="boolean"||typeof m=="boolean"?j||m:L?.checked||!1;return a.jsx(ce,{ref:t,...k("indicator",{variant:E}),variant:E,mod:[{checked:A,disabled:R},C],..._,children:a.jsx(p,{indeterminate:m,...k("icon")})})});d0.displayName="@mantine/core/CheckboxIndicator";d0.classes=_A;var AA={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const y7={labelPosition:"right",icon:RA,variant:"filled"},x7=(e,{radius:t,color:n,size:r,iconColor:o,variant:s,autoContrast:c})=>{const d=Wr({color:n||e.primaryColor,theme:e}),f=d.isThemeColor&&d.shade===void 0?`var(--mantine-color-${d.color}-outline)`:d.color;return{root:{"--checkbox-size":st(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Ht(t),"--checkbox-color":s==="outline"?f:Kt(n,e),"--checkbox-icon-color":o?Kt(o,e):Cl(c,e)?wa({color:n,theme:e,autoContrast:c}):void 0}}},Ln=ge((e,t)=>{const n=oe("Checkbox",y7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,color:p,label:m,id:g,size:y,radius:b,wrapperProps:S,checked:j,labelPosition:C,description:E,error:R,disabled:T,variant:_,indeterminate:k,icon:L,rootRef:A,iconColor:N,onChange:z,autoContrast:B,mod:G,attributes:Y,...J}=n,U=EA(),W=y||U?.size,O=Ie({name:"Checkbox",props:n,classes:AA,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:Y,vars:f,varsResolver:x7}),{styleProps:I,rest:$}=ja(J),H=mr(g),K={checked:U?.value.includes($.value)??j,onChange:ae=>{U?.onChange(ae),z?.(ae)},disabled:U?.disabled??T},M=v.useRef(null),F=t||M;return v.useEffect(()=>{F&&"current"in F&&F.current&&(F.current.indeterminate=k||!1,k?F.current.setAttribute("data-indeterminate","true"):F.current.removeAttribute("data-indeterminate"))},[k,F]),a.jsx(mm,{...O("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:H,size:W,labelPosition:C,label:m,description:E,error:R,disabled:K.disabled,classNames:r,styles:c,unstyled:d,"data-checked":K.checked||j||void 0,variant:_,ref:A,mod:G,...I,...S,children:a.jsxs(ce,{...O("inner"),mod:{"data-label-position":C},children:[a.jsx(ce,{component:"input",id:H,ref:F,mod:{error:!!R},...O("input",{focusable:!0,variant:_}),...$,...K,type:"checkbox"}),a.jsx(L,{indeterminate:k,...O("icon")})]})})});Ln.classes={...AA,...jA};Ln.displayName="@mantine/core/Checkbox";Ln.Group=u0;Ln.Indicator=d0;Ln.Card=l0;function Fc(e){return"group"in e}function DA({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),o=[];for(let s=0;s<e.length;s+=1){const c=e[s];if(o.length===n)return o;Fc(c)&&o.push({group:c.group,items:DA({options:c.items,search:t,limit:n-o.length})}),Fc(c)||c.label.toLowerCase().includes(r)&&o.push(c)}return o}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 kA(e,t=new Set){if(Array.isArray(e))for(const n of e)if(Fc(n))kA(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 S7(e,t){return Array.isArray(e)?e.includes(t):e===t}function PA({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:o,unstyled:s,renderOption:c}){if(!Fc(e)){const f=S7(r,e.value),p=t&&(f?a.jsx(Zd,{className:Or.optionsDropdownCheckIcon}):n?a.jsx("div",{className:Or.optionsDropdownCheckPlaceholder}):null),m=a.jsxs(a.Fragment,{children:[o==="left"&&p,a.jsx("span",{children:e.label}),o==="right"&&p]});return a.jsx(Ye.Option,{value:e.value,disabled:e.disabled,className:$t({[Or.optionsDropdownOption]:!s}),"data-reverse":o==="right"||void 0,"data-checked":f||void 0,"aria-selected":f,active:f,children:typeof c=="function"?c({option:e,checked:f}):m})}const d=e.items.map(f=>a.jsx(PA,{data:f,value:r,unstyled:s,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:o,renderOption:c},f.value));return a.jsx(Ye.Group,{label:e.group,children:d})}function w7({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:o,limit:s,maxDropdownHeight:c,withScrollArea:d=!0,filterOptions:f=!0,withCheckIcon:p=!1,withAlignedLabels:m=!1,value:g,checkIconPosition:y,nothingFoundMessage:b,unstyled:S,labelId:j,renderOption:C,scrollAreaProps:E,"aria-label":R}){kA(e);const _=typeof o=="string"?(r||DA)({options:e,search:f?o:"",limit:s??1/0}):e,k=b7(_),L=_.map(A=>a.jsx(PA,{data:A,withCheckIcon:p,withAlignedLabels:m,value:g,checkIconPosition:y,unstyled:S,renderOption:C},Fc(A)?A.group:A.value));return a.jsx(Ye.Dropdown,{hidden:t||n&&k,"data-composed":!0,children:a.jsxs(Ye.Options,{labelledBy:j,"aria-label":R,children:[d?a.jsx(Yr.Autosize,{mah:c??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...E,children:L}):L,k&&b&&a.jsx(Ye.Empty,{children:b})]})})}const NA=v.createContext(null),j7=NA.Provider;function C7(){return{withinGroup:!!v.useContext(NA)}}var gm={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const E7=(e,{spacing:t})=>({group:{"--ag-spacing":qn(t)}}),f0=ge((e,t)=>{const n=oe("AvatarGroup",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,spacing:p,attributes:m,...g}=n,y=Ie({name:"AvatarGroup",classes:gm,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:m,vars:f,varsResolver:E7,rootSelector:"group"});return a.jsx(j7,{value:!0,children:a.jsx(ce,{ref:t,...y("group"),...g})})});f0.classes=gm;f0.displayName="@mantine/core/AvatarGroup";function T7(e){return a.jsx("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.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 R7(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 _7=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function A7(e,t=_7){const n=R7(e),r=Math.abs(n)%t.length;return t[r]}function D7(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 k7=(e,{size:t,radius:n,variant:r,gradient:o,color:s,autoContrast:c,name:d,allowedInitialsColors:f})=>{const p=s==="initials"&&typeof d=="string"?A7(d,f):s,m=e.variantColorResolver({color:p||"gray",theme:e,gradient:o,variant:r||"light",autoContrast:c});return{root:{"--avatar-size":st(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:Ht(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}}},fl=or((e,t)=>{const n=oe("Avatar",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,src:p,alt:m,radius:g,color:y,gradient:b,imageProps:S,children:j,autoContrast:C,mod:E,name:R,allowedInitialsColors:T,attributes:_,...k}=n,L=C7(),[A,N]=v.useState(!p),z=Ie({name:"Avatar",props:n,classes:gm,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:_,vars:f,varsResolver:k7});return v.useEffect(()=>N(!p),[p]),a.jsx(ce,{...z("root"),mod:[{"within-group":L.withinGroup},E],ref:t,...k,children:A||!p?a.jsx("span",{...z("placeholder"),title:m,children:j||typeof R=="string"&&D7(R)||a.jsx(T7,{})}):a.jsx("img",{...S,...z("image"),src:p,alt:m,onError:B=>{N(!0),S?.onError?.(B)}})})});fl.classes=gm;fl.displayName="@mantine/core/Avatar";fl.Group=f0;var OA={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const P7=(e,{radius:t,color:n,gradient:r,variant:o,size:s,autoContrast:c,circle:d})=>{const f=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:c});return{root:{"--badge-height":st(s,"badge-height"),"--badge-padding-x":st(s,"badge-padding-x"),"--badge-fz":st(s,"badge-fz"),"--badge-radius":d||t===void 0?void 0:Ht(t),"--badge-bg":n||o?f.background:void 0,"--badge-color":n||o?f.color:void 0,"--badge-bd":n||o?f.border:void 0,"--badge-dot-color":o==="dot"?Kt(n,e):void 0}}},h0=or((e,t)=>{const n=oe("Badge",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,radius:p,color:m,gradient:g,leftSection:y,rightSection:b,children:S,variant:j,fullWidth:C,autoContrast:E,circle:R,mod:T,attributes:_,...k}=n,L=Ie({name:"Badge",props:n,classes:OA,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:_,vars:f,varsResolver:P7});return a.jsxs(ce,{variant:j,mod:[{block:C,circle:R,"with-right-section":!!b,"with-left-section":!!y},T],...L("root",{variant:j}),ref:t,...k,children:[y&&a.jsx("span",{...L("section"),"data-position":"left",children:y}),a.jsx("span",{...L("label"),children:S}),b&&a.jsx("span",{...L("section"),"data-position":"right",children:b})]})});h0.classes=OA;h0.displayName="@mantine/core/Badge";var MA={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const N7={iconSize:48},O7=(e,{color:t,iconSize:n,radius:r})=>{const o=Wr({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),s=Wr({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":Ai(s.value,.07),"--bq-bg-dark":Ai(o.value,.06),"--bq-bd":Kt(t,e),"--bq-icon-size":le(n),"--bq-radius":Ht(r)}}},p0=ge((e,t)=>{const n=oe("Blockquote",N7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,children:p,icon:m,iconSize:g,cite:y,attributes:b,...S}=n,j=Ie({name:"Blockquote",classes:MA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:b,vars:f,varsResolver:O7});return a.jsxs(ce,{component:"blockquote",ref:t,...j("root"),...S,children:[m&&a.jsx("span",{...j("icon"),children:m}),p,y&&a.jsx("cite",{...j("cite"),children:y})]})});p0.classes=MA;p0.displayName="@mantine/core/Blockquote";var ou={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const WE={orientation:"horizontal"},M7=(e,{borderWidth:t})=>({group:{"--button-border-width":le(t)}}),m0=ge((e,t)=>{const n=oe("ButtonGroup",WE,e),{className:r,style:o,classNames:s,styles:c,unstyled:d,orientation:f,vars:p,borderWidth:m,variant:g,mod:y,attributes:b,...S}=oe("ButtonGroup",WE,e),j=Ie({name:"ButtonGroup",props:n,classes:ou,className:r,style:o,classNames:s,styles:c,unstyled:d,attributes:b,vars:p,varsResolver:M7,rootSelector:"group"});return a.jsx(ce,{...j("group"),ref:t,variant:g,mod:[{"data-orientation":f},y],role:"group",...S})});m0.classes=ou;m0.displayName="@mantine/core/ButtonGroup";const L7=(e,{radius:t,color:n,gradient:r,variant:o,autoContrast:s,size:c})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:s});return{groupSection:{"--section-height":st(c,"section-height"),"--section-padding-x":st(c,"section-padding-x"),"--section-fz":c?.includes("compact")?Gn(c.replace("compact-","")):Gn(c),"--section-radius":t===void 0?void 0:Ht(t),"--section-bg":n||o?d.background:void 0,"--section-color":d.color,"--section-bd":n||o?d.border:void 0}}},g0=ge((e,t)=>{const n=oe("ButtonGroupSection",null,e),{className:r,style:o,classNames:s,styles:c,unstyled:d,vars:f,variant:p,gradient:m,radius:g,autoContrast:y,attributes:b,...S}=n,j=Ie({name:"ButtonGroupSection",props:n,classes:ou,className:r,style:o,classNames:s,styles:c,unstyled:d,attributes:b,vars:f,varsResolver:L7,rootSelector:"groupSection"});return a.jsx(ce,{...j("groupSection"),ref:t,variant:p,...S})});g0.classes=ou;g0.displayName="@mantine/core/ButtonGroupSection";const I7={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${le(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},z7=(e,{radius:t,color:n,gradient:r,variant:o,size:s,justify:c,autoContrast:d})=>{const f=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:d});return{root:{"--button-justify":c,"--button-height":st(s,"button-height"),"--button-padding-x":st(s,"button-padding-x"),"--button-fz":s?.includes("compact")?Gn(s.replace("compact-","")):Gn(s),"--button-radius":t===void 0?void 0:Ht(t),"--button-bg":n||o?f.background:void 0,"--button-hover":n||o?f.hover:void 0,"--button-color":f.color,"--button-bd":n||o?f.border:void 0,"--button-hover-color":n||o?f.hoverColor:void 0}}},Pe=or((e,t)=>{const n=oe("Button",null,e),{style:r,vars:o,className:s,color:c,disabled:d,children:f,leftSection:p,rightSection:m,fullWidth:g,variant:y,radius:b,loading:S,loaderProps:j,gradient:C,classNames:E,styles:R,unstyled:T,"data-disabled":_,autoContrast:k,mod:L,attributes:A,...N}=n,z=Ie({name:"Button",props:n,classes:ou,className:s,style:r,classNames:E,styles:R,unstyled:T,attributes:A,vars:o,varsResolver:z7}),B=!!p,G=!!m;return a.jsxs(In,{ref:t,...z("root",{active:!d&&!S&&!_}),unstyled:T,variant:y,disabled:d||S,mod:[{disabled:d||_,loading:S,block:g,"with-left-section":B,"with-right-section":G},L],...N,children:[typeof S=="boolean"&&a.jsx(to,{mounted:S,transition:I7,duration:150,children:Y=>a.jsx(ce,{component:"span",...z("loader",{style:Y}),"aria-hidden":!0,children:a.jsx(jr,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...j})})}),a.jsxs("span",{...z("inner"),children:[p&&a.jsx(ce,{component:"span",...z("section"),mod:{position:"left"},children:p}),a.jsx(ce,{component:"span",mod:{loading:S},...z("label"),children:f}),m&&a.jsx(ce,{component:"span",...z("section"),mod:{position:"right"},children:m})]})]})});Pe.classes=ou;Pe.displayName="@mantine/core/Button";Pe.Group=m0;Pe.GroupSection=g0;var LA={root:"m_4451eb3a"};const hr=or((e,t)=>{const n=oe("Center",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,inline:p,mod:m,attributes:g,...y}=n,b=Ie({name:"Center",props:n,classes:LA,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:g,vars:f});return a.jsx(ce,{ref:t,mod:[{inline:p},m],...b("root"),...y})});hr.classes=LA;hr.displayName="@mantine/core/Center";const[$7,U7]=zo();function IA(e){const{value:t,defaultValue:n,onChange:r,multiple:o,children:s}=oe("ChipGroup",null,e),[c,d]=tr({value:t,defaultValue:n,finalValue:o?[]:null,onChange:r}),f=m=>Array.isArray(c)?c.includes(m):m===c,p=m=>{const g=m.currentTarget.value;Array.isArray(c)?d(c.includes(g)?c.filter(y=>y!==g):[...c,g]):d(g)};return a.jsx($7,{value:{isChipSelected:f,onChange:p,multiple:o},children:s})}IA.displayName="@mantine/core/ChipGroup";var zA={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 B7={type:"checkbox"},V7=(e,{size:t,radius:n,variant:r,color:o,autoContrast:s})=>{const c=e.variantColorResolver({color:o||e.primaryColor,theme:e,variant:r||"filled",autoContrast:s});return{root:{"--chip-fz":Gn(t),"--chip-size":st(t,"chip-size"),"--chip-radius":n===void 0?void 0:Ht(n),"--chip-checked-padding":st(t,"chip-checked-padding"),"--chip-padding":st(t,"chip-padding"),"--chip-icon-size":st(t,"chip-icon-size"),"--chip-bg":o||r?c.background:void 0,"--chip-hover":o||r?c.hover:void 0,"--chip-color":o||r?c.color:void 0,"--chip-bd":o||r?c.border:void 0,"--chip-spacing":st(t,"chip-spacing")}}},Ad=ge((e,t)=>{const n=oe("Chip",B7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,id:p,checked:m,defaultChecked:g,onChange:y,value:b,wrapperProps:S,type:j,disabled:C,children:E,size:R,variant:T,icon:_,rootRef:k,autoContrast:L,mod:A,attributes:N,...z}=n,B=Ie({name:"Chip",classes:zA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:N,vars:f,varsResolver:V7}),G=U7(),Y=mr(p),{styleProps:J,rest:U}=ja(z),[W,O]=tr({value:m,defaultValue:g,finalValue:!1,onChange:y}),I=G?{checked:G.isChipSelected(b),onChange:H=>{G.onChange(H),y?.(H.currentTarget.checked)},type:G.multiple?"checkbox":"radio"}:{},$=I.checked||W;return a.jsxs(ce,{size:R,variant:T,ref:k,mod:A,...B("root"),...J,...S,children:[a.jsx("input",{type:j,...B("input"),checked:$,onChange:H=>O(H.currentTarget.checked),id:Y,disabled:C,ref:t,value:b,...I,...U}),a.jsxs("label",{htmlFor:Y,"data-checked":$||void 0,"data-disabled":C||void 0,...B("label",{variant:T||"filled"}),children:[$&&_!==null&&_!==!1&&a.jsx("span",{...B("iconWrapper"),children:_===void 0?a.jsx(Zd,{...B("checkIcon")}):_}),a.jsx("span",{children:E})]})]})});Ad.classes=zA;Ad.displayName="@mantine/core/Chip";Ad.Group=IA;var $A={root:"m_b183c0a2"};const F7=(e,{color:t})=>({root:{"--code-bg":t?Kt(t,e):void 0}}),ef=ge((e,t)=>{const n=oe("Code",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,color:p,block:m,variant:g,mod:y,attributes:b,...S}=n,j=Ie({name:"Code",props:n,classes:$A,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:b,vars:f,varsResolver:F7});return a.jsx(ce,{component:m?"pre":"code",variant:g,ref:t,mod:[{block:m},y],...j("root"),...S,dir:"ltr"})});ef.classes=$A;ef.displayName="@mantine/core/Code";var UA={root:"m_7485cace"};const H7=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:st(t,"container-size")}}),tf=ge((e,t)=>{const n=oe("Container",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,fluid:p,mod:m,attributes:g,strategy:y,...b}=n,S=Ie({name:"Container",classes:UA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:g,vars:f,varsResolver:H7});return a.jsx(ce,{ref:t,mod:[{fluid:p,strategy:y||"block"},m],...S("root"),...b})});tf.classes=UA;tf.displayName="@mantine/core/Container";const q7={timeout:1e3};function v0(e){const{children:t,timeout:n,value:r,...o}=oe("CopyButton",q7,e),s=V2({timeout:n}),c=()=>s.copy(r);return a.jsx(a.Fragment,{children:t({copy:c,copied:s.copied,...o})})}v0.displayName="@mantine/core/CopyButton";var BA={root:"m_3eebeb36",label:"m_9e365f20"};const G7={orientation:"horizontal"},Q7=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?Kt(t,e):void 0,"--divider-border-style":n,"--divider-size":st(r,"divider-size")}}),An=ge((e,t)=>{const n=oe("Divider",G7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,color:p,orientation:m,label:g,labelPosition:y,mod:b,attributes:S,...j}=n,C=Ie({name:"Divider",classes:BA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:S,vars:f,varsResolver:Q7});return a.jsx(ce,{ref:t,mod:[{orientation:m,"with-label":!!g},b],...C("root"),...j,role:"separator",children:g&&a.jsx(ce,{component:"span",mod:{position:y},...C("label"),children:g})})});An.classes=BA;An.displayName="@mantine/core/Divider";const[YE,VA]=Er("Grid component was not found in tree"),Mx=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,KE=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":Mx(e,t),XE=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},JE=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function W7({span:e,order:t,offset:n,selector:r}){const o=En(),s=VA(),c=s.breakpoints||o.breakpoints,f=Yi(e)===void 0?12:Yi(e),p=ys({"--col-order":Yi(t)?.toString(),"--col-flex-grow":XE(f,s.grow),"--col-flex-basis":Mx(f,s.columns),"--col-width":f==="content"?"auto":void 0,"--col-max-width":KE(f,s.columns,s.grow),"--col-offset":JE(Yi(n),s.columns)}),m=fn(c).reduce((b,S)=>(b[S]||(b[S]={}),typeof t=="object"&&t[S]!==void 0&&(b[S]["--col-order"]=t[S]?.toString()),typeof e=="object"&&e[S]!==void 0&&(b[S]["--col-flex-grow"]=XE(e[S],s.grow),b[S]["--col-flex-basis"]=Mx(e[S],s.columns),b[S]["--col-width"]=e[S]==="content"?"auto":void 0,b[S]["--col-max-width"]=KE(e[S],s.columns,s.grow)),typeof n=="object"&&n[S]!==void 0&&(b[S]["--col-offset"]=JE(n[S],s.columns)),b),{}),y=jd(fn(m),c).filter(b=>fn(m[b.value]).length>0).map(b=>({query:s.type==="container"?`mantine-grid (min-width: ${c[b.value]})`:`(min-width: ${c[b.value]})`,styles:m[b.value]}));return a.jsx(El,{styles:p,media:s.type==="container"?void 0:y,container:s.type==="container"?y:void 0,selector:r})}var y0={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const Y7={span:12},x0=ge((e,t)=>{const n=oe("GridCol",Y7,e),{classNames:r,className:o,style:s,styles:c,vars:d,span:f,order:p,offset:m,...g}=n,y=VA(),b=Gd();return a.jsxs(a.Fragment,{children:[a.jsx(W7,{selector:`.${b}`,span:f,order:p,offset:m}),a.jsx(ce,{ref:t,...y.getStyles("col",{className:$t(o,b),style:s,classNames:r,styles:c}),...g})]})});x0.classes=y0;x0.displayName="@mantine/core/GridCol";function ZE({gutter:e,selector:t,breakpoints:n,type:r}){const o=En(),s=n||o.breakpoints,c=ys({"--grid-gutter":qn(Yi(e))}),d=fn(s).reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--grid-gutter"]=qn(e[g])),m),{}),p=jd(fn(d),s).filter(m=>fn(d[m.value]).length>0).map(m=>({query:r==="container"?`mantine-grid (min-width: ${s[m.value]})`:`(min-width: ${s[m.value]})`,styles:d[m.value]}));return a.jsx(El,{styles:c,media:r==="container"?void 0:p,container:r==="container"?p:void 0,selector:t})}const K7={gutter:"md",grow:!1,columns:12},X7=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),wr=ge((e,t)=>{const n=oe("Grid",K7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,grow:p,gutter:m,columns:g,align:y,justify:b,children:S,breakpoints:j,type:C,attributes:E,...R}=n,T=Ie({name:"Grid",classes:y0,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:E,vars:f,varsResolver:X7}),_=Gd();return C==="container"&&j?a.jsxs(YE,{value:{getStyles:T,grow:p,columns:g,breakpoints:j,type:C},children:[a.jsx(ZE,{selector:`.${_}`,...n}),a.jsx("div",{...T("container"),children:a.jsx(ce,{ref:t,...T("root",{className:_}),...R,children:a.jsx("div",{...T("inner"),children:S})})})]}):a.jsxs(YE,{value:{getStyles:T,grow:p,columns:g,breakpoints:j,type:C},children:[a.jsx(ZE,{selector:`.${_}`,...n}),a.jsx(ce,{ref:t,...T("root",{className:_}),...R,children:a.jsx("div",{...T("inner"),children:S})})]})});wr.classes=y0;wr.displayName="@mantine/core/Grid";wr.Col=x0;function eT({color:e,theme:t,defaultShade:n}){const r=Wr({color:e,theme:t});return r.isThemeColor?r.shade===void 0?`var(--mantine-color-${r.color}-${n})`:`var(${r.variable})`:e}var FA={root:"m_bcb3f3c2"};const J7={color:"yellow"},Z7=(e,{color:t})=>({root:{"--mark-bg-dark":eT({color:t,theme:e,defaultShade:5}),"--mark-bg-light":eT({color:t,theme:e,defaultShade:2})}}),b0=ge((e,t)=>{const n=oe("Mark",J7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,color:p,variant:m,attributes:g,...y}=n,b=Ie({name:"Mark",props:n,className:o,style:s,classes:FA,classNames:r,styles:c,unstyled:d,attributes:g,vars:f,varsResolver:Z7});return a.jsx(ce,{component:"mark",ref:t,variant:m,...b("root"),...y})});b0.classes=FA;b0.displayName="@mantine/core/Mark";function tT(e){return e.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&")}function e6(e,t){if(t==null)return[{chunk:e,highlighted:!1}];const n=Array.isArray(t)?t.map(tT):tT(t);if(!(Array.isArray(n)?n.filter(d=>d.trim().length>0).length>0:n.trim()!==""))return[{chunk:e,highlighted:!1}];const o=typeof n=="string"?n.trim():n.filter(d=>d.trim().length!==0).map(d=>d.trim()).sort((d,f)=>f.length-d.length).join("|"),s=new RegExp(`(${o})`,"gi");return e.split(s).map(d=>({chunk:d,highlighted:s.test(d)})).filter(({chunk:d})=>d)}const S0=or((e,t)=>{const{unstyled:n,children:r,highlight:o,highlightStyles:s,color:c,...d}=oe("Highlight",null,e),f=e6(r,o);return a.jsx(Ee,{unstyled:n,ref:t,...d,__staticSelector:"Highlight",children:f.map(({chunk:p,highlighted:m},g)=>m?a.jsx(b0,{unstyled:n,color:c,style:s,"data-highlight":p,children:p},g):a.jsx("span",{children:p},g))})});S0.classes=Ee.classes;S0.displayName="@mantine/core/Highlight";function Rp(){return Rp=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},Rp.apply(null,arguments)}function w0(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 t6=v.useLayoutEffect,n6=function(t){var n=Pn.useRef(t);return t6(function(){n.current=t}),n},nT=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},r6=function(t,n){var r=Pn.useRef();return Pn.useCallback(function(o){t.current=o,r.current&&nT(r.current,null),r.current=n,n&&nT(n,o)},[n])},rT={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},i6=function(t){Object.keys(rT).forEach(function(n){t.style.setProperty(n,rT[n],"important")})},iT=i6,Ar=null,oT=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function o6(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),Ar||(Ar=document.createElement("textarea"),Ar.setAttribute("tabindex","-1"),Ar.setAttribute("aria-hidden","true"),iT(Ar)),Ar.parentNode===null&&document.body.appendChild(Ar);var o=e.paddingSize,s=e.borderSize,c=e.sizingStyle,d=c.boxSizing;Object.keys(c).forEach(function(y){var b=y;Ar.style[b]=c[b]}),iT(Ar),Ar.value=t;var f=oT(Ar,e);Ar.value=t,f=oT(Ar,e),Ar.value="x";var p=Ar.scrollHeight-o,m=p*n;d==="border-box"&&(m=m+o+s),f=Math.max(m,f);var g=p*r;return d==="border-box"&&(g=g+o+s),f=Math.min(g,f),[f,p]}var aT=function(){},a6=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},s6=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],l6=!!document.documentElement.currentStyle,c6=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=a6(s6,n),o=r.boxSizing;if(o==="")return null;l6&&o==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var s=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),c=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:s,borderSize:c}},u6=c6;function j0(e,t,n){var r=n6(n);v.useLayoutEffect(function(){var o=function(c){return r.current(c)};if(e)return e.addEventListener(t,o),function(){return e.removeEventListener(t,o)}},[])}var d6=function(t,n){j0(document.body,"reset",function(r){t.current.form===r.target&&n(r)})},f6=function(t){j0(window,"resize",t)},h6=function(t){j0(document.fonts,"loadingdone",t)},p6=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],m6=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,s=t.minRows,c=t.onChange,d=c===void 0?aT:c,f=t.onHeightChange,p=f===void 0?aT:f,m=w0(t,p6),g=m.value!==void 0,y=v.useRef(null),b=r6(y,n),S=v.useRef(0),j=v.useRef(),C=function(){var T=y.current,_=r&&j.current?j.current:u6(T);if(_){j.current=_;var k=o6(_,T.value||T.placeholder||"x",s,o),L=k[0],A=k[1];S.current!==L&&(S.current=L,T.style.setProperty("height",L+"px","important"),p(L,{rowHeight:A}))}},E=function(T){g||C(),d(T)};return v.useLayoutEffect(C),d6(y,function(){if(!g){var R=y.current.value;requestAnimationFrame(function(){var T=y.current;T&&R!==T.value&&C()})}}),f6(C),h6(C),v.createElement("textarea",Rp({},m,{onChange:E,ref:b}))},g6=v.forwardRef(m6);const v6={size:"sm"},Rl=ge((e,t)=>{const{autosize:n,maxRows:r,minRows:o,__staticSelector:s,resize:c,...d}=oe("Textarea",v6,e),f=n&&Y2()!=="test",p=f?{maxRows:r,minRows:o}:{};return a.jsx(Ir,{component:f?g6:"textarea",ref:t,...d,__staticSelector:s||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":c},...p})});Rl.classes=Ir.classes;Rl.displayName="@mantine/core/Textarea";function sT(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const y6={serialize:JSON.stringify,deserialize:JSON.parse,size:"sm"},au=ge((e,t)=>{const{value:n,defaultValue:r,onChange:o,formatOnBlur:s,validationError:c,serialize:d,deserialize:f,onFocus:p,onBlur:m,readOnly:g,error:y,...b}=oe("JsonInput",y6,e),[S,j]=tr({value:n,defaultValue:r,finalValue:"",onChange:o}),[C,E]=v.useState(sT(S,f)),R=_=>{p?.(_),E(!0)},T=_=>{typeof m=="function"&&m(_);const k=sT(_.currentTarget.value,f);s&&!g&&k&&_.currentTarget.value.trim()!==""&&j(d(f(_.currentTarget.value),null,2)),E(k)};return a.jsx(Rl,{value:S,onChange:_=>j(_.currentTarget.value),onFocus:R,onBlur:T,ref:t,readOnly:g,...b,autoComplete:"off",__staticSelector:"JsonInput",error:C?y:c||!0,"data-monospace":!0})});au.classes=Ir.classes;au.displayName="@mantine/core/JsonInput";const[x6,b6]=Er("List component was not found in tree");var C0={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const E0=ge((e,t)=>{const n=oe("ListItem",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,icon:f,children:p,mod:m,...g}=n,y=b6(),b=f||y.icon,S={classNames:r,styles:c};return a.jsx(ce,{...y.getStyles("item",{...S,className:o,style:s}),component:"li",mod:[{"with-icon":!!b,centered:y.center},m],ref:t,...g,children:a.jsxs("div",{...y.getStyles("itemWrapper",S),children:[b&&a.jsx("span",{...y.getStyles("itemIcon",S),children:b}),a.jsx("span",{...y.getStyles("itemLabel",S),children:p})]})})});E0.classes=C0;E0.displayName="@mantine/core/ListItem";const S6={type:"unordered"},w6=(e,{size:t,spacing:n})=>({root:{"--list-fz":Gn(t),"--list-lh":B2(t),"--list-spacing":qn(n)}}),Pr=ge((e,t)=>{const n=oe("List",S6,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,children:p,type:m,withPadding:g,icon:y,spacing:b,center:S,listStyleType:j,mod:C,attributes:E,...R}=n,T=Ie({name:"List",classes:C0,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:E,vars:f,varsResolver:w6});return a.jsx(x6,{value:{center:S,icon:y,getStyles:T},children:a.jsx(ce,{...T("root",{style:{listStyleType:j}}),component:m==="unordered"?"ul":"ol",mod:[{"with-padding":g,type:j},C],ref:t,...R,children:p})})});Pr.classes=C0;Pr.displayName="@mantine/core/List";Pr.Item=E0;var HA={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const lT={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Lr("overlay")},j6=(e,{zIndex:t})=>({root:{"--lo-z-index":t?.toString()}}),vm=ge((e,t)=>{const n=oe("LoadingOverlay",lT,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,transitionProps:p,loaderProps:m,overlayProps:g,visible:y,zIndex:b,attributes:S,...j}=n,C=En(),E=Ie({name:"LoadingOverlay",classes:HA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:S,vars:f,varsResolver:j6}),R={...lT.overlayProps,...g};return a.jsx(to,{transition:"fade",...p,mounted:!!y,children:T=>a.jsxs(ce,{...E("root",{style:T}),ref:t,...j,children:[a.jsx(jr,{...E("loader"),unstyled:d,...m}),a.jsx(Bc,{...R,...E("overlay"),darkHidden:!0,unstyled:d,color:g?.color||C.white}),a.jsx(Bc,{...R,...E("overlay"),lightHidden:!0,unstyled:d,color:g?.color||C.colors.dark[5]})]})})});vm.classes=HA;vm.displayName="@mantine/core/LoadingOverlay";const[C6,ws]=Er("Menu component was not found in the tree");var js={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504",chevron:"m_b85b0bed"};const T0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=oe("MenuDivider",null,e),f=ws();return a.jsx(ce,{ref:t,...f.getStyles("divider",{className:r,style:o,styles:s,classNames:n}),...d})});T0.classes=js;T0.displayName="@mantine/core/MenuDivider";const R0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,onMouseEnter:d,onMouseLeave:f,onKeyDown:p,children:m,...g}=oe("MenuDropdown",null,e),y=v.useRef(null),b=ws(),S=ir(p,E=>{(E.key==="ArrowUp"||E.key==="ArrowDown")&&(E.preventDefault(),y.current?.querySelectorAll("[data-menu-item]:not(:disabled)")[0]?.focus())}),j=ir(d,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.openDropdown()),C=ir(f,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.closeDropdown());return a.jsxs(Kr.Dropdown,{...g,onMouseEnter:j,onMouseLeave:C,role:"menu","aria-orientation":"vertical",ref:$n(t,y),...b.getStyles("dropdown",{className:r,style:o,styles:s,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:S,children:[b.withInitialFocusPlaceholder&&a.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),m]})});R0.classes=js;R0.displayName="@mantine/core/MenuDropdown";const[E6,ym]=zo(),_0=or((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,color:d,closeMenuOnClick:f,leftSection:p,rightSection:m,children:g,disabled:y,"data-disabled":b,...S}=oe("MenuItem",null,e),j=ws(),C=ym(),E=En(),{dir:R}=xs(),T=v.useRef(null),_=S,k=ir(_.onClick,()=>{b||(typeof f=="boolean"?f&&j.closeDropdownImmediately():j.closeOnItemClick&&j.closeDropdownImmediately())}),L=d?E.variantColorResolver({color:d,theme:E,variant:"light"}):void 0,A=d?Wr({color:d,theme:E}):null,N=ir(_.onKeyDown,z=>{z.key==="ArrowLeft"&&C&&(C.close(),C.focusParentItem())});return a.jsxs(In,{onMouseDown:z=>z.preventDefault(),...S,unstyled:j.unstyled,tabIndex:j.menuItemTabIndex,...j.getStyles("item",{className:r,style:o,styles:s,classNames:n}),ref:$n(T,t),role:"menuitem",disabled:y,"data-menu-item":!0,"data-disabled":y||b||void 0,"data-mantine-stop-propagation":!0,onClick:k,onKeyDown:yb({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:j.loop,dir:R,orientation:"vertical",onKeyDown:N}),__vars:{"--menu-item-color":A?.isThemeColor&&A?.shade===void 0?`var(--mantine-color-${A.color}-6)`:L?.color,"--menu-item-hover":L?.hover},children:[p&&a.jsx("div",{...j.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"left",children:p}),g&&a.jsx("div",{...j.getStyles("itemLabel",{styles:s,classNames:n}),children:g}),m&&a.jsx("div",{...j.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"right",children:m})]})});_0.classes=js;_0.displayName="@mantine/core/MenuItem";const A0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=oe("MenuLabel",null,e),f=ws();return a.jsx(ce,{ref:t,...f.getStyles("label",{className:r,style:o,styles:s,classNames:n}),...d})});A0.classes=js;A0.displayName="@mantine/core/MenuLabel";const D0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,onMouseEnter:d,onMouseLeave:f,onKeyDown:p,children:m,...g}=oe("MenuSubDropdown",null,e),y=v.useRef(null),b=ws(),S=ym(),j=ir(d,S?.open),C=ir(f,S?.close);return a.jsx(Kr.Dropdown,{...g,onMouseEnter:j,onMouseLeave:C,role:"menu","aria-orientation":"vertical",ref:$n(t,y),...b.getStyles("dropdown",{className:r,style:o,styles:s,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,children:m})});D0.classes=js;D0.displayName="@mantine/core/MenuSubDropdown";const k0=or((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,color:d,leftSection:f,rightSection:p,children:m,disabled:g,"data-disabled":y,closeMenuOnClick:b,...S}=oe("MenuSubItem",null,e),j=ws(),C=ym(),E=En(),{dir:R}=xs(),T=v.useRef(null),_=S,k=d?E.variantColorResolver({color:d,theme:E,variant:"light"}):void 0,L=d?Wr({color:d,theme:E}):null,A=ir(_.onKeyDown,G=>{G.key==="ArrowRight"&&(C?.open(),C?.focusFirstItem()),G.key==="ArrowLeft"&&C?.parentContext&&(C.parentContext.close(),C.parentContext.focusParentItem())}),N=ir(_.onClick,()=>{!y&&b&&j.closeDropdownImmediately()}),z=ir(_.onMouseEnter,C?.open),B=ir(_.onMouseLeave,C?.close);return a.jsxs(In,{onMouseDown:G=>G.preventDefault(),...S,unstyled:j.unstyled,tabIndex:j.menuItemTabIndex,...j.getStyles("item",{className:r,style:o,styles:s,classNames:n}),ref:$n(T,t),role:"menuitem",disabled:g,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":g||y||void 0,"data-mantine-stop-propagation":!0,onMouseEnter:z,onMouseLeave:B,onClick:N,onKeyDown:yb({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:j.loop,dir:R,orientation:"vertical",onKeyDown:A}),__vars:{"--menu-item-color":L?.isThemeColor&&L?.shade===void 0?`var(--mantine-color-${L.color}-6)`:k?.color,"--menu-item-hover":k?.hover},children:[f&&a.jsx("div",{...j.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"left",children:f}),m&&a.jsx("div",{...j.getStyles("itemLabel",{styles:s,classNames:n}),children:m}),a.jsx("div",{...j.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"right",children:p||a.jsx(uA,{...j.getStyles("chevron"),size:14})})]})});k0.classes=js;k0.displayName="@mantine/core/MenuSubItem";function qA({children:e,refProp:t}){if(!Io(e))throw new Error("Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return ws(),a.jsx(Kr.Target,{refProp:t,popupType:"menu",children:e})}qA.displayName="@mantine/core/MenuSubTarget";const T6={offset:0,position:"right-start",transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function su(e){const{children:t,closeDelay:n,openDelay:r,...o}=oe("MenuSub",T6,e),s=mr(),[c,{open:d,close:f}]=Zc(!1),p=ym(),{openDropdown:m,closeDropdown:g}=cA({open:d,close:f,closeDelay:n,openDelay:r}),y=()=>window.setTimeout(()=>{document.getElementById(`${s}-dropdown`)?.querySelectorAll("[data-menu-item]:not([data-disabled])")[0]?.focus()},16),b=()=>window.setTimeout(()=>{document.getElementById(`${s}-target`)?.focus()},16);return a.jsx(E6,{value:{opened:c,close:g,open:m,focusFirstItem:y,focusParentItem:b,parentContext:p},children:a.jsx(Kr,{opened:c,withinPortal:!1,withArrow:!1,id:s,...o,children:t})})}su.extend=e=>e;su.displayName="@mantine/core/MenuSub";su.Target=qA;su.Dropdown=D0;su.Item=k0;const R6={refProp:"ref"},GA=v.forwardRef((e,t)=>{const{children:n,refProp:r,...o}=oe("MenuTarget",R6,e);if(!Io(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=ws(),c=n.props,d=ir(c.onClick,()=>{s.trigger==="click"?s.toggleDropdown():s.trigger==="click-hover"&&(s.setOpenedViaClick(!0),s.opened||s.openDropdown())}),f=ir(c.onMouseEnter,()=>(s.trigger==="hover"||s.trigger==="click-hover")&&s.openDropdown()),p=ir(c.onMouseLeave,()=>{(s.trigger==="hover"||s.trigger==="click-hover"&&!s.openedViaClick)&&s.closeDropdown()});return a.jsx(Kr.Target,{refProp:r,popupType:"menu",ref:t,...o,children:v.cloneElement(n,{onClick:d,onMouseEnter:f,onMouseLeave:p,"data-expanded":s.opened?!0:void 0})})});GA.displayName="@mantine/core/MenuTarget";const _6={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function be(e){const t=oe("Menu",_6,e),{children:n,onOpen:r,onClose:o,opened:s,defaultOpened:c,trapFocus:d,onChange:f,closeOnItemClick:p,loop:m,closeOnEscape:g,trigger:y,openDelay:b,closeDelay:S,classNames:j,styles:C,unstyled:E,variant:R,vars:T,menuItemTabIndex:_,keepMounted:k,withInitialFocusPlaceholder:L,attributes:A,...N}=t,z=Ie({name:"Menu",classes:js,props:t,classNames:j,styles:C,unstyled:E,attributes:A}),[B,G]=tr({value:s,defaultValue:c,finalValue:!1,onChange:f}),[Y,J]=v.useState(!1),U=()=>{G(!1),J(!1),B&&o?.()},W=()=>{G(!0),!B&&r?.()},O=()=>{B?U():W()},{openDropdown:I,closeDropdown:$}=cA({open:W,close:U,closeDelay:S,openDelay:b}),H=F=>QM("[data-menu-item]","[data-menu-dropdown]",F),{resolvedClassNames:K,resolvedStyles:M}=jl({classNames:j,styles:C,props:t});return a.jsx(C6,{value:{getStyles:z,opened:B,toggleDropdown:O,getItemIndex:H,openedViaClick:Y,setOpenedViaClick:J,closeOnItemClick:p,closeDropdown:y==="click"?U:$,openDropdown:y==="click"?W:I,closeDropdownImmediately:U,loop:m,trigger:y,unstyled:E,menuItemTabIndex:_,withInitialFocusPlaceholder:L},children:a.jsx(Kr,{...N,opened:B,onChange:O,defaultOpened:c,trapFocus:k?!1:d,closeOnEscape:g,__staticSelector:"Menu",classNames:K,styles:M,unstyled:E,variant:R,keepMounted:k,children:n})})}be.extend=e=>e;be.withProps=O5(be);be.classes=js;be.displayName="@mantine/core/Menu";be.Item=_0;be.Label=A0;be.Dropdown=R0;be.Target=GA;be.Divider=T0;be.Sub=su;const[A6,lu]=Er("Modal component was not found in tree");var Ea={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const xm=ge((e,t)=>{const n=oe("ModalBody",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,...f}=n,p=lu();return a.jsx(eA,{ref:t,...p.getStyles("body",{classNames:r,style:s,styles:c,className:o}),...f})});xm.classes=Ea;xm.displayName="@mantine/core/ModalBody";const bm=ge((e,t)=>{const n=oe("ModalCloseButton",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,...f}=n,p=lu();return a.jsx(tA,{ref:t,...p.getStyles("close",{classNames:r,style:s,styles:c,className:o}),...f})});bm.classes=Ea;bm.displayName="@mantine/core/ModalCloseButton";const Sm=ge((e,t)=>{const n=oe("ModalContent",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,children:f,__hidden:p,...m}=n,g=lu(),y=g.scrollAreaComponent||gI;return a.jsx(nA,{...g.getStyles("content",{className:o,style:s,styles:c,classNames:r}),innerProps:g.getStyles("inner",{className:o,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:a.jsx(y,{style:{maxHeight:g.fullScreen?"100dvh":`calc(100dvh - (${le(g.yOffset)} * 2))`},children:f})})});Sm.classes=Ea;Sm.displayName="@mantine/core/ModalContent";const wm=ge((e,t)=>{const n=oe("ModalHeader",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,...f}=n,p=lu();return a.jsx(rA,{ref:t,...p.getStyles("header",{classNames:r,style:s,styles:c,className:o}),...f})});wm.classes=Ea;wm.displayName="@mantine/core/ModalHeader";const jm=ge((e,t)=>{const n=oe("ModalOverlay",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,...f}=n,p=lu();return a.jsx(iA,{ref:t,...p.getStyles("overlay",{classNames:r,style:s,styles:c,className:o}),...f})});jm.classes=Ea;jm.displayName="@mantine/core/ModalOverlay";const D6={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Lr("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},k6=(e,{radius:t,size:n,yOffset:r,xOffset:o})=>({root:{"--modal-radius":t===void 0?void 0:Ht(t),"--modal-size":st(n,"modal-size"),"--modal-y-offset":le(r),"--modal-x-offset":le(o)}}),Cm=ge((e,t)=>{const n=oe("ModalRoot",D6,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,yOffset:p,scrollAreaComponent:m,radius:g,fullScreen:y,centered:b,xOffset:S,__staticSelector:j,attributes:C,...E}=n,R=Ie({name:j,classes:Ea,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:C,vars:f,varsResolver:k6});return a.jsx(A6,{value:{yOffset:p,scrollAreaComponent:m,getStyles:R,fullScreen:y},children:a.jsx(Z_,{ref:t,...R("root"),"data-full-screen":y||void 0,"data-centered":b||void 0,"data-offset-scrollbars":m===Yr.Autosize||void 0,unstyled:d,...E})})});Cm.classes=Ea;Cm.displayName="@mantine/core/ModalRoot";const[P6,N6]=zo();function QA({children:e}){const[t,n]=v.useState([]),[r,o]=v.useState(Lr("modal"));return a.jsx(P6,{value:{stack:t,addModal:(s,c)=>{n(d=>[...new Set([...d,s])]),o(d=>typeof c=="number"&&typeof d=="number"?Math.max(d,c):d)},removeModal:s=>n(c=>c.filter(d=>d!==s)),getZIndex:s=>`calc(${r} + ${t.indexOf(s)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}QA.displayName="@mantine/core/ModalStack";const Em=ge((e,t)=>{const n=oe("ModalTitle",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,...f}=n,p=lu();return a.jsx(oA,{ref:t,...p.getStyles("title",{classNames:r,style:s,styles:c,className:o}),...f})});Em.classes=Ea;Em.displayName="@mantine/core/ModalTitle";const O6={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Lr("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Un=ge((e,t)=>{const{title:n,withOverlay:r,overlayProps:o,withCloseButton:s,closeButtonProps:c,children:d,radius:f,opened:p,stackId:m,zIndex:g,...y}=oe("Modal",O6,e),b=N6(),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||Lr("modal")):b.removeModal(m))},[p,m,g]),a.jsxs(Cm,{ref:t,radius:f,opened:p,zIndex:b&&m?b.getZIndex(m):g,...y,...j,children:[r&&a.jsx(jm,{visible:C,transitionProps:b&&m?{duration:0}:void 0,...o}),a.jsxs(Sm,{radius:f,__hidden:b&&m&&p?m!==b.currentId:!1,children:[S&&a.jsxs(wm,{children:[n&&a.jsx(Em,{children:n}),s&&a.jsx(bm,{...c})]}),a.jsx(xm,{children:d})]})]})});Un.classes=Ea;Un.displayName="@mantine/core/Modal";Un.Root=Cm;Un.Overlay=jm;Un.Content=Sm;Un.Body=xm;Un.Header=wm;Un.Title=Em;Un.CloseButton=bm;Un.Stack=QA;const[M6,P0]=zo(),[L6,I6]=zo();var Tm={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const z6=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?st(t):st(n,"pg-gap")}}),N0=ge((e,t)=>{const n=oe("PillGroup",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,size:p,disabled:m,attributes:g,...y}=n,S=P0()?.size||p||void 0,j=Ie({name:"PillGroup",classes:Tm,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:g,vars:f,varsResolver:z6,stylesCtx:{size:S},rootSelector:"group"});return a.jsx(L6,{value:{size:S,disabled:m},children:a.jsx(ce,{ref:t,size:S,...j("group"),...y})})});N0.classes=Tm;N0.displayName="@mantine/core/PillGroup";const $6={variant:"default"},U6=(e,{radius:t},{size:n})=>({root:{"--pill-fz":st(n,"pill-fz"),"--pill-height":st(n,"pill-height"),"--pill-radius":t===void 0?void 0:Ht(t)}}),ya=ge((e,t)=>{const n=oe("Pill",$6,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,variant:p,children:m,withRemoveButton:g,onRemove:y,removeButtonProps:b,radius:S,size:j,disabled:C,mod:E,attributes:R,...T}=n,_=I6(),k=P0(),L=j||_?.size||void 0,A=k?.variant==="filled"?"contrast":p||"default",N=Ie({name:"Pill",classes:Tm,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:R,vars:f,varsResolver:U6,stylesCtx:{size:L}});return a.jsxs(ce,{component:"span",ref:t,variant:A,size:L,...N("root",{variant:A}),mod:[{"with-remove":g&&!C,disabled:C||_?.disabled},E],...T,children:[a.jsx("span",{...N("label"),children:m}),g&&a.jsx(bs,{variant:"transparent",radius:S,tabIndex:-1,"aria-hidden":!0,unstyled:d,...b,...N("remove",{className:b?.className,style:b?.style}),onMouseDown:z=>{z.preventDefault(),z.stopPropagation(),b?.onMouseDown?.(z)},onClick:z=>{z.stopPropagation(),y?.(),b?.onClick?.(z)}})]})});ya.classes=Tm;ya.displayName="@mantine/core/Pill";ya.Group=N0;var WA={field:"m_45c4369d"};const B6={type:"visible"},O0=ge((e,t)=>{const n=oe("PillsInputField",B6,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,type:p,disabled:m,id:g,pointer:y,mod:b,attributes:S,...j}=n,C=P0(),E=ru(),R=Ie({name:"PillsInputField",classes:WA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:S,rootSelector:"field"}),T=m||C?.disabled;return a.jsx(ce,{component:"input",ref:$n(t,C?.fieldRef),"data-type":p,disabled:T,mod:[{disabled:T,pointer:y},b],...R("field"),...j,id:E?.inputId||g,"aria-invalid":C?.hasError,"aria-describedby":E?.describedBy,type:"text",onMouseDown:_=>!y&&_.stopPropagation()})});O0.classes=WA;O0.displayName="@mantine/core/PillsInputField";const V6={size:"sm"},ms=ge((e,t)=>{const n=oe("PillsInput",V6,e),{children:r,onMouseDown:o,onClick:s,size:c,disabled:d,__staticSelector:f,error:p,variant:m,...g}=n,y=v.useRef(null);return a.jsx(M6,{value:{fieldRef:y,size:c,disabled:d,hasError:!!p,variant:m},children:a.jsx(Ir,{size:c,error:p,variant:m,component:"div",ref:t,"data-no-overflow":!0,onMouseDown:b=>{b.preventDefault(),o?.(b),y.current?.focus()},onClick:b=>{b.preventDefault(),b.currentTarget.closest("fieldset")?.disabled||(y.current?.focus(),s?.(b))},...g,multiline:!0,disabled:d,__staticSelector:f||"PillsInput",withAria:!1,children:r})})});ms.displayName="@mantine/core/PillsInput";ms.Field=O0;function F6({data:e,value:t}){const n=t.map(o=>o.trim().toLowerCase());return e.reduce((o,s)=>(Fc(s)?o.push({group:s.group,items:s.items.filter(c=>n.indexOf(c.value.toLowerCase().trim())===-1)}):n.indexOf(s.value.toLowerCase().trim())===-1&&o.push(s),o),[])}const H6={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:",",clearSearchOnChange:!0,size:"sm"},Rm=ge((e,t)=>{const n=oe("MultiSelect",H6,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,size:p,value:m,defaultValue:g,onChange:y,onKeyDown:b,variant:S,data:j,dropdownOpened:C,defaultDropdownOpened:E,onDropdownOpen:R,onDropdownClose:T,selectFirstOptionOnChange:_,onOptionSubmit:k,comboboxProps:L,filter:A,limit:N,withScrollArea:z,maxDropdownHeight:B,searchValue:G,defaultSearchValue:Y,onSearchChange:J,readOnly:U,disabled:W,onFocus:O,onBlur:I,radius:$,rightSection:H,rightSectionWidth:K,rightSectionPointerEvents:M,rightSectionProps:F,leftSection:ae,leftSectionWidth:de,leftSectionPointerEvents:xe,leftSectionProps:Se,inputContainer:Ce,inputWrapperOrder:Ke,withAsterisk:Ae,labelProps:dt,descriptionProps:Ct,errorProps:ot,wrapperProps:it,description:pt,label:Et,error:wt,maxValues:Te,searchable:_e,nothingFoundMessage:Le,withCheckIcon:Me,withAlignedLabels:lt,checkIconPosition:nt,hidePickedOptions:ft,withErrorStyles:pe,name:Ve,form:je,id:ke,clearable:At,clearButtonProps:gn,hiddenInputProps:vn,placeholder:Bn,hiddenInputValuesDivider:ln,required:gr,mod:Qt,renderOption:ar,onRemove:Tn,onClear:co,scrollAreaProps:Ho,chevronColor:ka,attributes:zr,clearSearchOnChange:qo,...Bi}=n,Jr=mr(ke),Vi=mA(j),sr=gA(Vi),As=v.useRef({}),Vn=Tl({opened:C,defaultOpened:E,onDropdownOpen:R,onDropdownClose:()=>{T?.(),Vn.resetSelectedOption()}}),{styleProps:uo,rest:{type:Go,autoComplete:gu,...Ml}}=ja(Bi),[V,X]=tr({value:m,defaultValue:g,finalValue:[],onChange:y}),[ie,we]=tr({value:G,defaultValue:Y,finalValue:"",onChange:J}),De=tt=>{we(tt),Vn.resetSelectedOption()},We=Ie({name:"MultiSelect",classes:{},props:n,classNames:r,styles:c,unstyled:d,attributes:zr}),{resolvedClassNames:qe,resolvedStyles:Oe}=jl({props:n,styles:c,classNames:r}),ze=tt=>{b?.(tt),tt.key===" "&&!_e&&(tt.preventDefault(),Vn.toggleDropdown()),tt.key==="Backspace"&&ie.length===0&&V.length>0&&(Tn?.(V[V.length-1]),X(V.slice(0,V.length-1)))},Xe=V.map((tt,Zt)=>{const Rn=sr[tt]||As.current[tt];return a.jsx(ya,{withRemoveButton:!U&&!sr[tt]?.disabled,onRemove:()=>{X(V.filter(It=>tt!==It)),Tn?.(tt)},unstyled:d,disabled:W,...We("pill"),children:Rn?.label||tt},`${tt}-${Zt}`)});v.useEffect(()=>{_&&Vn.selectFirstOption()},[_,ie]),v.useEffect(()=>{V.forEach(tt=>{tt in sr&&(As.current[tt]=sr[tt])})},[sr,V]);const et=a.jsx(Ye.ClearButton,{...gn,onClear:()=>{co?.(),X([]),De("")}}),rt=F6({data:Vi,value:V}),Tt=At&&V.length>0&&!W&&!U;return a.jsxs(a.Fragment,{children:[a.jsxs(Ye,{store:Vn,classNames:qe,styles:Oe,unstyled:d,size:p,readOnly:U,__staticSelector:"MultiSelect",attributes:zr,onOptionSubmit:tt=>{k?.(tt),qo&&De(""),Vn.updateSelectedOptionIndex("selected"),V.includes(sr[tt].value)?(X(V.filter(Zt=>Zt!==sr[tt].value)),Tn?.(sr[tt].value)):V.length<Te&&X([...V,sr[tt].value])},...L,children:[a.jsx(Ye.DropdownTarget,{children:a.jsx(ms,{...uo,__staticSelector:"MultiSelect",classNames:qe,styles:Oe,unstyled:d,size:p,className:o,style:s,variant:S,disabled:W,radius:$,__defaultRightSection:a.jsx(Ye.Chevron,{size:p,error:wt,unstyled:d,color:ka}),__clearSection:et,__clearable:Tt,rightSection:H,rightSectionPointerEvents:M||"none",rightSectionWidth:K,rightSectionProps:F,leftSection:ae,leftSectionWidth:de,leftSectionPointerEvents:xe,leftSectionProps:Se,inputContainer:Ce,inputWrapperOrder:Ke,withAsterisk:Ae,labelProps:dt,descriptionProps:Ct,errorProps:ot,wrapperProps:it,description:pt,label:Et,error:wt,withErrorStyles:pe,__stylesApiProps:{...n,rightSectionPointerEvents:M||(Tt?"all":"none"),multiline:!0},pointer:!_e,onClick:()=>_e?Vn.openDropdown():Vn.toggleDropdown(),"data-expanded":Vn.dropdownOpened||void 0,id:Jr,required:gr,mod:Qt,attributes:zr,children:a.jsxs(ya.Group,{attributes:zr,disabled:W,unstyled:d,...We("pillsList"),children:[Xe,a.jsx(Ye.EventsTarget,{autoComplete:gu,children:a.jsx(ms.Field,{...Ml,ref:t,id:Jr,placeholder:Bn,type:!_e&&!Bn?"hidden":"visible",...We("inputField"),unstyled:d,onFocus:tt=>{O?.(tt),_e&&Vn.openDropdown()},onBlur:tt=>{I?.(tt),Vn.closeDropdown(),De("")},onKeyDown:ze,value:ie,onChange:tt=>{De(tt.currentTarget.value),_e&&Vn.openDropdown(),_&&Vn.selectFirstOption()},disabled:W,readOnly:U||!_e,pointer:!_e})})]})})}),a.jsx(w7,{data:ft?rt:Vi,hidden:U||W,filter:A,search:ie,limit:N,hiddenWhenEmpty:!Le,withScrollArea:z,maxDropdownHeight:B,filterOptions:_e,value:V,checkIconPosition:nt,withCheckIcon:Me,withAlignedLabels:lt,nothingFoundMessage:Le,unstyled:d,labelId:Et?`${Jr}-label`:void 0,"aria-label":Et?void 0:Bi["aria-label"],renderOption:ar,scrollAreaProps:Ho})]}),a.jsx(Ye.HiddenInput,{name:Ve,valuesDivider:ln,value:V,form:je,disabled:W,...vn})]})});Rm.classes={...Ir.classes,...Ye.classes};Rm.displayName="@mantine/core/MultiSelect";function q6(e){return"group"in e}function M0({data:e}){if(q6(e)){const o=e.items.map(s=>a.jsx(M0,{data:s},s.value));return a.jsx("optgroup",{label:e.group,children:o})}const{value:t,label:n,...r}=e;return a.jsx("option",{value:e.value,...r,children:e.label},e.value)}M0.displayName="@mantine/core/NativeSelectOption";const G6={rightSectionPointerEvents:"none"},hn=ge((e,t)=>{const{data:n,children:r,size:o,error:s,rightSection:c,unstyled:d,...f}=oe("NativeSelect",G6,e),p=mA(n).map((m,g)=>a.jsx(M0,{data:m},g));return a.jsx(Ir,{component:"select",ref:t,...f,__staticSelector:"NativeSelect",size:o,pointer:!0,error:s,unstyled:d,rightSection:c||a.jsx(pm,{size:o,error:s,unstyled:d}),children:r||p})});hn.classes=Ir.classes;hn.displayName="@mantine/core/NativeSelect";var YA={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const Q6={withCloseButton:!0},W6=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:Ht(t),"--notification-color":n?Kt(n,e):void 0}}),L0=ge((e,t)=>{const n=oe("Notification",Q6,e),{className:r,color:o,radius:s,loading:c,withCloseButton:d,withBorder:f,title:p,icon:m,children:g,onClose:y,closeButtonProps:b,classNames:S,style:j,styles:C,unstyled:E,variant:R,vars:T,mod:_,loaderProps:k,role:L,attributes:A,...N}=n,z=Ie({name:"Notification",classes:YA,props:n,className:r,style:j,classNames:S,styles:C,unstyled:E,attributes:A,vars:T,varsResolver:W6});return a.jsxs(ce,{...z("root"),mod:[{"data-with-icon":!!m||c,"data-with-border":f},_],ref:t,variant:R,role:L||"alert",...N,children:[m&&!c&&a.jsx("div",{...z("icon"),children:m}),c&&a.jsx(jr,{size:28,color:o,...k,...z("loader")}),a.jsxs("div",{...z("body"),children:[p&&a.jsx("div",{...z("title"),children:p}),a.jsx(ce,{...z("description"),mod:{"data-with-title":!!p},children:g})]}),d&&a.jsx(bs,{iconSize:16,color:"gray",...b,unstyled:E,onClick:y,...z("closeButton")})]})});L0.classes=YA;L0.displayName="@mantine/core/Notification";function KA(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}var Dd;(function(e){e.event="event",e.props="prop"})(Dd||(Dd={}));function ss(){}function Y6(e){var t,n=void 0;return function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return t&&r.length===t.length&&r.every(function(s,c){return s===t[c]})||(t=r,n=e.apply(void 0,r)),n}}function kd(e){return!!(e||"").match(/\d/)}function Mc(e){return e==null}function K6(e){return typeof e=="number"&&isNaN(e)}function XA(e){return Mc(e)||K6(e)||typeof e=="number"&&!isFinite(e)}function JA(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function X6(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 J6(e,t,n){var r=X6(n),o=e.search(/[1-9]/);return o=o===-1?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(r,"$1"+t)}function Z6(e){var t=v.useRef(e);t.current=e;var n=v.useRef(function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return t.current.apply(t,r)});return n.current}function I0(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var o=e.split("."),s=o[0],c=o[1]||"";return{beforeDecimal:s,afterDecimal:c,hasNegation:n,addNegation:r}}function ez(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",o=n[1]||"";return(t?"-":"")+r+(o?"."+o:"")}function ZA(e,t,n){for(var r="",o=n?"0":"",s=0;s<=t-1;s++)r+=e[s]||o;return r}function cT(e,t){return Array(t+1).join(e)}function eD(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),o=r[0],s=r[1];if(s=Number(s),!s)return n+o;o=o.replace(".","");var c=1+s,d=o.length;return c<0?o="0."+cT("0",Math.abs(c))+o:c>=d?o=o+cT("0",c-d):o=(o.substring(0,c)||"0")+"."+o.substring(c),n+o}function uT(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,o=I0(e),s=o.beforeDecimal,c=o.afterDecimal,d=o.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,E){return j.length>E?(Number(j[0])+Number(C)).toString()+j.substring(1,j.length):C+j},m[0]));var y=ZA(m[1]||"",t,n),b=d?"-":"",S=r?".":"";return""+b+g+S+y}function Js(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 tD=Y6(function(e,t){for(var n=0,r=0,o=e.length,s=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[s-1-r]&&s-r>n&&o-r>n;)r++;return{from:{start:n,end:o-r},to:{start:n,end:s-r}}}),tz=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function nz(e,t,n){return Math.min(Math.max(e,t),n)}function Fy(e){return Math.max(e.selectionStart,e.selectionEnd)}function rz(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function iz(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function oz(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,o=e.formattedValueIndex;return t[r]===n[o]}function az(e,t,n,r,o,s,c){c===void 0&&(c=oz);var d=o.findIndex(function(_){return _}),f=e.slice(0,d);!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 E=r;E<p&&(y[E]===-1||!s(n[E]));)E++;var R=E===p||y[E]===-1?m:y[E];for(E=r-1;E>0&&y[E]===-1;)E--;var T=E===-1||y[E]===-1?0:y[E]+1;return T>R?R:r-T<R-r?T:R}function dT(e,t,n,r){var o=e.length;if(t=nz(t,0,o),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=o&&!n[t];)t++;t>o&&(t=n.lastIndexOf(!0))}return t===-1&&(t=o),t}function sz(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(kd(e[n])||kd(e[n-1]));return t}function nD(e,t,n,r,o,s){s===void 0&&(s=ss);var c=Z6(function(S,j){var C,E;return XA(S)?(E="",C=""):typeof S=="number"||j?(E=typeof S=="number"?eD(S):S,C=r(E)):(E=o(S,void 0),C=r(E)),{formattedValue:C,numAsString:E}}),d=v.useState(function(){return c(Mc(e)?t:e,n)}),f=d[0],p=d[1],m=function(S,j){S.formattedValue!==f.formattedValue&&p({formattedValue:S.formattedValue,numAsString:S.value}),s(S,j)},g=e,y=n;Mc(e)&&(g=f.numAsString,y=!0);var b=c(g,y);return v.useMemo(function(){p(b)},[b.formattedValue]),[f,m]}function lz(e){return e.replace(/[^0-9]/g,"")}function cz(e){return e}function uz(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,o=e.renderText,s=e.getInputRef,c=e.format;c===void 0&&(c=cz);var d=e.removeFormatting;d===void 0&&(d=lz);var f=e.defaultValue,p=e.valueIsNumericString,m=e.onValueChange,g=e.isAllowed,y=e.onChange;y===void 0&&(y=ss);var b=e.onKeyDown;b===void 0&&(b=ss);var S=e.onMouseUp;S===void 0&&(S=ss);var j=e.onFocus;j===void 0&&(j=ss);var C=e.onBlur;C===void 0&&(C=ss);var E=e.value,R=e.getCaretBoundary;R===void 0&&(R=sz);var T=e.isValidInputCharacter;T===void 0&&(T=kd);var _=e.isCharacterSame,k=KA(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),L=nD(E,f,!!p,c,d,m),A=L[0],N=A.formattedValue,z=A.numAsString,B=L[1],G=v.useRef(),Y=v.useRef({formattedValue:N,numAsString:z}),J=function(Te,_e){Y.current={formattedValue:Te.formattedValue,numAsString:Te.value},B(Te,_e)},U=v.useState(!1),W=U[0],O=U[1],I=v.useRef(null),$=v.useRef({setCaretTimeout:null,focusTimeout:null});v.useEffect(function(){return O(!0),function(){clearTimeout($.current.setCaretTimeout),clearTimeout($.current.focusTimeout)}},[]);var H=c,K=function(Te,_e){var Le=parseFloat(_e);return{formattedValue:Te,value:_e,floatValue:isNaN(Le)?void 0:Le}},M=function(Te,_e,Le){Te.selectionStart===0&&Te.selectionEnd===Te.value.length||(Js(Te,_e),$.current.setCaretTimeout=setTimeout(function(){Te.value===Le&&Te.selectionStart!==_e&&Js(Te,_e)},0))},F=function(Te,_e,Le){return dT(Te,_e,R(Te),Le)},ae=function(Te,_e,Le){var Me=R(_e),lt=az(_e,N,Te,Le,Me,T,_);return lt=dT(_e,lt,Me),lt},de=function(Te){var _e=Te.formattedValue;_e===void 0&&(_e="");var Le=Te.input,Me=Te.source,lt=Te.event,nt=Te.numAsString,ft;if(Le){var pe=Te.inputValue||Le.value,Ve=Fy(Le);Le.value=_e,ft=ae(pe,_e,Ve),ft!==void 0&&M(Le,ft,_e)}_e!==N&&J(K(_e,nt),{event:lt,source:Me})};v.useEffect(function(){var Te=Y.current,_e=Te.formattedValue,Le=Te.numAsString;(N!==_e||z!==Le)&&J(K(N,z),{event:void 0,source:Dd.props})},[N,z]);var xe=I.current?Fy(I.current):void 0,Se=typeof window<"u"?v.useLayoutEffect:v.useEffect;Se(function(){var Te=I.current;if(N!==Y.current.formattedValue&&Te){var _e=ae(Y.current.formattedValue,N,xe);Te.value=N,M(Te,_e,N)}},[N]);var Ce=function(Te,_e,Le){var Me=_e.target,lt=G.current?tz(G.current,Me.selectionEnd):tD(N,Te),nt=Object.assign(Object.assign({},lt),{lastValue:N}),ft=d(Te,nt),pe=H(ft);if(ft=d(pe,void 0),g&&!g(K(pe,ft))){var Ve=_e.target,je=Fy(Ve),ke=ae(Te,N,je);return Ve.value=N,M(Ve,ke,N),!1}return de({formattedValue:pe,numAsString:ft,inputValue:Te,event:_e,source:Le,input:_e.target}),!0},Ke=function(Te,_e){_e===void 0&&(_e=0);var Le=Te.selectionStart,Me=Te.selectionEnd;G.current={selectionStart:Le,selectionEnd:Me+_e}},Ae=function(Te){var _e=Te.target,Le=_e.value,Me=Ce(Le,Te,Dd.event);Me&&y(Te),G.current=void 0},dt=function(Te){var _e=Te.target,Le=Te.key,Me=_e.selectionStart,lt=_e.selectionEnd,nt=_e.value;nt===void 0&&(nt="");var ft;Le==="ArrowLeft"||Le==="Backspace"?ft=Math.max(Me-1,0):Le==="ArrowRight"?ft=Math.min(Me+1,nt.length):Le==="Delete"&&(ft=Me);var pe=0;Le==="Delete"&&Me===lt&&(pe=1);var Ve=Le==="ArrowLeft"||Le==="ArrowRight";if(ft===void 0||Me!==lt&&!Ve){b(Te),Ke(_e,pe);return}var je=ft;if(Ve){var ke=Le==="ArrowLeft"?"left":"right";je=F(nt,ft,ke),je!==ft&&Te.preventDefault()}else Le==="Delete"&&!T(nt[ft])?je=F(nt,ft,"right"):Le==="Backspace"&&!T(nt[ft])&&(je=F(nt,ft,"left"));je!==ft&&M(_e,je,nt),b(Te),Ke(_e,pe)},Ct=function(Te){var _e=Te.target,Le=function(){var Me=_e.selectionStart,lt=_e.selectionEnd,nt=_e.value;if(nt===void 0&&(nt=""),Me===lt){var ft=F(nt,Me);ft!==Me&&M(_e,ft,nt)}};Le(),requestAnimationFrame(function(){Le()}),S(Te),Ke(_e)},ot=function(Te){Te.persist&&Te.persist();var _e=Te.target,Le=Te.currentTarget;I.current=_e,$.current.focusTimeout=setTimeout(function(){var Me=_e.selectionStart,lt=_e.selectionEnd,nt=_e.value;nt===void 0&&(nt="");var ft=F(nt,Me);ft!==Me&&!(Me===0&<===nt.length)&&M(_e,ft,nt),j(Object.assign(Object.assign({},Te),{currentTarget:Le}))},0)},it=function(Te){I.current=null,clearTimeout($.current.focusTimeout),clearTimeout($.current.setCaretTimeout),C(Te)},pt=W&&rz()?"numeric":void 0,Et=Object.assign({inputMode:pt},k,{type:t,value:N,onChange:Ae,onKeyDown:dt,onMouseUp:Ct,onFocus:ot,onBlur:it});if(n==="text")return o?Pn.createElement(Pn.Fragment,null,o(N,k)||null):Pn.createElement("span",Object.assign({},k,{ref:s}),N);if(r){var wt=r;return Pn.createElement(wt,Object.assign({},Et,{ref:s}))}return Pn.createElement("input",Object.assign({},Et,{ref:s}))}function fT(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix;o===void 0&&(o="");var s=t.suffix;s===void 0&&(s="");var c=t.allowNegative,d=t.thousandsGroupStyle;if(d===void 0&&(d="thousand"),e===""||e==="-")return e;var f=_m(t),p=f.thousandSeparator,m=f.decimalSeparator,g=n!==0&&e.indexOf(".")!==-1||n&&r,y=I0(e,c),b=y.beforeDecimal,S=y.afterDecimal,j=y.addNegation;return n!==void 0&&(S=ZA(S,n,!!r)),p&&(b=J6(b,p,d)),o&&(b=o+b),s&&(S=S+s),j&&(b="-"+b),e=b+(g&&m||"")+S,e}function _m(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 dz(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),s=r.test(e);return e=e.replace(/-/g,""),o&&!s&&t&&(e="-"+e),e}function fz(e,t){return new RegExp("(^-)|[0-9]|"+JA(e),"g")}function hz(e,t,n){return e===""?!0:!t?.match(/\d/)&&!n?.match(/\d/)&&typeof e=="string"&&!isNaN(Number(e))}function pz(e,t,n){var r;t===void 0&&(t=iz(e));var o=n.allowNegative,s=n.prefix;s===void 0&&(s="");var c=n.suffix;c===void 0&&(c="");var d=n.decimalScale,f=t.from,p=t.to,m=p.start,g=p.end,y=_m(n),b=y.allowedDecimalSeparators,S=y.decimalSeparator,j=e[g]===S;if(kd(e)&&(e===s||e===c)&&t.lastValue==="")return e;if(g-m===1&&b.indexOf(e[m])!==-1){var C=d===0?"":S;e=e.substring(0,m)+C+e.substring(m+1,e.length)}var E=function(I,$,H){var K=!1,M=!1;s.startsWith("-")?K=!1:I.startsWith("--")?(K=!1,M=!0):c.startsWith("-")&&I.length===c.length?K=!1:I[0]==="-"&&(K=!0);var F=K?1:0;return M&&(F=2),F&&(I=I.substring(F),$-=F,H-=F),{value:I,start:$,end:H,hasNegation:K}},R=E(e,m,g),T=R.hasNegation;r=R,e=r.value,m=r.start,g=r.end;var _=E(t.lastValue,f.start,f.end),k=_.start,L=_.end,A=_.value,N=e.substring(m,g);e.length&&A.length&&(k>A.length-c.length||L<s.length)&&!(N&&c.startsWith(N))&&(e=A);var z=0;e.startsWith(s)?z+=s.length:m<s.length&&(z=m),e=e.substring(z),g-=z;var B=e.length,G=e.length-c.length;e.endsWith(c)?B=G:(g>G||g>e.length-c.length)&&(B=g),e=e.substring(0,B),e=dz(T?"-"+e:e,o),e=(e.match(fz(S))||[]).join("");var Y=e.indexOf(S);e=e.replace(new RegExp(JA(S),"g"),function(I,$){return $===Y?".":""});var J=I0(e,o),U=J.beforeDecimal,W=J.afterDecimal,O=J.addNegation;return p.end-p.start<f.end-f.start&&U===""&&j&&!parseFloat(W)&&(e=O?"-":""),e}function mz(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var o=Array.from({length:e.length+1}).map(function(){return!0}),s=e[0]==="-";o.fill(!1,0,n.length+(s?1:0));var c=e.length;return o.fill(!1,c-r.length+1,c+1),o}function gz(e){var t=_m(e),n=t.thousandSeparator,r=t.decimalSeparator,o=e.prefix;o===void 0&&(o="");var s=e.allowNegative;if(s===void 0&&(s=!0),n===r)throw new Error(`
|
|
49
|
+
Decimal separator can't be same as thousand separator.
|
|
50
|
+
thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
51
|
+
decimalSeparator: `+r+` (default value for decimalSeparator is .)
|
|
52
|
+
`);return o.startsWith("-")&&s&&(console.error(`
|
|
53
|
+
Prefix can't start with '-' when allowNegative is true.
|
|
54
|
+
prefix: `+o+`
|
|
55
|
+
allowNegative: `+s+`
|
|
56
|
+
`),s=!1),Object.assign(Object.assign({},e),{allowNegative:s})}function vz(e){e=gz(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,o=e.onKeyDown;o===void 0&&(o=ss);var s=e.onBlur;s===void 0&&(s=ss);var c=e.thousandSeparator,d=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=KA(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),j=_m(e),C=j.decimalSeparator,E=j.allowedDecimalSeparators,R=function(O){return fT(O,e)},T=function(O,I){return pz(O,I,e)},_=Mc(g)?m:g,k=y??hz(_,p,t);Mc(g)?Mc(m)||(k=k||typeof m=="number"):k=k||typeof g=="number";var L=function(O){return XA(O)?O:(typeof O=="number"&&(O=eD(O)),k&&typeof d=="number"?uT(O,d,!!f):O)},A=nD(L(g),L(m),!!k,R,T,b),N=A[0],z=N.numAsString,B=N.formattedValue,G=A[1],Y=function(O){var I=O.target,$=O.key,H=I.selectionStart,K=I.selectionEnd,M=I.value;if(M===void 0&&(M=""),($==="Backspace"||$==="Delete")&&K<p.length){O.preventDefault();return}if(H!==K){o(O);return}$==="Backspace"&&M[0]==="-"&&H===p.length+1&&n&&Js(I,1),d&&f&&($==="Backspace"&&M[H-1]===C?(Js(I,H-1),O.preventDefault()):$==="Delete"&&M[H]===C&&O.preventDefault()),E?.includes($)&&M[H]===C&&Js(I,H+1);var F=c===!0?",":c;$==="Backspace"&&M[H-1]===F&&Js(I,H-1),$==="Delete"&&M[H]===F&&Js(I,H+1),o(O)},J=function(O){var I=z;if(I.match(/\d/g)||(I=""),r||(I=ez(I)),f&&d&&(I=uT(I,d,f)),I!==z){var $=fT(I,e);G({formattedValue:$,value:I,floatValue:parseFloat(I)},{event:O,source:Dd.event})}s(O)},U=function(O){return O===C?!0:kd(O)},W=function(O){var I=O.currentValue,$=O.lastValue,H=O.formattedValue,K=O.currentValueIndex,M=O.formattedValueIndex,F=I[K],ae=H[M],de=tD($,I),xe=de.to,Se=function(Ce){return T(Ce).indexOf(".")+p.length};return g===0&&f&&d&&I[xe.start]===C&&Se(I)<K&&Se(H)>M?!1:K>=xe.start&&K<xe.end&&E&&E.includes(F)&&ae===C?!0:F===ae};return Object.assign(Object.assign({},S),{value:B,valueIsNumericString:!1,isValidInputCharacter:U,isCharacterSame:W,onValueChange:G,format:R,removeFormatting:T,getCaretBoundary:function(O){return mz(O,e)},onKeyDown:Y,onBlur:J})}function yz(e){var t=vz(e);return Pn.createElement(uz,Object.assign({},t))}function hT({direction:e,style:t,...n}){return a.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:a.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 Lx={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const xz=/^(0\.0*|-0(\.0*)?)$/,bz=/^-?0\d+(\.\d+)?\.?$/,Sz=/\.\d*0$/;function Ix(e){return typeof e=="string"&&e!==""&&!Number.isNaN(Number(e))}function Hy(e){return typeof e=="number"?e<Number.MAX_SAFE_INTEGER:e===""||Ix(e)&&Number(e)<Number.MAX_SAFE_INTEGER}function wz(e){return e.toString().replace(".","").length}function jz(e,t){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&wz(t)<14&&t!==""}function pT(e,t,n){if(e===void 0)return!0;const r=t===void 0||e>=t,o=n===void 0||e<=n;return r&&o}const Cz={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0,allowedDecimalSeparators:[".",","]},Ez=(e,{size:t})=>({controls:{"--ni-chevron-size":st(t,"ni-chevron-size")}});function Tz(e,t,n){const r=e.toString().replace(/^0+(?=\d)/,""),o=parseFloat(r);return Number.isNaN(o)?r:o>Number.MAX_SAFE_INTEGER?t!==void 0?t:r:xd(o,n,t)}const Hc=ge((e,t)=>{const n=oe("NumberInput",Cz,e),{className:r,classNames:o,styles:s,unstyled:c,vars:d,onChange:f,onValueChange:p,value:m,defaultValue:g,max:y,min:b,step:S,hideControls:j,rightSection:C,isAllowed:E,clampBehavior:R,onBlur:T,allowDecimal:_,decimalScale:k,onKeyDown:L,onKeyDownCapture:A,handlersRef:N,startValue:z,disabled:B,rightSectionPointerEvents:G,allowNegative:Y,readOnly:J,size:U,rightSectionWidth:W,stepHoldInterval:O,stepHoldDelay:I,allowLeadingZeros:$,withKeyboardEvents:H,trimLeadingZeroesOnBlur:K,allowedDecimalSeparators:M,attributes:F,...ae}=n,de=Ie({name:"NumberInput",classes:Lx,props:n,classNames:o,styles:s,unstyled:c,attributes:F,vars:d,varsResolver:Ez}),{resolvedClassNames:xe,resolvedStyles:Se}=jl({classNames:o,styles:s,props:n}),[Ce,Ke]=tr({value:m,defaultValue:g,finalValue:"",onChange:f}),Ae=I!==void 0&&O!==void 0,dt=v.useRef(null),Ct=v.useRef(null),ot=v.useRef(0),it=(je,ke)=>{ke.source==="event"&&Ke(jz(je.floatValue,je.value)&&!xz.test(je.value)&&!($&&bz.test(je.value))&&!Sz.test(je.value)?je.floatValue:je.value),p?.(je,ke)},pt=je=>{const ke=String(je).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return ke?Math.max(0,(ke[1]?ke[1].length:0)-(ke[2]?+ke[2]:0)):0},Et=je=>{dt.current&&typeof je<"u"&&dt.current.setSelectionRange(je,je)},wt=v.useRef(bp);wt.current=()=>{if(!Hy(Ce))return;let je;const ke=pt(Ce),At=pt(S),gn=Math.max(ke,At),vn=10**gn;if(!Ix(Ce)&&(typeof Ce!="number"||Number.isNaN(Ce)))je=xd(z,b,y);else if(y!==void 0){const ln=(Math.round(Number(Ce)*vn)+Math.round(S*vn))/vn;je=ln<=y?ln:y}else je=(Math.round(Number(Ce)*vn)+Math.round(S*vn))/vn;const Bn=je.toFixed(gn);Ke(parseFloat(Bn)),p?.({floatValue:parseFloat(Bn),formattedValue:Bn,value:Bn},{source:"increment"}),setTimeout(()=>Et(dt.current?.value.length),0)};const Te=v.useRef(bp);Te.current=()=>{if(!Hy(Ce))return;let je;const ke=b!==void 0?b:Y?Number.MIN_SAFE_INTEGER:0,At=pt(Ce),gn=pt(S),vn=Math.max(At,gn),Bn=10**vn;if(!Ix(Ce)&&typeof Ce!="number"||Number.isNaN(Ce))je=xd(z,ke,y);else{const gr=(Math.round(Number(Ce)*Bn)-Math.round(S*Bn))/Bn;je=ke!==void 0&&gr<ke?ke:gr}const ln=je.toFixed(vn);Ke(parseFloat(ln)),p?.({floatValue:parseFloat(ln),formattedValue:ln,value:ln},{source:"decrement"}),setTimeout(()=>Et(dt.current?.value.length),0)};const _e=je=>{L?.(je),!(J||!H)&&(je.key==="ArrowUp"&&(je.preventDefault(),wt.current?.()),je.key==="ArrowDown"&&(je.preventDefault(),Te.current?.()))},Le=je=>{if(A?.(je),je.key==="Backspace"){const ke=dt.current;ke&&ke.selectionStart===0&&ke.selectionStart===ke.selectionEnd&&(je.preventDefault(),window.setTimeout(()=>Et(0),0))}},Me=je=>{let ke=Ce;R==="blur"&&typeof ke=="number"&&(ke=xd(ke,b,y)),K&&typeof ke=="string"&&pt(ke)<15&&(ke=Tz(ke,y,b)),Ce!==ke&&Ke(ke),T?.(je)};Cd(N,{increment:wt.current,decrement:Te.current});const lt=je=>{je?wt.current?.():Te.current?.(),ot.current+=1},nt=je=>{if(lt(je),Ae){const ke=typeof O=="number"?O:O(ot.current);Ct.current=window.setTimeout(()=>nt(je),ke)}},ft=(je,ke)=>{je.preventDefault(),dt.current?.focus(),lt(ke),Ae&&(Ct.current=window.setTimeout(()=>nt(ke),I))},pe=()=>{Ct.current&&window.clearTimeout(Ct.current),Ct.current=null,ot.current=0},Ve=a.jsxs("div",{...de("controls"),children:[a.jsx(In,{...de("control"),tabIndex:-1,"aria-hidden":!0,disabled:B||typeof Ce=="number"&&y!==void 0&&Ce>=y,mod:{direction:"up"},onMouseDown:je=>je.preventDefault(),onPointerDown:je=>{ft(je,!0)},onPointerUp:pe,onPointerLeave:pe,children:a.jsx(hT,{direction:"up"})}),a.jsx(In,{...de("control"),tabIndex:-1,"aria-hidden":!0,disabled:B||typeof Ce=="number"&&b!==void 0&&Ce<=b,mod:{direction:"down"},onMouseDown:je=>je.preventDefault(),onPointerDown:je=>{ft(je,!1)},onPointerUp:pe,onPointerLeave:pe,children:a.jsx(hT,{direction:"down"})})]});return a.jsx(Ir,{component:yz,allowNegative:Y,className:$t(Lx.root,r),size:U,inputMode:"decimal",...ae,readOnly:J,disabled:B,value:Ce,getInputRef:$n(t,dt),onValueChange:it,rightSection:j||J||!Hy(Ce)?C:C||Ve,classNames:xe,styles:Se,unstyled:c,__staticSelector:"NumberInput",decimalScale:_?k:0,onKeyDown:_e,onKeyDownCapture:Le,rightSectionPointerEvents:G??(B?"none":void 0),rightSectionWidth:W??`var(--ni-right-section-width-${U||"sm"})`,allowLeadingZeros:$,allowedDecimalSeparators:M,onBlur:Me,attributes:F,isAllowed:je=>R==="strict"?E?E(je)&&pT(je.floatValue,b,y):pT(je.floatValue,b,y):E?E(je):!0})});Hc.classes={...Ir.classes,...Lx};Hc.displayName="@mantine/core/NumberInput";const[Rz,Am]=Er("Pagination.Root component was not found in tree");var nf={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const _z={withPadding:!0},rf=ge((e,t)=>{const n=oe("PaginationControl",_z,e),{classNames:r,className:o,style:s,styles:c,vars:d,active:f,disabled:p,withPadding:m,mod:g,...y}=n,b=Am(),S=p||b.disabled;return a.jsx(In,{ref:t,disabled:S,mod:[{active:f,disabled:S,"with-padding":m},g],...b.getStyles("control",{className:o,style:s,classNames:r,styles:c,active:!S}),...y})});rf.classes=nf;rf.displayName="@mantine/core/PaginationControl";function of({style:e,children:t,path:n,...r}){return a.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:a.jsx("path",{d:n,fill:"currentColor"})})}const Az=e=>a.jsx(of,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),Dz=e=>a.jsx(of,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),kz=e=>a.jsx(of,{...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"}),Pz=e=>a.jsx(of,{...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"}),Nz=e=>a.jsx(of,{...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"}),Oz={icon:Nz},Dm=ge((e,t)=>{const n=oe("PaginationDots",Oz,e),{classNames:r,className:o,style:s,styles:c,vars:d,icon:f,...p}=n,m=Am();return a.jsx(ce,{ref:t,...m.getStyles("dots",{className:o,style:s,styles:c,classNames:r}),...p,children:a.jsx(f,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});Dm.classes=nf;Dm.displayName="@mantine/core/PaginationDots";function km({icon:e,name:t,action:n,type:r}){const o={icon:e},s=v.forwardRef((c,d)=>{const{icon:f,...p}=oe(t,o,c),m=Am(),g=r==="next"?m.active===m.total:m.active===1;return a.jsx(rf,{disabled:m.disabled||g,ref:d,onClick:m[n],withPadding:!1,...p,children:a.jsx(f,{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 rD=km({icon:Az,name:"PaginationNext",action:"onNext",type:"next"}),iD=km({icon:Dz,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),oD=km({icon:kz,name:"PaginationFirst",action:"onFirst",type:"previous"}),aD=km({icon:Pz,name:"PaginationLast",action:"onLast",type:"next"});function z0({dotsIcon:e}){const t=Am(),n=t.range.map((r,o)=>r==="dots"?a.jsx(Dm,{icon:e},o):a.jsx(rf,{active:r===t.active,"aria-current":r===t.active?"page":void 0,onClick:()=>t.onChange(r),disabled:t.disabled,...t.getItemProps?.(r),children:t.getItemProps?.(r)?.children??r},o));return a.jsx(a.Fragment,{children:n})}z0.displayName="@mantine/core/PaginationItems";const Mz={siblings:1,boundaries:1},Lz=(e,{size:t,radius:n,color:r,autoContrast:o})=>({root:{"--pagination-control-radius":n===void 0?void 0:Ht(n),"--pagination-control-size":st(t,"pagination-control-size"),"--pagination-control-fz":Gn(t),"--pagination-active-bg":r?Kt(r,e):void 0,"--pagination-active-color":Cl(o,e)?wa({color:r,theme:e,autoContrast:o}):void 0}}),Pm=ge((e,t)=>{const n=oe("PaginationRoot",Mz,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,total:p,value:m,defaultValue:g,onChange:y,disabled:b,siblings:S,boundaries:j,color:C,radius:E,onNextPage:R,onPreviousPage:T,onFirstPage:_,onLastPage:k,getItemProps:L,autoContrast:A,attributes:N,...z}=n,B=Ie({name:"Pagination",classes:nf,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:N,vars:f,varsResolver:Lz}),{range:G,setPage:Y,next:J,previous:U,active:W,first:O,last:I}=d4({page:m,initialPage:g,onChange:y,total:p,siblings:S,boundaries:j}),$=ir(R,J),H=ir(T,U),K=ir(_,O),M=ir(k,I);return a.jsx(Rz,{value:{total:p,range:G,active:W,disabled:b,getItemProps:L,onChange:Y,onNext:$,onPrevious:H,onFirst:K,onLast:M,getStyles:B},children:a.jsx(ce,{ref:t,...B("root"),...z})})});Pm.classes=nf;Pm.displayName="@mantine/core/PaginationRoot";const Iz={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8},$i=ge((e,t)=>{const n=oe("Pagination",Iz,e),{withEdges:r,withControls:o,getControlProps:s,nextIcon:c,previousIcon:d,lastIcon:f,firstIcon:p,dotsIcon:m,total:g,gap:y,hideWithOnePage:b,withPages:S,...j}=n;return g<=0||b&&g===1?null:a.jsx(Pm,{ref:t,total:g,...j,children:a.jsxs(ye,{gap:y,children:[r&&a.jsx(oD,{icon:p,...s?.("first")}),o&&a.jsx(iD,{icon:d,...s?.("previous")}),S&&a.jsx(z0,{dotsIcon:m}),o&&a.jsx(rD,{icon:c,...s?.("next")}),r&&a.jsx(aD,{icon:f,...s?.("last")})]})})});$i.classes=nf;$i.displayName="@mantine/core/Pagination";$i.Root=Pm;$i.Control=rf;$i.Dots=Dm;$i.First=oD;$i.Last=aD;$i.Next=rD;$i.Previous=iD;$i.Items=z0;const zz=({reveal:e})=>a.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:a.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 zx={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const $z={visibilityToggleIcon:zz},Uz=(e,{size:t})=>({root:{"--psi-icon-size":st(t,"psi-icon-size"),"--psi-button-size":st(t,"psi-button-size")}}),Ji=ge((e,t)=>{const n=oe("PasswordInput",$z,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,required:p,error:m,leftSection:g,disabled:y,id:b,variant:S,inputContainer:j,description:C,label:E,size:R,errorProps:T,descriptionProps:_,labelProps:k,withAsterisk:L,inputWrapperOrder:A,wrapperProps:N,radius:z,rightSection:B,rightSectionWidth:G,rightSectionPointerEvents:Y,leftSectionWidth:J,visible:U,defaultVisible:W,onVisibilityChange:O,visibilityToggleIcon:I,visibilityToggleButtonProps:$,rightSectionProps:H,leftSectionProps:K,leftSectionPointerEvents:M,withErrorStyles:F,mod:ae,attributes:de,...xe}=n,Se=mr(b),[Ce,Ke]=tr({value:U,defaultValue:W,finalValue:!1,onChange:O}),Ae=()=>Ke(!Ce),dt=Ie({name:"PasswordInput",classes:zx,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:de,vars:f,varsResolver:Uz}),{resolvedClassNames:Ct,resolvedStyles:ot}=jl({classNames:r,styles:c,props:n}),{styleProps:it,rest:pt}=ja(xe),Et=T?.id||`${Se}-error`,wt=_?.id||`${Se}-description`,Le=`${!!m&&typeof m!="boolean"?Et:""} ${!!C?wt:""}`,Me=Le.trim().length>0?Le.trim():void 0,lt=a.jsx(Dn,{...dt("visibilityToggle"),disabled:y,radius:z,"aria-hidden":!$,"aria-pressed":Ce,tabIndex:-1,...$,variant:$?.variant??"subtle",color:"gray",unstyled:d,onTouchEnd:nt=>{nt.preventDefault(),$?.onTouchEnd?.(nt),Ae()},onMouseDown:nt=>{nt.preventDefault(),$?.onMouseDown?.(nt),Ae()},onKeyDown:nt=>{$?.onKeyDown?.(nt),nt.key===" "&&(nt.preventDefault(),Ae())},children:a.jsx(I,{reveal:Ce})});return a.jsx(pn.Wrapper,{required:p,id:Se,label:E,error:m,description:C,size:R,classNames:Ct,styles:ot,__staticSelector:"PasswordInput",unstyled:d,withAsterisk:L,inputWrapperOrder:A,inputContainer:j,variant:S,labelProps:{...k,htmlFor:Se},descriptionProps:{..._,id:wt},errorProps:{...T,id:Et},mod:ae,attributes:de,...dt("root"),...it,...N,children:a.jsx(pn,{component:"div",error:m,leftSection:g,size:R,classNames:{...Ct,input:$t(zx.input,Ct.input)},styles:ot,radius:z,disabled:y,__staticSelector:"PasswordInput",rightSectionWidth:G,rightSection:B??lt,variant:S,unstyled:d,leftSectionWidth:J,rightSectionPointerEvents:Y||"all",rightSectionProps:H,leftSectionProps:K,leftSectionPointerEvents:M,withAria:!1,withErrorStyles:F,attributes:de,children:a.jsx("input",{required:p,"data-invalid":!!m||void 0,"data-with-left-section":!!g||void 0,...dt("innerInput"),disabled:y,id:Se,ref:t,...pt,"aria-describedby":Me,autoComplete:pt.autoComplete||"off",type:Ce?"text":"password"})})})});Ji.classes={...Ir.classes,...zx};Ji.displayName="@mantine/core/PasswordInput";const[Bz,sD]=zo(),[Vz,Fz]=zo();var lD={card:"m_9dc8ae12"};const Hz={withBorder:!0},qz=(e,{radius:t})=>({card:{"--card-radius":Ht(t)}}),$0=ge((e,t)=>{const n=oe("RadioCard",Hz,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,checked:p,mod:m,withBorder:g,value:y,onClick:b,name:S,onKeyDown:j,attributes:C,...E}=n,R=Ie({name:"RadioCard",classes:lD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:C,vars:f,varsResolver:qz,rootSelector:"card"}),{dir:T}=xs(),_=sD(),k=typeof p=="boolean"?p:_?.value===y||!1,L=S||_?.name,A=N=>{if(j?.(N),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(N.nativeEvent.code)){N.preventDefault();const z=Array.from(document.querySelectorAll(`[role="radio"][name="${L||"__mantine"}"]`)),B=z.findIndex(J=>J===N.target),G=B+1>=z.length?0:B+1,Y=B-1<0?z.length-1:B-1;N.nativeEvent.code==="ArrowDown"&&(z[G].focus(),z[G].click()),N.nativeEvent.code==="ArrowUp"&&(z[Y].focus(),z[Y].click()),N.nativeEvent.code==="ArrowLeft"&&(z[T==="ltr"?Y:G].focus(),z[T==="ltr"?Y:G].click()),N.nativeEvent.code==="ArrowRight"&&(z[T==="ltr"?G:Y].focus(),z[T==="ltr"?G:Y].click())}};return a.jsx(Vz,{value:{checked:k},children:a.jsx(In,{ref:t,mod:[{"with-border":g,checked:k},m],...R("card"),...E,role:"radio","aria-checked":k,name:L,onClick:N=>{b?.(N),_?.onChange(y||"")},onKeyDown:A})})});$0.displayName="@mantine/core/RadioCard";$0.classes=lD;const U0=ge((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:s,wrapperProps:c,children:d,name:f,readOnly:p,disabled:m,...g}=oe("RadioGroup",null,e),y=mr(f),[b,S]=tr({value:n,defaultValue:r,finalValue:"",onChange:o}),j=C=>!p&&S(typeof C=="string"?C:C.currentTarget.value);return a.jsx(Bz,{value:{value:b,onChange:j,size:s,name:y,disabled:m},children:a.jsx(pn.Wrapper,{size:s,ref:t,...c,...g,labelElement:"div",__staticSelector:"RadioGroup",children:a.jsx(c0,{role:"radiogroup",children:d})})})});U0.classes=pn.Wrapper.classes;U0.displayName="@mantine/core/RadioGroup";function cD({size:e,style:t,...n}){return a.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:a.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}var uD={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const Gz={icon:cD},Qz=(e,{radius:t,color:n,size:r,iconColor:o,variant:s,autoContrast:c})=>{const d=Wr({color:n||e.primaryColor,theme:e}),f=d.isThemeColor&&d.shade===void 0?`var(--mantine-color-${d.color}-outline)`:d.color;return{indicator:{"--radio-size":st(r,"radio-size"),"--radio-radius":t===void 0?void 0:Ht(t),"--radio-color":s==="outline"?f:Kt(n,e),"--radio-icon-size":st(r,"radio-icon-size"),"--radio-icon-color":o?Kt(o,e):Cl(c,e)?wa({color:n,theme:e,autoContrast:c}):void 0}}},B0=ge((e,t)=>{const n=oe("RadioIndicator",Gz,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,icon:p,radius:m,color:g,iconColor:y,autoContrast:b,checked:S,mod:j,variant:C,disabled:E,attributes:R,...T}=n,_=Ie({name:"RadioIndicator",classes:uD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:R,vars:f,varsResolver:Qz,rootSelector:"indicator"}),k=Fz(),L=typeof S=="boolean"?S:k?.checked||!1;return a.jsx(ce,{ref:t,..._("indicator",{variant:C}),variant:C,mod:[{checked:L,disabled:E},j],...T,children:a.jsx(p,{..._("icon")})})});B0.displayName="@mantine/core/RadioIndicator";B0.classes=uD;var dD={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const Wz={labelPosition:"right"},Yz=(e,{size:t,radius:n,color:r,iconColor:o,variant:s,autoContrast:c})=>{const d=Wr({color:r||e.primaryColor,theme:e}),f=d.isThemeColor&&d.shade===void 0?`var(--mantine-color-${d.color}-outline)`:d.color;return{root:{"--radio-size":st(t,"radio-size"),"--radio-radius":n===void 0?void 0:Ht(n),"--radio-color":s==="outline"?f:Kt(r,e),"--radio-icon-color":o?Kt(o,e):Cl(c,e)?wa({color:r,theme:e,autoContrast:c}):void 0,"--radio-icon-size":st(t,"radio-icon-size")}}},yr=ge((e,t)=>{const n=oe("Radio",Wz,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,id:p,size:m,label:g,labelPosition:y,description:b,error:S,radius:j,color:C,variant:E,disabled:R,wrapperProps:T,icon:_=cD,rootRef:k,iconColor:L,onChange:A,mod:N,attributes:z,checked:B,...G}=n,Y=Ie({name:"Radio",classes:dD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:z,vars:f,varsResolver:Yz}),J=sD(),U=J?.size??m,W=n.size?m:U,{styleProps:O,rest:I}=ja(G),$=mr(p),H=J?J.value===I.value:void 0,K={checked:H??B,name:J?.name??I.name,onChange:M=>{J?.onChange(M),A?.(M)},disabled:J?.disabled??R};return a.jsx(mm,{...Y("root"),__staticSelector:"Radio",__stylesApiProps:n,id:$,size:W,labelPosition:y,label:g,description:b,error:S,disabled:K.disabled,classNames:r,styles:c,unstyled:d,"data-checked":(H??B)||void 0,variant:E,ref:k,mod:N,...O,...T,children:a.jsxs(ce,{...Y("inner"),mod:{"label-position":y},children:[a.jsx(ce,{...Y("radio",{focusable:!0,variant:E}),...I,...K,component:"input",mod:{error:!!S},ref:t,id:$,type:"radio"}),a.jsx(_,{...Y("icon"),"aria-hidden":!0})]})})});yr.classes=dD;yr.displayName="@mantine/core/Radio";yr.Group=U0;yr.Card=$0;yr.Indicator=B0;const Kz={duration:100,transition:"fade"};function mT(e,t){return{...Kz,...t,...e}}function Xz({offset:e,position:t,defaultOpened:n}){const[r,o]=v.useState(n),s=v.useRef(null),{x:c,y:d,elements:f,refs:p,update:m,placement:g}=zb({placement:t,middleware:[Ob({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=ma(p.floating.current);return C.forEach(E=>{E.addEventListener("scroll",m)}),()=>{j.removeEventListener("mousemove",S),C.forEach(E=>{E.removeEventListener("scroll",m)})}}},[f.reference,p.floating.current,m,S,r]),{handleMouseMove:S,x:c,y:d,opened:r,setOpened:o,boundaryRef:s,floating:p.setFloating}}var Nm={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const Jz={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:Lr("popover")},Zz=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Ht(t),"--tooltip-bg":n?Kt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),V0=ge((e,t)=>{const n=oe("TooltipFloating",Jz,e),{children:r,refProp:o,withinPortal:s,style:c,className:d,classNames:f,styles:p,unstyled:m,radius:g,color:y,label:b,offset:S,position:j,multiline:C,zIndex:E,disabled:R,defaultOpened:T,variant:_,vars:k,portalProps:L,attributes:A,...N}=n,z=En(),B=Ie({name:"TooltipFloating",props:n,classes:Nm,className:d,style:c,classNames:f,styles:p,unstyled:m,attributes:A,rootSelector:"tooltip",vars:k,varsResolver:Zz}),{handleMouseMove:G,x:Y,y:J,opened:U,boundaryRef:W,floating:O,setOpened:I}=Xz({offset:S,position:j,defaultOpened:T});if(!Io(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 $=$n(W,em(r),t),H=r.props,K=F=>{H.onMouseEnter?.(F),G(F),I(!0)},M=F=>{H.onMouseLeave?.(F),I(!1)};return a.jsxs(a.Fragment,{children:[a.jsx(va,{...L,withinPortal:s,children:a.jsx(ce,{...N,...B("tooltip",{style:{...n_(c,z),zIndex:E,display:!R&&U?"block":"none",top:(J&&Math.round(J))??"",left:(Y&&Math.round(Y))??""}}),variant:_,ref:O,mod:{multiline:C},children:b})}),v.cloneElement(r,{...H,[o]:$,onMouseEnter:K,onMouseLeave:M})]})});V0.classes=Nm;V0.displayName="@mantine/core/TooltipFloating";const fD=v.createContext(!1),e$=fD.Provider,t$=()=>v.useContext(fD),n$={openDelay:0,closeDelay:0};function F0(e){const{openDelay:t,closeDelay:n,children:r}=oe("TooltipGroup",n$,e);return a.jsx(e$,{value:!0,children:a.jsx(gL,{delay:{open:t,close:n},children:r})})}F0.displayName="@mantine/core/TooltipGroup";F0.extend=e=>e;function r$(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 i$(e){const t=r$(e.middlewares),n=[x_(e.offset)];return t.shift&&n.push(Ob(typeof t.shift=="boolean"?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip=="boolean"?Ep():Ep(t.flip)),n.push(b_({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline=="boolean"?bd():bd(t.inline)):e.inline&&n.push(bd()),n}function o$(e){const[t,n]=v.useState(e.defaultOpened),o=typeof e.opened=="boolean"?e.opened:t,s=t$(),c=mr(),d=v.useCallback(k=>{n(k),k&&E(c)},[c]),{x:f,y:p,context:m,refs:g,placement:y,middlewareData:{arrow:{x:b,y:S}={}}}=zb({strategy:e.strategy,placement:e.position,open:o,onOpenChange:d,middleware:i$(e),whileElementsMounted:kx}),{delay:j,currentId:C,setCurrentId:E}=vL(m,{id:c}),{getReferenceProps:R,getFloatingProps:T}=jL([pL(m,{enabled:e.events?.hover,delay:s?j:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch}),wL(m,{enabled:e.events?.focus,visibleOnly:!0}),EL(m,{role:"tooltip"}),bL(m,{enabled:typeof e.opened>"u"})]);hs(()=>{e.onPositionChange?.(y)},[y]);const _=o&&C&&C!==c;return{x:f,y:p,arrowX:b,arrowY:S,reference:g.setReference,floating:g.setFloating,getFloatingProps:T,getReferenceProps:R,isGroupPhase:_,opened:o,placement:y}}const gT={position:"top",refProp:"ref",withinPortal:!0,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:Lr("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},a$=(e,{radius:t,color:n,variant:r,autoContrast:o})=>{const s=e.variantColorResolver({theme:e,color:n||e.primaryColor,autoContrast:o,variant:r||"filled"});return{tooltip:{"--tooltip-radius":t===void 0?void 0:Ht(t),"--tooltip-bg":n?s.background:void 0,"--tooltip-color":n?s.color:void 0}}},ro=ge((e,t)=>{const n=oe("Tooltip",gT,e),{children:r,position:o,refProp:s,label:c,openDelay:d,closeDelay:f,onPositionChange:p,opened:m,defaultOpened:g,withinPortal:y,radius:b,color:S,classNames:j,styles:C,unstyled:E,style:R,className:T,withArrow:_,arrowSize:k,arrowOffset:L,arrowRadius:A,arrowPosition:N,offset:z,transitionProps:B,multiline:G,events:Y,zIndex:J,disabled:U,positionDependencies:W,onClick:O,onMouseEnter:I,onMouseLeave:$,inline:H,variant:K,keepMounted:M,vars:F,portalProps:ae,mod:de,floatingStrategy:xe,middlewares:Se,autoContrast:Ce,attributes:Ke,target:Ae,...dt}=oe("Tooltip",gT,n),{dir:Ct}=xs(),ot=v.useRef(null),it=o$({position:$_(Ct,o),closeDelay:f,openDelay:d,onPositionChange:p,opened:m,defaultOpened:g,events:Y,arrowRef:ot,arrowOffset:L,offset:typeof z=="number"?z+(_?k/2:0):z,positionDependencies:[...W,Ae??r],inline:H,strategy:xe,middlewares:Se});v.useEffect(()=>{const Le=Ae instanceof HTMLElement?Ae:typeof Ae=="string"?document.querySelector(Ae):Ae?.current||null;Le&&it.reference(Le)},[Ae,it]);const pt=Ie({name:"Tooltip",props:n,classes:Nm,className:T,style:R,classNames:j,styles:C,unstyled:E,attributes:Ke,rootSelector:"tooltip",vars:F,varsResolver:a$});if(!Ae&&!Io(r))return null;if(Ae){const Le=mT(B,{duration:100,transition:"fade"});return a.jsx(a.Fragment,{children:a.jsx(va,{...ae,withinPortal:y,children:a.jsx(to,{...Le,keepMounted:M,mounted:!U&&!!it.opened,duration:it.isGroupPhase?10:Le.duration,children:Me=>a.jsxs(ce,{...dt,"data-fixed":xe==="fixed"||void 0,variant:K,mod:[{multiline:G},de],...it.getFloatingProps({ref:it.floating,className:pt("tooltip").className,style:{...pt("tooltip").style,...Me,zIndex:J,top:it.y??0,left:it.x??0}}),children:[c,a.jsx(Tp,{ref:ot,arrowX:it.arrowX,arrowY:it.arrowY,visible:_,position:it.placement,arrowSize:k,arrowOffset:L,arrowRadius:A,arrowPosition:N,...pt("arrow")})]})})})})}const Et=r,wt=Et.props,Te=$n(it.reference,em(Et),t),_e=mT(B,{duration:100,transition:"fade"});return a.jsxs(a.Fragment,{children:[a.jsx(va,{...ae,withinPortal:y,children:a.jsx(to,{..._e,keepMounted:M,mounted:!U&&!!it.opened,duration:it.isGroupPhase?10:_e.duration,children:Le=>a.jsxs(ce,{...dt,"data-fixed":xe==="fixed"||void 0,variant:K,mod:[{multiline:G},de],...it.getFloatingProps({ref:it.floating,className:pt("tooltip").className,style:{...pt("tooltip").style,...Le,zIndex:J,top:it.y??0,left:it.x??0}}),children:[c,a.jsx(Tp,{ref:ot,arrowX:it.arrowX,arrowY:it.arrowY,visible:_,position:it.placement,arrowSize:k,arrowOffset:L,arrowRadius:A,arrowPosition:N,...pt("arrow")})]})})}),v.cloneElement(Et,it.getReferenceProps({onClick:O,onMouseEnter:I,onMouseLeave:$,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,className:$t(T,wt.className),...wt,[s]:Te}))]})});ro.classes=Nm;ro.displayName="@mantine/core/Tooltip";ro.Floating=V0;ro.Group=F0;function s$({size:e,thickness:t,sum:n,value:r,root:o,offset:s}){const c=(e*.9-t*2)/2,d=Math.PI*c*2/100,f=o||r===void 0?`${(100-n)*d}, ${n*d}`:`${r*d}, ${(100-r)*d}`;return{strokeWidth:Number.isNaN(t)?12:t,cx:e/2||0,cy:e/2||0,r:c||0,transform:o?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:f,strokeDashoffset:o?0:s||0}}function hD({size:e,value:t,offset:n,sum:r,thickness:o,root:s,color:c,lineRoundCaps:d,tooltip:f,getStyles:p,display:m,...g}){const y=En();return a.jsx(ro.Floating,{disabled:!f,label:f,children:a.jsx(ce,{component:"circle",...g,...p("curve"),__vars:{"--curve-color":c?Kt(c,y):void 0},fill:"none",strokeLinecap:d?"round":"butt",...s$({sum:r,size:e,thickness:o,value:t,offset:n,root:s})})})}hD.displayName="@mantine/core/Curve";function l$({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:o}){const s=n.reduce((m,g)=>m+g.value,0),c=Math.PI*((e*.9-t*2)/2)*2;let d=c;const f=[],p=[];for(let m=0;m<n.length;m+=1)f.push({sum:s,offset:d,data:n[m],root:!1}),d-=n[m].value/100*c;if(f.push({sum:s,offset:d,data:{color:o},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 pD={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function c$(e,t){return Math.min(e||12,(t||120)/4)}const u$={size:120,thickness:12},d$=(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}}),Om=ge((e,t)=>{const n=oe("RingProgress",u$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,label:p,sections:m,size:g,thickness:y,roundCaps:b,rootColor:S,transitionDuration:j,attributes:C,...E}=n,R=Ie({name:"RingProgress",classes:pD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:C,vars:f,varsResolver:d$}),T=c$(y,g),_=l$({size:g,thickness:T,sections:m,renderRoundedLineCaps:b,rootColor:S}).map(({data:k,sum:L,root:A,lineRoundCaps:N,offset:z},B)=>v.createElement(hD,{...k,key:B,size:g,thickness:T,sum:L,offset:z,color:k?.color,root:A,lineRoundCaps:N,getStyles:R}));return a.jsxs(ce,{...R("root"),size:g,ref:t,...E,children:[a.jsx("svg",{...R("svg"),children:_}),p&&a.jsx("div",{...R("label"),children:p})]})});Om.classes=pD;Om.displayName="@mantine/core/RingProgress";var mD={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const f$={withItemsBorders:!0},h$=(e,{radius:t,color:n,transitionDuration:r,size:o,transitionTimingFunction:s})=>({root:{"--sc-radius":t===void 0?void 0:Ht(t),"--sc-color":n?Kt(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":st(o,"sc-padding"),"--sc-font-size":Gn(o)}}),qc=ge((e,t)=>{const n=oe("SegmentedControl",f$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,data:p,value:m,defaultValue:g,onChange:y,size:b,name:S,disabled:j,readOnly:C,fullWidth:E,orientation:R,radius:T,color:_,transitionDuration:k,transitionTimingFunction:L,variant:A,autoContrast:N,withItemsBorders:z,mod:B,attributes:G,...Y}=n,J=Ie({name:"SegmentedControl",props:n,classes:mD,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:G,vars:f,varsResolver:h$}),U=En(),W=p.map(Ae=>typeof Ae=="string"?{label:Ae,value:Ae}:Ae),O=j4(),[I,$]=v.useState(Sp()),[H,K]=v.useState(null),[M,F]=v.useState({}),ae=(Ae,dt)=>{M[dt]=Ae,F(M)},[de,xe]=tr({value:m,defaultValue:g,finalValue:Array.isArray(p)?W.find(Ae=>!Ae.disabled)?.value??p[0]?.value??null:null,onChange:y}),Se=mr(S),Ce=W.map(Ae=>v.createElement(ce,{...J("control"),mod:{active:de===Ae.value,orientation:R},key:Ae.value},v.createElement("input",{...J("input"),disabled:j||Ae.disabled,type:"radio",name:Se,value:Ae.value,id:`${Se}-${Ae.value}`,checked:de===Ae.value,onChange:()=>!C&&xe(Ae.value),"data-focus-ring":U.focusRing,key:`${Ae.value}-input`}),v.createElement(ce,{component:"label",...J("label"),mod:{active:de===Ae.value&&!(j||Ae.disabled),disabled:j||Ae.disabled,"read-only":C},htmlFor:`${Se}-${Ae.value}`,ref:dt=>ae(dt,Ae.value),__vars:{"--sc-label-color":_!==void 0?wa({color:_,theme:U,autoContrast:N}):void 0},key:`${Ae.value}-label`},a.jsx("span",{...J("innerLabel"),children:Ae.label})))),Ke=$n(t,Ae=>K(Ae));return p4(()=>{$(Sp())},[p.length]),p.length===0?null:a.jsxs(ce,{...J("root"),variant:A,size:b,ref:Ke,mod:[{"full-width":E,orientation:R,initialized:O,"with-items-borders":z},B],...Y,role:"radiogroup","data-disabled":j,children:[typeof de=="string"&&a.jsx(Gb,{target:M[de],parent:H,component:"span",transitionDuration:"var(--sc-transition-duration)",...J("indicator")},I),Ce]})});qc.classes=mD;qc.displayName="@mantine/core/SegmentedControl";function p$({spacing:e,verticalSpacing:t,cols:n,selector:r}){const o=En(),s=t===void 0?e:t,c=ys({"--sg-spacing-x":qn(Yi(e)),"--sg-spacing-y":qn(Yi(s)),"--sg-cols":Yi(n)?.toString()}),d=fn(o.breakpoints).reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--sg-spacing-x"]=qn(e[g])),typeof s=="object"&&s[g]!==void 0&&(m[g]["--sg-spacing-y"]=qn(s[g])),typeof n=="object"&&n[g]!==void 0&&(m[g]["--sg-cols"]=n[g]),m),{}),p=jd(fn(d),o.breakpoints).filter(m=>fn(d[m.value]).length>0).map(m=>({query:`(min-width: ${o.breakpoints[m.value]})`,styles:d[m.value]}));return a.jsx(El,{styles:c,media:p,selector:r})}function qy(e){return typeof e=="object"&&e!==null?fn(e):[]}function m$(e){return e.sort((t,n)=>wd(t)-wd(n))}function g$({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...qy(e),...qy(t),...qy(n)]));return m$(r)}function v$({spacing:e,verticalSpacing:t,cols:n,selector:r}){const o=t===void 0?e:t,s=ys({"--sg-spacing-x":qn(Yi(e)),"--sg-spacing-y":qn(Yi(o)),"--sg-cols":Yi(n)?.toString()}),c=g$({spacing:e,verticalSpacing:t,cols:n}),d=c.reduce((p,m)=>(p[m]||(p[m]={}),typeof e=="object"&&e[m]!==void 0&&(p[m]["--sg-spacing-x"]=qn(e[m])),typeof o=="object"&&o[m]!==void 0&&(p[m]["--sg-spacing-y"]=qn(o[m])),typeof n=="object"&&n[m]!==void 0&&(p[m]["--sg-cols"]=n[m]),p),{}),f=c.map(p=>({query:`simple-grid (min-width: ${p})`,styles:d[p]}));return a.jsx(El,{styles:s,container:f,selector:r})}var gD={container:"m_925c2d2c",root:"m_2415a157"};const y$={cols:1,spacing:"md",type:"media"},Mm=ge((e,t)=>{const n=oe("SimpleGrid",y$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,cols:p,verticalSpacing:m,spacing:g,type:y,attributes:b,...S}=n,j=Ie({name:"SimpleGrid",classes:gD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:b,vars:f}),C=Gd();return y==="container"?a.jsxs(a.Fragment,{children:[a.jsx(v$,{...n,selector:`.${C}`}),a.jsx("div",{...j("container"),children:a.jsx(ce,{ref:t,...j("root",{className:C}),...S})})]}):a.jsxs(a.Fragment,{children:[a.jsx(p$,{...n,selector:`.${C}`}),a.jsx(ce,{ref:t,...j("root",{className:C}),...S})]})});Mm.classes=gD;Mm.displayName="@mantine/core/SimpleGrid";const Lm=ge((e,t)=>{const{w:n,h:r,miw:o,mih:s,...c}=oe("Space",null,e);return a.jsx(ce,{ref:t,...c,w:n,miw:o??n,h:r,mih:s??r})});Lm.displayName="@mantine/core/Space";var vD={root:"m_6d731127"};const x$={gap:"md",align:"stretch",justify:"flex-start"},b$=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":qn(t),"--stack-align":n,"--stack-justify":r}}),Be=ge((e,t)=>{const n=oe("Stack",x$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,align:p,justify:m,gap:g,variant:y,attributes:b,...S}=n,j=Ie({name:"Stack",props:n,classes:vD,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:b,vars:f,varsResolver:b$});return a.jsx(ce,{ref:t,...j("root"),variant:y,...S})});Be.classes=vD;Be.displayName="@mantine/core/Stack";const[S$,w$]=Er("Stepper component was not found in tree"),_p=()=>null;_p.displayName="@mantine/core/StepperCompleted";var H0={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 Qh=(e,t)=>typeof e=="function"?a.jsx(e,{step:t||0}):e,j$={withIcon:!0,allowStepClick:!0,iconPosition:"left"},q0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,step:d,state:f,color:p,icon:m,completedIcon:g,progressIcon:y,label:b,description:S,withIcon:j,iconSize:C,loading:E,allowStepClick:R,allowStepSelect:T,iconPosition:_,orientation:k,mod:L,...A}=oe("StepperStep",j$,e),N=w$(),z=En(),B={classNames:n,styles:s},G=f==="stepCompleted"?null:f==="stepProgress"?y:m,Y={"data-progress":f==="stepProgress"||void 0,"data-completed":f==="stepCompleted"||void 0};return a.jsxs(In,{...N.getStyles("step",{className:r,style:o,variant:N.orientation,...B}),mod:[{"icon-position":_||N.iconPosition,"allow-click":R},L],ref:t,...Y,...A,__vars:{"--step-color":p?Kt(p,z):void 0},tabIndex:R?0:-1,children:[j&&a.jsxs("span",{...N.getStyles("stepWrapper",B),children:[a.jsxs("span",{...N.getStyles("stepIcon",B),...Y,children:[a.jsx(to,{mounted:f==="stepCompleted",transition:"pop",duration:200,children:J=>a.jsx("span",{...N.getStyles("stepCompletedIcon",{style:J,...B}),children:E?a.jsx(jr,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...N.getStyles("stepLoader",B)}):Qh(g,d)||a.jsx(Zd,{size:"60%"})})}),f!=="stepCompleted"?E?a.jsx(jr,{...N.getStyles("stepLoader",B),size:"calc(var(--stepper-icon-size) / 2)",color:p}):Qh(G||m,d):null]}),k==="vertical"&&a.jsx("span",{...N.getStyles("verticalSeparator",B),"data-active":f==="stepCompleted"||void 0})]}),(b||S)&&a.jsxs("span",{...N.getStyles("stepBody",B),"data-orientation":N.orientation,"data-icon-position":_||N.iconPosition,children:[b&&a.jsx("span",{...N.getStyles("stepLabel",B),children:Qh(b,d)}),S&&a.jsx("span",{...N.getStyles("stepDescription",B),children:Qh(S,d)})]})]})});q0.classes=H0;q0.displayName="@mantine/core/StepperStep";const C$={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},E$=(e,{color:t,iconSize:n,size:r,contentPadding:o,radius:s,autoContrast:c})=>({root:{"--stepper-color":t?Kt(t,e):void 0,"--stepper-icon-color":Cl(c,e)?wa({color:t,theme:e,autoContrast:c}):void 0,"--stepper-icon-size":n===void 0?st(r,"stepper-icon-size"):le(n),"--stepper-content-padding":qn(o),"--stepper-radius":s===void 0?void 0:Ht(s),"--stepper-fz":Gn(r),"--stepper-spacing":qn(r)}}),Gc=ge((e,t)=>{const n=oe("Stepper",C$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,children:p,onStepClick:m,active:g,icon:y,completedIcon:b,progressIcon:S,color:j,iconSize:C,contentPadding:E,orientation:R,iconPosition:T,size:_,radius:k,allowNextStepsSelect:L,wrap:A,autoContrast:N,attributes:z,...B}=n,G=Ie({name:"Stepper",classes:H0,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:z,vars:f,varsResolver:E$}),Y=v.Children.toArray(p),J=Y.filter(H=>H.type!==_p),U=Y.find(H=>H.type===_p),W=J.reduce((H,K,M)=>{const F=g===M?"stepProgress":g>M?"stepCompleted":"stepInactive",de=typeof m!="function"?!1:typeof K.props.allowStepSelect=="boolean"?K.props.allowStepSelect:F==="stepCompleted"||L;return H.push(v.cloneElement(K,{icon:K.props.icon||y||M+1,key:M,step:M,state:F,onClick:()=>de&&m?.(M),allowStepClick:de,completedIcon:K.props.completedIcon||b,progressIcon:K.props.progressIcon||S,color:K.props.color||j,iconSize:C,iconPosition:K.props.iconPosition||T,orientation:R})),R==="horizontal"&&M!==J.length-1&&H.push(v.createElement("div",{...G("separator"),"data-active":M<g||void 0,"data-orientation":R,key:`separator-${M}`})),H},[]),O=J[g]?.props?.children,I=U?.props?.children,$=g>J.length-1?I:O;return a.jsx(S$,{value:{getStyles:G,orientation:R,iconPosition:T},children:a.jsxs(ce,{...G("root"),ref:t,size:_,...B,children:[a.jsx(ce,{...G("steps"),mod:{orientation:R,"icon-position":T,wrap:A&&R!=="vertical"},children:W}),$&&a.jsx("div",{...G("content"),children:$})]})})});Gc.classes=H0;Gc.displayName="@mantine/core/Stepper";Gc.Completed=_p;Gc.Step=q0;const yD=v.createContext(null),T$=yD.Provider,R$=()=>v.useContext(yD),G0=ge((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:s,wrapperProps:c,children:d,readOnly:f,disabled:p,...m}=oe("SwitchGroup",null,e),[g,y]=tr({value:n,defaultValue:r,finalValue:[],onChange:o}),b=S=>{const j=S.currentTarget.value;!f&&y(g.includes(j)?g.filter(C=>C!==j):[...g,j])};return a.jsx(T$,{value:{value:g,onChange:b,size:s,disabled:p},children:a.jsx(pn.Wrapper,{size:s,ref:t,...c,...m,labelElement:"div",__staticSelector:"SwitchGroup",children:a.jsx(c0,{role:"group",children:d})})})});G0.classes=pn.Wrapper.classes;G0.displayName="@mantine/core/SwitchGroup";var xD={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const _$={labelPosition:"right",withThumbIndicator:!0},A$=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:Ht(t),"--switch-height":st(r,"switch-height"),"--switch-width":st(r,"switch-width"),"--switch-thumb-size":st(r,"switch-thumb-size"),"--switch-label-font-size":st(r,"switch-label-font-size"),"--switch-track-label-padding":st(r,"switch-track-label-padding"),"--switch-color":n?Kt(n,e):void 0}}),af=ge((e,t)=>{const n=oe("Switch",_$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,color:p,label:m,offLabel:g,onLabel:y,id:b,size:S,radius:j,wrapperProps:C,thumbIcon:E,checked:R,defaultChecked:T,onChange:_,labelPosition:k,description:L,error:A,disabled:N,variant:z,rootRef:B,mod:G,withThumbIndicator:Y,attributes:J,...U}=n,W=R$(),O=S||W?.size,I=Ie({name:"Switch",props:n,classes:xD,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:J,vars:f,varsResolver:A$}),{styleProps:$,rest:H}=ja(U),K=mr(b),M={checked:W?.value.includes(H.value)??R,onChange:de=>{W?.onChange(de),_?.(de)},disabled:W?.disabled??N},[F,ae]=tr({value:M.checked??R,defaultValue:T,finalValue:!1});return a.jsxs(mm,{...I("root"),__staticSelector:"Switch",__stylesApiProps:n,id:K,size:O,labelPosition:k,label:m,description:L,error:A,disabled:M.disabled,bodyElement:"label",labelElement:"span",classNames:r,styles:c,unstyled:d,"data-checked":M.checked,variant:z,ref:B,mod:G,...$,...C,children:[a.jsx("input",{...H,...M,checked:F,"data-checked":M.checked,onChange:de=>{M.onChange?.(de),ae(de.currentTarget.checked)},id:K,ref:t,type:"checkbox",role:"switch",...I("input")}),a.jsxs(ce,{"aria-hidden":"true",component:"span",mod:{error:A,"label-position":k,"without-labels":!y&&!g},...I("track"),children:[a.jsx(ce,{component:"span",mod:{"reduce-motion":!0,"with-thumb-indicator":Y&&!E},...I("thumb"),children:E}),a.jsx("span",{...I("trackLabel"),children:F?y:g})]})]})});af.classes={...xD,...jA};af.displayName="@mantine/core/Switch";af.Group=G0;const[D$,k$]=Er("Table component was not found in the tree");var sf={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 P$(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 _l(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=ge((o,s)=>{const c=oe(n,{},o),{classNames:d,className:f,style:p,styles:m,...g}=c,y=k$();return a.jsx(ce,{component:e,ref:s,...P$(y,t),...y.getStyles(e,{className:f,classNames:d,style:p,styles:m,props:c}),...g})});return r.displayName=`@mantine/core/${n}`,r.classes=sf,r}const $x=_l("th",{columnBorder:!0}),bD=_l("td",{columnBorder:!0}),dp=_l("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),SD=_l("thead",{stickyHeader:!0}),wD=_l("tbody"),jD=_l("tfoot"),CD=_l("caption",{captionSide:!0});function Q0({data:e}){return a.jsxs(a.Fragment,{children:[e.caption&&a.jsx(CD,{children:e.caption}),e.head&&a.jsx(SD,{children:a.jsx(dp,{children:e.head.map((t,n)=>a.jsx($x,{children:t},n))})}),e.body&&a.jsx(wD,{children:e.body.map((t,n)=>a.jsx(dp,{children:t.map((r,o)=>a.jsx(bD,{children:r},o))},n))}),e.foot&&a.jsx(jD,{children:a.jsx(dp,{children:e.foot.map((t,n)=>a.jsx($x,{children:t},n))})})]})}Q0.displayName="@mantine/core/TableDataRenderer";const N$={type:"scrollarea"},O$=(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}}),W0=ge((e,t)=>{const n=oe("TableScrollContainer",N$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,children:p,minWidth:m,maxHeight:g,type:y,scrollAreaProps:b,attributes:S,...j}=n,C=Ie({name:"TableScrollContainer",classes:sf,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:S,vars:f,varsResolver:O$,rootSelector:"scrollContainer"});return a.jsx(ce,{component:y==="scrollarea"?Yr:"div",...y==="scrollarea"?g?{offsetScrollbars:"xy",...b}:{offsetScrollbars:"x",...b}:{},ref:t,...C("scrollContainer"),...j,children:a.jsx("div",{...C("scrollContainerInner"),children:p})})});W0.classes=sf;W0.displayName="@mantine/core/TableScrollContainer";const M$={withRowBorders:!0,verticalSpacing:7},L$=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:o,borderColor:s,stripedColor:c,highlightOnHoverColor:d,striped:f,highlightOnHover:p,stickyHeaderOffset:m,stickyHeader:g})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":qn(r),"--table-vertical-spacing":qn(o),"--table-border-color":s?Kt(s,e):void 0,"--table-striped-color":f&&c?Kt(c,e):void 0,"--table-highlight-on-hover-color":p&&d?Kt(d,e):void 0,"--table-sticky-header-offset":g?le(m):void 0}}),ue=ge((e,t)=>{const n=oe("Table",M$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,horizontalSpacing:p,verticalSpacing:m,captionSide:g,stripedColor:y,highlightOnHoverColor:b,striped:S,highlightOnHover:j,withColumnBorders:C,withRowBorders:E,withTableBorder:R,borderColor:T,layout:_,variant:k,data:L,children:A,stickyHeader:N,stickyHeaderOffset:z,mod:B,tabularNums:G,attributes:Y,...J}=n,U=Ie({name:"Table",props:n,className:o,style:s,classes:sf,classNames:r,styles:c,unstyled:d,attributes:Y,rootSelector:"table",vars:f,varsResolver:L$});return a.jsx(D$,{value:{getStyles:U,stickyHeader:N,striped:S===!0?"odd":S||void 0,highlightOnHover:j,withColumnBorders:C,withRowBorders:E,captionSide:g||"bottom"},children:a.jsx(ce,{component:"table",variant:k,ref:t,mod:[{"data-with-table-border":R,"data-tabular-nums":G},B],...U("table"),...J,children:A||!!L&&a.jsx(Q0,{data:L})})})});ue.classes=sf;ue.displayName="@mantine/core/Table";ue.Td=bD;ue.Th=$x;ue.Tr=dp;ue.Thead=SD;ue.Tbody=wD;ue.Tfoot=jD;ue.Caption=CD;ue.ScrollContainer=W0;ue.DataRenderer=Q0;const[I$,Y0]=Er("Tabs component was not found in the tree");var lf={root:"m_89d60db1","list--default":"m_576c9d4",list:"m_89d33d6d",tab:"m_4ec4dce6",panel:"m_b0c91715",tabSection:"m_fc420b1f",tabLabel:"m_42bbd1ae","tab--default":"m_539e827b","list--outline":"m_6772fbd5","tab--outline":"m_b59ab47c","tab--pills":"m_c3381914"};const K0=ge((e,t)=>{const n=oe("TabsList",null,e),{children:r,className:o,grow:s,justify:c,classNames:d,styles:f,style:p,mod:m,...g}=n,y=Y0();return a.jsx(ce,{...g,...y.getStyles("list",{className:o,style:p,classNames:d,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})});K0.classes=lf;K0.displayName="@mantine/core/TabsList";const X0=ge((e,t)=>{const n=oe("TabsPanel",null,e),{children:r,className:o,value:s,classNames:c,styles:d,style:f,mod:p,keepMounted:m,...g}=n,y=Y0(),b=y.value===s,S=y.keepMounted||m||b?r:null;return a.jsx(ce,{...y.getStyles("panel",{className:o,classNames:c,styles:d,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),...g,children:S})});X0.classes=lf;X0.displayName="@mantine/core/TabsPanel";const J0=ge((e,t)=>{const n=oe("TabsTab",null,e),{className:r,children:o,rightSection:s,leftSection:c,value:d,onClick:f,onKeyDown:p,disabled:m,color:g,style:y,classNames:b,styles:S,vars:j,mod:C,tabIndex:E,...R}=n,T=En(),{dir:_}=xs(),k=Y0(),L=d===k.value,A=z=>{k.onChange(k.allowTabDeactivation&&d===k.value?null:d),f?.(z)},N={classNames:b,styles:S,props:n};return a.jsxs(In,{...k.getStyles("tab",{className:r,style:y,variant:k.variant,...N}),disabled:m,unstyled:k.unstyled,variant:k.variant,mod:[{active:L,disabled:m,orientation:k.orientation,inverted:k.inverted,placement:k.orientation==="vertical"&&k.placement},C],ref:t,role:"tab",id:k.getTabId(d),"aria-selected":L,tabIndex:E!==void 0?E:L||k.value===null?0:-1,"aria-controls":k.getPanelId(d),onClick:A,__vars:{"--tabs-color":g?Kt(g,T):void 0},onKeyDown:yb({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:k.activateTabWithKeyboard,loop:k.loop,orientation:k.orientation||"horizontal",dir:_,onKeyDown:p}),...R,children:[c&&a.jsx("span",{...k.getStyles("tabSection",N),"data-position":"left",children:c}),o&&a.jsx("span",{...k.getStyles("tabLabel",N),children:o}),s&&a.jsx("span",{...k.getStyles("tabSection",N),"data-position":"right",children:s})]})});J0.classes=lf;J0.displayName="@mantine/core/TabsTab";const vT="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",z$={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,variant:"default",placement:"left"},$$=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":Ht(t),"--tabs-color":Kt(n,e),"--tabs-text-color":Cl(r,e)?wa({color:n,theme:e,autoContrast:r}):void 0}}),Wt=ge((e,t)=>{const n=oe("Tabs",z$,e),{defaultValue:r,value:o,onChange:s,orientation:c,children:d,loop:f,id:p,activateTabWithKeyboard:m,allowTabDeactivation:g,variant:y,color:b,radius:S,inverted:j,placement:C,keepMounted:E,classNames:R,styles:T,unstyled:_,className:k,style:L,vars:A,autoContrast:N,mod:z,attributes:B,...G}=n,Y=mr(p),[J,U]=tr({value:o,defaultValue:r,finalValue:null,onChange:s}),W=Ie({name:"Tabs",props:n,classes:lf,className:k,style:L,classNames:R,styles:T,unstyled:_,attributes:B,vars:A,varsResolver:$$});return a.jsx(I$,{value:{placement:C,value:J,orientation:c,id:Y,loop:f,activateTabWithKeyboard:m,getTabId:uE(`${Y}-tab`,vT),getPanelId:uE(`${Y}-panel`,vT),onChange:U,allowTabDeactivation:g,variant:y,color:b,radius:S,inverted:j,keepMounted:E,unstyled:_,getStyles:W},children:a.jsx(ce,{ref:t,id:Y,variant:y,mod:[{orientation:c,inverted:c==="horizontal"&&j,placement:c==="vertical"&&C},z],...W("root"),...G,children:d})})});Wt.classes=lf;Wt.displayName="@mantine/core/Tabs";Wt.Tab=J0;Wt.Panel=X0;Wt.List=K0;const He=ge((e,t)=>{const n=oe("TextInput",null,e);return a.jsx(Ir,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});He.classes=Ir.classes;He.displayName="@mantine/core/TextInput";var ED={root:"m_7341320d"};const U$=(e,{size:t,radius:n,variant:r,gradient:o,color:s,autoContrast:c})=>{const d=e.variantColorResolver({color:s||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:c});return{root:{"--ti-size":st(t,"ti-size"),"--ti-radius":n===void 0?void 0:Ht(n),"--ti-bg":s||r?d.background:void 0,"--ti-color":s||r?d.color:void 0,"--ti-bd":s||r?d.border:void 0}}},Z0=ge((e,t)=>{const n=oe("ThemeIcon",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,autoContrast:p,attributes:m,...g}=n,y=Ie({name:"ThemeIcon",classes:ED,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:m,vars:f,varsResolver:U$});return a.jsx(ce,{ref:t,...y("root"),...g})});Z0.classes=ED;Z0.displayName="@mantine/core/ThemeIcon";const B$=["h1","h2","h3","h4","h5","h6"],V$=["xs","sm","md","lg","xl"];function F$(e,t){const n=t!==void 0?t:`h${e}`;return B$.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:V$.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:le(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var TD={root:"m_8a5d1357"};const H$={order:1},q$=(e,{order:t,size:n,lineClamp:r,textWrap:o})=>{const s=F$(t||1,n);return{root:{"--title-fw":s.fontWeight,"--title-lh":s.lineHeight,"--title-fz":s.fontSize,"--title-line-clamp":typeof r=="number"?r.toString():void 0,"--title-text-wrap":o}}},$e=ge((e,t)=>{const n=oe("Title",H$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,order:f,vars:p,size:m,variant:g,lineClamp:y,textWrap:b,mod:S,attributes:j,...C}=n,E=Ie({name:"Title",props:n,classes:TD,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:j,vars:p,varsResolver:q$});return[1,2,3,4,5,6].includes(f)?a.jsx(ce,{...E("root"),component:`h${f}`,variant:g,ref:t,mod:[{order:f,"data-line-clamp":typeof y=="number"},S],size:m,...C}):null});$e.classes=TD;$e.displayName="@mantine/core/Title";function RD(e){let t=e,n=!1;const r=new Set;return{getState(){return t},updateState(o){t=typeof o=="function"?o(t):o},setState(o){this.updateState(o),r.forEach(s=>s(t))},initialize(o){n||(t=o,n=!0)},subscribe(o){return r.add(o),()=>r.delete(o)}}}function _D(e){return v.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function G$(e,t,n){const r=[],o=[],s={};for(const c of e){const d=c.position||t;s[d]=s[d]||0,s[d]+=1,s[d]<=n?o.push(c):r.push(c)}return{notifications:o,queue:r}}const Q$=()=>RD({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),Al=Q$(),W$=(e=Al)=>_D(e);function cu(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]),o=G$(r,n.defaultPosition,n.limit);e.setState({notifications:o.notifications,queue:o.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function Ne(e,t=Al){const n=e.id||Sp();return cu(t,r=>e.id&&r.some(o=>o.id===e.id)?r:[...r,{...e,id:n}]),n}function AD(e,t=Al){return cu(t,n=>n.filter(r=>r.id===e?(r.onClose?.(r),!1):!0)),e}function nl(e,t=Al){return cu(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function Y$(e=Al){cu(e,()=>[])}function K$(e=Al){cu(e,t=>t.slice(0,e.getState().limit))}const ki={show:Ne,hide:AD,update:nl,clean:Y$,cleanQueue:K$,updateState:cu};function Ux(e,t){return Ux=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Ux(e,t)}function DD(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ux(e,t)}var Gy={exports:{}},Qy,yT;function X$(){if(yT)return Qy;yT=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Qy=e,Qy}var Wy,xT;function J$(){if(xT)return Wy;xT=1;var e=X$();function t(){}function n(){}return n.resetWarningCache=t,Wy=function(){function r(c,d,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 o(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},Wy}var bT;function Z$(){return bT||(bT=1,Gy.exports=J$()()),Gy.exports}var e8=Z$();const dn=Xp(e8),ST={disabled:!1},Ap=Pn.createContext(null);var t8=function(t){return t.scrollTop},gd="unmounted",Ys="exited",Ks="entering",Dc="entered",Bx="exiting",Ta=(function(e){DD(t,e);function t(r,o){var s;s=e.call(this,r,o)||this;var c=o,d=c&&!c.isMounting?r.enter:r.appear,f;return s.appearStatus=null,r.in?d?(f=Ys,s.appearStatus=Ks):f=Dc:r.unmountOnExit||r.mountOnEnter?f=gd:f=Ys,s.state={status:f},s.nextCallback=null,s}t.getDerivedStateFromProps=function(o,s){var c=o.in;return c&&s.status===gd?{status:Ys}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var s=null;if(o!==this.props){var c=this.state.status;this.props.in?c!==Ks&&c!==Dc&&(s=Ks):(c===Ks||c===Dc)&&(s=Bx)}this.updateStatus(!1,s)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,s,c,d;return s=c=d=o,o!=null&&typeof o!="number"&&(s=o.exit,c=o.enter,d=o.appear!==void 0?o.appear:c),{exit:s,enter:c,appear:d}},n.updateStatus=function(o,s){if(o===void 0&&(o=!1),s!==null)if(this.cancelNextCallback(),s===Ks){if(this.props.unmountOnExit||this.props.mountOnEnter){var c=this.props.nodeRef?this.props.nodeRef.current:md.findDOMNode(this);c&&t8(c)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ys&&this.setState({status:gd})},n.performEnter=function(o){var s=this,c=this.props.enter,d=this.context?this.context.isMounting:o,f=this.props.nodeRef?[d]:[md.findDOMNode(this),d],p=f[0],m=f[1],g=this.getTimeouts(),y=d?g.appear:g.enter;if(!o&&!c||ST.disabled){this.safeSetState({status:Dc},function(){s.props.onEntered(p)});return}this.props.onEnter(p,m),this.safeSetState({status:Ks},function(){s.props.onEntering(p,m),s.onTransitionEnd(y,function(){s.safeSetState({status:Dc},function(){s.props.onEntered(p,m)})})})},n.performExit=function(){var o=this,s=this.props.exit,c=this.getTimeouts(),d=this.props.nodeRef?void 0:md.findDOMNode(this);if(!s||ST.disabled){this.safeSetState({status:Ys},function(){o.props.onExited(d)});return}this.props.onExit(d),this.safeSetState({status:Bx},function(){o.props.onExiting(d),o.onTransitionEnd(c.exit,function(){o.safeSetState({status:Ys},function(){o.props.onExited(d)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,s){s=this.setNextCallback(s),this.setState(o,s)},n.setNextCallback=function(o){var s=this,c=!0;return this.nextCallback=function(d){c&&(c=!1,s.nextCallback=null,o(d))},this.nextCallback.cancel=function(){c=!1},this.nextCallback},n.onTransitionEnd=function(o,s){this.setNextCallback(s);var c=this.props.nodeRef?this.props.nodeRef.current:md.findDOMNode(this),d=o==null&&!this.props.addEndListener;if(!c||d){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)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===gd)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 d=w0(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Pn.createElement(Ap.Provider,{value:null},typeof c=="function"?c(o,d):Pn.cloneElement(Pn.Children.only(c),d))},t})(Pn.Component);Ta.contextType=Ap;Ta.propTypes={};function wc(){}Ta.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:wc,onEntering:wc,onEntered:wc,onExit:wc,onExiting:wc,onExited:wc};Ta.UNMOUNTED=gd;Ta.EXITED=Ys;Ta.ENTERING=Ks;Ta.ENTERED=Dc;Ta.EXITING=Bx;function n8(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eS(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(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function r8(e,t){e=e||{},t=t||{};function n(m){return m in t?t[m]:e[m]}var r=Object.create(null),o=[];for(var s in e)s in t?o.length&&(r[s]=o,o=[]):o.push(s);var c,d={};for(var f in t){if(r[f])for(c=0;c<r[f].length;c++){var p=r[f][c];d[r[f][c]]=n(p)}d[f]=n(f)}for(c=0;c<o.length;c++)d[o[c]]=n(o[c]);return d}function rl(e,t,n){return n[t]!=null?n[t]:e.props[t]}function i8(e,t){return eS(e.children,function(n){return v.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:rl(n,"appear",e),enter:rl(n,"enter",e),exit:rl(n,"exit",e)})})}function o8(e,t,n){var r=eS(e.children),o=r8(t,r);return Object.keys(o).forEach(function(s){var c=o[s];if(v.isValidElement(c)){var d=s in t,f=s in r,p=t[s],m=v.isValidElement(p)&&!p.props.in;f&&(!d||m)?o[s]=v.cloneElement(c,{onExited:n.bind(null,c),in:!0,exit:rl(c,"exit",e),enter:rl(c,"enter",e)}):!f&&d&&!m?o[s]=v.cloneElement(c,{in:!1}):f&&d&&v.isValidElement(p)&&(o[s]=v.cloneElement(c,{onExited:n.bind(null,c),in:p.props.in,exit:rl(c,"exit",e),enter:rl(c,"enter",e)}))}}),o}var a8=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},s8={component:"div",childFactory:function(t){return t}},os=(function(e){DD(t,e);function t(r,o){var s;s=e.call(this,r,o)||this;var c=s.handleExited.bind(n8(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(o,s){var c=s.children,d=s.handleExited,f=s.firstRender;return{children:f?i8(o,d):o8(o,c,d),firstRender:!1}},n.handleExited=function(o,s){var c=eS(this.props.children);o.key in c||(o.props.onExited&&o.props.onExited(s),this.mounted&&this.setState(function(d){var f=Rp({},d.children);return delete f[o.key],{children:f}}))},n.render=function(){var o=this.props,s=o.component,c=o.childFactory,d=w0(o,["component","childFactory"]),f=this.state.contextValue,p=a8(this.state.children).map(c);return delete d.appear,delete d.enter,delete d.exit,s===null?Pn.createElement(Ap.Provider,{value:f},p):Pn.createElement(Ap.Provider,{value:f},Pn.createElement(s,d,p))},t})(Pn.Component);os.propTypes={};os.defaultProps=s8;const kD=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function l8(e,t){return e.reduce((n,r)=>(n[r.position||t].push(r),n),kD.reduce((n,r)=>(n[r]=[],n),{}))}const wT={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},c8={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function u8({state:e,maxHeight:t,position:n,transitionDuration:r}){const[o,s]=n.split("-"),c=s==="center"?`${o}-center`:s,d={opacity:0,maxHeight:t,transform:wT[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:c8[c]},p={opacity:0,maxHeight:0,transform:wT[c]};return{...d,...{entering:f,entered:f,exiting:p,exited:p}[e]}}function d8(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const PD=v.forwardRef(({data:e,onHide:t,autoClose:n,...r},o)=>{const{autoClose:s,message:c,...d}=e,f=d8(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(()=>{e.onOpen?.(e)},[]),v.useEffect(()=>(y(),m),[f]),a.jsx(L0,{...r,...d,onClose:g,ref:o,onMouseEnter:m,onMouseLeave:y,children:c})});PD.displayName="@mantine/notifications/NotificationContainer";var ND={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const f8=Ta,h8={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:Lr("overlay"),store:Al,withinPortal:!0},p8=(e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t?.toString(),"--notifications-container-width":le(n)}}),Ra=ge((e,t)=>{const n=oe("Notifications",h8,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,position:p,autoClose:m,transitionDuration:g,containerWidth:y,notificationMaxHeight:b,limit:S,zIndex:j,store:C,portalProps:E,withinPortal:R,...T}=n,_=En(),k=W$(C),L=s4(),A=Sb(),N=v.useRef({}),z=v.useRef(0),G=(_.respectReducedMotion?A:!1)?1:g,Y=Ie({name:"Notifications",classes:ND,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:p8});v.useEffect(()=>{C?.updateState(W=>({...W,limit:S||5,defaultPosition:p}))},[S,p]),hs(()=>{k.notifications.length>z.current&&setTimeout(()=>L(),0),z.current=k.notifications.length},[k.notifications]);const J=l8(k.notifications,p),U=kD.reduce((W,O)=>(W[O]=J[O].map(({style:I,...$})=>a.jsx(f8,{timeout:G,onEnter:()=>N.current[$.id].offsetHeight,nodeRef:{current:N.current[$.id]},children:H=>a.jsx(PD,{ref:K=>{K&&(N.current[$.id]=K)},data:$,onHide:K=>AD(K,C),autoClose:m,...Y("notification",{style:{...u8({state:H,position:O,transitionDuration:G,maxHeight:b}),...I}})})},$.id)),W),{});return a.jsxs(va,{withinPortal:R,...E,children:[a.jsx(ce,{...Y("root"),"data-position":"top-center",ref:t,...T,children:a.jsx(os,{children:U["top-center"]})}),a.jsx(ce,{...Y("root"),"data-position":"top-left",...T,children:a.jsx(os,{children:U["top-left"]})}),a.jsx(ce,{...Y("root",{className:ul.classNames.fullWidth}),"data-position":"top-right",...T,children:a.jsx(os,{children:U["top-right"]})}),a.jsx(ce,{...Y("root",{className:ul.classNames.fullWidth}),"data-position":"bottom-right",...T,children:a.jsx(os,{children:U["bottom-right"]})}),a.jsx(ce,{...Y("root"),"data-position":"bottom-left",...T,children:a.jsx(os,{children:U["bottom-left"]})}),a.jsx(ce,{...Y("root"),"data-position":"bottom-center",...T,children:a.jsx(os,{children:U["bottom-center"]})})]})});Ra.classes=ND;Ra.displayName="@mantine/notifications/Notifications";Ra.show=ki.show;Ra.hide=ki.hide;Ra.update=ki.update;Ra.clean=ki.clean;Ra.cleanQueue=ki.cleanQueue;Ra.updateState=ki.updateState;class m8{operator;child;constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class cf{operator;left;right;constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`(${this.left.toString()} ${this.operator} ${this.right.toString()})`}}class g8{prefixParselets={};infixParselets={};registerInfix(t,n){return this.infixParselets[t]=n,this}registerPrefix(t,n){return this.prefixParselets[t]=n,this}prefix(t,n,r){return this.registerPrefix(t,{parse(o,s){const c=o.consumeAndParse(n);return r(s,c)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(o,s,c){const d=o.consumeAndParse(n);return r(s,c,d)},precedence:n})}construct(t){return new v8(t,this.prefixParselets,this.infixParselets)}}class v8{tokens;prefixParselets;infixParselets;constructor(t,n,r){this.tokens=t,this.prefixParselets=n,this.infixParselets=r}hasMore(){return this.tokens.length>0}match(t){return this.peek()?.id!==t?!1:(this.consume(),!0)}consumeAndParse(t=1/0){const n=this.consume(),r=this.prefixParselets[n.id];if(!r)throw Error(`Parse error at "${n.value}" (line ${n.line}, column ${n.column}). No matching prefix parselet.`);let o=r.parse(this,n);for(;t>this.getPrecedence();){const s=this.consume();o=this.getInfixParselet(s).parse(this,o,s)}return o}getPrecedence(){const t=this.peek();if(!t)return 1/0;const n=this.getInfixParselet(t);return n?n.precedence:1/0}consume(t,n){if(!this.tokens.length)throw Error("Cant consume unknown more tokens.");if(t&&this.peek()?.id!==t){const r=this.peek();throw Error(`Expected ${t} but got "${r.id}" (${r.value}) at line ${r.line} column ${r.column}.`)}if(n&&this.peek()?.value!==n){const r=this.peek();throw Error(`Expected "${n}" but got "${r.value}" at line ${r.line} column ${r.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 OD{max;cache;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 ao="http://hl7.org",MD="ok",y8="created",x8="gone",b8="not-modified",S8="not-found",w8="unauthorized",j8="forbidden",C8="accepted",E8={resourceType:"OperationOutcome",id:MD,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},T8={resourceType:"OperationOutcome",id:S8,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},Pd={resourceType:"OperationOutcome",id:w8,issue:[{severity:"error",code:"login",details:{text:"Unauthorized"}}]},R8={...Pd,issue:[...Pd.issue,{severity:"error",code:"expired",details:{text:"Token expired"}}]},jT={...Pd,issue:[...Pd.issue,{severity:"error",code:"invalid",details:{text:"Token not issued for this audience"}}]},uf={resourceType:"OperationOutcome",id:j8,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function To(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},...t?{expression:[t]}:void 0}]}}function jn(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function _8(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function A8(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 Im(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function LD(e){return e.id===MD||e.id===y8||e.id===b8||e.id===C8}function D8(e){return e.id===x8}class gt extends Error{outcome;constructor(t,n){super(ID(t),n),this.name="OperationOutcomeError",this.outcome=t}}function Xt(e){return e instanceof gt?e.outcome:Im(e)?e:To(Qe(e))}function Qe(e){return e?typeof e=="string"?e:A8(e)?e.message:Im(e)?ID(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function ID(e){const t=e.issue?.map(zD)??[];return t.length>0?t.join("; "):"Unknown error"}function zD(e){let t;return e.details?.text?e.diagnostics?t=`${e.details.text} (${e.diagnostics})`:t=e.details.text:e.diagnostics?t=e.diagnostics:t="Unknown error",e.expression?.length&&(t+=` (${e.expression.join(", ")})`),t}function k8(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 P8(e){const t=Object.create(null);for(const[n,r]of Object.entries(e))t[n]={name:n,type:n,path:n,elements:Object.fromEntries(Object.entries(r.elements).map(([o,s])=>[o,k8(o,s)])),constraints:[],innerTypes:[]};return t}const N8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},O8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},M8={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"}]}}},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"}]}}},I8={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"}]}}},z8={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"}]}}},$8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},U8={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"}]}}},B8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},V8={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"}]}}},F8={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"}]}}},H8={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"}]}}},q8={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"}]}}},G8={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"}]}}},Q8={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"}]}}},W8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},direction:{min:1,type:[{code:"code"}]}}},Y8={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"}]}}},K8={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"]}]}}},X8={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"]}]}}},J8={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"}]},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"}]}}},eU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},path:{min:1,type:[{code:"string"}]}}},tU={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"}]}}},nU={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"}]}}},rU={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"}]}}},iU={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"}]}}},oU={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"]}]}}},aU={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"]}]}}},sU={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"}]}}},lU={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"}]}}},cU={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"}]}}},uU={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"}]}}},dU={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"]}]}}},fU={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"}]}}},hU={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"}]}}},pU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},mU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},gU={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"]}]}}},vU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},yU={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"}]}}},xU={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"}]}}},bU={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"}]}}},SU={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"}]}}},wU={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"]}]}}},jU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},CU={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"}]}}},EU={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"]}]}}},TU={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"}]}}},RU={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"}]}}},_U={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"}]}}},AU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},lowLimit:{type:[{code:"Quantity"}]},highLimit:{type:[{code:"Quantity"}]}}},DU={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"}]}}},kU={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"}]}}},PU={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"}]}}},NU={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"]}]}}},OU={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"}]}}},MU={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"}]}}},LU={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"}]}}},IU={Element:N8,BackboneElement:O8,Address:M8,Age:L8,Annotation:I8,Attachment:z8,CodeableConcept:$8,Coding:U8,ContactDetail:B8,ContactPoint:V8,Contributor:F8,Count:H8,DataRequirement:q8,DataRequirementCodeFilter:G8,DataRequirementDateFilter:Q8,DataRequirementSort:W8,Distance:Y8,Dosage:K8,DosageDoseAndRate:X8,Duration:J8,ElementDefinition:Z8,ElementDefinitionSlicingDiscriminator:eU,ElementDefinitionSlicing:tU,ElementDefinitionBase:nU,ElementDefinitionType:rU,ElementDefinitionExample:iU,ElementDefinitionConstraint:oU,ElementDefinitionBinding:aU,ElementDefinitionMapping:sU,Expression:lU,Extension:cU,HumanName:uU,Identifier:dU,MarketingStatus:fU,Meta:hU,Money:pU,Narrative:mU,ParameterDefinition:gU,Period:vU,Population:yU,ProdCharacteristic:xU,ProductShelfLife:bU,Quantity:SU,Range:wU,Ratio:jU,Reference:CU,RelatedArtifact:EU,SampledData:TU,Signature:RU,SubstanceAmount:_U,SubstanceAmountReferenceRange:AU,Timing:DU,TimingRepeat:kU,TriggerDefinition:PU,UsageContext:NU,MoneyQuantity:OU,SimpleQuantity:MU,IdentityProvider:LU};function zU(e){return new UU(e).parse()}const Dp=P8(IU),tS=Object.create(null),CT=Object.create(null),$U={"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 $D(e){let t;return t=CT[e],t||(t=CT[e]=Object.create(null)),t}function ET(e){const n=(Array.isArray(e)?e:e.entry?.map(r=>r.resource)??[]).filter(r=>r?.resourceType==="StructureDefinition");_B(n);for(const r of n)UD(r)}function UD(e){if(!e?.name)throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=zU(e),n=$U[e.url];let r,o;n?(r=Dp,o=n):e.url===`http://hl7.org/fhir/StructureDefinition/${e.type}`||e.url===`https://medplum.com/fhir/StructureDefinition/${e.type}`||e.type?.startsWith("http://")||e.type?.startsWith("https://")?(r=Dp,o=e.type):(r=$D(e.url),o=e.type),r[o]=t;for(const s of t.innerTypes)s.parentType=t,r[s.name]=s;tS[e.url]=t}function BD(e){return!!Dp[e]}function zm(e,t){if(t){const n=$D(t)[e];if(n)return n}return Dp[e]}function VD(e,t){const n=zm(e,t);if(!n)throw new gt(To("Unknown data type: "+e));return n}function nS(e){return!!tS[e]}function uu(e){return tS[e]}class UU{root;elements;elementIndex;index;resourceSchema;slicingContext;innerTypes;backboneContext;constructor(t){if(!t.snapshot?.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:FU(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){let t=this.next();for(;t;){if(t.sliceName)this.parseSliceStart(t);else if(t.id?.includes(":")){if(this.slicingContext?.current){const n=Yy(t,this.slicingContext.path);this.slicingContext.current.elements[n]=this.parseElementDefinition(t)}}else{const n=this.parseElementDefinition(t);this.checkFieldEnter(t,n);let r=this.backboneContext;for(;r;){if(t.path?.startsWith(r.path+".")){r.type.elements[Yy(t,r.path)]=n;break}r=r.parent}if(!r){const o=Yy(t,this.root.path);t.isSummary&&this.resourceSchema.summaryProperties?.add(o.replace("[x]","")),n.min>0&&this.resourceSchema.mandatoryProperties?.add(o.replace("[x]","")),this.resourceSchema.elements[o]=n}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&&!jc(this.slicingContext.path,t?.path)&&(this.slicingContext=void 0),t.slicing&&!this.slicingContext&&this.enterSlice(t,n)}enterInnerType(t){for(;this.backboneContext&&!jc(this.backboneContext?.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;const n=NT(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:jc(this.backboneContext?.path,t.path)?this.backboneContext:this.backboneContext?.parent}}enterSlice(t,n){VU(t)&&!this.peek()?.sliceName||(n.slicing={discriminator:(t.slicing?.discriminator??[]).map(r=>{if(r.type!=="value"&&r.type!=="pattern"&&r.type!=="type")throw new Error(`Unsupported slicing discriminator type: ${r.type}`);return{path:r.path,type:r.type}}),slices:[],ordered:t.slicing?.ordered??!1,rule:t.slicing?.rules},this.slicingContext={field:n.slicing,path:t.path??""})}checkFieldExit(t=void 0){if(this.backboneContext&&!jc(this.backboneContext.path,t?.path))if(this.backboneContext.parent)do this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;while(this.backboneContext&&!jc(this.backboneContext.path,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(){const t=this.elements[this.index];if(t){if(this.elementIndex[t.path??""]=t,t.contentReference){const n=t.contentReference.slice(t.contentReference.indexOf("#")+1),r=this.elementIndex[n];return r?{...r,id:t.id,path:t.path,min:t.min??r.min,max:t.max??r.max,base:{path:r.base?.path??n,min:t.base?.min??r.base?.min??r.min,max:t.base?.max??r.base?.max??r.max},contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){const n=this.peek();return!!(jc(t?.path,n?.path)&&t.type?.some(r=>["BackboneElement","Element"].includes(r.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=>{let r;return(n.code==="BackboneElement"||n.code==="Element")&&(r=NT(t)),r||(r=Bo(n,"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type")?.valueUrl),r||(r=n.code??""),{code:r,targetProfile:n.targetProfile,profile:n.profile}})}parseElementDefinition(t){const n=TT(t.max),r=t.base?.max?TT(t.base.max):n,o={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||t.base?.path||"",min:t.min??0,max:n,isArray:r>1,constraints:(t.constraint??[]).map(s=>({key:s.key??"",severity:s.severity??"error",expression:s.expression??"",description:s.human??""})),type:this.parseElementDefinitionType(t),fixed:RT(Nd(o,"fixed[x]")),pattern:RT(Nd(o,"pattern[x]")),binding:t.binding}}}function TT(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function Yy(e,t=""){return BU(e.path,t)}function BU(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function jc(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function RT(e){return Array.isArray(e)&&e.length>0?e[0]:Cn(e)?void 0:e}function VU(e){const t=e.slicing?.discriminator;return!!(e.type?.some(n=>n.code==="Extension")&&t?.length===1&&t[0].type==="value"&&t[0].path==="url")}function FU(e){let t=e.description;return t?.startsWith(`Base StructureDefinition for ${e.name} Type: `)&&(t=t.substring(`Base StructureDefinition for ${e.name} Type: `.length)),t}function HU(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n?.withPath?FD:Nd,[o,...s]=t.split(".");let c=[r(e,o,n)];for(const d of s){const f=[];for(const p of c)if(Array.isArray(p))for(const m of p)f.push(r(m,d,n));else(n?.withPath&&p?.value!==void 0||!n?.withPath&&p!==void 0)&&f.push(r(p,d,n));c=f}return c}function FD(e,t,n){const r=e.path;return qU(Nd(e,t,n),r,t)}function qU(e,t,n){const r=t?t+".":"";return e===void 0?{type:"undefined",value:void 0,path:`${r}${n}`}:Array.isArray(e)?e.map((o,s)=>({...o,path:`${r}${n}[${s}]`})):{...e,path:`${r}${n}`}}const HD={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 GU(e,t,n,r){if(Array.isArray(e))return!1;let o;t.path==="$this"?o=n:o=(r??n.elements)[t.path];const s=n.type;switch(t.type){case"value":case"pattern":if(!e||!o)return!1;if(o.pattern)return oS(e,o.pattern);if(o.fixed)return Po(e,o.fixed);if(o.binding?.strength==="required"&&o.binding.valueSet)return!0;break;case"type":return!e||!s?.length?!1:s.some(c=>c.code===e.type)}return!1}function Ze(e){return[{type:ne.boolean,value:e}]}function fi(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:ne.integer,value:e}:typeof e=="number"?{type:ne.decimal,value:e}:typeof e=="boolean"?{type:ne.boolean,value:e}:typeof e=="string"?{type:ne.string,value:e}:Pi(e)?{type:ne.Quantity,value:e}:Vo(e)?{type:e.resourceType,value:e}:rk(e)?{type:ne.CodeableConcept,value:e}:nk(e)?{type:ne.Coding,value:e}:{type:ne.BackboneElement,value:e}}function jo(e){return e.length===0?!1:!!e[0].value}function xa(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 Nd(e,t,n){if(!e.value)return;const r=Es(e.type,t,n?.profileUrl);return r?qD(e,t,r):df(e,t)}function qD(e,t,n){const r=e.value,o=n.type;if(!o||o.length===0)return;let s,c="undefined",d;const f=n.path.lastIndexOf("."),p=n.path.substring(f+1);for(const m of o){const g=p.replace("[x]",Qn(m.code));if(s=r[g],d=r["_"+g],s!==void 0||d!==void 0){c=m.code;break}}if(d)if(Array.isArray(s)){s=s.slice();for(let m=0;m<Math.max(s.length,d.length);m++)s[m]=Ky(s[m],d[m])}else if(!s&&Array.isArray(d)){s=d.slice();for(let m=0;m<d.length;m++)s[m]=Ky(void 0,d[m])}else s=Ky(s,d);if(!Cn(s))return(c==="Element"||c==="BackboneElement")&&(c=n.type[0].code),Array.isArray(s)?s.map(m=>_T(m,c)):_T(s,c)}function _T(e,t){return t==="Resource"&&Vo(e)&&(t=e.resourceType),{type:t,value:e}}function df(e,t){const n=e.value;if(!n||typeof n!="object")return;let r;if(t in n){const o=n[t];Array.isArray(o)?r=o.map(fi):r=fi(o)}else{const o=t.endsWith("[x]")?t.substring(0,t.length-3):t;for(const s of Object.values(ne)){const c=o+Qn(s);if(c in n){const d=n[c];Array.isArray(d)?r=d.map(f=>({type:s,value:f})):r={type:s,value:d};break}}}if(Array.isArray(r)){if(r.length===0||Cn(r[0]))return}else if(Cn(r))return;return r}function GD(e){const t=[];for(const n of e){let r=!1;for(const o of t)if(jo($m(n,o))){r=!0;break}r||t.push(n)}return t}function QU(e){return Ze(!jo(e))}function WU(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Ze(!1):Ze(e.every((n,r)=>jo($m(n,t[r]))))}function YU(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Ze(!0):Ze(e.some((n,r)=>!jo($m(n,t[r]))))}function $m(e,t){const n=e.value?.valueOf(),r=t.value?.valueOf();return typeof n=="number"&&typeof r=="number"?Ze(Math.abs(n-r)<1e-8):Pi(n)&&Pi(r)?Ze(JD(n,r)):Ze(typeof n=="object"&&typeof r=="object"?rS(e,t):n===r)}function QD(e,t){return e.length===0&&t.length===0?Ze(!0):e.length!==t.length?Ze(!1):(e.sort(AT),t.sort(AT),Ze(e.every((n,r)=>jo(KU(n,t[r])))))}function KU(e,t){const{type:n,value:r}=e,{type:o,value:s}=t,c=r?.valueOf(),d=s?.valueOf();return typeof c=="number"&&typeof d=="number"?Ze(Math.abs(c-d)<.01):Pi(c)&&Pi(d)?Ze(JD(c,d)):Ze(n==="Coding"&&o==="Coding"?typeof c!="object"||typeof d!="object"?!1:c.code===d.code&&c.system===d.system:typeof c=="object"&&typeof d=="object"?rS({...c,id:void 0},{...d,id:void 0}):typeof c=="string"&&typeof d=="string"?c.toLowerCase()===d.toLowerCase():c===d)}function AT(e,t){const n=e.value?.valueOf(),r=t.value?.valueOf();return typeof n=="number"&&typeof r=="number"?n-r:typeof n=="string"&&typeof r=="string"?n.localeCompare(r):0}function WD(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 YD(n);case"DateTime":return Od(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return KD(n);case"Quantity":return Pi(n);default:return e.type===r||typeof n=="object"&&n?.resourceType===r}}function YD(e){return typeof e=="string"&&!!HD.date.exec(e)}function Od(e){return typeof e=="string"&&!!HD.dateTime.exec(e)}function KD(e){return!!(e&&typeof e=="object"&&("start"in e&&Od(e.start)||"end"in e&&Od(e.end)))}function XD(e){if(e){if(YD(e)||Od(e))return{start:Wh(e,"0000-01-01T00:00:00.000"),end:Wh(e,"xxxx-12-31T23:59:59.999")};if(KD(e))return{start:e.start?Wh(e.start,"0000-01-01T00:00:00.000"):void 0,end:e.end?Wh(e.end,"xxxx-12-31T23:59:59.999"):void 0}}}function Wh(e,t){let n="Z";const r=Math.max(e.indexOf("+",10),e.indexOf("-",10));r>-1?(n=e.substring(r),e=e.substring(0,r)):e.endsWith("Z")&&(e=e.substring(0,e.length-1));const o=e+t.substring(e.length)+n;return new Date(o).toISOString()}function Pi(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function JD(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 rS(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const s=e[o],c=t[o];if(DT(s)&&DT(c)){if(!rS(s,c))return!1}else if(s!==c)return!1}return!0}function DT(e){return e!==null&&typeof e=="object"}function Ky(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return XU(e??{},t)}return e}function XU(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function ZD(e,t){return Vo(e,t)&&"id"in e&&typeof e.id=="string"}function Yt(e){const t=Mt(e)??"undefined/undefined",n=ba(e);return n===t?{reference:t}:{reference:t,display:n}}function Mt(e){if(_a(e))return e.reference;if(ZD(e))return`${e.resourceType}/${e.id}`}function hl(e){if(e)return _a(e)?e.reference.split("/")[1]:e.id}function JU(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function ba(e){if(JU(e)){const t=ZU(e);if(t)return t}if(e.resourceType==="Device"){const t=eB(e);if(t)return t}if(e.resourceType==="MedicationRequest"&&e.medicationCodeableConcept)return gs(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]),rk(t))return gs(t);if(uB(t))return t.text}return Mt(e)??""}function ZU(e){const t=e.name;if(t&&t.length>0)return Cs(t[0])}function eB(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function tB(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=kT(n);if(r)return r}else return kT(t)}function kT(e){if(e.url&&e.contentType?.startsWith("image/"))return e.url}function ek(e,t){const n=new Date(e);n.setUTCHours(0,0,0,0);const r=t?new Date(t):new Date;r.setUTCHours(0,0,0,0);const o=n.getUTCFullYear(),s=n.getUTCMonth(),c=n.getUTCDate(),d=r.getUTCFullYear(),f=r.getUTCMonth(),p=r.getUTCDate();let m=d-o;(f<s||f===s&&p<c)&&m--;let g=d*12+f-(o*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 nB(e,t){const{years:n,months:r,days:o}=ek(e,t);return n>=2?n.toString().padStart(3,"0")+"Y":r>=1?r.toString().padStart(3,"0")+"M":o.toString().padStart(3,"0")+"D"}function Bo(e,...t){let n=e;for(let r=0;r<t.length&&n;r++)n=n?.extension?.find(o=>o.url===t[r]);return n}function io(e,t){const n=iS(e);return JSON.stringify(n,null,t?2:void 0)??""}function iS(e){if(!(e==null||e===""))return typeof e=="object"?Array.isArray(e)?rB(e):iB(e):e}function rB(e){const t=e.length;if(t===0)return;let n,r=0;for(let o=0;o<t;o++){const s=e[o],c=iS(s);c!==s&&!n&&(n=Array.from(e)),c===void 0?n&&(n[o]=null):(n&&(n[o]=c),r++)}if(r!==0)return n??e}function iB(e){let t,n=0;for(const r in e){const o=e[r],s=iS(o);s!==o&&!t&&(t={...e}),s===void 0?t&&delete t[r]:(t&&(t[r]=s),n++)}if(n!==0)return t??e}function Cn(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!Nn(e):!1}function Nn(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 oB(e){if(!e)return;let t=e.length-1;for(;t>=0&&Cn(e[t]);)t--;return t>=0?e.slice(0,t+1):void 0}function Po(e,t,n){return e===t||Cn(e)&&Cn(t)?!0:Cn(e)||Cn(t)?!1:Array.isArray(e)&&Array.isArray(t)?aB(e,t):Array.isArray(e)||Array.isArray(t)?!1:pr(e)&&pr(t)?sB(e,t,n):(pr(e)||pr(t),!1)}function aB(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Po(e[n],t[n]))return!1;return!0}function sB(e,t,n){const r=new Set;Object.keys(e).forEach(o=>r.add(o)),Object.keys(t).forEach(o=>r.add(o)),n==="meta"&&(r.delete("versionId"),r.delete("lastUpdated"),r.delete("author"));for(const o of r){const s=e[o],c=t[o];if(!Po(s,c,o))return!1}return!0}function oS(e,t){return Cn(e)?!0:Cn(t)?!1:Array.isArray(e)&&Array.isArray(t)?lB(e,t):Array.isArray(e)||Array.isArray(t)?!1:pr(e)&&pr(t)?cB(e,t):pr(e)||pr(t)?!1:e===t}function lB(e,t){return t.every(n=>e.some(r=>oS(r,n)))}function cB(e,t){return Object.entries(t).every(([n,r])=>n in e&&oS(e[n],r))}function hi(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function aS(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 pr(e){return e!==null&&typeof e=="object"}function tk(e){return typeof e=="string"}function nk(e){return pr(e)&&"code"in e&&typeof e.code=="string"}function rk(e){return pr(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(nk)}function uB(e){return pr(e)&&"text"in e&&typeof e.text=="string"}const ik=[];for(let e=0;e<256;e++)ik.push(e.toString(16).padStart(2,"0"));function dB(e){const t=ok(e),n=new Uint8Array(t),r=new Array(n.length);for(let o=0;o<n.length;o++)r[o]=ik[n[o]];return r.join("")}function fB(e){const t=ok(e),n=new Uint8Array(t),r=new Array(n.length);for(let o=0;o<n.length;o++)r[o]=String.fromCharCode(n[o]);return window.btoa(r.join(""))}function ok(e){return ArrayBuffer.isView(e)?e.buffer:e}function Qn(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function sS(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function il(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function hB(e,t){return e.coding?.find(n=>n.system===t)?.code}function pB(e){if(e!==void 0)return Array.isArray(e)?e:[e]}const PT=e=>new Promise(t=>{setTimeout(t,e)});function Vx(e,t,n){const r=[];for(let o=0;o<n-1;o++){const s=e.indexOf(t);if(s<0)break;r.push(e.slice(0,s)),e=e.slice(s+t.length)}return r.push(e),r}function mB(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function cd(e,t){return e?(e.push(t),e):[t]}function Qc(e){return e.sort((t,n)=>t.localeCompare(n))}function lS(e){return e.endsWith("/")?e:e+"/"}function gB(e){return e.startsWith("/")?e.slice(1):e}function yo(e,t){return new URL(gB(t),lS(e.toString())).toString()}function vB(e,t){return yo(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function yB(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 ak(e,t){return e?.meta?.profile?.includes(t)||(e.meta=e.meta??{},e.meta.profile=e.meta.profile??[],e.meta.profile.push(t)),e}function xB(e,t){if(e?.meta?.profile?.includes(t)){const n=e.meta.profile.indexOf(t);e.meta.profile.splice(n,1)}return e}function pl(e){if(!e)return"";switch(e.type){case"Address":return sk(e.value);case"CodeableConcept":return gs(e.value);case"Coding":return ff(e.value);case"ContactPoint":return e.value.value;case"HumanName":return Cs(e.value);case"Quantity":return ol(e.value);case"Reference":return bB(e.value);default:return e.value?.toString()??""}}function bB(e){return e?e.display??e.reference??io(e):""}function sk(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?.use,n.join(", ").trim()}function Cs(e,t){if(!e)return"";const n=[];if(e.prefix&&t?.prefix!==!1&&n.push(...e.prefix),e.given&&n.push(...e.given),e.family&&n.push(e.family),e.suffix&&t?.suffix!==!1&&n.push(...e.suffix),e.use&&(t?.all||t?.use)&&n.push("["+e.use+"]"),n.length===0){const r=Ld(e.text);if(r)return r}return n.join(" ").trim()}function Um(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function SB(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return Um(r)?r.toLocaleTimeString(t,n):""}function Cr(e,t,n){if(!e)return"";const r=new Date(e);return Um(r)?r.toLocaleString(t,n):""}function wB(e,t,n){return!e||!e.start&&!e.end?"":Cr(e.start,t,n)+" - "+Cr(e.end,t,n)}const jB={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},CB={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},EB={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function lk(e){if(!e)return"";const t=[];return TB(t,e.repeat),e.event&&t.push(e.event.map(n=>Cr(n)).join(", ")),Qn(t.join(" ").trim())}function TB(e,t){if(!t?.periodUnit)return;const n=t.frequency??1,r=t.period??1,o=t.periodUnit;n===1&&r===1?e.push(jB[o]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+CB[o]):e.push("per "+r+" "+EB[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(Qn).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(s=>SB(s)).join(", "))}function Md(e,t,n=!1){if(n&&t===void 0)throw new Error("Precision must be specified for exclusive ranges");const r=e?.low&&{...e.low,comparator:void 0},o=e?.high&&{...e.high,comparator:void 0};return r?.value===void 0&&o?.value===void 0?"":r?.value!==void 0&&o?.value===void 0?`>= ${ol(r)}`:r?.value===void 0&&o?.value!==void 0?`<= ${ol(o)}`:(r?.unit===o?.unit&&delete r?.unit,`${ol(r)} - ${ol(o)}`)}function ol(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.at(-1)!==" "&&n.push(" "),n.push(e.unit)),n.join("").trim()}function RB(e){return e?.value===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function gs(e){if(!e)return"";const t=Ld(e.text);return t||(e.coding?e.coding.map(n=>ff(n)).join(", "):"")}function ff(e,t){const n=Ld(e?.display);return n?`${n}`:Ld(e?.code)??""}function ck(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(ol(e.valueQuantity));else if(e.valueCodeableConcept)t.push(gs(e.valueCodeableConcept));else{const n=Ld(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>ck(n)).join(" / ")),t.join(" / ").trim()}function Ld(e){return typeof e=="string"?e:void 0}const ne={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",Element:"Element",ElementDefinition:"ElementDefinition",Expression:"Expression",Extension:"Extension",HumanName:"HumanName",Identifier:"Identifier",MarketingStatus:"MarketingStatus",Meta:"Meta",Money:"Money",MoneyQuantity:"MoneyQuantity",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",SimpleQuantity:"SimpleQuantity",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",xhtml:"xhtml"};function _B(e){const t=Array.isArray(e)?e:e.entry?.map(n=>n.resource)??[];for(const n of t)n?.resourceType==="StructureDefinition"&&n.kind==="resource"&&uk(n.type)}function uk(e){let t=No.types[e];return t||(t={searchParamsDetails:{}},No.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 AB(e){for(const t of e.base??[]){const n=uk(t);n.searchParams||(n.searchParams={}),n.searchParams[e.code]=e}}function NT(e){const t=e.type?.[0]?.code;return t==="BackboneElement"||t==="Element"?DB((e.base?.path??e.path)?.split(".")):t}function DB(e){return e.length===1?e[0]:e.map(Qn).join("")}function cS(e){return No.types[e]?.searchParams}function kB(e,t){return No.types[e]?.searchParams?.[t]}function ml(e){const t=e.replaceAll("[x]","").split(".").pop();return dk(t)}function dk(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(NB).join(" ").replace("_"," ").replaceAll(/\s+/g," ")}const PB=new Set(["CDS","ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function NB(e){const t=e.toUpperCase();return e===t?e:PB.has(t)?t:t.charAt(0)+e.slice(1)}function Es(e,t,n){const r=zm(e,n);if(r)return OB(r.elements,t)}function OB(e,t){const n=e[t]??e[t+"[x]"];if(n)return n;for(let r=0;r<t.length;r++){const o=t[r];if(o>="A"&&o<="Z"){const s=t.slice(0,r)+"[x]",c=e[s];if(c)return c}}}function Vo(e,t){return!(!e||typeof e!="object"||!("resourceType"in e)||t&&e.resourceType!==t)}function _a(e,t){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const No={types:{}};function fp(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 ua=()=>[],Gr={empty:(e,t)=>Ze(t.every(n=>Cn(n.value))),hasValue:(e,t)=>Ze(t.length!==0),exists:(e,t,n)=>Ze(n?t.some(r=>jo(n.eval(e,[r]))):t.length>0&&t.every(r=>!Cn(r.value))),all:(e,t,n)=>Ze(t.every(r=>jo(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return Ze(!1);return Ze(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return Ze(!0);return Ze(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return Ze(!1);return Ze(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return Ze(!0);return Ze(!1)},subsetOf:(e,t,n)=>{if(t.length===0)return Ze(!0);const r=n.eval(e,Qs(e));return r.length===0?Ze(!1):Ze(t.every(o=>r.some(s=>s.value===o.value)))},supersetOf:(e,t,n)=>{const r=n.eval(e,Qs(e));return r.length===0?Ze(!0):t.length===0?Ze(!1):Ze(r.every(o=>t.some(s=>s.value===o.value)))},count:(e,t)=>[{type:ne.integer,value:t.length}],distinct:(e,t)=>{const n=[];for(const r of t)n.some(o=>o.value===r.value)||n.push(r);return n},isDistinct:(e,t)=>Ze(t.length===Gr.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>jo(n.eval(e,[r]))),select:(e,t,n)=>t.flatMap(r=>n.eval({parent:e,variables:{$this:r}},[r])),repeat:ua,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(-1,t.length),tail:(e,t)=>t.length===0?[]:t.slice(1,t.length),skip:(e,t,n)=>{const r=n.eval(e,t)[0]?.value;if(typeof r!="number")throw new TypeError("Expected a number for skip(num)");return r>=t.length?[]:r<=0?t:t.slice(r,t.length)},take:(e,t,n)=>{const r=n.eval(e,t)[0]?.value;if(typeof r!="number")throw new TypeError("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,Qs(e)),o=[];for(const s of t)!o.some(c=>c.value===s.value)&&r.some(c=>c.value===s.value)&&o.push(s);return o},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Qs(e)),o=[];for(const s of t)r.some(c=>c.value===s.value)||o.push(s);return o},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Qs(e));return GD([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Qs(e));return[...t,...r]},htmlChecks:(e,t,n)=>[fi(!0)],iif:(e,t,n,r,o)=>{const s=n.eval(e,t);if(s.length>1||s.length===1&&typeof s[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return jo(s)?r.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=xo(t,1);if(typeof n=="boolean")return[{type:ne.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return Ze(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return Ze(!0);if(["false","f","no","n","0","0.0"].includes(r))return Ze(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:Ze(Gr.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=xo(t,1);return typeof n=="number"?[{type:ne.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:ne.integer,value:Number.parseInt(n,10)}]:typeof n=="boolean"?[{type:ne.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:Ze(Gr.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=xo(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:ne.date,value:fp(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:Ze(Gr.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=xo(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:ne.dateTime,value:fp(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:Ze(Gr.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=xo(t,1);return typeof n=="number"?[{type:ne.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:ne.decimal,value:Number.parseFloat(n)}]:typeof n=="boolean"?[{type:ne.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:Ze(Gr.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=xo(t,1);return Pi(n)?[{type:ne.Quantity,value:n}]:typeof n=="number"?[{type:ne.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:ne.Quantity,value:{value:Number.parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:ne.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:Ze(Gr.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=xo(t,1);return n==null?[]:Pi(n)?[{type:ne.string,value:`${n.value} '${n.unit}'`}]:[{type:ne.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:Ze(Gr.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=xo(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:ne.time,value:fp("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:Ze(Gr.toTime(e,t).length===1),indexOf:(e,t,n)=>Ri((r,o)=>r.indexOf(o),e,t,n),substring:(e,t,n,r)=>Ri((o,s,c)=>{const d=s,f=c?d+c:o.length;return d<0||d>=o.length?void 0:o.substring(d,f)},e,t,n,r),startsWith:(e,t,n)=>Ri((r,o)=>r.startsWith(o),e,t,n),endsWith:(e,t,n)=>Ri((r,o)=>r.endsWith(o),e,t,n),contains:(e,t,n)=>Ri((r,o)=>r.includes(o),e,t,n),upper:(e,t)=>Ri(n=>n.toUpperCase(),e,t),lower:(e,t)=>Ri(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>Ri((o,s,c)=>o.replaceAll(s,c),e,t,n,r),matches:(e,t,n)=>Ri((r,o)=>!!new RegExp(o).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>Ri((o,s,c)=>o.replaceAll(new RegExp(s,"g"),c.replaceAll(/\$\{(\w+)\}/g,"$<$1>")),e,t,n,r),length:(e,t)=>Ri(n=>n.length,e,t),toChars:(e,t)=>Ri(n=>n?n.split(""):void 0,e,t),encode:ua,decode:ua,escape:ua,unescape:ua,trim:ua,split:ua,join:(e,t,n)=>{const r=n?.eval(e,Qs(e))[0]?.value??"";if(typeof r!="string")throw new TypeError("Separator must be a string.");return[{type:ne.string,value:t.map(o=>o.value?.toString()??"").join(r)}]},abs:(e,t)=>go(Math.abs,e,t),ceiling:(e,t)=>go(Math.ceil,e,t),exp:(e,t)=>go(Math.exp,e,t),floor:(e,t)=>go(Math.floor,e,t),ln:(e,t)=>go(Math.log,e,t),log:(e,t,n)=>go((r,o)=>Math.log(r)/Math.log(o),e,t,n),power:(e,t,n)=>go(Math.pow,e,t,n),round:(e,t,...n)=>go((r,o=0)=>{if(typeof o!="number"||o<0)throw new Error("Invalid precision provided to round()");const s=Math.pow(10,o);return Math.round(r*s)/s},e,t,...n),sqrt:(e,t)=>go(Math.sqrt,e,t),truncate:(e,t)=>go(n=>Math.trunc(n),e,t),children:ua,descendants:ua,trace:(e,t,n)=>t,now:()=>[{type:ne.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:ne.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:ne.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,o)=>{const s=Gr.toDateTime(e,n.eval(e,t));if(s.length===0)throw new Error("Invalid start date");const c=Gr.toDateTime(e,r.eval(e,t));if(c.length===0)throw new Error("Invalid end date");const d=o.eval(e,t)[0]?.value;if(d!=="years"&&d!=="months"&&d!=="days")throw new Error("Invalid units");const f=ek(s[0].value,c[0].value);return[{type:ne.Quantity,value:{value:f[d],unit:d}}]},is:(e,t,n)=>{let r="";return n instanceof Id?r=n.name:n instanceof Bm&&(r=n.left.name+"."+n.right.name),r?t.map(o=>({type:ne.boolean,value:WD(o,r)})):[]},not:(e,t)=>Gr.toBoolean(e,t).map(n=>({type:ne.boolean,value:!n.value})),resolve:(e,t)=>t.map(n=>{const r=n.value;let o;if(typeof r=="string")o=r;else if(typeof r=="object"){const s=r;if(s.resource)return fi(s.resource);s.reference?o=s.reference:s.type&&s.identifier&&(o=`${s.type}?identifier=${s.identifier.system}|${s.identifier.value}`)}if(o?.includes("?")){const[s]=o.split("?");return{type:s,value:{resourceType:s}}}if(o?.includes("/")){const[s,c]=o.split("/");return{type:s,value:{resourceType:s,id:c}}}return{type:ne.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:ne.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:ne.BackboneElement,value:{namespace:"System",name:"Integer"}}:Vo(n)?{type:ne.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:ne.BackboneElement,value:null}),conformsTo:(e,t,n)=>{const r=n.eval(e,t)[0].value;if(!r.startsWith("http://hl7.org/fhir/StructureDefinition/"))throw new Error("Expected a StructureDefinition URL");const o=r.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(s=>({type:ne.boolean,value:s.value?.resourceType===o}))},getResourceKey:(e,t)=>{const n=t[0].value;return n?.id?[{type:ne.id,value:n.id}]:[]},getReferenceKey:(e,t,n)=>{const r=t[0].value;if(!r?.reference)return[];let o="";return n instanceof Id&&(o=n.name),o&&!r.reference.startsWith(o+"/")?[]:[{type:ne.id,value:hl(r)}]},extension:(e,t,n)=>{const r=n.eval(e,t)[0].value,o=t?.[0]?.value;if(o){const s=Bo(o,r);if(s)return[{type:ne.Extension,value:s}]}return[]}};function Ri(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=xo(n,1);if(typeof o!="string")throw new TypeError("String function cannot be called with non-string");const s=r.map(d=>d?.eval(t,n)[0]?.value),c=e(o,...s);return c===void 0?[]:Array.isArray(c)?c.map(fi):[fi(c)]}function go(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=xo(n,1),s=Pi(o),c=s?o.value:o;if(typeof c!="number")throw new TypeError("Math function cannot be called with non-number");const d=e(c,...r.map(m=>m.eval(t,n)[0]?.value)),f=s?ne.Quantity:n[0].type,p=s?{...o,value:d}:d;return[{type:f,value:p}]}function xo(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 Qs(e){let t=e;for(;t.parent?.variables.$this;)t=t.parent;return[t.variables.$this]}class uS{original;child;constructor(t,n){this.original=t,this.child=n}eval(t,n){try{if(n.length>0){const r=[];for(const o of n)r.push(this.child.eval({parent:t,variables:{$this:o}},[o]));return r.flat()}else return this.child.eval(t,[])}catch(r){throw new Error(`FhirPathError on "${this.original}": ${r}`,{cause:r})}}toString(){return this.child.toString()}}class Cc{value;constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class Id{name;constructor(t){this.name=t}eval(t,n){if(this.name==="$this")return n;const r=this.getVariable(t);if(r)return[r];if(this.name.startsWith("%"))throw new Error(`Undefined variable ${this.name}`);return n.flatMap(o=>this.evalValue(o)).filter(o=>o?.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 Vo(n,this.name)?t:FD(t,this.name)}toString(){return this.name}}class MB{eval(){return[]}toString(){return"{}"}}class LB extends m8{impl;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 kp extends cf{constructor(t,n){super("as",t,n)}eval(t,n){return Gr.ofType(t,this.left.eval(t,n),this.right)}}class Xr extends cf{}class Qi extends Xr{impl;constructor(t,n,r,o){super(t,n,r),this.impl=o}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const o=this.right.eval(t,n);if(o.length!==1)return[];const s=r[0].value,c=o[0].value,d=Pi(s)?s.value:s,f=Pi(c)?c.value:c,p=this.impl(d,f);return typeof p=="boolean"?Ze(p):Pi(s)?[{type:ne.Quantity,value:{...s,value:p}}]:[fi(p)]}}class IB extends cf{constructor(t,n){super("&",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n),s=[...r,...o];return s.length>0&&s.every(c=>typeof c.value=="string")?[{type:ne.string,value:s.map(c=>c.value).join("")}]:s}}class zB extends Xr{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return Ze(r.some(s=>s.value===o[0].value))}}class $B extends Xr{constructor(t,n){super("in",t,n)}eval(t,n){const r=xa(this.left.eval(t,n)),o=this.right.eval(t,n);return r?Ze(o.some(s=>$m(r,s)[0].value)):[]}}class Bm extends cf{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 dS extends cf{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return GD([...r,...o])}}class UB extends Xr{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return WU(r,o)}}class BB extends Xr{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return YU(r,o)}}class VB extends Xr{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return QD(r,o)}}class FB extends Xr{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return QU(QD(r,o))}}class fS extends Xr{constructor(t,n){super("is",t,n)}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const o=this.right.name;return Ze(WD(r[0],o))}}class HB extends Xr{constructor(t,n){super("and",t,n)}eval(t,n){const r=xa(this.left.eval(t,n),"boolean"),o=xa(this.right.eval(t,n),"boolean");return r?.value===!0&&o?.value===!0?Ze(!0):r?.value===!1||o?.value===!1?Ze(!1):[]}}class qB extends Xr{constructor(t,n){super("or",t,n)}eval(t,n){const r=xa(this.left.eval(t,n),"boolean"),o=xa(this.right.eval(t,n),"boolean");return r?.value===!1&&o?.value===!1?Ze(!1):r?.value||o?.value?Ze(!0):[]}}class GB extends Xr{constructor(t,n){super("xor",t,n)}eval(t,n){const r=xa(this.left.eval(t,n),"boolean"),o=xa(this.right.eval(t,n),"boolean");return!r||!o?[]:Ze(r.value!==o.value)}}class QB extends Xr{constructor(t,n){super("implies",t,n)}eval(t,n){const r=xa(this.left.eval(t,n),"boolean"),o=xa(this.right.eval(t,n),"boolean");return o?.value===!0||r?.value===!1?Ze(!0):!r||!o?[]:Ze(!1)}}class hS{name;args;constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=Gr[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 pS{left;expr;constructor(t,n){this.left=t,this.expr=n}eval(t,n){const r=this.expr.eval(t,n);if(r.length!==1)return[];const o=r[0].value;if(typeof o!="number")throw new Error("Invalid indexer expression: should return integer}");const s=this.left.eval(t,n);return o in s?[s[o]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const WB=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"],YB={"'":"'",'"':'"',"`":"`",r:"\r",n:`
|
|
57
|
+
`,t:" ",f:"\f","\\":"\\"};class KB{str;keywords;operators;dateTimeLiterals;symbolRegex;result=[];pos={index:0,line:1,column:0};markStack=[];constructor(t,n,r,o){this.str=t,this.keywords=n,this.operators=r,this.dateTimeLiterals=!!o?.dateTimeLiterals,this.symbolRegex=o?.symbolRegex??/[$\w%]/}tokenize(){for(;this.pos.index<this.str.length;){const t=this.consumeToken();t&&this.result.push(t)}return this.result}prevToken(){return this.result.slice(-1)[0]}peekToken(){this.mark();const t=this.consumeToken();return this.reset(),t}consumeToken(){this.consumeWhitespace();const t=this.curr();if(!t)return;this.mark();const n=this.peek();return t==="/"&&n==="*"?this.consumeMultiLineComment():t==="/"&&n==="/"?this.consumeSingleLineComment():t==="'"||t==='"'||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()!==`
|
|
58
|
+
`))}consumeString(t){this.advance();let n="",r;for(;r=this.consumeChar(t);)n+=r;const o=this.buildToken(t==="`"?"Symbol":"String",n);return this.advance(),o}consumeChar(t){const n=this.curr();if(n==="\\"){this.advance();const r=this.curr(),o=YB[r];if(o!==void 0)return this.advance(),o;if(r==="u"){this.advance();const s=/^[0-9a-fA-F]{4}$/.exec(this.str.substring(this.pos.index,this.pos.index+4))?.[0];return s?(this.advance(),this.advance(),this.advance(),this.advance(),String.fromCodePoint(Number.parseInt(s,16))):"u"}return this.consumeChar(t)}return n===t||!n?"":(this.advance(),n)}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 o=this.str.substring(t,this.pos.index);return o.endsWith("T")?o=o.substring(0,o.length-1):!o.startsWith("T")&&n&&!r&&(o+="Z"),this.buildToken("DateTime",o)}consumeNumber(){const t=this.pos.index;let n="Number";return this.consumeWhile(()=>/\d/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="-"&&this.dateTimeLiterals?(this.pos.index=t-1,this.consumeDateTime()):(this.curr()===" "&&XB(this.peekToken())&&(n="Quantity",this.consumeToken()),this.buildToken(n,this.str.substring(t,this.pos.index)))}consumeSymbol(){const t=this.consumeWhile(()=>this.symbolRegex.exec(this.curr()));return this.prevToken()?.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]}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()===`
|
|
59
|
+
`?(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 XB(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&WB.includes(e.value)))}const JB=["true","false"],ZB=["!=","!~","<=",">=","{}","->"];function eV(e){return new KB(e,JB,ZB).tokenize()}const nn={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},tV={parse(e){const t=e.consumeAndParse();if(!e.match(")"))throw new Error("Parse error: expected `)` got `"+e.peek()?.value+"`");return t}},nV={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new pS(t,n)},precedence:nn.Indexer},rV={parse(e,t){if(!(t instanceof Id))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new hS(t.name,n)},precedence:nn.FunctionCall};function iV(e){const t=e.split(" "),n=Number.parseFloat(t[0]);let r=t[1];return r?.startsWith("'")&&r.endsWith("'")?r=r.substring(1,r.length-1):r="{"+r+"}",{value:n,unit:r}}function oV(){return new g8().registerPrefix("String",{parse:(e,t)=>new Cc({type:ne.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new Cc({type:ne.dateTime,value:fp(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new Cc({type:ne.Quantity,value:iV(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new Cc({type:t.value.includes(".")?ne.decimal:ne.integer,value:Number.parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new Cc({type:ne.boolean,value:!0})}).registerPrefix("false",{parse:()=>new Cc({type:ne.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new Id(t.value)}).registerPrefix("{}",{parse:()=>new MB}).registerPrefix("(",tV).registerInfix("[",nV).registerInfix("(",rV).prefix("+",nn.UnaryAdd,(e,t)=>new LB("+",t,n=>n)).prefix("-",nn.UnarySubtract,(e,t)=>new Qi("-",t,t,(n,r)=>-r)).infixLeft(".",nn.Dot,(e,t,n)=>new Bm(e,n)).infixLeft("/",nn.Divide,(e,t,n)=>new Qi("/",e,n,(r,o)=>r/o)).infixLeft("*",nn.Multiply,(e,t,n)=>new Qi("*",e,n,(r,o)=>r*o)).infixLeft("+",nn.Add,(e,t,n)=>new Qi("+",e,n,(r,o)=>r+o)).infixLeft("-",nn.Subtract,(e,t,n)=>new Qi("-",e,n,(r,o)=>r-o)).infixLeft("|",nn.Union,(e,t,n)=>new dS(e,n)).infixLeft("=",nn.Equals,(e,t,n)=>new UB(e,n)).infixLeft("!=",nn.NotEquals,(e,t,n)=>new BB(e,n)).infixLeft("~",nn.Equivalent,(e,t,n)=>new VB(e,n)).infixLeft("!~",nn.NotEquivalent,(e,t,n)=>new FB(e,n)).infixLeft("<",nn.LessThan,(e,t,n)=>new Qi("<",e,n,(r,o)=>r<o)).infixLeft("<=",nn.LessThanOrEquals,(e,t,n)=>new Qi("<=",e,n,(r,o)=>r<=o)).infixLeft(">",nn.GreaterThan,(e,t,n)=>new Qi(">",e,n,(r,o)=>r>o)).infixLeft(">=",nn.GreaterThanOrEquals,(e,t,n)=>new Qi(">=",e,n,(r,o)=>r>=o)).infixLeft("&",nn.Ampersand,(e,t,n)=>new IB(e,n)).infixLeft("and",nn.And,(e,t,n)=>new HB(e,n)).infixLeft("as",nn.As,(e,t,n)=>new kp(e,n)).infixLeft("contains",nn.Contains,(e,t,n)=>new zB(e,n)).infixLeft("div",nn.Divide,(e,t,n)=>new Qi("div",e,n,(r,o)=>Math.trunc(r/o))).infixLeft("in",nn.In,(e,t,n)=>new $B(e,n)).infixLeft("is",nn.Is,(e,t,n)=>new fS(e,n)).infixLeft("mod",nn.Modulo,(e,t,n)=>new Qi("mod",e,n,(r,o)=>r%o)).infixLeft("or",nn.Or,(e,t,n)=>new qB(e,n)).infixLeft("xor",nn.Xor,(e,t,n)=>new GB(e,n)).infixLeft("implies",nn.Implies,(e,t,n)=>new QB(e,n))}const aV=oV();function mS(e){return new uS(e,aV.construct(eV(e)).consumeAndParse())}function sV(e,t){const n=Array.isArray(t)?t:[t];for(let r=0;r<n.length;r++){const o=n[r];typeof o=="object"&&"type"in o&&"value"in o||(n[r]=fi(n[r]))}return vs(e,n).map(r=>r.value)}function vs(e,t,n={},r=void 0){let o;if(typeof e=="string"){const s=r?.get(e);o=s??mS(e),r&&!s&&r.set(e,o)}else o=e;return o.eval({variables:n},t).map(s=>{const c={type:s.type,value:s.value?.valueOf()};return"path"in s&&(c.path=s.path),c})}function lV(e){const t=[];for(const n of e){const r=XD(n.value);r&&t.push(r)}return t}function cV(e){const t=new Set;for(const n of e){const r=pl(n);r&&t.add(r)}return Array.from(t)}function uV(e){const t=new Set;for(const n of e){const{value:r}=n;r&&(tk(r)?t.add(r):_a(r)?t.add(r.reference):ZD(r)?t.add(Mt(r)):typeof r.identifier=="object"&&t.add(`identifier:${r.identifier.system}|${r.identifier.value}`))}return Array.from(t)}function dV(e,t={}){const n=[];for(const r of e)fV(t,n,r);return n}function fV(e,t,n){const{type:r,value:o}=n;switch(r){case ne.Identifier:hV(t,e,o);break;case ne.CodeableConcept:pV(t,e,o);break;case ne.Coding:fk(t,e,o);break;case ne.ContactPoint:mV(t,e,o);break;default:gl(t,e,void 0,o?.toString())}}function hV(e,t,n){n?.type?.text&&gl(e,t,t.textSearchSystem,n.type.text),gl(e,t,n?.system,n?.value)}function pV(e,t,n){if(n?.text&&gl(e,t,t.textSearchSystem,n.text),n?.coding)for(const r of n.coding)fk(e,t,r)}function fk(e,t,n){n&&(n.display&&gl(e,t,t.textSearchSystem,n.display),gl(e,t,n.system,n.code))}function mV(e,t,n){n&&gl(e,t,n.system,n.value?.toLocaleLowerCase())}function gl(e,t,n,r){(n||r)&&!e.some(o=>o.system===n&&o.value===r)&&e.push({system:n,value:r&&t.caseInsensitive?r.toLocaleLowerCase():r})}const Vm=20,he={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"},hk={contains:he.CONTAINS,exact:he.EXACT,above:he.ABOVE,below:he.BELOW,text:he.TEXT,not:he.NOT,in:he.IN,"not-in":he.NOT_IN,"of-type":he.OF_TYPE,missing:he.MISSING,identifier:he.IDENTIFIER,iterate:he.ITERATE},gS={eq:he.EQUALS,ne:he.NOT_EQUALS,lt:he.LESS_THAN,le:he.LESS_THAN_OR_EQUALS,gt:he.GREATER_THAN,ge:he.GREATER_THAN_OR_EQUALS,sa:he.STARTS_AFTER,eb:he.ENDS_BEFORE,ap:he.APPROXIMATELY,sw:he.STARTS_WITH};function pk(e,t){if(!e)throw new Error("Invalid search URL");let n="",r;if(typeof e=="string")if(e.includes("?")){const[c,d]=e.split("?");n=c,r=new URLSearchParams(d)}else n=e;else typeof e=="object"&&(n=e.pathname,r=e.searchParams);let o;n.includes("/")?o=n.split("/").filter(Boolean).pop():o=n;const s=[];return r&&s.push(...r.entries()),gV(o,s)}function gV(e,t){const n={resourceType:e};for(const[r,o]of t)vV(n,r,o);return n}function vV(e,t,n){let r,o;const s=t.indexOf(":");if(s>=0?(r=t.substring(0,s),o=t.substring(s+1)):(r=t,o=""),r!=="_"){if(r==="_has"||t.includes(".")){e.filters=cd(e.filters,{code:t,operator:he.EQUALS,value:n});return}switch(r){case"_sort":yV(e,n);break;case"_cursor":e.cursor=n;break;case"_count":e.count=Number.parseInt(n,10);break;case"_offset":e.offset=Number.parseInt(n,10);break;case"_total":e.total=n;break;case"_summary":n==="count"?(e.total="accurate",e.count=0):(n==="true"||n==="data"||n==="text")&&(e.summary=n);break;case"_include":{const c=OT(n);o==="iterate"&&(c.modifier=he.ITERATE),e.include=cd(e.include,c);break}case"_revinclude":{const c=OT(n);o==="iterate"&&(c.modifier=he.ITERATE),e.revInclude=cd(e.revInclude,c);break}case"_fields":case"_elements":e.fields=n.split(",");break;case"_type":e.types=n.split(",");break;case"_format":e.format=n;break;case"_pretty":e.pretty=n==="true";break;default:{const c=No.types[e.resourceType]?.searchParams?.[r];c?e.filters=cd(e.filters,bV(c,o,n)):e.filters=cd(e.filters,SV(r,o,n))}}}}function yV(e,t){for(const n of t.split(",")){let r,o=!1;n.startsWith("-")?(r=n.substring(1),o=!0):r=n,e.sortRules||(e.sortRules=[]),e.sortRules.push({code:r,descending:o})}}const xV=[he.MISSING,he.PRESENT];function bV(e,t,n){if(xV.includes(t))return{code:e.code,operator:t,value:n};switch(e.type){case"number":case"date":case"quantity":{const{operator:r,value:o}=wV(n,t||he.EQUALS);if(!MT(e,o))throw new gt(To(`Invalid format for ${e.type} search parameter: ${o}`));return{code:e.code,operator:r,value:o}}case"reference":case"string":case"token":case"uri":if(!MT(e,n))throw new gt(To(`Invalid format for ${e.type} search parameter: ${n}`));return{code:e.code,operator:jV(t),value:n};default:throw new Error("Unrecognized search parameter type: "+e.type)}}function SV(e,t,n){let r=he.EQUALS;if(t)r=t;else if(n.length>=2){const o=n.substring(0,2);o in gS&&(n.length===2||n.at(2)?.match(/\d/))&&(r=o,n=n.substring(o.length))}return{code:e,operator:r,value:n}}function wV(e,t){const n=e.substring(0,2),r=gS[n];return r?{operator:r,value:e.substring(2)}:{operator:t,value:e}}function jV(e){return hk[e]??he.EQUALS}function OT(e){const t=e.split(":");if(t.includes("*"))throw new gt(To("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new gt(To(`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 gt(To(`Invalid include value '${e}'`))}function MT(e,t){switch(e.type){case"date":return Od(t);default:return!0}}function ds(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(CV(n))),e.sortRules&&e.sortRules.length>0&&t.push(EV(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(LT("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(LT("_revinclude",n))),t.length===0?"":(Qc(t),"?"+t.join("&"))}function CV(e){const t=e.operator in hk?":"+e.operator:"",n=e.operator!==he.EQUALS&&e.operator in gS?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function EV(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function LT(e,t){return e+(t.modifier?":"+t.modifier:"")+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function Fm(e){const t=[];let n="",r=!1;for(const o of e)r?(n+=o,r=!1):o==="\\"?r=!0:o===","?(t.push(n),n=""):n+=o;return t.push(n),t}function TV(e,t){if(t.resourceType!==e.resourceType)return!1;if(t.filters){for(const n of t.filters)if(!RV(e,t,n))return!1}return!0}function RV(e,t,n){const r=No.types[t.resourceType]?.searchParams?.[n.code];if(!r)return!1;const o=vs(r.expression,[fi(e)]);if(n.operator===he.MISSING||n.operator===he.PRESENT)return _V(o,n);switch(r.type){case"reference":return AV(o,n);case"string":case"uri":return PV(o,n);case"token":return DV(o,n);case"date":return OV(o,n);default:return!1}}function _V(e,t){const n=e.length>0;return(t.operator===he.MISSING&&t.value==="false"||t.operator===he.PRESENT&&t.value==="true")===n}function AV(e,t){const n=Hm(t.operator);if(t.value===""&&e.length===0)return t.operator===he.EQUALS;const r=uV(e);for(const o of Fm(t.value)){let s=r.includes(o);if(!s&&t.code==="_compartment"&&(s=r.some(c=>c?.endsWith("/"+o))),s)return!n}return n}function DV(e,t){const n=dV(e),r=Fm(t.value),o=Hm(t.operator);for(const s of n)for(const c of r)if(kV(s,c))return!o;return o}function kV(e,t){if(t.includes("|")){const[n,r]=t.split("|").map(o=>o.toLowerCase());return!n&&!r?!1:n?e.system?.toLowerCase()===n&&(!r||e.value?.toLowerCase()===r):!e.system&&e.value?.toLowerCase()===r}return e.value?.toLowerCase()===t.toLowerCase()}function PV(e,t){const n=cV(e),r=Fm(t.value),o=Hm(t.operator);for(const s of n)for(const c of r)if(NV(s,c))return!o;return o}function NV(e,t){return e.toLowerCase().includes(t.toLowerCase())}function OV(e,t){const n=lV(e),r=Fm(t.value),o=Hm(t.operator);for(const s of n)for(const c of r)if(MV(s,t.operator,c))return!o;return o}function MV(e,t,n){if(!e)return!1;const r=XD(n);if(!r)return!1;const o=e.start??"0000",s=e.end??"9999",c=r.start,d=r.end;switch(t){case he.APPROXIMATELY:case he.EQUALS:case he.NOT_EQUALS:return o<d&&s>c;case he.LESS_THAN:return o<c;case he.GREATER_THAN:return s>d;case he.LESS_THAN_OR_EQUALS:return o<=d;case he.GREATER_THAN_OR_EQUALS:return s>=c;case he.STARTS_AFTER:return o>d;case he.ENDS_BEFORE:return s<c;default:return!1}}function Hm(e){return e===he.NOT_EQUALS||e===he.NOT}const LV={resourceType:"*"},IV=["DomainConfiguration","JsonWebKey","Login"],zV=["UserSecurityRequest","Project","ProjectMembership","User"],al={READ:"read",VREAD:"vread",UPDATE:"update",HISTORY:"history",SEARCH:"search"},$V=[al.READ,al.VREAD,al.HISTORY,al.SEARCH];function UV(e,t){return IV.includes(t)?!1:BV(e,al.UPDATE,t)}function BV(e,t,n){return!!e.resource?.some(r=>gk(r,n,t))}function mk(e,t,n){return n?n.resource?.find(r=>VV(e,t,r)):LV}function VV(e,t,n){const r=e.resourceType;return gk(n,r,t)?r==="Binary"?!0:!(n.compartment&&!e.meta?.compartment?.some(o=>o.reference===n.compartment?.reference)||n.criteria&&!TV(e,pk(n.criteria))):!1}function gk(e,t,n){return e.resourceType!==t&&(e.resourceType!=="*"||zV.includes(t))?!1:e.interaction?e.interaction.includes(n):!e.readonly||$V.includes(n)}function bo(){return typeof window<"u"}function vk(){return typeof Buffer<"u"?Buffer:void 0}const Zn={assign(e){bo()&&globalThis.location.assign(e)},reload(){bo()&&globalThis.location.reload()},getSearch(){return bo()?globalThis.location.search:""},getPathname(){return bo()?globalThis.location.pathname:""},getLocation(){return bo()?globalThis.location.toString():""},getOrigin(){return bo()?globalThis.location.protocol+"//"+globalThis.location.host+"/":""}};function FV(e){if(bo()){const n=window.atob(e),r=Uint8Array.from(n,o=>o.charCodeAt(0));return new window.TextDecoder().decode(r)}const t=vk();if(t)return t.from(e,"base64").toString("utf-8");throw new Error("Unable to decode base64")}function IT(e){if(bo()){const n=new window.TextEncoder().encode(e),r=String.fromCharCode.apply(null,n);return window.btoa(r)}const t=vk();if(t)return t.from(e,"utf8").toString("base64");throw new Error("Unable to encode base64")}function HV(e){e=e.padEnd(e.length+(4-e.length%4)%4,"=");const t=e.replaceAll("-","+").replaceAll("_","/");return FV(t)}function zT(){const e=new Uint32Array(28);return crypto.getRandomValues(e),dB(e.buffer)}async function qV(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function yk(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g,e=>{const t=Math.trunc(Math.random()*16);return(e==="x"?t:t&3|8).toString(16)})}function xk(e){const t={};e=hi(e);for(const o of e.entry||[]){const s=o.resource;if(!s)continue;s.meta!==void 0&&(delete s.meta.author,delete s.meta.compartment,delete s.meta.lastUpdated,delete s.meta.project,delete s.meta.versionId,Object.keys(s.meta).length===0&&delete s.meta);const c=s?.id;c&&(t[c]=yk(),o.fullUrl="urn:uuid:"+t[c],delete o.resource?.id)}const n=e.entry,r=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:n?.map(o=>({fullUrl:o.fullUrl,request:{method:"POST",url:o.resource?.resourceType},resource:o.resource}))},(o,s)=>GV(o,s,t),2);return QV(JSON.parse(r))}function GV(e,t,n){if(e==="reference"&&typeof t=="string"){let r;if(t.includes("/")?r=t.split("/")[1]:t.startsWith("urn:uuid:")?r=t.slice(9):t.startsWith("#")&&(r=t.slice(1)),r){const o=n[r];if(o)return"urn:uuid:"+o}}return t}function QV(e){const t=YV(e),{sorted:n,cycles:r}=WV(t),o={},s=[];for(const d of e.entry??[])d.fullUrl?o[d.fullUrl]=d:s.push(d);const c=n.map(d=>o[d]);for(const d of r)for(const f of d){const p=o[f],m={...p,request:{...p.request,method:"PUT"}};c.push(m)}return c.push(...s),{...e,entry:c}}const Ec={NotVisited:"NotVisited",Visiting:"Visiting",Visited:"Visited"};function WV(e){const t=[],n={},r=[];for(const s of Object.keys(e))n[s]=Ec.NotVisited;function o(s,c){if(n[s]===Ec.Visited)return!0;if(n[s]===Ec.Visiting){const f=c.lastIndexOf(s);return f!==-1&&r.push(c.slice(f)),!0}n[s]=Ec.Visiting,c.push(s);let d=!1;for(const f of e[s])o(f,c)||(d=!0);return n[s]=Ec.Visited,c.pop(),t.unshift(s),!d}for(const s in e)n[s]===Ec.NotVisited&&o(s,[]);return{sorted:t,cycles:r}}function bk(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(_a(r)){const o=r.reference;o.startsWith("urn:uuid:")&&t(o)}else bk(r,t)}}function YV(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&&bk(n.resource,o=>{t[o]&&t[o].push(r)})}return t}const rn={CSS:"text/css",DICOM:"application/dicom",FAVICON:"image/vnd.microsoft.icon",FHIR_JSON:"application/fhir+json",FORM_URL_ENCODED:"application/x-www-form-urlencoded",HL7_V2:"x-application/hl7-v2+er7",HTML:"text/html",JAVASCRIPT:"text/javascript",JSON:"application/json",JSON_PATCH:"application/json-patch+json",JWT:"application/jwt",MULTIPART_FORM_DATA:"multipart/form-data",PNG:"image/png",SCIM_JSON:"application/scim+json",SVG:"image/svg+xml",TEXT:"text/plain",TYPESCRIPT:"text/typescript",PING:"x-application/ping",XML:"text/xml",CDA_XML:"application/cda+xml",OCTET_STREAM:"application/octet-stream"};let KV=class{listeners;constructor(){this.listeners={}}addEventListener(t,n){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(n)}removeEventListener(t,n){const r=this.listeners[t];if(r){for(let o=0;o<r.length;o++)if(r[o]===n){r.splice(o,1);return}}}dispatchEvent(t){const n=this.listeners[t.type];if(n)for(const r of n)r.call(this,t);return!t.defaultPrevented}removeAllListeners(){this.listeners={}}listenerCount(t){return this.listeners[t]?.length??0}};class qm{emitter=new KV;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()}listenerCount(t){return this.emitter.listenerCount(t)}}const Fx={"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"},XV=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],vS=["DiagnosticReport-update"];function JV(e){return vS.includes(e)}function ZV(e){if(vS.includes(e))throw new gt(jn(`'context.version' is required for '${e}'.`))}const eF={"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 tF(e){return XV.includes(e)}function Sk(e){return!!e.endpoint}function $T(e){if(!yS(e))throw new gt(jn("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:n,topic:r,events:o}=e,s={"hub.channel.type":t,"hub.mode":n,"hub.topic":r,"hub.events":o.join(",")};return Sk(e)&&(s.endpoint=e.endpoint),new URLSearchParams(s).toString()}function yS(e){if(typeof e!="object")return!1;const{channelType:t,mode:n,topic:r,events:o}=e;if(!(t&&n&&r&&o)||typeof r!="string"||typeof o!="object"||!Array.isArray(o)||o.length<1||t!=="websocket"||n!=="subscribe"&&n!=="unsubscribe")return!1;for(const s of o)if(!Fx[s])return!1;return!(Sk(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function nF(e,t,n,r){if(typeof t!="object")throw new gt(jn(`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 gt(jn(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new gt(jn(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const o=r.resourceType;if(o!=="*"){if(!tF(t.resourceType))throw new gt(jn(`context[${n}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));if(o&&t.resourceType!==o)throw new gt(jn(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${o}.`))}}function rF(e,t,n,r,o){if(o.set(t.key,(o.get(t.key)??0)+1),r.reference){if(!_a(t.reference))throw new gt(jn(`context[${n}] is invalid. Expected key '${t.key}' to be a reference.`))}else nF(e,t.resource,n,r)}function iF(e,t){const n=new Map,r=eF[e];for(let o=0;o<t.length;o++){const s=t[o].key;if(!r[s])throw new gt(jn(`Key '${s}' not found for event '${e}'. Make sure to add only valid keys.`));rF(e,t[o],o,r[s],n)}for(const[o,s]of Object.entries(r)){if(!(s.optional||n.has(o)))throw new gt(jn(`Missing required key '${o}' on context for '${e}' event.`));if(!s.manyAllowed&&(n.get(o)??0)>1)throw new gt(jn(`${n.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function UT(e,t,n,r){if(!(e&&typeof e=="string"))throw new gt(jn("Must provide a topic."));if(!Fx[t])throw new gt(jn(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Fx).join(", ")}`));if(typeof n!="object")throw new gt(jn("context must be a context object or array of context objects."));if(vS.includes(t)&&!r)throw new gt(jn(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(n)?n:[n];return iF(t,o),{timestamp:new Date().toISOString(),id:yk(),event:{"hub.topic":e,"hub.event":t,context:o,...r?{"context.versionId":r}:{}}}}class oF extends qm{subRequest;websocket;constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new gt(jn("Subscription request should contain an endpoint."));if(!yS(t))throw new gt(jn("Subscription request failed validation."));const n=new WebSocket(t.endpoint);n.addEventListener("open",()=>{this.dispatchEvent({type:"connect"}),n.addEventListener("message",r=>{const o=JSON.parse(r.data);if(o["hub.topic"])return;const s=o;s.event["hub.event"]!=="heartbeat"&&(this.dispatchEvent({type:"message",payload:s}),n.send(JSON.stringify({id:o?.id,timestamp:new Date().toISOString()})))}),n.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=n}disconnect(){this.websocket.close()}}function aF(e){return JSON.parse(HV(e))}function sF(e){return e.split(".").length===3}function xS(e){const[t,n,r]=e.split(".");return aF(n)}function lF(e){try{return typeof xS(e).login_id=="string"}catch{return!1}}function cF(e){try{const n=xS(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class uF{medplum;constructor(t){this.medplum=t}async get(t){return this.medplum.get(`keyvalue/v1/${t}`)}async set(t,n){await this.medplum.put(`keyvalue/v1/${t}`,n,rn.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}class Wi{[Symbol.toStringTag]="ReadablePromise";suspender;status="pending";response;error;constructor(t){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 dF{storage;prefix="";constructor(t,n=""){this.storage=t??globalThis.localStorage??new fF,this.prefix=n}makeKey(t){return this.prefix+t}clear(){this.storage===globalThis.localStorage&&this.prefix?Object.keys(this.storage).filter(t=>t.startsWith(this.prefix)).forEach(t=>{this.storage.removeItem(t)}):this.storage.clear()}getString(t){return this.storage.getItem(this.makeKey(t))??void 0}setString(t,n){n?this.storage.setItem(this.makeKey(t),n):this.storage.removeItem(this.makeKey(t))}getObject(t){const n=this.getString(t);return n?JSON.parse(n):void 0}setObject(t,n){this.setString(t,n?io(n):void 0)}}class fF{data;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]}}const Lc={Event:typeof globalThis.Event<"u"?globalThis.Event:void 0,ErrorEvent:void 0,CloseEvent:void 0};let BT=!1;function hF(){if(typeof globalThis.Event>"u")throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");Lc.Event=globalThis.Event,Lc.ErrorEvent=class extends Event{message;error;constructor(t,n){super("error",n),this.message=t.message,this.error=t}},Lc.CloseEvent=class extends Event{code;reason;wasClean=!0;constructor(t=1e3,n="",r){super("close",r),this.code=t,this.reason=n}}}function pF(e,t){if(!e)throw new Error(t)}function Yh(e){return new e.constructor(e.type,e)}const Ws={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0};let VT=!1;class as extends qm{_ws;_retryCount=-1;_uptimeTimeout;_connectTimeout;_shouldReconnect=!0;_connectLock=!1;_binaryType;_closeCalled=!1;_messageQueue=[];_debugLogger=console.log.bind(console);_url;_protocols;_options;constructor(t,n,r={}){BT||(hF(),BT=!0),super(),this._url=t,this._protocols=n,this._options=r,this._options.startClosed&&(this._shouldReconnect=!1),this._options.binaryType?this._binaryType=this._options.binaryType:this._binaryType="blob",this._options.debugLogger&&(this._debugLogger=this._options.debugLogger),this._connect()}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return as.CONNECTING}get OPEN(){return as.OPEN}get CLOSING(){return as.CLOSING}get CLOSED(){return as.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(t){this._binaryType=t,this._ws&&(this._ws.binaryType=t)}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){return this._messageQueue.reduce((n,r)=>(typeof r=="string"?n+=r.length:r instanceof Blob?n+=r.size:n+=r.byteLength,n),0)+(this._ws?.bufferedAmount??0)}get extensions(){return this._ws?.extensions??""}get protocol(){return this._ws?.protocol??""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?as.CLOSED:as.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}onclose=null;onerror=null;onmessage=null;onopen=null;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=Ws.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=Ws.reconnectionDelayGrowFactor,minReconnectionDelay:n=Ws.minReconnectionDelay,maxReconnectionDelay:r=Ws.maxReconnectionDelay}=this._options;let o=0;return this._retryCount>0&&(o=n*Math.pow(t,this._retryCount-1),o>r&&(o=r)),this._debug("next delay",o),o}_wait(){return new Promise(t=>{setTimeout(t,this._getNextDelay())})}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;const{maxRetries:t=Ws.maxRetries,connectionTimeout:n=Ws.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"&&!VT&&(console.error("‼️ No WebSocket implementation available. You should define options.WebSocket."),VT=!0);const r=this._options.WebSocket||WebSocket;this._debug("connect",{url:this._url,protocols:this._protocols}),this._ws=this._protocols?new r(this._url,this._protocols):new r(this._url),this._ws.binaryType=this._binaryType,this._connectLock=!1,this._addListeners(),this._connectTimeout=setTimeout(()=>this._handleTimeout(),n)}).catch(r=>{this._connectLock=!1,this._handleError(new Lc.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new Lc.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new Lc.CloseEvent(t,n,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_handleOpen=t=>{this._debug("open event");const{minUptime:n=Ws.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),n),pF(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(r=>this._ws?.send(r)),this._messageQueue=[],this.onopen&&this.onopen(t),this.dispatchEvent(Yh(t))};_handleMessage=t=>{this._debug("message event"),this.onmessage&&this.onmessage(t),this.dispatchEvent(Yh(t))};_handleError=t=>{this._debug("error event",t.message),this._disconnect(void 0,t.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(t),this._debug("exec error listeners"),this.dispatchEvent(Yh(t)),this._connect()};_handleClose=t=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(t),this.dispatchEvent(Yh(t))};_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 mF=5e3;class Hx extends qm{criteria;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 gF{criteria;emitter;refCount;subscriptionProps;subscriptionId;token;connecting=!1;constructor(t,n){this.criteria=t,this.emitter=new Hx(t),this.refCount=1,this.subscriptionProps=n?{...n}:void 0}clearAttachedSubscription(){this.subscriptionId=void 0,this.token=void 0}}class vF{medplum;ws;masterSubEmitter;criteriaEntries;criteriaEntriesBySubscriptionId;wsClosed;pingTimer=void 0;pingIntervalMs;waitingForPong=!1;currentProfile;constructor(t,n,r){if(!(t instanceof jk))throw new gt(jn("First arg of constructor should be a `MedplumClient`"));let o;try{o=new URL(n).toString()}catch{throw new gt(jn("Not a valid URL"))}const s=r?.ReconnectingWebSocket?new r.ReconnectingWebSocket(o,void 0,{debug:r?.debug,debugLogger:r?.debugLogger}):new as(o,void 0,{debug:r?.debug,debugLogger:r?.debugLogger});this.medplum=t,this.ws=s,this.masterSubEmitter=new Hx,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.pingIntervalMs=r?.pingIntervalMs??mF,this.currentProfile=t.getProfile(),this.setupListeners()}setupListeners(){const t=this.ws;t.addEventListener("message",n=>{try{const r=JSON.parse(n.data);if(r.type==="pong"){this.waitingForPong=!1;return}const o=r,s=o?.entry?.[0]?.resource;if(s.type==="heartbeat"){this.masterSubEmitter?.dispatchEvent({type:"heartbeat",payload:o});return}if(s.type==="handshake"){const d=hl(s.subscription),f={type:"connect",payload:{subscriptionId:d}};this.masterSubEmitter?.dispatchEvent(f);const p=this.criteriaEntriesBySubscriptionId.get(d);if(!p){console.warn("Received handshake for criteria the SubscriptionManager is not listening for yet");return}p.connecting=!1,p.emitter.dispatchEvent({...f});return}this.masterSubEmitter?.dispatchEvent({type:"message",payload:o});const c=this.criteriaEntriesBySubscriptionId.get(hl(s.subscription));if(!c){console.warn("Received notification for criteria the SubscriptionManager is not listening for");return}c.emitter.dispatchEvent({type:"message",payload:o})}catch(r){console.error(r);const o={type:"error",payload:r};this.masterSubEmitter?.dispatchEvent(o);for(const s of this.getAllCriteriaEmitters())s.dispatchEvent({...o})}}),t.addEventListener("error",()=>{const n={type:"error",payload:new gt(_8(new Error("WebSocket error")))};this.masterSubEmitter?.dispatchEvent(n);for(const r of this.getAllCriteriaEmitters())r.dispatchEvent({...n})}),t.addEventListener("close",()=>{const n={type:"close"};this.masterSubEmitter?.dispatchEvent(n);for(const r of this.getAllCriteriaEmitters())r.dispatchEvent({...n});this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=void 0,this.waitingForPong=!1),this.wsClosed&&(this.criteriaEntries.clear(),this.criteriaEntriesBySubscriptionId.clear(),this.masterSubEmitter?.removeAllListeners())}),t.addEventListener("open",()=>{const n={type:"open"};this.masterSubEmitter?.dispatchEvent(n);for(const r of this.getAllCriteriaEmitters())r.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",()=>{const n=this.medplum.getProfile();this.currentProfile&&n===void 0?this.ws.close():n&&this.currentProfile?.id!==n.id&&this.ws.reconnect(),this.currentProfile=n})}emitError(t,n){const r={type:"error",payload:n};this.masterSubEmitter?.dispatchEvent(r),t.emitter.dispatchEvent({...r})}maybeEmitDisconnect(t){const{subscriptionId:n}=t;if(n){const r={type:"disconnect",payload:{subscriptionId:n}};this.masterSubEmitter?.dispatchEvent(r),t.emitter.dispatchEvent({...r})}else console.warn("Called disconnect for `CriteriaEntry` before `subscriptionId` was present.")}async getTokenForCriteria(t){let n=t?.subscriptionId;n||(n=(await this.medplum.createResource({...t.subscriptionProps,resourceType:"Subscription",status:"active",reason:`WebSocket subscription for ${Mt(this.medplum.getProfile())}`,channel:{type:"websocket"},criteria:t.criteria})).id);const{parameter:r}=await this.medplum.get(`fhir/R4/Subscription/${n}/$get-ws-binding-token`),o=r?.find(c=>c.name==="token")?.valueString,s=r?.find(c=>c.name==="websocket-url")?.valueUrl;if(!o)throw new gt(jn("Failed to get token"));if(!s)throw new gt(jn("Failed to get URL from $get-ws-binding-token"));return[n,o]}maybeGetCriteriaEntry(t,n){const r=this.criteriaEntries.get(t);if(r){if(!n)return r.bareCriteria;for(const o of r.criteriaWithProps)if(Po(n,o.subscriptionProps))return o}}getAllCriteriaEmitters(){const t=[];for(const n of this.criteriaEntries.values()){n.bareCriteria&&t.push(n.bareCriteria.emitter);for(const r of n.criteriaWithProps)t.push(r.emitter)}return t}addCriteriaEntry(t){const{criteria:n,subscriptionProps:r}=t;let o;this.criteriaEntries.has(n)?o=this.criteriaEntries.get(n):(o={criteriaWithProps:[]},this.criteriaEntries.set(n,o)),r?o.criteriaWithProps.push(t):o.bareCriteria=t}removeCriteriaEntry(t){const{criteria:n,subscriptionProps:r,subscriptionId:o,token:s}=t;if(!this.criteriaEntries.has(n))return;const c=this.criteriaEntries.get(n);r?c.criteriaWithProps=c.criteriaWithProps.filter(d=>{const f=d.subscriptionProps;return!Po(r,f)}):c.bareCriteria=void 0,!c.bareCriteria&&c.criteriaWithProps.length===0&&(this.criteriaEntries.delete(n),this.masterSubEmitter?._removeCriteria(n)),o&&this.criteriaEntriesBySubscriptionId.delete(o),s&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"unbind-from-token",payload:{token:s}}))}async subscribeToCriteria(t){if(!(this.ws.readyState!==WebSocket.OPEN||t.connecting)){t.connecting=!0;try{const[n,r]=await this.getTokenForCriteria(t);t.subscriptionId=n,t.token=r,this.criteriaEntriesBySubscriptionId.set(n,t),this.ws.send(JSON.stringify({type:"bind-with-token",payload:{token:r}}))}catch(n){console.error(Qe(n)),this.emitError(t,n),this.removeCriteriaEntry(t)}}}async refreshAllSubscriptions(){this.criteriaEntriesBySubscriptionId.clear();for(const t of this.criteriaEntries.values())for(const n of[...t.bareCriteria?[t.bareCriteria]:[],...t.criteriaWithProps])n.clearAttachedSubscription(),await this.subscribeToCriteria(n)}addCriteria(t,n){this.masterSubEmitter&&this.masterSubEmitter._addCriteria(t);const r=this.maybeGetCriteriaEntry(t,n);if(r)return r.refCount+=1,r.emitter;const o=new gF(t,n);return this.addCriteriaEntry(o),this.subscribeToCriteria(o).catch(console.error),o.emitter}removeCriteria(t,n){const r=this.maybeGetCriteriaEntry(t,n);if(!r){console.warn("Criteria not known to `SubscriptionManager`. Possibly called remove too many times.");return}r.refCount-=1,!(r.refCount>0)&&(this.maybeEmitDisconnect(r),this.removeCriteriaEntry(r))}getWebSocket(){return this.ws}closeWebSocket(){this.wsClosed||(this.wsClosed=!0,this.ws.close())}reconnectWebSocket(){this.ws.reconnect(),this.wsClosed=!1}getCriteriaCount(){return this.getAllCriteriaEmitters().length}getMasterEmitter(){return this.masterSubEmitter||(this.masterSubEmitter=new Hx(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const wk="5.0.8-e365fa4",yF=rn.FHIR_JSON+", */*; q=0.1",xF="https://api.medplum.com/",bF=1e3,SF=6e4,wF=0,jF=3e5,CF="Binary/",FT={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]},Tc={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"},EF={AccessToken:"urn:ietf:params:oauth:token-type:access_token"},TF={JwtBearer:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"};class jk extends qm{options;fetch;createPdfImpl;storage;requestCache;cacheTime;baseUrl;fhirBaseUrl;authorizeUrl;tokenUrl;logoutUrl;fhircastHubUrl;defaultHeaders;onUnauthenticated;autoBatchTime;autoBatchQueue;refreshGracePeriod;subscriptionManager;medplumServer;clientId;clientSecret;credentialsInHeader;autoBatchTimerId;accessToken;accessTokenExpires;refreshToken;refreshPromise;profilePromise;sessionDetails;currentRateLimits;basicAuth;initPromise;initComplete=!0;keyValueClient;constructor(t){if(super(),t?.baseUrl&&!t.baseUrl.startsWith("http"))throw new Error("Base URL must start with http or https");this.options=t??{},this.fetch=t?.fetch??RF(),this.storage=t?.storage??new dF(void 0,t?.storagePrefix),this.createPdfImpl=t?.createPdf,this.baseUrl=lS(t?.baseUrl??xF),this.fhirBaseUrl=yo(this.baseUrl,t?.fhirUrlPath??"fhir/R4"),this.authorizeUrl=yo(this.baseUrl,t?.authorizeUrl??"oauth2/authorize"),this.tokenUrl=yo(this.baseUrl,t?.tokenUrl??"oauth2/token"),this.logoutUrl=yo(this.baseUrl,t?.logoutUrl??"oauth2/logout"),this.fhircastHubUrl=yo(this.baseUrl,t?.fhircastHubUrl??"fhircast/STU3"),this.clientId=t?.clientId??"",this.clientSecret=t?.clientSecret??"",this.credentialsInHeader=t?.authCredentialsMethod==="header",this.defaultHeaders=t?.defaultHeaders??{},this.onUnauthenticated=t?.onUnauthenticated,this.refreshGracePeriod=t?.refreshGracePeriod??jF,this.cacheTime=t?.cacheTime??(bo()?SF:wF),this.cacheTime>0?this.requestCache=new OD(t?.resourceCacheSize??bF):this.requestCache=void 0,t?.autoBatchTime?(this.autoBatchTime=t.autoBatchTime,this.autoBatchQueue=[]):(this.autoBatchTime=0,this.autoBatchQueue=void 0),t?.accessToken&&this.setAccessToken(t.accessToken),this.storage.getInitPromise===void 0?(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?.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(),bo()&&sessionStorage.clear(),this.clearActiveLogin()}clearActiveLogin(){this.storage.setString("activeLogin",void 0),this.requestCache?.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){t=t.toString(),this.requestCache?.delete(t)}invalidateAll(){this.requestCache?.clear()}invalidateSearches(t){const n=yo(this.fhirBaseUrl,t);if(this.requestCache)for(const r of this.requestCache.keys())(r.endsWith(n)||r.includes(n+"?"))&&this.requestCache.delete(r)}get(t,n={}){t=t.toString();const r=this.getCacheEntry(t,n);if(r)return r.value;let o;t.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue&&!n.disableAutoBatch?o=new Promise((c,d)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:n,resolve:c,reject:d}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):o=this.request("GET",t,n);const s=new Wi(o);return this.setCacheEntry(t,s),s}post(t,n,r,o={}){return t=t.toString(),this.setRequestBody(o,n),r&&this.setRequestContentType(o,r),this.invalidateUrl(t),this.request("POST",t,o)}put(t,n,r,o={}){return t=t.toString(),this.setRequestBody(o,n),r&&this.setRequestContentType(o,r),this.invalidateUrl(t),this.request("PUT",t,o)}patch(t,n,r={}){return t=t.toString(),this.setRequestBody(r,n),this.setRequestContentType(r,rn.JSON_PATCH),this.invalidateUrl(t),this.request("PATCH",t,r)}delete(t,n){return t=t.toString(),this.invalidateUrl(t),this.request("DELETE",t,n)}async startNewUser(t,n){const{codeChallengeMethod:r,codeChallenge:o}=await this.startPkce();return this.post("auth/newuser",{...t,clientId:t.clientId??this.clientId,codeChallengeMethod:r,codeChallenge:o},void 0,n)}async startNewProject(t,n){return this.post("auth/newproject",t,void 0,n)}async startNewPatient(t,n){return this.post("auth/newpatient",t,void 0,n)}async startLogin(t,n){return this.post("auth/login",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async startGoogleLogin(t,n){return this.post("auth/google",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async ensureCodeChallenge(t){return t.codeChallenge?t:{...t,...await this.startPkce()}}async signOut(){await this.post(this.logoutUrl,{}),this.clear()}async signInWithRedirect(t){const r=new URLSearchParams(Zn.getSearch()).get("code");if(!r){await this.requestAuthorization(t);return}return this.processCode(r)}signOutWithRedirect(){Zn.assign(this.logoutUrl)}async signInWithExternalAuth(t,n,r,o,s=!0){let c=o;s&&(c=await this.ensureCodeChallenge(o)),Zn.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:Tc.TokenExchange,subject_token_type:EF.AccessToken,client_id:n,subject_token:t})}getExternalAuthRedirectUri(t,n,r,o,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",o.scope??"openid profile email"),c.searchParams.set("state",JSON.stringify(o)),s){const{codeChallenge:d,codeChallengeMethod:f}=o;if(!f)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!d)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");c.searchParams.set("code_challenge_method",f),c.searchParams.set("code_challenge",d)}return c.toString()}fhirUrl(...t){return new URL(yo(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=yB(n)),r}search(t,n,r){const o=this.fhirSearchUrl(t,n),s="search-"+o.toString(),c=this.getCacheEntry(s,r);if(c)return c.value;const d=this.getBundle(o,r);return this.setCacheEntry(s,d),d}searchOne(t,n,r){const o=this.fhirSearchUrl(t,n);o.searchParams.set("_count","1"),o.searchParams.sort();const s="searchOne-"+o.toString(),c=this.getCacheEntry(s,r);if(c)return c.value;const d=new Wi(this.search(t,o.searchParams,r).then(f=>f.entry?.[0]?.resource));return this.setCacheEntry(s,d),d}searchResources(t,n,r){const s="searchResources-"+this.fhirSearchUrl(t,n).toString(),c=this.getCacheEntry(s,r);if(c)return c.value;const d=new Wi(this.search(t,n,r).then(qT));return this.setCacheEntry(s,d),d}async*searchResourcePages(t,n,r){let o=this.fhirSearchUrl(t,n);for(;o;){const s=new URL(o).searchParams;s.has("_count")||s.set("_count","1000");const c=await this.search(t,s,r),d=c.link?.find(f=>f.relation==="next");if(!c.entry?.length&&!d)break;yield qT(c),o=d?.url?new URL(d.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){const r=this.requestCache?.get(this.fhirUrl(t,n).toString())?.value;return r?.isOk()?r.read():void 0}getCachedReference(t){const n=t.reference;if(!n)return;if(n==="system")return FT;const[r,o]=n.split("/");if(!(!r||!o))return this.getCached(r,o)}readResource(t,n,r){if(!n)throw new Error('The "id" parameter cannot be null, undefined, or an empty string.');return this.get(this.fhirUrl(t,n),r)}readReference(t,n){const r=t.reference;if(!r)return new Wi(Promise.reject(new Error("Missing reference")));if(r==="system")return new Wi(Promise.resolve(FT));const[o,s]=r.split("/");return!o||!s?new Wi(Promise.reject(new Error("Invalid reference"))):this.readResource(o,s,n)}readCanonical(t,n,r){return Array.isArray(t)?this.searchOne("",{_type:t.join(","),url:n},r):this.searchOne(t,"url="+n,r)}requestSchema(t){if(BD(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const o=new Wi((async()=>{const s=`{
|
|
60
|
+
StructureDefinitionList(_filter: "name eq ${t}") {
|
|
61
|
+
resourceType,
|
|
62
|
+
name,
|
|
63
|
+
kind,
|
|
64
|
+
description,
|
|
65
|
+
type,
|
|
66
|
+
url,
|
|
67
|
+
snapshot {
|
|
68
|
+
element {
|
|
69
|
+
id,
|
|
70
|
+
path,
|
|
71
|
+
definition,
|
|
72
|
+
min,
|
|
73
|
+
max,
|
|
74
|
+
base {
|
|
75
|
+
path,
|
|
76
|
+
min,
|
|
77
|
+
max
|
|
78
|
+
},
|
|
79
|
+
contentReference,
|
|
80
|
+
type {
|
|
81
|
+
code,
|
|
82
|
+
profile,
|
|
83
|
+
targetProfile
|
|
84
|
+
},
|
|
85
|
+
binding {
|
|
86
|
+
strength,
|
|
87
|
+
valueSet
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
SearchParameterList(base: "${t}", _count: 100) {
|
|
93
|
+
base,
|
|
94
|
+
code,
|
|
95
|
+
type,
|
|
96
|
+
expression,
|
|
97
|
+
target
|
|
98
|
+
}
|
|
99
|
+
}`.replaceAll(/\s+/g," "),c=await this.graphql(s);ET(c.data.StructureDefinitionList);for(const d of c.data.SearchParameterList)AB(d)})());return this.setCacheEntry(n,o),o}requestProfileSchema(t,n){if(!n?.expandProfile&&nS(t))return Promise.resolve();const r=t+"-requestSchema"+(n?.expandProfile?"-nested":""),o=this.getCacheEntry(r,void 0);if(o)return o.value;const s=new Wi((async()=>{if(n?.expandProfile){const c=this.fhirUrl("StructureDefinition","$expand-profile");c.search=new URLSearchParams({url:t}).toString();const d=await this.post(c.toString(),{});ET(d)}else{const c=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});if(!c){console.warn(`No StructureDefinition found for ${t}!`);return}UD(c)}})());return this.setCacheEntry(r,s),s}readHistory(t,n,r,o){const s=this.fhirUrl(t,n,"_history");return r?.count&&s.searchParams.set("_count",r.count.toString()),r?.offset&&s.searchParams.set("_offset",r.offset.toString()),this.get(s.toString(),o)}readVersion(t,n,r,o){return this.get(this.fhirUrl(t,n,"_history",r),o)}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 o=this.fhirUrl(t.resourceType);this.setRequestHeader(r,"If-None-Exist",n);const s=await this.post(o,t,void 0,r);return this.cacheResource(s),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),s}async upsertResource(t,n,r){const o=this.fhirSearchUrl(t.resourceType,n);let s=await this.put(o,t,void 0,r);return s||(s=t),this.cacheResource(s),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),s}async createAttachment(t,n,r,o,s){let c=GT(t,n,r,o);if(c.contentType===rn.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:rn.CDA_XML})}const d=s??(typeof n=="object"?n:{}),f=await this.createBinary(c,d);return{contentType:c.contentType,url:f.url,title:c.filename}}createBinary(t,n,r,o,s){const c=GT(t,n,r,o),d=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?.reference&&this.setRequestHeader(d,"X-Security-Context",g.reference),y?this.uploadwithProgress(b,f,p,y,d):this.post(b,f,p,d)}uploadwithProgress(t,n,r,o,s){return new Promise((c,d)=>{const f=new XMLHttpRequest,p=()=>f.abort();s?.signal?.addEventListener("abort",p);const m=g=>{s?.signal?.removeEventListener("abort",p),g instanceof Error?d(g):c(g)};if(f.responseType="json",f.onabort=()=>m(new DOMException("Request aborted","AbortError")),f.onerror=()=>m(new Error("Request error")),o&&(f.upload.onprogress=g=>o(g),f.upload.onload=g=>o(g)),f.onload=()=>{f.status>=200&&f.status<300?m(f.response):m(new gt(Xt(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?.headers){const g=s.headers;for(const[y,b]of Object.entries(g))f.setRequestHeader(y,b)}f.send(n)})}async createPdf(t,n,r,o){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const s=DF(t,n,r,o),c=typeof n=="object"?n:{},{docDefinition:d,tableLayouts:f,fonts:p,...m}=s,g=await this.createPdfImpl(d,f,p),y={...m,data:g,contentType:"application/pdf"};return this.createBinary(y,c)}createComment(t,n,r){const o=this.getProfile();let s,c;return t.resourceType==="Encounter"&&(s=Yt(t),c=t.subject),t.resourceType==="ServiceRequest"&&(s=t.encounter,c=t.subject),t.resourceType==="Patient"&&(c=Yt(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[Yt(t)],encounter:s,subject:c,sender:o?Yt(o):void 0,sent:new Date().toISOString(),payload:[{contentString:n}]},r)}async updateResource(t,n){if(!t.resourceType)throw new Error("Missing resourceType");if(!t.id)throw new Error("Missing id");let r=await this.put(this.fhirUrl(t.resourceType,t.id),t,void 0,n);return r||(r=t),this.cacheResource(r),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),r}async patchResource(t,n,r,o){const s=await this.patch(this.fhirUrl(t,n),r,o);return this.cacheResource(s),this.invalidateUrl(this.fhirUrl(t,n,"_history")),this.invalidateSearches(t),s}deleteResource(t,n,r){return this.deleteCacheEntry(this.fhirUrl(t,n).toString()),this.invalidateSearches(t),this.delete(this.fhirUrl(t,n),r)}validateResource(t,n){return this.post(this.fhirUrl(t.resourceType,"$validate"),t,void 0,n)}executeBot(t,n,r,o){let s;if(typeof t=="string"){const 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,o)}executeBatch(t,n){return this.post(this.fhirBaseUrl,t,void 0,n)}sendEmail(t,n){return this.post("email/v1/send",t,rn.JSON,n)}graphql(t,n,r,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},rn.JSON,o)}readResourceGraph(t,n,r,o){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,o)}pushToAgent(t,n,r,o,s,c){const{waitTimeout:d,...f}=c??{};return this.post(this.fhirUrl("Agent",hl(t),"$push"),{destination:typeof n=="string"?n:Mt(n),body:r,contentType:o,waitForResponse:s,...d!==void 0?{waitTimeout:d}:void 0},rn.FHIR_JSON,f)}getCdsServices(t){return this.get("/cds-services",t)}callCdsService(t,n,r){return this.post(`/cds-services/${t}`,n,rn.JSON,r)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){(!this.sessionDetails?.profile||Mt(this.sessionDetails.profile)!==t.profile?.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=cF(t),this.medplumServer=lF(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const n=this.getLogins().filter(r=>r.profile?.reference!==t.profile?.reference);n.push(t),this.storage.setObject("logins",n)}async refreshProfile(){if(this.medplumServer)return this.profilePromise=new Promise((t,n)=>{this.get("auth/me",{cache:"no-cache"}).then(r=>{this.profilePromise=void 0;const o=this.sessionDetails?.profile?.id!==r.profile.id;this.sessionDetails=r,o&&this.dispatchEvent({type:"change"}),t(r.profile),this.dispatchEvent({type:"profileRefreshed"})}).catch(n)}),this.dispatchEvent({type:"profileRefreshing"}),this.profilePromise}isLoading(){return!this.isInitialized||!!this.profilePromise&&!this.sessionDetails?.profile}isSuperAdmin(){return!!this.sessionDetails?.project.superAdmin}isProjectAdmin(){return!!this.sessionDetails?.membership.admin}getProject(){return this.sessionDetails?.project}getProjectMembership(){return this.sessionDetails?.membership}getProfile(){return this.sessionDetails?.profile}async getProfileAsync(){return this.profilePromise?this.profilePromise:this.sessionDetails?this.sessionDetails.profile:this.refreshProfile()}getUserConfiguration(){return this.sessionDetails?.config}getAccessPolicy(){return this.sessionDetails?.accessPolicy}async download(t,n={}){this.refreshPromise&&await this.refreshPromise;const r=t.toString();r.startsWith(CF)&&(t=this.fhirUrl(r));let o=n.headers;return o||(o={},n.headers=o),o.Accept||(o.Accept="*/*"),this.addFetchOptionsDefaults(n),(await this.fetchWithRetry(t.toString(),n)).blob()}async createMedia(t,n){const{additionalFields:r,...o}=t,s=await this.createResource({resourceType:"Media",status:"preparation",content:{contentType:t.contentType},...r});o.securityContext||(o.securityContext=Yt(s));const c=await this.createAttachment(o,n);return this.updateResource({...s,status:"completed",content:c})}async uploadMedia(t,n,r,o,s){return this.createMedia({data:t,contentType:n,filename:r,additionalFields:o},s)}async createDocumentReference(t,n){const{additionalFields:r,...o}=t,s=await this.createResource({resourceType:"DocumentReference",status:"current",content:[{attachment:{contentType:t.contentType}}],...r});o.securityContext||(o.securityContext=Yt(s));const c=await this.createAttachment(o,n);return this.updateResource({...s,content:[{attachment:c}]})}async bulkExport(t="",n,r,o){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(),o)}async startAsyncRequest(t,n={}){this.addFetchOptionsDefaults(n);const r=n.headers;return r.Prefer="respond-async",this.request("POST",t,n)}get keyValue(){return this.keyValueClient||(this.keyValueClient=new uF(this)),this.keyValueClient}getBundle(t,n){return new Wi((async()=>{const r=await this.get(t,n);if(r.entry)for(const o of r.entry)this.cacheResource(o.resource);return r})())}getCacheEntry(t,n){if(!this.requestCache||n?.cache==="no-cache"||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){t?.id&&!t.meta?.tag?.some(n=>n.code==="SUBSETTED")&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new Wi(Promise.resolve(t)))}deleteCacheEntry(t){this.requestCache&&this.requestCache.delete(t)}async request(t,n,r={},o={}){await this.refreshIfExpired(),r.method=t,this.addFetchOptionsDefaults(r);const s=await this.fetchWithRetry(n,r);if(s.status===401)return this.handleUnauthenticated(t,n,r);if(s.status===204||s.status===304)return;const d=s.headers.get("content-type")?.includes("json");if(s.status===404&&!d)throw new gt(T8);const f=await this.parseBody(s,d);if(s.status===200&&r.followRedirectOnOk||s.status===201&&r.followRedirectOnCreated){const p=await HT(s,f);if(p)return this.request("GET",p,{...r,body:void 0})}if(s.status===202&&r.pollStatusOnAccepted){const m=await HT(s,f)??o.statusUrl;if(m)return this.pollStatus(m,r,o)}if(s.status>=400)throw new gt(Xt(f));return f}async parseBody(t,n){let r;if(t.headers.get("content-length")!=="0"){if(n)try{r=await t.json()}catch(o){throw console.error("Error parsing response",t.status,o),o}else r=await t.text();return r}}async fetchWithRetry(t,n){t.startsWith("http")||(t=yo(this.baseUrl,t));const r=n?.maxRetries??2;for(let o=0;o<=r;o++)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),o>=r||!kF(s))return s;const c=this.getRetryDelay(o),d=n.maxRetryTime??2e3;if(c>d)return s;await PT(c)}catch(s){if(s.message==="Failed to fetch"&&o===0&&this.dispatchEvent({type:"offline"}),s.name==="AbortError"||o===r)throw s}throw new Error("Unreachable")}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const o of Qc(Object.keys(r)))console.log(`> ${o}: ${r[o]}`)}}logResponse(t){console.log(`< ${t.status} ${t.statusText}`),t.headers&&t.headers.forEach((n,r)=>console.log(`< ${r}: ${n}`))}setCurrentRateLimit(t){if(!t?.headers||typeof t.headers.get!="function")return;const n=t.headers.get("ratelimit");n&&(this.currentRateLimits=n)}rateLimitStatus(){if(!this.currentRateLimits)return[];const t=this.currentRateLimits;return t.split(",").map(n=>{const r=n.split(";").map(p=>p.trim());if(r.length!==3)throw new Error("Could not parse RateLimit header: "+t);const o=r[0].substring(1,r[0].length-1),s=r.find(p=>p.startsWith("r="))?.substring(2),c=s?Number.parseInt(s,10):Number.NaN,d=r.find(p=>p.startsWith("t="))?.substring(2),f=d?Number.parseInt(d,10):Number.NaN;if(!o||Number.isNaN(c)||Number.isNaN(f))throw new Error("Could not parse RateLimit header: "+t);return{name:o,remainingUnits:c,secondsUntilReset:f,resetsAfter:Math.ceil((Date.now()+1e3*f)/1e3)}})}getRetryDelay(t){const n=this.rateLimitStatus();let r=500*Math.pow(1.5,t);for(const o of n)o.remainingUnits||(r=Math.max(r,o.secondsUntilReset*1e3));return r}async pollStatus(t,n,r){const o={...n,method:"GET",body:void 0,redirect:"follow"};if(r.pollCount===void 0)n.headers&&typeof n.headers=="object"&&"Prefer"in n.headers&&(o.headers={...n.headers},delete o.headers.Prefer),r.statusUrl=t,r.pollCount=1;else{const s=n.pollStatusPeriod??1e3;await PT(s),r.pollCount++}return this.request("GET",t,o,r)}async executeAutoBatch(){if(this.autoBatchQueue===void 0)return;const t=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,t.length===1){const o=t[0];try{o.resolve(await this.request(o.method,yo(this.fhirBaseUrl,o.url),o.options))}catch(s){o.reject(new gt(Xt(s)))}return}const n={resourceType:"Bundle",type:"batch",entry:t.map(o=>({request:{method:o.method,url:o.url},resource:o.options.body?JSON.parse(o.options.body):void 0}))},r=await this.post(this.fhirBaseUrl,n);for(let o=0;o<t.length;o++){const s=t[o],c=r.entry?.[o];c?.response?.outcome&&!LD(c.response.outcome)?s.reject(new gt(c.response.outcome)):s.resolve(c?.resource)}}addFetchOptionsDefaults(t){Object.entries(this.defaultHeaders).forEach(([n,r])=>{this.setRequestHeader(t,n,r)}),this.setRequestHeader(t,"Accept",yF,!0),this.options.extendedMode!==!1&&this.setRequestHeader(t,"X-Medplum","extended"),t.body&&this.setRequestHeader(t,"Content-Type",rn.FHIR_JSON,!0),this.accessToken?this.setRequestHeader(t,"Authorization","Bearer "+this.accessToken):this.basicAuth&&this.setRequestHeader(t,"Authorization","Basic "+this.basicAuth),t.cache||(t.cache="no-cache"),t.credentials||(t.credentials="include")}setRequestContentType(t,n){this.setRequestHeader(t,"Content-Type",n)}setRequestHeader(t,n,r,o=!1){const s=t.headers;s?Array.isArray(s)?(!o||!s.some(([c])=>c.toLowerCase()===n.toLowerCase()))&&s.push([n,r]):s instanceof Headers?(!o||!s.has(n))&&s.set(n,r):pr(s)&&(!o||!s[n])&&(s[n]=r):t.headers={[n]:r}}setRequestBody(t,n){typeof n=="string"||typeof Blob<"u"&&(n instanceof Blob||n?.constructor.name==="Blob")||typeof File<"u"&&(n instanceof File||n?.constructor.name==="File")||typeof Uint8Array<"u"&&(n instanceof Uint8Array||n?.constructor.name==="Uint8Array")?t.body=n:n&&(t.body=JSON.stringify(n))}async handleUnauthenticated(t,n,r){if(this.refresh())return this.request(t,n,r);throw this.clear(),this.onUnauthenticated?.(),new gt(Pd)}async startPkce(){const t=zT();sessionStorage.setItem("pkceState",t);const n=zT().slice(0,128);sessionStorage.setItem("codeVerifier",n);try{const r=await qV(n);return{codeChallengeMethod:"S256",codeChallenge:fB(r).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}}catch(r){return console.warn("Failed to hash code verifier. Falling back to 'plain' code challenge method",r),{codeChallengeMethod:"plain",codeChallenge:n}}}async requestAuthorization(t){const n=await this.ensureCodeChallenge(t??{}),r=new URL(this.authorizeUrl);r.searchParams.set("response_type","code"),r.searchParams.set("state",sessionStorage.getItem("pkceState")),r.searchParams.set("client_id",n.clientId??this.clientId),r.searchParams.set("redirect_uri",n.redirectUri??Zn.getOrigin()),r.searchParams.set("code_challenge_method",n.codeChallengeMethod),r.searchParams.set("code_challenge",n.codeChallenge),r.searchParams.set("scope",n.scope??"openid profile"),Zn.assign(r.toString())}processCode(t,n){const r={grant_type:Tc.AuthorizationCode,code:t,client_id:n?.clientId??this.clientId??"",redirect_uri:n?.redirectUri??Zn.getOrigin()};if(typeof sessionStorage<"u"){const o=sessionStorage.getItem("codeVerifier");o&&(r.code_verifier=o)}return this.fetchTokens(r)}refreshIfExpired(t){return!this.refreshPromise&&this.accessTokenExpires!==void 0&&!this.isAuthenticated(t)&&this.refresh(),this.refreshPromise??Promise.resolve()}refresh(){if(this.refreshPromise)return this.refreshPromise;if(this.refreshToken)return this.refreshPromise=this.fetchTokens({grant_type:Tc.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:Tc.ClientCredentials,client_id:t,client_secret:n})}async startJwtBearerLogin(t,n,r){return this.clientId=t,this.fetchTokens({grant_type:Tc.JwtBearer,client_id:t,assertion:n,scope:r})}async startJwtAssertionLogin(t){return this.fetchTokens({grant_type:Tc.ClientCredentials,client_assertion_type:TF.JwtBearer,client_assertion:t})}setBasicAuth(t,n){this.clientId=t,this.clientSecret=n,this.basicAuth=IT(t+":"+n)}setVerbose(t){this.options.verbose=t}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new gt(jn("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new gt(jn("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,$T(r),rn.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!s)throw new Error("Invalid response!");return r.endpoint=s,r}async fhircastUnsubscribe(t){if(!yS(t))throw new gt(jn("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new gt(jn("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post(this.fhircastHubUrl,$T(t),rn.FORM_URL_ENCODED)}fhircastConnect(t){return new oF(t)}async fhircastPublish(t,n,r,o){return JV(n)?this.post(this.fhircastHubUrl,UT(t,n,r,o),rn.JSON):(ZV(n),this.post(this.fhircastHubUrl,UT(t,n,r),rn.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":rn.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 ${IT(t.client_id+":"+t.client_secret)}`));const o={method:"POST",headers:r,body:n.toString(),credentials:"include"};let s;try{s=await this.fetchWithRetry(this.tokenUrl,o)}catch(d){throw this.refreshPromise=void 0,d}if(!s.ok){this.clearActiveLogin(),this.onUnauthenticated?.();try{const d=await s.json();throw new gt(To(d.error_description))}catch(d){throw new gt(To("Failed to fetch tokens"),{cause:d})}}const c=await s.json();return await this.verifyTokens(c),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(sF(n)){const r=xS(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new gt(R8);if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new gt(jT)}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new gt(jT)}return this.setActiveLogin({accessToken:n,refreshToken:t.refresh_token,project:t.project,profile:t.profile})}checkSessionDetailsMatchLogin(t){return this.sessionDetails&&t?t.profile?.reference?.endsWith(this.sessionDetails.profile.id)??!1:!0}setupStorageListener(){try{window.addEventListener("storage",t=>{if(t.key===null)Zn.reload();else if(t.key===this.storage.makeKey("activeLogin")){const n=t.oldValue?JSON.parse(t.oldValue):void 0,r=t.newValue?JSON.parse(t.newValue):void 0;n?.profile.reference!==r?.profile.reference||!this.checkSessionDetailsMatchLogin(r)?Zn.reload():r?this.setAccessToken(r.accessToken,r.refreshToken):this.clear()}})}catch{}}getSubscriptionManager(){return this.subscriptionManager||(this.subscriptionManager=new vF(this,vB(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 RF(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}async function HT(e,t){const n=e.headers.get("content-location");if(n)return n;const r=e.headers.get("location");if(r)return r;if(Im(t)&&t.issue?.[0]?.diagnostics)return t.issue[0].diagnostics}function qT(e){const t=e.entry?.map(n=>n.resource)??[];return Object.assign(t,{bundle:e})}function _F(e){return pr(e)&&"data"in e&&"contentType"in e}function GT(e,t,n,r){return _F(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function AF(e){return pr(e)&&"docDefinition"in e}function DF(e,t,n,r){return AF(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function kF(e){return e.status===429||e.status>=500}function Wc({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:o,accessPolicyResource:s}){if(t===e?.path)return;o??=e?.debugMode??!1,s??=e?.accessPolicyResource;let c=PF(t,n,e,!!o);const d=Vx(t,".",2)[1];c=NF(c,s,d),c=OF(c,s,d);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=Vx(g,".",2)[1];if(y){if(!m[y]){const b=Pp(y,s?.hiddenFields);m[y]={hidden:b,readonly:b||Pp(y,s?.readonlyFields)}}return m[y]}}}return{path:t,elements:c,elementsByPath:f,profileUrl:r??e?.profileUrl,debugMode:o,getExtendedProps:p,accessPolicyResource:s}}function PF(e,t,n,r){const o=Object.create(null);if(n)for(const[c,d]of Object.entries(n.elementsByPath)){const f=il(e,c);f!==void 0&&(o[f]=d)}let s=!1;if(t)for(const[c,d]of Object.entries(t))c in o||(o[c]=d,s=!0);return r&&console.assert(s,"Unnecessary ElementsContext; not using any newly provided elements"),o}function NF(e,t,n){if(!t?.hiddenFields?.length)return e;const r=n?n+".":"";return Object.fromEntries(Object.entries(e).filter(([o])=>!Pp(r+o,t.hiddenFields)))}function OF(e,t,n){if(!t?.readonlyFields?.length)return e;const r=Object.create(null),o=n?n+".":"";for(const[s,c]of Object.entries(e))Pp(o+s,t.readonlyFields)?r[s]={...c,readonly:!0}:r[s]=c;return r}function Pp(e,t){if(!t?.length)return!1;const n=e.split(".");for(let r=1;r<=n.length;r++){const o=n.slice(0,r).join(".");if(t.includes(o))return!0}return!1}function Ck(e){return e.type!==void 0&&e.type.length>0}function MF(e,t,n,r){const o=HU(e,t.path,{profileUrl:r});if(o){const s=n.typeSchema?.elements??n.elements;return o.some(c=>GU(c,t,n,s))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function Ek(e,t,n,r){if(e)for(const o of t){const s={value:e,type:o.typeSchema?.type??o.type?.[0].code};if(n.every(c=>MF(s,c,o,o.typeSchema?.url??r)))return o.name}}class LF{rootSchema;visitor;elementsContextStack;sliceAllowList;constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const o=Wc({parentContext:void 0,path:this.rootSchema.type,elements:r??this.rootSchema.elements,profileUrl:this.rootSchema.name===this.rootSchema.type?void 0:this.rootSchema.url});if(o===void 0)throw new Error("Could not create root elements context");this.elementsContextStack=[o],this.visitor=n}get elementsContext(){return this.elementsContextStack.at(-1)}crawlElement(t,n,r){this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema);const o=Object.fromEntries(Object.entries(this.elementsContext.elements).filter(([s])=>s.startsWith(n)));this.crawlElementsImpl(o,r),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlSlice(t,n,r){const o=this.prepareSlices(r.slices,r);if(!Nn(o.slices))throw new Error(`cannot crawl slice ${n.name} since it has no type information`);this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema),this.sliceAllowList=[n],this.crawlSliceImpl(o.slices[0],n.path,o),this.sliceAllowList=void 0,this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlResource(){this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema),this.crawlElementsImpl(this.rootSchema.elements,this.rootSchema.type),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlElementsImpl(t,n){const r=IF(t);for(const o of r)this.crawlElementNode(o,n)}crawlElementNode(t,n){const r=n+"."+t.key;this.visitor.onEnterElement&&this.visitor.onEnterElement(r,t.element,this.elementsContext);for(const o of t.children)this.crawlElementNode(o,n);Nn(t.element?.slicing?.slices)&&this.crawlSlicingImpl(t.element.slicing,r),this.visitor.onExitElement&&this.visitor.onExitElement(r,t.element,this.elementsContext)}prepareSlices(t,n){const r=[];for(const s of t){if(!Ck(s))continue;const c=s.type.find(d=>Nn(d.profile))?.profile?.[0];if(Nn(c)){const d=uu(c);d&&(s.typeSchema=d)}r.push(s)}return{...n,slices:r}}crawlSlicingImpl(t,n){const r=this.prepareSlices(t.slices,t);for(const o of r.slices)(this.sliceAllowList===void 0||this.sliceAllowList.includes(o))&&this.crawlSliceImpl(o,n,r)}crawlSliceImpl(t,n,r){const o=t.typeSchema;o&&this.visitor.onEnterSchema&&this.visitor.onEnterSchema(o),this.visitor.onEnterSlice&&this.visitor.onEnterSlice(n,t,r);let s;const c=o?.elements??t.elements;Nn(c)&&(s=Wc({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),o&&this.visitor.onExitSchema&&this.visitor.onExitSchema(o)}}function IF(e){const t=[];function n(s,c){return c.startsWith(s+".")}function r(s,c){for(const d of s.children)if(n(d.key,c.key)){r(d,c);return}s.children.push(c)}const o=Object.entries(e);o.sort((s,c)=>s[0].localeCompare(c[0]));for(const[s,c]of o){const d={key:s,element:c,children:[]};let f=!1;for(const p of t)if(n(p.key,s)){r(p,d),f=!0;break}f||t.push(d)}return t}const Xy="__sliceName";function zF(e,t){const n=new $F(e,e.resourceType,"resource");return new LF(t,n).crawlResource(),n.getDefaultValue()}function QT(e,t,n){for(const[r,o]of Object.entries(t)){if(n===void 0||n===r){Np(e,r,o,t);continue}const s=il(n,r);s!==void 0&&Np(e,s,o,t)}return e}class $F{rootValue;schemaStack;valueStack;constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=hi(t),this.valueStack.splice(0,this.valueStack.length,{type:r,path:n,values:[this.rootValue]})}get schema(){return this.schemaStack.at(-1)}get value(){return this.valueStack.at(-1)}onEnterSchema(t){this.schemaStack.push(t)}onExitSchema(){this.schemaStack.pop()}onEnterElement(t,n,r){const o=this.value.values,s=this.value.path,c=il(s,t);if(c===void 0)throw new Error(`Expected ${t} to be prefixed by ${s}`);const d=[];for(const f of o){if(f===void 0)continue;const p=il(r.path,s),m=Array.isArray(f)?f:[f];for(const g of m){UF(g,c,n,r.elements,p),Np(g,c,n,r.elements);const y=Gx(g,c,r.elements,p);y!==void 0&&d.push(y)}}this.valueStack.push({type:"element",path:t,values:d})}onExitElement(t,n,r){if(!this.valueStack.pop())throw new Error("Expected value context to exist when exiting element");const s=il(this.value.path,t);if(s===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);const c=il(r.path,this.value.path);for(const d of this.value.values){const f=Gx(d,s,r.elements,c);if(Array.isArray(f))for(let p=f.length-1;p>=0;p--){const m=f[p];Nn(m)||f.splice(p,1)}Cn(f)&&qx(d,void 0,s,n)}}onEnterSlice(t,n,r){const o=this.value.values,s=[];for(const c of o)if(c!==void 0){const d=Array.isArray(c)?c:[c],f=this.getMatchingSliceValues(d,n,r);s.push(f)}this.valueStack.push({type:"slice",path:t,values:s})}getMatchingSliceValues(t,n,r){const o=[];for(const s of t)(s[Xy]??Ek(s,[n],r.discriminator,this.schema.url))===n.name&&o.push(s);for(let s=o.length;s<n.min;s++)if(sS(n.type[0].code)){const c=Object.create(null);o.push(c),t.push(c)}return o}onExitSlice(){const t=this.valueStack.pop();if(!t)throw new Error("Expected value context to exist in onExitSlice");for(const n of t.values)for(let r=n.length-1;r>=0;r--){const o=n[r];Xy in o&&delete o[Xy]}}getDefaultValue(){return this.rootValue}}function UF(e,t,n,r,o){const s=Gx(e,t,r,o);n.min>0&&s===void 0&&sS(n.type[0].code)&&(n.isArray?qx(e,[Object.create(null)],t,n):qx(e,Object.create(null),t,n))}function qx(e,t,n,r){if(n.includes("."))throw new Error("key cannot be nested");let o=n;if(n.includes("[x]")){const s=r.type[0].code;o=n.replace("[x]",Qn(s))}t===void 0?delete e[o]:e[o]=t}function Gx(e,t,n,r){const o=t.split(".");let s=e,c;for(let d=0;d<o.length;d++){let f=o[d];if(f.includes("[x]")){const p=(r?r+".":"")+o.slice(0,d+1).join("."),g=n[p].type[0].code;f=f.replace("[x]",Qn(g))}if(d===o.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(pr(s)){if(s[f]===void 0)return;s=s[f]}else return}return c}function Np(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(d=>Np(d,t,n,r));e==null&&(e=Object.create(null));const o=e,s=t.split(".");let c=o;for(let d=0;d<s.length;d++){let f=s[d];if(f.includes("[x]")){const m=r[s.slice(0,d+1).join(".")].type[0].code;f=f.replace("[x]",Qn(m))}if(d===s.length-1){const p=Array.isArray(c)?c:[c];for(const m of p)n.fixed?m[f]??=n.fixed.value:n.pattern&&(m[f]=Tk(m[f],n.pattern.value))}else{if(!(f in c)){const p=s.slice(0,d+1).join(".");c[f]=r[p].isArray?[Object.create(null)]:Object.create(null)}c=c[f]}}return o}function Tk(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return(e?.length??0)>0?e:hi(t);if(pr(t)&&(pr(e)&&!Array.isArray(e)||e===void 0)){const n=hi(e)??Object.create(null);for(const r of Object.keys(t))n[r]=Tk(n[r],t[r]);return n}return e}function BF(e){return e.match(/^\((.+)\)\.identifier$/)?.[1]}function VF(e,t){return new uS(e,new Bm(t,new Id("identifier")))}const xr={BOOLEAN:"BOOLEAN",NUMBER:"NUMBER",QUANTITY:"QUANTITY",TEXT:"TEXT",REFERENCE:"REFERENCE",CANONICAL:"CANONICAL",DATE:"DATE",DATETIME:"DATETIME"};function Gm(e,t){let n=No.types[e]?.searchParamsDetails?.[t.code];return n||(n=HF(e,t)),n}function FF(e,t,n){let r=No.types[e];r||(r={},No.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function HF(e,t){const n=t.code,r=t.expression,o=WF(e,r),s={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const f of o){const p=hp(f),m=mB(()=>p.join("."));p.length===1&&p[0]instanceof Xr?s.propertyTypes.add("boolean"):t.code.endsWith(":identifier")?s.propertyTypes.add("Identifier"):m().endsWith("extension.value.code")||m().endsWith("extension.value.coding.code")?(s.array=!0,s.propertyTypes.clear(),s.propertyTypes.add("code")):Rk(s,p,e,1),m().endsWith("extension.valueDateTime")&&(s.array=!1,s.propertyTypes.clear(),s.propertyTypes.add("dateTime"))}let c;if(t.code.endsWith(":identifier")){const f=BF(r);if(f===void 0)throw new Error(`Unexpected expression for derived identifier search parameter: ${r}`);const p=WT(e,f);c=VF(r,p)}else c=WT(e,r);const d={type:QF(t,s.propertyTypes),elementDefinitions:s.elementDefinitions.map(f=>({...f,type:f.type?.filter(p=>s.propertyTypes.has(p.code))})).filter(f=>f.type&&f.type.length>0),parsedExpression:c,array:s.array};return FF(e,n,d),d}function Rk(e,t,n,r){const o=t[r];if(o instanceof kp){e.propertyTypes.add(o.right.toString());return}if(o instanceof hS){qF(e,o);return}const s=o.toString(),c=Es(n,s);if(!c)throw new Error(`Element definition not found for ${n} ${s}`);let d=!1,f=r+1;f<t.length&&t[f]instanceof pS&&(d=!0,f++);const p=t[f];if(c.isArray&&!d&&(e.array=!0),f===t.length-1&&p instanceof kp){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;GF(g)&&(g=c.type[0].code),Rk(e,t,g,f)}}function qF(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 fS){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function GF(e){return e==="Element"||e==="BackboneElement"}function QF(e,t){switch(e.type){case"date":return t.size===1&&t.has(ne.date)?xr.DATE:xr.DATETIME;case"number":return xr.NUMBER;case"quantity":return xr.QUANTITY;case"reference":return t.has(ne.canonical)?xr.CANONICAL:xr.REFERENCE;case"token":return t.size===1&&t.has(ne.boolean)?xr.BOOLEAN:xr.TEXT;default:return xr.TEXT}}function WF(e,t){const n=[],r=mS(t);return Op(e,r.child,n),n}function WT(e,t){const n=[],r=mS(t);if(Op(e,r.child,n),n.length===0)return r;let o=n[0];for(let s=1;s<n.length;s++)o=new dS(o,n[s]);return new uS("<original-not-available>",o)}function Op(e,t,n){t instanceof dS?(Op(e,t.left,n),Op(e,t.right,n)):t.toString().includes(e+".")&&n.push(t)}function hp(e){if(e instanceof kp||e instanceof pS)return[hp(e.left),e].flat();if(e instanceof Xr)return[e];if(e instanceof Bm)return[hp(e.left),hp(e.right)].flat();if(e instanceof hS){if(e.name==="where"&&!(e.args[0]instanceof fS))return[];if(e.name==="last")return[]}return[e]}const YF="https://meta.medplum.com/releases",Jy=new Map;function KF(e){const t=e;if(!t.tag_name)throw new Error("Manifest missing tag_name");const n=t.assets;if(!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 XF(e,t,n){let r=Jy.get("latest");if(!r){const o="latest",s=new URL(`${YF}/${o}.json`);s.searchParams.set("a",e),s.searchParams.set("c",wk);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: ${Qe(p)}`)}throw new Error(`Received status code ${c.status} while fetching manifest for version 'latest'. Message: ${f}`)}const d=await c.json();KF(d),r=d,Jy.set("latest",r),Jy.set(r.tag_name.slice(1),r)}return r}async function JF(e){const t=await XF(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 _k=v.createContext(void 0);function Qm(){return v.useContext(_k)}function Re(){return Qm().medplum}function du(){return Qm().navigate}function hf(){return Qm().profile}const YT=["change","storageInitialized","storageInitFailed","profileRefreshing","profileRefreshed"];function ZF(e){const t=e.medplum,n=e.navigate??eH,[r,o]=v.useState({profile:t.getProfile(),loading:t.isLoading()});v.useEffect(()=>{function c(){o(d=>({...d,profile:t.getProfile(),loading:t.isLoading()}))}for(const d of YT)t.addEventListener(d,c);return()=>{for(const d of YT)t.removeEventListener(d,c)}},[t]);const s=v.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return a.jsx(_k.Provider,{value:s,children:e.children})}function eH(e){window.location.assign(e)}const KT=new Map,Ak=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 o=KT.get(t);if(o){const c=new URLSearchParams(new URL(o).search).get("Expires");if(c&&Number.parseInt(c,10)*1e3-5e3>Date.now())return o}return KT.set(t,e),e},[e]);function Jt(e,t){const n=Re(),[r,o]=v.useState(()=>XT(n,e)),s=v.useCallback(c=>{Po(c,r)||o(c)},[r]);return v.useEffect(()=>{let c=!0;const d=XT(n,e);return!d&&_a(e)?n.readReference(e).then(f=>{c&&s(f)}).catch(f=>{c&&(s(void 0),t&&t(Xt(f)))}):s(d),(()=>c=!1)},[n,e,s,t]),r}function XT(e,t){if(t){if(Vo(t))return t;if(_a(t))return e.getCachedReference(t)}}const jt={group:"group",display:"display",boolean:"boolean",decimal:"decimal",integer:"integer",date:"date",dateTime:"dateTime",time:"time",string:"string",text:"text",url:"url",choice:"choice",openChoice:"open-choice",attachment:"attachment",reference:"reference",quantity:"quantity"},bS=`${ao}/fhir/StructureDefinition/questionnaire-itemControl`,tH=`${ao}/fhir/StructureDefinition/questionnaire-referenceFilter`,Qx=`${ao}/fhir/StructureDefinition/questionnaire-referenceResource`,nH=`${ao}/fhir/StructureDefinition/questionnaire-validationError`,rH=`${ao}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression`,iH=`${ao}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression`,oH=`${ao}/fhir/StructureDefinition/questionnaire-signatureRequired`,pp=`${ao}/fhir/StructureDefinition/questionnaireresponse-signature`;function aH(e){return e.type==="choice"||e.type==="open-choice"}function sH(e,t){const n=lH(e,t);return n!==void 0?n:cH(e,t)}function lH(e,t){const n=Bo(e,rH);if(t&&n){const r=n.valueExpression?.expression;if(r){const o=fi(t),s=vs(r,[o],{"%resource":o});return jo(s)}}}function cH(e,t){if(!e.enableWhen)return!0;const n=e.enableBehavior??"any";for(const r of e.enableWhen){const o=Pk(t?.item,r.question);if(r.operator==="exists"&&!r.answerBoolean&&!o?.length){if(n==="any")return!0;continue}const{anyMatch:s,allMatch:c}=mH(r,o,n);if(n==="any"&&s)return!0;if(n==="all"&&!c)return!1}return n!=="any"}function Dk(e,t,n=t.item){for(const r of e){const o=n?.find(s=>s.linkId===r.linkId);o&&(uH(t,r,o),r.item&&o.item&&Dk(r.item,t,o.item))}}function uH(e,t,n){try{const r=hH(t,e);if(!r)return;const o=fH(t,r);if(!o)return;n.answer=[o]}catch(r){n.extension=[{url:nH,valueString:`Expression evaluation failed: ${Qe(r)}`}]}}const dH={[jt.boolean]:[ne.boolean],[jt.date]:[ne.date],[jt.dateTime]:[ne.dateTime],[jt.time]:[ne.time],[jt.url]:[ne.string,ne.uri,ne.url],[jt.attachment]:[ne.Attachment],[jt.reference]:[ne.Reference],[jt.quantity]:[ne.Quantity],[jt.decimal]:[ne.decimal,ne.integer],[jt.integer]:[ne.decimal,ne.integer]};function fH(e,t){if(!e.type)return;if(e.type===jt.choice||e.type===jt.openChoice)return{[`value${Qn(t.type)}`]:t.value};if(e.type===jt.string||e.type===jt.text)return typeof t.value=="string"?{valueString:t.value}:void 0;if(dH[e.type]?.includes(t.type))return{[`value${Qn(e.type)}`]:t.value}}function hH(e,t){if(!t)return;const n=Bo(e,iH);if(n){const r=n.valueExpression?.expression;if(r){const o=fi(t),s=vs(r,[o],{"%resource":o});return s.length!==0?s[0]:void 0}}}function kk(e,t,n){const r=[];for(const o of e){const s=n.answerOption?.find(c=>pl(Oo(c))===o);if(s){const c=Oo(s);c&&r.push({[t]:c.value})}}return r}function Pk(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=Pk(n.item,t);if(r)return r}}}function pH(e,t,n){if(n==="exists")return!!e===t.value;if(e){const r=n==="="||n==="!="?n?.replace("=","~"):n,[{value:o}]=vs(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return o}else return!1}function mH(e,t,n){const r=t||[],o=yH(e);let s=!1,c=!0;for(const d of r){const f=xH(d),{operator:p}=e;if(pH(f,o,p)?s=!0:c=!1,n==="any"&&s)break}return{anyMatch:s,allMatch:c}}function Nk(e){const t=Bo(e,Qx);if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return t.valueCodeableConcept?.coding?.map(n=>n.code)}}function Zy(e,t){const n=hi(e);let r=Bo(n,Qx);return!t||t.length===0?(r&&(n.extension=n.extension?.filter(o=>o!==r)),n):(r||(n.extension??=[],r={url:Qx},n.extension.push(r)),t.length===1?(r.valueCode=t[0],delete r.valueCodeableConcept):(r.valueCodeableConcept={coding:t.map(o=>({code:o}))},delete r.valueCode),n)}function gH(e,t,n){const r=Bo(e,tH);if(!r?.valueString)return;let o=r.valueString;t?.reference&&(o=o.replaceAll("$subj",t.reference)),n?.reference&&(o=o.replaceAll("$encounter",n.reference));const s={},c=o.split("&");for(const d of c){const[f,p]=Vx(d,"=",2);s[f]=p}return s}function JT(e,t){return{resourceType:"QuestionnaireResponse",questionnaire:e.url??Mt(e),item:SS(e.item,t?.item),status:"in-progress"}}function SS(e,t){if(!e)return;const n=[];for(const r of e){if(r.type===jt.display)continue;const o=t?.filter(s=>s.linkId===r.linkId);if(o&&o?.length>0)for(const s of o)s.id=s.id??Mk(),s.text=s.text??r.text,s.item=SS(r.item,s.item),s.answer=Lk(r,s),n.push(s);else n.push(Ok(r))}return n}function Ok(e){return{id:Mk(),linkId:e.linkId,text:e.text,item:SS(e.item,void 0),answer:Lk(e)}}let vH=1;function Mk(){return"id-"+vH++}function Lk(e,t){if(!(e.type===jt.display||e.type===jt.group)){if(t?.answer&&t.answer.length>0)return t.answer;if(e.initial&&e.initial.length>0)return e.initial.map(n=>({...n}));if(e.answerOption)return e.answerOption.filter(n=>n.initialSelected).map(n=>({...n,initialSelected:void 0}))}}function wS(e){return df({value:e},"value")}function Oo(e){return df({value:e},"value")}function yH(e){return df({value:e},"answer")}function xH(e){return df({value:e},"value")}function bH(e){const t=Jt(e.questionnaire),n=Jt(e.defaultValue),[,r]=v.useReducer(S=>S+1,0),o=v.useRef({activePage:0});if(!o.current.questionnaire&&t&&(o.current.questionnaire=t,o.current.pages=e.disablePagination?void 0:SH(t)),t&&e.defaultValue&&n&&!o.current.questionnaireResponse&&(o.current.questionnaireResponse=JT(t,n),b()),t&&!e.defaultValue&&!o.current.questionnaireResponse&&(o.current.questionnaireResponse=JT(t),b()),!o.current.questionnaire||!o.current.questionnaireResponse)return{loading:!0};function s(S,j){let C=o.current.questionnaireResponse;for(const E of S)C=C?.item?.find(R=>E.id?R.id===E.id:R.linkId===E.linkId);return j&&(C=C?.item?.find(E=>E.linkId===j.linkId)),C}function c(){o.current.activePage=(o.current.activePage??0)+1,r()}function d(){o.current.activePage=(o.current.activePage??0)-1,r()}function f(S,j){const C=s(S);C&&(C.item??=[],C.item.push(Ok(j)),b())}function p(S,j){const C=s(S,j);C&&(C.answer??=[],C.answer.push({}),b())}function m(S,j,C){const E=s(S,j);E&&(E.answer=C,b())}function g(S){const j=o.current.questionnaireResponse;j&&(S?(j.extension=j.extension??[],j.extension=j.extension.filter(C=>C.url!==pp),j.extension.push({url:pp,valueSignature:S})):j.extension=j.extension?.filter(C=>C.url!==pp),b())}function y(){const S=o.current.questionnaire;if(S?.item){const j=o.current.questionnaireResponse;Dk(S.item,j)}}function b(){const S=o.current.questionnaireResponse;S&&(y(),r(),e.onChange?.(S))}return{loading:!1,pagination:!!o.current.pages,questionnaire:o.current.questionnaire,questionnaireResponse:o.current.questionnaireResponse,subject:e.subject,encounter:e.encounter,activePage:o.current.activePage,pages:o.current.pages,items:wH(o.current.questionnaire,o.current.pages,o.current.activePage),responseItems:jH(o.current.questionnaireResponse,o.current.pages,o.current.activePage),onNextPage:c,onPrevPage:d,onAddGroup:f,onAddAnswer:p,onChangeAnswer:m,onChangeSignature:g}}function SH(e){if(!(!e?.item||Bo(e?.item?.[0],bS)?.valueCodeableConcept?.coding?.[0]?.code!=="page"))return e.item.map((n,r)=>({linkId:n.linkId,title:n.text??`Page ${r+1}`,group:n}))}function wH(e,t,n=0){return t&&e?.item?.[n]?[e.item[n]]:e.item??[]}function jH(e,t,n=0){return t&&e?.item?.[n]?[e.item[n]]:e.item??[]}function CH(e,t,n={leading:!1}){const[r,o]=v.useState(e),s=v.useRef(!1),c=v.useRef(void 0),d=v.useRef(!1),f=v.useCallback(()=>window.clearTimeout(c.current),[]);return v.useEffect(()=>{s.current&&(!d.current&&n.leading?(d.current=!0,o(e)):(f(),c.current=setTimeout(()=>{d.current=!1,o(e)},t)))},[e,n.leading,t,f]),v.useEffect(()=>(s.current=!0,f),[f]),[r,f]}const EH=250;function TH(e,t,n){return Ik("searchOne",e,t)}function Yc(e,t,n){return Ik("searchResources",e,t)}function Ik(e,t,n,r){const o=Re(),[s,c]=v.useState(),[d,f]=v.useState(!0),[p,m]=v.useState(),[g,y]=v.useState(),b=o.fhirSearchUrl(t,n).toString(),[S]=CH(b,EH,{leading:!0});return v.useEffect(()=>{S!==s&&(c(S),o[e](t,n).then(j=>{f(!1),m(j),y(E8)}).catch(j=>{f(!1),m(void 0),y(Xt(j))}))},[o,e,t,n,s,S]),[p,d,g]}function RH(e){const t=e.value;return t?a.jsx(a.Fragment,{children:sk(t)}):null}const zk=["meta","implicitRules","contained","extension","modifierExtension"],$k=["language","text"],mn=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});mn.displayName="ElementsContext";const jS=["extension","modifierExtension"],_H=["id",...zk].filter(e=>!jS.includes(e));function AH(e){return Object.entries(e).filter(([n,r])=>!Nn(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||jS.includes(n)&&!Nn(r.slicing?.slices)||_H.includes(n)?!1:!($k.includes(n)&&r.path.split(".").length===2||n.includes(".")))}function ZT(e,t){return e.line&&e.line.length>t?e.line[t]:""}function eR(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:oB(r)}}function DH(e){const[t,n]=v.useState(e.defaultValue||{}),r=v.useRef(t);r.current=t;const{getExtendedProps:o}=v.useContext(mn),[s,c,d,f,p,m,g]=v.useMemo(()=>["use","type","line1","line2","city","state","postalCode"].map(_=>o(e.path+"."+_)),[o,e.path]);function y(_){n(_),e.onChange&&e.onChange(_)}function b(_){y({...r.current,use:_})}function S(_){y({...r.current,type:_})}function j(_){y(eR(r.current||{},0,_))}function C(_){y(eR(r.current||{},1,_))}function E(_){y({...r.current,city:_})}function R(_){y({...r.current,state:_})}function T(_){y({...r.current,postalCode:_})}return a.jsxs(ye,{gap:"xs",wrap:"nowrap",grow:!0,children:[a.jsx(hn,{disabled:e.disabled||s?.readonly,"data-testid":"address-use",defaultValue:t.use,onChange:_=>b(_.currentTarget.value),data:["","home","work","temp","old","billing"]}),a.jsx(hn,{disabled:e.disabled||c?.readonly,"data-testid":"address-type",defaultValue:t.type,onChange:_=>S(_.currentTarget.value),data:["","postal","physical","both"]}),a.jsx(He,{disabled:e.disabled||d?.readonly,placeholder:"Line 1",defaultValue:ZT(t,0),onChange:_=>j(_.currentTarget.value)}),a.jsx(He,{disabled:e.disabled||f?.readonly,placeholder:"Line 2",defaultValue:ZT(t,1),onChange:_=>C(_.currentTarget.value)}),a.jsx(He,{disabled:e.disabled||p?.readonly,placeholder:"City",defaultValue:t.city,onChange:_=>E(_.currentTarget.value)}),a.jsx(He,{disabled:e.disabled||m?.readonly,placeholder:"State",defaultValue:t.state,onChange:_=>R(_.currentTarget.value)}),a.jsx(He,{disabled:e.disabled||g?.readonly,placeholder:"Postal Code",defaultValue:t.postalCode,onChange:_=>T(_.currentTarget.value)})]})}function kH(e){const t=hf(),[n,r]=v.useState(e.defaultValue||{});function o(s){const c=s?{text:s,authorReference:t&&Yt(t),time:new Date().toISOString()}:{};r(c),e.onChange&&e.onChange(c)}return a.jsx(He,{disabled:e.disabled,name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:s=>o(s.currentTarget.value)})}var PH={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"}};const Fe=(e,t,n,r)=>{const o=v.forwardRef(({color:s="currentColor",size:c=24,stroke:d=2,title:f,className:p,children:m,...g},y)=>v.createElement("svg",{ref:y,...PH[e],width:c,height:c,className:["tabler-icon",`tabler-icon-${t}`,p].join(" "),...e==="filled"?{fill:s}:{strokeWidth:d,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 o.displayName=`${n}`,o};const NH=[["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"}]],OH=Fe("outline","adjustments-horizontal","AdjustmentsHorizontal",NH);const MH=[["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"}]],Ts=Fe("outline","alert-circle","AlertCircle",MH);const LH=[["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"}]],IH=Fe("outline","arrow-down","ArrowDown",LH);const zH=[["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"}]],$H=Fe("outline","arrow-up","ArrowUp",zH);const UH=[["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"}]],BH=Fe("outline","bleach-off","BleachOff",UH);const VH=[["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"}]],FH=Fe("outline","bleach","Bleach",VH);const HH=[["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"}]],qH=Fe("outline","box-multiple","BoxMultiple",HH);const GH=[["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"}]],QH=Fe("outline","brackets-contain","BracketsContain",GH);const WH=[["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"}]],YH=Fe("outline","brand-asana","BrandAsana",WH);const KH=[["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"}]],XH=Fe("outline","bucket-off","BucketOff",KH);const JH=[["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"}]],ZH=Fe("outline","bucket","Bucket",JH);const eq=[["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"}]],tq=Fe("outline","building","Building",eq);const nq=[["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"}]],rs=Fe("outline","calendar","Calendar",nq);const rq=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],Fo=Fe("outline","check","Check",rq);const iq=[["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"}]],oq=Fe("outline","checkbox","Checkbox",iq);const aq=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],CS=Fe("outline","chevron-down","ChevronDown",aq);const sq=[["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"}]],lq=Fe("outline","circle-check","CircleCheck",sq);const cq=[["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"}]],Mp=Fe("outline","circle-minus","CircleMinus",cq);const uq=[["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"}]],Lp=Fe("outline","circle-plus","CirclePlus",uq);const dq=[["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"}]],ES=Fe("outline","cloud-upload","CloudUpload",dq);const fq=[["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"}]],hq=Fe("outline","columns","Columns",fq);const pq=[["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"}]],TS=Fe("outline","copy","Copy",pq);const mq=[["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"}]],gq=Fe("outline","currency-dollar","CurrencyDollar",mq);const vq=[["path",{d:"M12 6m-8 0a8 3 0 1 0 16 0a8 3 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 6v6a8 3 0 0 0 16 0v-6",key:"svg-1"}],["path",{d:"M4 12v6a8 3 0 0 0 16 0v-6",key:"svg-2"}]],yq=Fe("outline","database","Database",vq);const xq=[["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"}]],bq=Fe("outline","device-floppy","DeviceFloppy",xq);const Sq=[["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"}]],wq=Fe("outline","dots","Dots",Sq);const jq=[["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"}]],Uk=Fe("outline","edit","Edit",jq);const Cq=[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}],["path",{d:"M5 19l14 -14",key:"svg-2"}]],pf=Fe("outline","equal-not","EqualNot",Cq);const Eq=[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]],mf=Fe("outline","equal","Equal",Eq);const Tq=[["path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828",key:"svg-0"}],["path",{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]],Rq=Fe("outline","eye-off","EyeOff",Tq);const _q=[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",key:"svg-1"}]],Aq=Fe("outline","eye","Eye",_q);const Dq=[["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"}]],tR=Fe("outline","file-alert","FileAlert",Dq);const kq=[["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"}]],Pq=Fe("outline","file-plus","FilePlus",kq);const Nq=[["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"}]],Oq=Fe("outline","filter","Filter",Nq);const Mq=[["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"}]],Lq=Fe("outline","forms","Forms",Mq);const Iq=[["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"}]],zq=Fe("outline","id","Id",Iq);const $q=[["path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M9 4l0 16",key:"svg-1"}]],Uq=Fe("outline","layout-sidebar","LayoutSidebar",$q);const Bq=[["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"}]],nR=Fe("outline","list-details","ListDetails",Bq);const Vq=[["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"}]],Fq=Fe("outline","lock-access","LockAccess",Vq);const Hq=[["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"}]],qq=Fe("outline","lock","Lock",Hq);const Gq=[["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"}]],Qq=Fe("outline","logout","Logout",Gq);const Wq=[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]],Bk=Fe("outline","math-greater","MathGreater",Wq);const Yq=[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]],Vk=Fe("outline","math-lower","MathLower",Yq);const Kq=[["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"}]],Xq=Fe("outline","message","Message",Kq);const Jq=[["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"}]],Zq=Fe("outline","microscope","Microscope",Jq);const eG=[["path",{d:"M5 12l14 0",key:"svg-0"}]],tG=Fe("outline","minus","Minus",eG);const nG=[["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"}]],rG=Fe("outline","packages","Packages",nG);const iG=[["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"}]],oG=Fe("outline","pin","Pin",iG);const aG=[["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"}]],sG=Fe("outline","pinned-off","PinnedOff",aG);const lG=[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]],cG=Fe("outline","player-play","PlayerPlay",lG);const uG=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],Fk=Fe("outline","plus","Plus",uG);const dG=[["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"}]],fG=Fe("outline","receipt","Receipt",dG);const hG=[["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"}]],Hk=Fe("outline","refresh","Refresh",hG);const pG=[["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"}]],mG=Fe("outline","repeat","Repeat",pG);const gG=[["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"}]],vG=Fe("outline","report-medical","ReportMedical",gG);const yG=[["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"}]],xG=Fe("outline","router","Router",yG);const bG=[["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"}]],RS=Fe("outline","search","Search",bG);const SG=[["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"}]],Wx=Fe("outline","settings","Settings",SG);const wG=[["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"}]],_S=Fe("outline","sort-ascending","SortAscending",wG);const jG=[["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"}]],AS=Fe("outline","sort-descending","SortDescending",jG);const CG=[["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"}]],EG=Fe("outline","square","Square",CG);const TG=[["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"}]],RG=Fe("outline","star","Star",TG);const _G=[["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"}]],AG=Fe("outline","switch-horizontal","SwitchHorizontal",_G);const DG=[["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"}]],kG=Fe("outline","table-export","TableExport",DG);const PG=[["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"}]],NG=Fe("outline","text-recognition","TextRecognition",PG);const OG=[["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"}]],Wm=Fe("outline","trash","Trash",OG);const MG=[["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"}]],rR=Fe("outline","upload","Upload",MG);const LG=[["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"}]],IG=Fe("outline","webhook","Webhook",LG);const zG=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],vl=Fe("outline","x","X",zG);const $G=[["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"}]],UG=Fe("filled","circle-filled","CircleFilled",$G);class DS extends v.Component{state;constructor(t){super(t),this.state={lastLocation:Zn.getLocation()}}static getDerivedStateFromError(t){return{error:t,lastLocation:Zn.getLocation()}}componentDidUpdate(t,n){Zn.getLocation()!==this.state.lastLocation&&this.setState({lastLocation:Zn.getLocation(),error:void 0})}shouldComponentUpdate(t,n){return!!(this.props.children!==t.children||n.error&&!this.state.error||this.state.lastLocation!==Zn.getLocation())}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.error?a.jsx(Uo,{icon:a.jsx(Ts,{size:16}),title:"Something went wrong",color:"red",children:Qe(this.state.error)}):this.props.children}}function Oi(){return a.jsx(hr,{style:{width:"100%",height:"100vh"},children:a.jsx(jr,{})})}const BG="_main_6f7o5_1",VG={main:BG};function yn(e){e.preventDefault(),e.stopPropagation()}function kS(e){return e.button===1||e.ctrlKey||e.metaKey}function qk(e){if(iR(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&iR(t[0]))return!0}return!1}function iR(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}async function Sd(e,t){return new Promise((n,r)=>{const o=new MessageChannel;o.port1.onmessage=({data:s})=>{o.port1.close(),s.error?r(s.error):n(s.result)},e.contentWindow?.postMessage(t,new URL(e.src).origin,[o.port2])})}function Gk(e,t){const n=new Blob([e],{type:rn.JSON}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r;const s=t??new Date().toISOString().replaceAll(/\D/g,"");o.download=`${s}.json`,document.body.appendChild(o),o.click(),URL.revokeObjectURL(r)}function yt(e){const t=du(),{to:n,suffix:r,label:o,onClick:s,children:c,...d}=e;let f=FG(n);return r&&(f+="/"+r),a.jsx(Nt,{href:f,"aria-label":o,onAuxClick:p=>{p.stopPropagation()},onClick:p=>{p.stopPropagation(),s?(p.preventDefault(),s(p)):n&&(kS(p)||(p.preventDefault(),t(f)))},...d,children:c})}function FG(e){if(e){if(typeof e=="string")return HG(e);if(Vo(e))return qG(e);if(_a(e))return GG(e)}return"#"}function HG(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function qG(e){return`/${e.resourceType}/${e.id}`}function GG(e){return`/${e.reference}`}function QG(e){const t=e.split(" ").filter(Boolean);return t.length>1?t[0][0]+t.at(-1)?.at(0):t.length===1?t[0][0]:""}function Aa(e){const t=Jt(e.value),n=t?ba(t):e.alt??"",r=QG(n),o=(t&&tB(t))??e.src,s=Ak(o??void 0),c=e.radius??"xl",d={...e,value:void 0,link:void 0};return e.link?a.jsx(yt,{to:t,children:a.jsx(fl,{src:s,alt:n,radius:c,...d,children:r})}):a.jsx(fl,{src:s,alt:n,radius:c,...d,children:r})}const WG="_logoButton_799cf_1",YG="_user_799cf_11",KG="_userName_799cf_25",ex={logoButton:WG,user:YG,userName:KG};function PS(e){const t=e.value;return t?a.jsx(a.Fragment,{children:Cs(t,e.options)}):null}function Qk(){return"Medplum"}function Wk(e){const t=Qm(),{medplum:n,profile:r,navigate:o}=t,s=n.getLogins(),{colorScheme:c,setColorScheme:d}=h5(),[f]=v.useState(localStorage.appShellLayoutVersion??"v1");function p(m){localStorage.appShellLayoutVersion=m,Zn.reload()}return a.jsxs(a.Fragment,{children:[a.jsxs(Be,{align:"center",p:"xl",children:[a.jsx(Aa,{size:"xl",radius:100,value:t.profile}),a.jsx(PS,{value:t.profile?.name?.[0]}),a.jsx(Ee,{c:"dimmed",size:"xs",children:n.getActiveLogin()?.project.display})]}),s.length>1&&a.jsx(be.Divider,{}),s.map(m=>m.profile.reference!==Mt(t.profile)&&a.jsx(be.Item,{onClick:()=>{n.setActiveLogin(m).then(()=>Zn.reload()).catch(console.log)},children:a.jsxs(ye,{children:[a.jsx(fl,{radius:"xl"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(Ee,{size:"sm",fw:500,children:m.profile.display}),a.jsx(Ee,{c:"dimmed",size:"xs",children:m.project.display})]})]})},m.profile.reference)),a.jsx(be.Divider,{}),a.jsxs(ye,{justify:"center",children:[a.jsx(qc,{size:"xs",value:c,onChange:m=>d(m),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]}),a.jsx(qc,{size:"xs",value:f,onChange:m=>p(m),data:[{label:"v1",value:"v1"},{label:"v2",value:"v2"}]})]}),a.jsx(be.Divider,{}),a.jsx(be.Item,{leftSection:a.jsx(AG,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Add another account"}),a.jsx(be.Item,{leftSection:a.jsx(Wx,{size:14,stroke:1.5}),onClick:()=>o(`/${Mt(r)}`),children:"Account settings"}),a.jsx(be.Item,{leftSection:a.jsx(Qq,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),o("/signin")},children:"Sign out"}),a.jsxs(Ee,{size:"xs",c:"dimmed",my:"sm",ta:"center",children:[Qk()," ",e.version]})]})}const oR={selectedItems:"selected-items",options:"options"};function NS(e){const t=Tl({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:o,error:s,defaultValue:c,toOption:d,loadOptions:f,itemComponent:p,pillComponent:m,emptyComponent:g,onChange:y,onCreate:b,creatable:S,clearable:j,required:C,placeholder:E,leftSection:R,maxValues:T,optionsDropdownMaxHeight:_=320,minInputLength:k=0,...L}=e,A=L.disabled,N=XG(c),[z,B]=v.useState(""),[G,Y]=v.useState(),[J,U]=v.useState(),[W,O]=v.useState(),[I,$]=v.useState(N.map(d)),[H,K]=v.useState([]),M=p??JG,F=m??ZG,ae=g??eQ,de=v.useRef(z);de.current=z;const xe=v.useRef(void 0),Se=v.useRef(void 0),Ce=v.useRef(G);Ce.current=G;const Ke=v.useRef(J);Ke.current=J;const Ae=v.useRef(W);Ae.current=W;const dt=v.useRef(H);dt.current=H;const Ct=v.useCallback(()=>{if(Y(void 0),de.current===Se.current&&f===xe.current||(de.current?.length??0)<k)return;Se.current=de.current,xe.current=f;const Me=new AbortController;U(Me),f(de.current??"",Me.signal).then(lt=>{Me.signal.aborted||(K(lt.map(d)),Ae.current?(lt.length>0&&y(lt.slice(0,1)),O(!1)):lt.length>0&&t.openDropdown())}).catch(lt=>{Me.signal.aborted||lt.message.includes("aborted")||Ne({color:"red",message:Qe(lt)})}).finally(()=>{Me.signal.aborted||U(void 0)})},[t,f,y,d,k]),ot=v.useCallback(Me=>{(H&&H.length>0||S)&&t.openDropdown(),t.updateSelectedOptionIndex(),B(Me.currentTarget.value),Ke.current&&(Ke.current.abort(),U(void 0)),Ce.current!==void 0&&window.clearTimeout(Ce.current);const lt=window.setTimeout(()=>Ct(),100);Y(lt)},[t,H,S,Ct]),it=v.useCallback(Me=>{const lt=I.some(pe=>pe.value===Me),nt=lt?I.filter(pe=>pe.value!==Me):[...I];let ft=H?.find(pe=>pe.value===Me);if(!ft&&S!==!1&&b){const pe=b(Me);ft=d(pe)}if(ft){if(T===0){y([ft.resource]),I.length>0&&$([]);return}lt||nt.push(ft)}if(T!==void 0)for(;nt.length>T;)nt.shift();y(nt.map(pe=>pe.resource)),$(nt)},[S,H,I,T,y,b,d]),pt=v.useMemo(()=>{if(!A)return Me=>{A||(T===1&&(B(""),K([]),t.closeDropdown()),Se.current=void 0,Me==="$create"?(B(""),it(z)):it(Me))}},[it,t,A,T,z]),Et=v.useCallback(Me=>{const lt=I.filter(nt=>nt.value!==Me.value);y(lt.map(nt=>nt.resource)),$(lt)},[I,y]),wt=v.useCallback(Me=>{Me.key==="Enter"?(G||J)&&O(!0):Me.key==="Backspace"&&z.length===0&&(yn(Me),Et(I[I.length-1]))},[J,Et,z.length,I,G]);v.useEffect(()=>()=>{Ke.current&&Ke.current.abort()},[]);const Te=!A&&j&&I.length>0&&a.jsx(Ye.ClearButton,{title:"Clear all",size:"sm",onClear:()=>{B(""),$([]),y([]),t.closeDropdown()}}),_e=S&&z.trim().length>0,Le=H.length>0||_e;return a.jsxs(Ye,{store:t,onOptionSubmit:pt,withinPortal:!0,shadow:"xl",...L,children:[a.jsx(Ye.DropdownTarget,{children:a.jsx(ms,{label:r,description:o,error:s,className:e.className,leftSection:R,rightSection:J?a.jsx(jr,{size:16}):Te,required:C,disabled:A,children:a.jsxs(ya.Group,{"data-testid":oR.selectedItems,children:[I.map(Me=>a.jsx(F,{item:Me,disabled:A,onRemove:()=>Et(Me)},Me.value)),!A&&(T===void 0||T===0||I.length<T)&&a.jsx(Ye.EventsTarget,{children:a.jsx(ms.Field,{role:"searchbox",name:n,value:z,placeholder:E,onFocus:ot,onBlur:()=>{t.closeDropdown(),B("")},onKeyDown:wt,onChange:ot})})]})})}),a.jsx(Ye.Dropdown,{hidden:!Le,"data-testid":oR.options,children:a.jsx(Ye.Options,{children:a.jsxs(um,{type:"scroll",mah:_,children:[H.map(Me=>{const lt=I.some(nt=>nt.value===Me.value);return a.jsx(Ye.Option,{value:Me.value,active:lt,children:a.jsx(M,{...Me,active:lt})},Me.value)}),_e&&a.jsxs(Ye.Option,{value:"$create",children:["+ Create ",z]}),!S&&z.trim().length>0&&H.length===0&&a.jsx(ae,{search:z})]})})})]})}function XG(e){return e?Array.isArray(e)?e:[e]:[]}function JG(e){return a.jsxs(ye,{gap:"xs",children:[e.active&&a.jsx(Fo,{size:12}),a.jsx("span",{children:e.label})]})}function ZG({item:e,disabled:t,onRemove:n}){return a.jsx(ya,{withRemoveButton:!t,onRemove:n,children:e.label})}function eQ(){return a.jsx(Ye.Empty,{children:"Nothing found"})}const tQ="_searchInput_dick8_1",nQ={searchInput:tQ};function rQ(e){return{value:e.id,label:ba(e),resource:e}}function iQ(e){const t=du(),n=Re(),r=v.useCallback(async(s,c)=>{const d=aQ(s),f={signal:c},p=await n.graphql(d,void 0,void 0,f);return sQ(p,s)},[n]),o=v.useCallback(s=>{s.length>0&&t(`/${Mt(s[0])}`)},[t]);return a.jsx(NS,{size:"sm",radius:"md",className:nQ.searchInput,leftSection:a.jsx(RS,{size:16}),placeholder:"Search",itemComponent:oQ,toOption:rQ,onChange:o,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const oQ=v.forwardRef(({resource:e,active:t,...n},r)=>{let o;return e.resourceType==="Patient"?o=e.birthDate:e.resourceType==="ServiceRequest"&&(o=e.subject?.display),a.jsx("div",{ref:r,...n,children:a.jsxs(ye,{wrap:"nowrap",children:[a.jsx(Aa,{value:e}),a.jsxs("div",{children:[a.jsx(Ee,{children:ba(e)}),a.jsx(Ee,{size:"xs",c:"dimmed",children:o})]})]})})});function aQ(e){const t=JSON.stringify(e);return aS(e)?`{
|
|
100
|
+
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
101
|
+
resourceType
|
|
102
|
+
id
|
|
103
|
+
identifier {
|
|
104
|
+
system
|
|
105
|
+
value
|
|
106
|
+
}
|
|
107
|
+
name {
|
|
108
|
+
given
|
|
109
|
+
family
|
|
110
|
+
}
|
|
111
|
+
birthDate
|
|
112
|
+
}
|
|
113
|
+
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
114
|
+
resourceType
|
|
115
|
+
id
|
|
116
|
+
identifier {
|
|
117
|
+
system
|
|
118
|
+
value
|
|
119
|
+
}
|
|
120
|
+
subject {
|
|
121
|
+
display
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}`.replaceAll(/\s+/g," "):`{
|
|
125
|
+
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
126
|
+
resourceType
|
|
127
|
+
id
|
|
128
|
+
identifier {
|
|
129
|
+
system
|
|
130
|
+
value
|
|
131
|
+
}
|
|
132
|
+
name {
|
|
133
|
+
given
|
|
134
|
+
family
|
|
135
|
+
}
|
|
136
|
+
birthDate
|
|
137
|
+
}
|
|
138
|
+
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
139
|
+
resourceType
|
|
140
|
+
id
|
|
141
|
+
identifier {
|
|
142
|
+
system
|
|
143
|
+
value
|
|
144
|
+
}
|
|
145
|
+
name {
|
|
146
|
+
given
|
|
147
|
+
family
|
|
148
|
+
}
|
|
149
|
+
birthDate
|
|
150
|
+
}
|
|
151
|
+
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
152
|
+
resourceType
|
|
153
|
+
id
|
|
154
|
+
identifier {
|
|
155
|
+
system
|
|
156
|
+
value
|
|
157
|
+
}
|
|
158
|
+
subject {
|
|
159
|
+
display
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}`.replaceAll(/\s+/g," ")}function sQ(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),cQ(lQ(n),t).slice(0,5)}function lQ(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 cQ(e,t){return e.sort((n,r)=>aR(r,t)-aR(n,t))}function aR(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,sR(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,sR(Cs(r),t));return n}function sR(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function uQ(e){const t=hf(),[n,r]=v.useState(!1);return a.jsx(Sr.Header,{p:8,style:{zIndex:101},children:a.jsxs(ye,{justify:"space-between",children:[a.jsxs(ye,{gap:"xs",children:[a.jsx(In,{className:ex.logoButton,"aria-expanded":e.navbarOpen,"aria-controls":"navbar",onClick:()=>e.navbarToggle(),children:e.logo}),!e.headerSearchDisabled&&a.jsx(iQ,{pathname:e.pathname,searchParams:e.searchParams})]}),a.jsxs(ye,{gap:"lg",pr:"sm",children:[e.notifications,a.jsxs(be,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"fade-down"},opened:n,onClose:()=>r(!1),children:[a.jsx(be.Target,{children:a.jsx(In,{className:ex.user,"aria-label":"User menu","data-active":n||void 0,onClick:()=>r(o=>!o),children:a.jsxs(ye,{gap:7,children:[a.jsx(Aa,{value:t,radius:"xl",size:24}),a.jsx(Ee,{size:"sm",className:ex.userName,children:Cs(t?.name?.[0])}),a.jsx(CS,{size:12,stroke:1.5})]})})}),a.jsx(be.Dropdown,{children:a.jsx(Wk,{version:e.version})})]})]})]})})}const dQ=()=>RD({opened:!1,empty:!1,selected:-1,listId:"",query:"",registeredActions:new Set}),fQ=e=>_D(e);function Kc(e,t){const n=t.getState();t.setState({...n,...e(t.getState())})}function Yk(e){Kc(()=>({opened:!0,selected:-1}),e)}function Kk(e){Kc(()=>({opened:!1}),e)}function Xk(e){Kc(t=>({opened:!t.opened,selected:t.opened?t.selected:-1}),e)}function Jk(e,t){t.updateState(n=>({...n,selected:e}))}function hQ(e,t){t.updateState(n=>({...n,listId:e}))}function Ip(e,t=document){const n=t.querySelector(e);if(n)return n;const r=t instanceof ShadowRoot?t.host.children:t.children;for(let o=0;o<r.length;o+=1){const s=r[o];if(s.shadowRoot){const d=Ip(e,s.shadowRoot);if(d)return d}const c=Ip(e,s);if(c)return c}return null}function Ym(e,t){const n=t.getState(),r=n.listId?Ip(`#${n.listId}`):null,o=r?.querySelector("[data-selected]"),s=r?.querySelectorAll("[data-action]")??[],c=e===-1?s.length-1:e===s.length?0:e,d=xd(c,0,s.length-1);return o?.removeAttribute("data-selected"),s[d]?.scrollIntoView({block:"nearest"}),s[d]?.setAttribute("data-selected","true"),Jk(d,t),d}function pQ(e){return Ym(e.getState().selected+1,e)}function mQ(e){return Ym(e.getState().selected-1,e)}function gQ(e){const t=e.getState();Ip(`#${t.listId} [data-selected]`)?.click()}function vQ(e,t){const n=t.getState();return n.registeredActions.add(e),()=>{n.registeredActions.delete(e)}}function yQ(e,t){Kc(()=>({query:e}),t),Promise.resolve().then(()=>{Ym(0,t),Kc(n=>({empty:n.query.trim().length>0&&n.registeredActions.size===0||!1}),t)})}function xQ({clearQuery:e},t){t.updateState(n=>({...n,selected:-1,query:e?"":n.query,empty:e?!1:n.empty}))}const Ro={open:Yk,close:Kk,toggle:Xk,updateState:Kc,setSelectedAction:Jk,setListId:hQ,selectAction:Ym,selectNextAction:pQ,selectPreviousAction:mQ,triggerSelectedAction:gQ,registerAction:vQ,setQuery:yQ,clearSpotlightState:xQ};function bQ(){const e=dQ();return[e,{open:()=>Yk(e),close:()=>Kk(e),toggle:()=>Xk(e)}]}const[Zk,gf]=bQ(),{open:doe,close:foe,toggle:hoe}=gf;function eP(e){const t=e;return t.group!==void 0&&Array.isArray(t.actions)}function SQ(e){return Array.isArray(e)?e.map(t=>t.trim()).join(",").toLowerCase().trim():typeof e=="string"?e.toLowerCase().trim():""}function wQ(e){return e.reduce((t,n)=>"actions"in n?[...t,...n.actions.map(r=>({...r,group:n.group}))]:[...t,n],[])}function jQ(e){const t={},n=[];return e.forEach(r=>{r.group?(t[r.group]||(t[r.group]={pushed:!1,data:{group:r.group,actions:[]}}),t[r.group].data.actions.push(r),t[r.group].pushed||(t[r.group].pushed=!0,n.push(t[r.group].data))):n.push(r)}),n}const CQ=(e,t)=>{const n=e.trim().toLowerCase(),r=[[],[]];return wQ(t).forEach(s=>{s.label?.toLowerCase().includes(n)?r[0].push(s):(s.description?.toLowerCase().includes(n)||SQ(s.keywords).includes(n))&&r[1].push(s)}),jQ(r.flat())};function tP(e,t){if(!Array.isArray(e))return[];let n=0;return e.reduce((r,o)=>{if(n>=t)return r;if(eP(o)){const s=tP(o.actions,t-n);r.push({group:o.group,actions:s}),n+=s.length}else r.push(o),n+=1;return r},[])}const[EQ,fu]=Er("Spotlight component was not found in tree");var Mo={root:"m_d2b315db",content:"m_3cd250e0",body:"m_d2abce9b",search:"m_f366a061",actionsList:"m_6e463822",action:"m_d49bb8ef",actionBody:"m_3d475731",actionSection:"m_832642f6",actionLabel:"m_6c2a1345",actionDescription:"m_a6d9d78d",empty:"m_82f78f74",footer:"m_ddcaf054",actionsGroup:"m_5a3e5f7b"};const TQ={dimmedSections:!0,highlightQuery:!1},zd=ge((e,t)=>{const n=oe("SpotlightAction",TQ,e),{className:r,style:o,classNames:s,styles:c,id:d,description:f,label:p,leftSection:m,rightSection:g,children:y,dimmedSections:b,highlightQuery:S,highlightColor:j,closeSpotlightOnTrigger:C,onClick:E,onMouseDown:R,keywords:T,vars:_,...k}=n,L=fu(),A={classNames:s,styles:c},N=S&&typeof p=="string"?a.jsx(S0,{component:"span",highlight:L.query,color:j,...L.getStyles("actionLabel",A),children:p}):a.jsx("span",{...L.getStyles("actionLabel",A),children:p});return a.jsx(In,{ref:t,"data-action":!0,...L.getStyles("action",{className:r,style:o,...A}),...k,onMouseDown:z=>{z.preventDefault(),R?.(z)},onClick:z=>{E?.(z),(C??L.closeOnActionTrigger)&&Ro.close(L.store)},tabIndex:-1,children:y||a.jsxs(a.Fragment,{children:[m&&a.jsx(ce,{component:"span",mod:{position:"left",dimmed:b},...L.getStyles("actionSection",A),children:m}),a.jsxs("span",{...L.getStyles("actionBody",A),children:[N,a.jsx("span",{...L.getStyles("actionDescription",A),children:f})]}),g&&a.jsx(ce,{component:"span",mod:{position:"right",dimmed:b},...L.getStyles("actionSection",A),children:g})]})})});zd.classes=Mo;zd.displayName="@mantine/spotlight/SpotlightAction";const Km=ge((e,t)=>{const{className:n,style:r,styles:o,classNames:s,label:c,children:d,...f}=oe("SpotlightActionsGroup",null,e),p=fu();return a.jsx(ce,{...p.getStyles("actionsGroup",{className:n,style:r,classNames:s,styles:o}),ref:t,...f,__vars:{"--spotlight-label":`'${c?.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`},children:d})});Km.classes=Mo;Km.displayName="@mantine/core/SpotlightActionsGroup";const Xm=ge((e,t)=>{const{className:n,style:r,id:o,children:s,vars:c,classNames:d,styles:f,...p}=oe("SpotlightActionsList",null,e),m=fu(),g=`mantine-${v.useId().replace(/:/g,"")}`,y=o||g;return v.useEffect(()=>(Ro.setListId(y,m.store),()=>Ro.setListId("",m.store)),[]),a.jsx(Yr.Autosize,{...m.getStyles("actionsList",{className:n,style:r,classNames:d,styles:f}),ref:t,type:"scroll",scrollbarSize:"var(--spotlight-actions-list-padding)",offsetScrollbars:"y",id:y,...p,children:s})});Xm.classes=Mo;Xm.displayName="@mantine/spotlight/SpotlightActionsList";const Jm=ge((e,t)=>{const{className:n,style:r,classNames:o,styles:s,...c}=oe("SpotlightEmpty",null,e),d=fu();return a.jsx(ce,{ref:t,...d.getStyles("empty",{classNames:o,styles:s,className:n,style:r}),...c})});Jm.classes=Mo;Jm.displayName="@mantine/spotlight/SpotlightEmpty";const OS=ge((e,t)=>{const{className:n,style:r,classNames:o,styles:s,...c}=oe("SpotlightFooter",null,e),d=fu();return a.jsx(ce,{ref:t,...d.getStyles("footer",{className:n,classNames:o,style:r,styles:s}),...c})});OS.classes=Mo;OS.displayName="@mantine/spotlight/SpotlightFooter";function RQ(e,t){if(!e)return[];const n=()=>Ro.open(t);return Array.isArray(e)?e.map(r=>[r,n]):[[e,n]]}const _Q={size:600,yOffset:80,zIndex:Lr("max"),overlayProps:{backgroundOpacity:.35,blur:7},transitionProps:{duration:200,transition:"pop"},store:Zk,clearQueryOnClose:!0,closeOnActionTrigger:!0,shortcut:"mod + K",maxHeight:400},Zm=ge((e,t)=>{const n=oe("SpotlightRoot",_Q,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,store:p,children:m,query:g,onQueryChange:y,transitionProps:b,clearQueryOnClose:S,shortcut:j,tagsToIgnore:C,triggerOnContentEditable:E,disabled:R,onSpotlightOpen:T,onSpotlightClose:_,forceOpened:k,closeOnActionTrigger:L,maxHeight:A,scrollable:N,attributes:z,...B}=n,G=En(),{opened:Y,query:J}=fQ(p),U=typeof g=="string"?g:J,W=I=>{y?.(I),Ro.setQuery(I,p)},O=Ie({name:"Spotlight",classes:Mo,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:z});return b4(RQ(j,p),C,E),hs(()=>{Y?T?.():_?.()},[Y]),R?null:a.jsx(EQ,{value:{getStyles:O,query:U,setQuery:W,store:p,closeOnActionTrigger:L},children:a.jsx(Un,{ref:t,...B,withCloseButton:!1,opened:Y||!!k,padding:0,onClose:()=>Ro.close(p),className:o,style:s,classNames:qd({theme:G,classNames:[Mo,r],props:n,stylesCtx:void 0}),styles:Ed({theme:G,styles:c,props:n,stylesCtx:void 0}),transitionProps:{...b,onExited:()=>{S&&W(""),Ro.clearSpotlightState({clearQuery:S},p),b?.onExited?.()}},__vars:{"--spotlight-max-height":N?le(A):void 0},__staticSelector:"Spotlight","data-scrollable":N||void 0,children:m})})});Zm.classes=Mo;Zm.displayName="@mantine/spotlight/SpotlightRoot";const AQ={size:"lg"},eg=ge((e,t)=>{const{classNames:n,styles:r,onKeyDown:o,onChange:s,vars:c,value:d,...f}=oe("SpotlightSearch",AQ,e),p=fu(),m=p.getStyles("search"),[g,y]=v.useState(!1),b=S=>{o?.(S),!g&&(S.nativeEvent.code==="ArrowDown"&&(S.preventDefault(),Ro.selectNextAction(p.store)),S.nativeEvent.code==="ArrowUp"&&(S.preventDefault(),Ro.selectPreviousAction(p.store)),(S.nativeEvent.code==="Enter"||S.nativeEvent.code==="NumpadEnter")&&(S.preventDefault(),Ro.triggerSelectedAction(p.store)))};return a.jsx(pn,{ref:t,classNames:[{input:m.className},n],styles:[{input:m.style},r],...f,value:d??p.query,onChange:S=>{p.setQuery(S.currentTarget.value),s?.(S)},onKeyDown:b,onCompositionStart:()=>y(!0),onCompositionEnd:()=>y(!1)})});eg.classes=Mo;eg.displayName="@mantine/spotlight/SpotlightSearch";const DQ={size:600,yOffset:80,limit:1/0,zIndex:Lr("max"),overlayProps:{backgroundOpacity:.35,blur:7},transitionProps:{duration:200,transition:"pop"},store:Zk,filter:CQ,clearQueryOnClose:!0,closeOnActionTrigger:!0,shortcut:"mod + K"},pi=ge((e,t)=>{const n=oe("Spotlight",DQ,e),{searchProps:r,filter:o,query:s,onQueryChange:c,actions:d,nothingFound:f,highlightQuery:p,limit:m,scrollAreaProps:g,...y}=n,[b,S]=tr({value:s,defaultValue:"",finalValue:"",onChange:c}),j=tP(o(b,d),m).map(C=>{if(eP(C)){const E=C.actions.map(({id:R,...T})=>a.jsx(zd,{highlightQuery:p,...T},R));return a.jsx(Km,{label:C.group,children:E},C.group)}return a.jsx(zd,{highlightQuery:p,...C},C.id)});return a.jsxs(Zm,{...y,query:b,onQueryChange:S,ref:t,children:[a.jsx(eg,{...r}),a.jsxs(Xm,{...g,children:[j,j.length===0&&f&&a.jsx(Jm,{children:f})]})]})});pi.classes=Mo;pi.displayName="@mantine/spotlight/Spotlight";pi.Search=eg;pi.ActionsList=Xm;pi.Action=zd;pi.Empty=Jm;pi.ActionsGroup=Km;pi.Footer=OS;pi.Root=Zm;pi.open=gf.open;pi.close=gf.close;pi.toggle=gf.toggle;const MS=v.createContext({submitting:!1});MS.displayName="FormContext";function kQ(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?PQ(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&NQ(t,n);return t}function PQ(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function NQ(e,t){e[t.name]=t.value}function ht(e){const[t,n]=v.useState(!1);return a.jsx(MS.Provider,{value:{submitting:t},children:a.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:r=>{r.preventDefault();const o=kQ(r.target);if(e.onSubmit){n(!0);const s=e.onSubmit(o);s?.then?s.catch(console.error).finally(()=>{n(!1)}):n(!1)}},children:e.children})})}function Tr(e){const{children:t,...n}=e,{submitting:r}=v.useContext(MS);return a.jsx(Pe,{type:"submit",loading:r,...n,children:t})}function OQ(e){const t=Re(),n=t.getUserConfiguration();function r(o){const{menuname:s,bookmarkname:c}=o,d=`${e.pathname}?${e.searchParams.toString()}`,f=hi(n);f.menu?.find(({title:m})=>m===s)?.link?.push({name:c,target:d}),t.updateResource(f).then(m=>{n.menu=m.menu,t.dispatchEvent({type:"change"}),Ne({color:"green",message:"Success"}),e.onOk()}).catch(m=>{Ne({color:"red",message:Qe(m)})})}return a.jsx(Un,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:a.jsx(ht,{onSubmit:r,children:a.jsxs(Be,{children:[a.jsx(MQ,{config:n}),a.jsx(He,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),a.jsx(ye,{justify:"flex-end",children:a.jsx(Tr,{mt:"sm",children:"OK"})})]})})})}function MQ(e){function t(r){return r?.menu?.map(o=>o.title)}const n=t(e.config);return a.jsx(hn,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function nP(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function LQ(e){return typeof e.display=="string"?e.display:nP(e)}function IQ(e){return{value:nP(e),label:LQ(e),resource:e}}function zQ(e){return{code:e,display:e}}function vf(e){const t=Re(),{binding:n,creatable:r,clearable:o,expandParams:s,withHelpText:c,...d}=e,f=v.useCallback(async(p,m)=>{if(!n)return[];const y=(await t.valueSetExpand({...s,url:n,filter:p,count:10},{signal:m})).expansion?.contains??[],b=[];for(const S of y)S.code&&!b.some(j=>j.code===S.code)&&b.push(S);return b},[t,s,n]);return a.jsx(NS,{...d,creatable:r??!0,clearable:o??!0,toOption:IQ,loadOptions:f,onCreate:zQ,itemComponent:c?$Q:void 0})}const $Q=v.forwardRef(({label:e,resource:t,active:n,...r},o)=>a.jsx("div",{ref:o,...r,children:a.jsxs(ye,{wrap:"nowrap",gap:"xs",children:[n&&a.jsx(Fo,{size:12}),a.jsxs("div",{children:[a.jsx(Ee,{children:e}),a.jsx(Ee,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})]})}));function rP(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[s,c]=v.useState(t);function d(f){const p=f[0],m=BQ(p);c(m),n&&n(m)}return a.jsx(vf,{defaultValue:UQ(s),onChange:d,withHelpText:r??!0,...o})}function UQ(e){return e?{code:e}:void 0}function BQ(e){return e?.code}function LS(e){const[t,n]=v.useState(e.defaultValue),r=e.onChange,o=v.useCallback(s=>{n(s),r&&r(s)},[r]);return a.jsx(rP,{disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":e.testId,defaultValue:t,onChange:o,name:e.name,placeholder:e.placeholder,binding:"https://medplum.com/fhir/ValueSet/resource-types",creatable:!1,maxValues:e.maxValues??1,clearable:!1,withHelpText:!1})}const VQ="_navbar_1nbn5_1",FQ="_logoButton_1nbn5_6",HQ="_menuTitle_1nbn5_17",qQ="_link_1nbn5_29",GQ="_toggleButton_1nbn5_78",Zs={navbar:VQ,logoButton:FQ,menuTitle:HQ,link:qQ,toggleButton:GQ};function QQ(){const e=Re(),t=du(),[n,r]=v.useState("Type to search..."),[o,s]=v.useState([]),c=d=>{if(!d){r("Type to search..."),s([]);return}r("Searching...");const f=WQ(d);e.graphql(f).then(p=>{const m=YQ(p),g=XQ(m,t);s(g)}).catch(p=>{console.error("GraphQL query failed:",p)}).finally(()=>{r("No results found")})};return a.jsx(pi,{actions:o,nothingFound:n,highlightQuery:!0,searchProps:{leftSection:a.jsx(RS,{size:20,stroke:1.5}),placeholder:"Search..."},onQueryChange:c})}function WQ(e){const t=JSON.stringify(e);return aS(e)?`{
|
|
163
|
+
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
164
|
+
resourceType
|
|
165
|
+
id
|
|
166
|
+
identifier {
|
|
167
|
+
system
|
|
168
|
+
value
|
|
169
|
+
}
|
|
170
|
+
name {
|
|
171
|
+
given
|
|
172
|
+
family
|
|
173
|
+
}
|
|
174
|
+
birthDate
|
|
175
|
+
}
|
|
176
|
+
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
177
|
+
resourceType
|
|
178
|
+
id
|
|
179
|
+
identifier {
|
|
180
|
+
system
|
|
181
|
+
value
|
|
182
|
+
}
|
|
183
|
+
subject {
|
|
184
|
+
display
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}`.replaceAll(/\s+/g," "):`{
|
|
188
|
+
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
189
|
+
resourceType
|
|
190
|
+
id
|
|
191
|
+
identifier {
|
|
192
|
+
system
|
|
193
|
+
value
|
|
194
|
+
}
|
|
195
|
+
name {
|
|
196
|
+
given
|
|
197
|
+
family
|
|
198
|
+
}
|
|
199
|
+
birthDate
|
|
200
|
+
}
|
|
201
|
+
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
202
|
+
resourceType
|
|
203
|
+
id
|
|
204
|
+
identifier {
|
|
205
|
+
system
|
|
206
|
+
value
|
|
207
|
+
}
|
|
208
|
+
name {
|
|
209
|
+
given
|
|
210
|
+
family
|
|
211
|
+
}
|
|
212
|
+
birthDate
|
|
213
|
+
}
|
|
214
|
+
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
215
|
+
resourceType
|
|
216
|
+
id
|
|
217
|
+
identifier {
|
|
218
|
+
system
|
|
219
|
+
value
|
|
220
|
+
}
|
|
221
|
+
subject {
|
|
222
|
+
display
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}`.replaceAll(/\s+/g," ")}function YQ(e){const t=[];return e.data.Patients1&&t.push(...e.data.Patients1),e.data.Patients2&&t.push(...e.data.Patients2),e.data.ServiceRequestList&&t.push(...e.data.ServiceRequestList),KQ(t)}function KQ(e){const t=new Set,n=[];for(const r of e)t.has(r.id)||(t.add(r.id),n.push(r));return n}function XQ(e,t){const n=[],r=[];for(const s of e)s.resourceType==="Patient"?n.push({id:s.id,label:s.name?Cs(s.name[0]):s.id,description:s.birthDate,onClick:()=>t(`/Patient/${s.id}`)}):s.resourceType==="ServiceRequest"&&r.push({id:s.id,label:s.id,description:s.subject?.display,onClick:()=>t(`/ServiceRequest/${s.id}`)});const o=[];return n.length>0&&o.push({group:"Patients",actions:n}),r.length>0&&o.push({group:"Service Requests",actions:r}),o}function lR(e){const t=du(),n=hf(),r=JQ(e.pathname,e.searchParams,e.menus),[o,s]=v.useState(!1),[c,d]=v.useState(!1);function f(g,y){g.stopPropagation(),g.preventDefault(),t(y),window.innerWidth<768&&e.closeNavbar()}function p(g){g&&t(`/${g}`)}const m=e.opened??!0;return a.jsxs(a.Fragment,{children:[a.jsxs(Sr.Navbar,{id:"navbar",className:Zs.navbar,children:[e.logo&&a.jsx(Sr.Section,{px:"sm",py:"xs",children:a.jsx(In,{className:Zs.logoButton,onClick:e.navbarToggle,"aria-expanded":m,"aria-controls":"navbar",children:e.logo})}),a.jsx(Yr,{px:"sm",py:"xs",h:"100%",children:a.jsxs(Sr.Section,{grow:!0,children:[e.spotlightEnabled&&a.jsx(cR,{to:"#",active:!1,onClick:gf.open,icon:a.jsx(RS,{size:"1.2rem"}),label:"Search",opened:m}),e.spotlightEnabled&&a.jsx(QQ,{}),!e.resourceTypeSearchDisabled&&a.jsx(Sr.Section,{mb:"sm",children:a.jsx(LS,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:g=>p(g)},window.location.pathname)}),e.menus?.map(g=>a.jsxs(v.Fragment,{children:[m?a.jsx(Ee,{className:Zs.menuTitle,children:g.title}):a.jsx(Lm,{h:41}),g.links?.map(y=>a.jsx(cR,{to:y.href,active:y.href===r?.href,onClick:b=>f(b,y.href),icon:y.icon,label:y.label??"",opened:m},y.href))]},`menu-${g.title}`)),e.displayAddBookmark&&a.jsx(Pe,{variant:"subtle",size:"xs",mt:"xl",leftSection:a.jsx(Fk,{size:"0.75rem"}),onClick:()=>d(!0),children:"Add Bookmark"})]})}),e.userMenuEnabled&&a.jsxs(Sr.Section,{px:"sm",py:"xs",children:[a.jsx(ro,{label:"Toggle navbar",position:"right",transitionProps:{duration:0},children:a.jsx(In,{className:Zs.toggleButton,"aria-label":"Toggle navbar",onClick:e.navbarToggle,"aria-expanded":m,"aria-controls":"navbar",children:a.jsx(Uq,{})})}),a.jsxs(be,{width:260,shadow:"xl",position:"top-start",transitionProps:{transition:"fade-up"},opened:o,onClose:()=>s(!1),children:[a.jsx(be.Target,{children:a.jsxs(In,{className:Zs.link,"aria-label":"User menu","data-active":o||void 0,onClick:()=>s(g=>!g),children:[a.jsx(Aa,{value:n,radius:"xl",size:18}),m&&a.jsx("span",{children:Cs(n?.name?.[0])})]})}),a.jsx(be.Dropdown,{children:a.jsx(Wk,{version:e.version})})]})]})]}),e.pathname&&e.searchParams&&a.jsx(OQ,{pathname:e.pathname,searchParams:e.searchParams,visible:c,onOk:()=>d(!1),onCancel:()=>d(!1)})]})}function cR(e){const{to:t,icon:n,label:r,onClick:o,active:s}=e;return e.opened?a.jsxs(yt,{to:t,onClick:o,className:Zs.link,"data-active":s||void 0,children:[n,a.jsx("span",{children:r})]}):a.jsx(ro,{label:r,position:"right",transitionProps:{duration:0},children:a.jsx(yt,{to:t,onClick:o,className:Zs.link,"data-active":s||void 0,children:n})})}function JQ(e,t,n){if(!e||!t||!n)return;let r,o=0;for(const s of n)if(s.links)for(const c of s.links){const d=ZQ(e,t,c.href);d>o&&(o=d,r=c)}return r}function ZQ(e,t,n){const r=new URL(n,"https://example.com");if(e!==r.pathname)return 0;const o=["_count","_offset"];for(const[c,d]of r.searchParams.entries())if(!o.includes(c)&&t.get(c)!==d)return 0;let s=1;for(const[c,d]of t.entries())o.includes(c)||r.searchParams.get(c)===d&&s++;return s}const uR=250,eW=70;function tW(e){const[t,n]=v.useState(localStorage.navbarOpen==="true"),[r]=v.useState(e.layoutVersion??localStorage.appShellLayoutVersion??"v1"),o=Re(),s=hf();function c(b){localStorage.navbarOpen=b.toString(),n(b)}function d(){c(!1)}function f(){c(!t)}if(o.isLoading())return a.jsx(Oi,{});let p,m,g,y;return r==="v2"?(p={height:0},m={width:t?uR:eW,breakpoint:0,collapsed:{desktop:!s,mobile:!s}},g=void 0,y=s?a.jsx(lR,{logo:e.logo,pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,navbarToggle:f,closeNavbar:d,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:!0,opened:t,spotlightEnabled:!0,userMenuEnabled:!0,version:e.version}):void 0):(p={height:60},m={width:uR,breakpoint:"sm",collapsed:{desktop:!s||!t,mobile:!s||!t}},g=s&&a.jsx(uQ,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarOpen:t,navbarToggle:f,notifications:e.notifications}),y=s&&t?a.jsx(lR,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,navbarToggle:f,closeNavbar:d,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0),a.jsxs(Sr,{header:p,navbar:m,padding:0,children:[g,y,a.jsx(Sr.Main,{className:VG.main,children:a.jsx(DS,{children:a.jsx(v.Suspense,{fallback:a.jsx(Oi,{}),children:e.children})})})]})}const nW="https://ccda.medplum.com",rW="https://ccda-validator.medplum.com/";function iW(e){const{url:t}=e,[n,r]=v.useState(!1),o=v.useRef(null),[s,c]=v.useState(),[d,f]=v.useState(!1);v.useEffect(()=>{t&&n&&o.current&&(Sd(o.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=`${rW}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 E=await C.json();c(E)}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);Gk(y,"ccda-validation-results")},g=()=>s?s.resultsMetaData.resultMetaData.filter(y=>y?.type.includes("Error")).reduce((y,b)=>y+(b.count||0),0):0;return t?a.jsxs("div",{"data-testid":"ccda-iframe",style:{maxWidth:e.maxWidth},children:[a.jsx("div",{style:{minHeight:400},children:a.jsx("iframe",{title:"C-CDA Viewer",width:"100%",height:"400",ref:o,src:nW,allowFullScreen:!0,frameBorder:0,seamless:!0,onLoad:()=>r(!0)})}),a.jsxs("div",{style:{marginTop:"10px",marginBottom:"10px",display:"flex",alignItems:"center"},children:[a.jsx(Pe,{type:"button",onClick:p,disabled:d,children:d?"Validating...":"Validate"}),s&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{style:{marginLeft:"15px"},children:[a.jsx("strong",{children:"Validation Results:"})," ",g()," errors found"]}),a.jsx(Pe,{type:"button",onClick:m,color:"green",style:{marginLeft:"auto"},children:"Download Full Results"})]})]})]}):null}function yf(e){const{contentType:t,url:n,title:r}=e.value??{},o=Ak(n);return o?a.jsxs("div",{"data-testid":"attachment-display",children:[t?.startsWith("image/")&&a.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:o,alt:r}),t?.startsWith("video/")&&a.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:a.jsx("source",{type:t,src:o})}),(t?.startsWith("text/")||t==="application/json"||t==="application/pdf")&&a.jsx("div",{"data-testid":"attachment-iframe",style:{maxWidth:e.maxWidth,minHeight:400},children:a.jsx("iframe",{title:"Attachment",width:"100%",height:"400",src:o+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),t===rn.CDA_XML&&a.jsx(iW,{url:o}),a.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:a.jsx(Nt,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:oW(r),children:r||"Download"})})]}):null}function oW(e){return e?.includes(".")?e:void 0}const aW="_root_1bd5a_1",sW="_compact_1bd5a_19",dR={root:aW,compact:sW};function xf(e){const{children:t,compact:n}=e;return a.jsx("dl",{className:$t(dR.root,{[dR.compact]:n}),children:t})}function Mr(e){return a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:e.term}),a.jsx("dd",{children:e.children})]})}function lW(e){const t=e.values?.map((r,o)=>a.jsx("div",{children:a.jsx(yf,{value:r,maxWidth:e.maxWidth})},"attatchment-"+o));let n;if(e.includeDescriptionListEntry){if(e.property===void 0)throw new Error("props.property is required when includeDescriptionListEntry is true");if(!Nn(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const r=e.path.split(".").pop();n=a.jsx(Mr,{term:ml(r),children:t})}else n=a.jsx(a.Fragment,{children:t});return n}function IS(e){const t=Re(),n=v.useRef(null);function r(c){yn(c),n.current?.click()}function o(c){yn(c);const d=c.target.files;d&&Array.from(d).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(Xt(f))}))}return a.jsxs(a.Fragment,{children:[a.jsx("input",{disabled:e.disabled,type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:n,onChange:c=>o(c)}),e.children({onClick:r,disabled:e.disabled})]})}function cW(e){const[t,n]=v.useState(e.defaultValue??[]),r=v.useRef(t);r.current=t;function o(s){n(s),e.onChange&&e.onChange(s)}return a.jsxs("table",{style:{width:"100%"},children:[a.jsxs("colgroup",{children:[a.jsx("col",{width:"97%"}),a.jsx("col",{width:"3%"})]}),a.jsxs("tbody",{children:[t.map((s,c)=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(yf,{value:s,maxWidth:200})}),a.jsx("td",{children:a.jsx(Dn,{disabled:e.disabled,title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:d=>{yn(d);const f=t.slice();f.splice(c,1),o(f)},children:a.jsx(Mp,{})})})]},`${c}-${t.length}`)),a.jsxs("tr",{children:[a.jsx("td",{}),a.jsx("td",{children:a.jsx(IS,{disabled:e.disabled,onUpload:s=>{o([...r.current,s])},children:s=>a.jsx(Dn,{...s,title:"Add",variant:"subtle",size:"sm",color:s.disabled?"gray":"green",children:a.jsx(ES,{})})})})]})]})]})}function iP(e){const[t,n]=v.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return t?a.jsxs(a.Fragment,{children:[a.jsx(yf,{value:t,maxWidth:200}),a.jsx(Pe,{disabled:e.disabled,onClick:o=>{yn(o),r(void 0)},children:"Remove"})]}):a.jsx(IS,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:o=>a.jsx(Pe,{...o,children:"Upload..."})})}function Ui(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 180 180",style:{width:e.size,height:e.size},children:[a.jsx("title",{children:"Medplum Logo"}),a.jsx("path",{fill:e.fill??"#9c36b5",d:"M84 56c-3-15-15-24-23-28l5-10c8 2 14 8 20 14 0-12 1-16 5-21 8-9 13-9 41-9 0 7 1 18-3 24-7 9-16 7-41 8 5 8 7 14 8 22 36-24 74-7 74 39 0 42-40 83-80 83s-80-41-80-83c0-46 38-63 74-39Zm-3 43H65c-4 0-7 3-7 7v4c0 4 3 7 7 7h16v16c0 4 3 7 7 7h4c4 0 7-3 7-7v-16h16c4 0 7-3 7-7v-4c0-4-3-7-7-7H99V83c0-4-3-7-7-7h-4c-4 0-7 3-7 7z"})]})}function zp(e){const[t,n]=v.useState();return a.jsx(ht,{onSubmit:r=>{n(void 0),e.onSubmit(r)?.catch(o=>n(Qe(o)))},children:a.jsxs(Be,{children:[a.jsxs(hr,{style:{flexDirection:"column"},children:[a.jsx(Ui,{size:32}),a.jsx($e,{children:e.title})]}),t&&a.jsx(Uo,{icon:a.jsx(Ts,{size:16}),title:"Error",color:"red",children:t}),e.qrCodeUrl&&a.jsxs(Be,{align:"center",children:[a.jsx(Ee,{children:"Scan this QR code with your authenticator app."}),a.jsx("img",{src:e.qrCodeUrl,alt:"Multi Factor Auth QR Code"})]}),a.jsx(Be,{children:a.jsx(He,{name:"token",label:"MFA code",autoComplete:"one-time-code",required:!0,autoFocus:!0})}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(Tr,{children:e.buttonText})})]})})}const uW="_root_1vii2_1",dW={root:uW};function hu(e){const{children:t,...n}=e;return a.jsx(tf,{className:dW.root,...n,children:t})}const fW="_paper_1igaj_1",hW="_fill_1igaj_20",fR={paper:fW,fill:hW};function Dl(e){const{width:t,fill:n,className:r,children:o,...s}=e,c=t?{maxWidth:t}:void 0;return a.jsx(Nr,{className:$t(fR.paper,n&&fR.fill,r),style:c,shadow:"sm",radius:"sm",withBorder:!0,...s,children:o})}function ut(e){const{children:t,...n}=e;return a.jsx(hu,{children:a.jsx(Dl,{...n,children:t})})}function Lt(e,t){return e?.issue?.filter(n=>oP(n.expression?.[0],t))?.map(n=>n.details?.text)?.join(`
|
|
226
|
+
`)}function pu(e,t){return e?.issue?.filter(n=>oP(n.expression?.[0],t))}const Kh=/\[\d+\]/;function oP(e,t){const n=typeof e=="string"&&Kh.test(e),r=typeof t=="string"&&Kh.test(t);if(n!==r&&(e=e?.replace(Kh,""),t=t?.replace(Kh,"")),e===t)return!0;if(!e||!t)return!1;const o=e.indexOf(".");if(o>=0&&e.substring(o+1)===t)return!0;const s=t.indexOf(".");return s>=0&&t.substring(s+1)===e}function aP(e){const t=Re(),[n,r]=v.useState();return a.jsxs(ht,{onSubmit:async o=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:o.projectName}))}catch(s){r(Xt(s))}},children:[a.jsxs(hr,{style:{flexDirection:"column"},children:[a.jsx(Ui,{size:32}),a.jsx($e,{children:"Create project"})]}),a.jsxs(Be,{gap:"xl",children:[a.jsx(He,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:Lt(n,"projectName")}),a.jsxs(Ee,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",a.jsx(Nt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Nt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Tr,{children:"Create project"})})]})}function sP(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 lP(e){const t=Re(),{googleClientId:n,handleGoogleCredential:r}=e,o=v.useRef(null),[s,c]=v.useState(typeof google<"u"),[d,f]=v.useState(!1),[p,m]=v.useState(!1);return v.useEffect(()=>{if(typeof google>"u"){sP("https://accounts.google.com/gsi/client",()=>c(!0));return}d||(google.accounts.id.initialize({client_id:n,callback:r}),f(!0)),o.current&&!p&&(google.accounts.id.renderButton(o.current,{}),m(!0))},[t,n,d,s,o,p,r]),n?a.jsx("div",{ref:o}):null}function cP(e){if(e)return e;const t=Zn.getOrigin();if(t&&[].includes(t))return"__GOOGLE_CLIENT_ID__"}function Rr(e){const t=e.outcome?.issue||e.issues;return!t||t.length===0?null:a.jsx(Uo,{icon:a.jsx(Ts,{size:16}),color:"red",children:t.map(n=>a.jsx("div",{"data-testid":"text-field-error",children:zD(n)},n.details?.text))})}function uP(e){typeof grecaptcha>"u"&&sP("https://www.google.com/recaptcha/api.js?render="+e)}function dP(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function pW(e){const t=cP(e.googleClientId),n=e.recaptchaSiteKey,r=Re(),[o,s]=v.useState(),c=pu(o,void 0);return v.useEffect(()=>{n&&uP(n)},[n]),a.jsxs(ht,{onSubmit:async d=>{s(void 0);try{let f="";n&&(f=await dP(n)),e.handleAuthResponse(await r.startNewUser({projectId:e.projectId,clientId:e.clientId,firstName:d.firstName,lastName:d.lastName,email:d.email,password:d.password,remember:d.remember==="true",recaptchaSiteKey:n,recaptchaToken:f}))}catch(f){s(Xt(f))}},children:[a.jsx(hr,{style:{flexDirection:"column"},children:e.children}),a.jsx(Rr,{issues:c}),t&&a.jsxs(a.Fragment,{children:[a.jsx(ye,{justify:"center",p:"xl",style:{height:70},children:a.jsx(lP,{googleClientId:t,handleGoogleCredential:async d=>{try{e.handleAuthResponse(await r.startGoogleLogin({googleClientId:d.clientId,googleCredential:d.credential,projectId:e.projectId,createUser:!0}))}catch(f){s(Xt(f))}}})}),a.jsx(An,{label:"or",labelPosition:"center",my:"lg"})]}),a.jsxs(Be,{gap:"xl",children:[a.jsx(He,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:Lt(o,"firstName")}),a.jsx(He,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:Lt(o,"lastName")}),a.jsx(He,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:Lt(o,"email")}),a.jsx(Ji,{name:"password",label:"Password",autoComplete:"off",required:!0,error:Lt(o,"password")}),a.jsxs(Ee,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",a.jsx(Nt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Nt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),a.jsxs(Ee,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",a.jsx(Nt,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Nt,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),a.jsxs(ye,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[a.jsx(Ln,{name:"remember",label:"Remember me",size:"xs"}),a.jsx(Tr,{children:"Create account"})]})]})}function mW(e){const{type:t,projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:s,onSuccess:c}=e,d=Re(),[f,p]=v.useState(),[m,g]=v.useState();v.useEffect(()=>{t==="patient"&&f&&d.startNewPatient({login:f,projectId:n}).then(b=>d.processCode(b.code)).then(()=>c()).catch(b=>g(Xt(b)))},[d,t,n,f,c]);function y(b){b.code?d.processCode(b.code).then(()=>c()).catch(console.log):b.login&&p(b.login)}return a.jsxs(ut,{width:450,children:[m&&a.jsx("pre",{children:JSON.stringify(m,null,2)}),!f&&a.jsx(pW,{projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:s,handleAuthResponse:y,children:e.children}),f&&t==="project"&&a.jsx(aP,{login:f,handleAuthResponse:y})]})}const gW="_userNotice_1iefq_1",vW={userNotice:gW};function yW(e){const[t,n]=v.useState();return t?a.jsx(bW,{email:t,resetEmail:()=>n(void 0),...e}):a.jsx(xW,{setEmail:n,...e})}function xW(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:o,disableEmailAuth:s,...c}=e,d=Re(),f=!e.disableGoogleAuth&&cP(e.googleClientId),[p,m]=v.useState(),g=pu(p,void 0),y=v.useCallback(async j=>{if(!j.authorizeUrl)return!1;const C=JSON.stringify({...await d.ensureCodeChallenge(c),domain:j.domain}),E=new URL(j.authorizeUrl);return E.searchParams.set("state",C),Zn.assign(E.toString()),!0},[d,c]),b=v.useCallback(async j=>{const C=await d.post("auth/method",{email:j.email});await y(C)||t(j.email)},[d,y,t]),S=v.useCallback(async j=>{try{const C=await d.startGoogleLogin({...c,googleCredential:j.credential});await y(C)||r(C)}catch(C){m(Xt(C))}},[d,c,y,r]);return a.jsxs(ht,{onSubmit:b,children:[a.jsx(hr,{style:{flexDirection:"column"},children:o}),a.jsx(Rr,{issues:g}),f&&a.jsxs(a.Fragment,{children:[a.jsx(ye,{justify:"center",p:"xl",style:{height:70},children:a.jsx(lP,{googleClientId:f,handleGoogleCredential:S})}),!s&&a.jsx(An,{label:"or",labelPosition:"center",my:"lg"})]}),!s&&a.jsx(He,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:Lt(p,"email"),"data-testid":"auth.email"}),a.jsxs(ye,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[a.jsx("div",{children:n&&a.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&&a.jsx(Tr,{children:"Next"})]})]})}function bW(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...o}=e,s=Re(),[c,d]=v.useState(),f=pu(c,void 0),p=v.useCallback(m=>{s.startLogin({...o,password:m.password,remember:m.remember==="on"}).then(n).catch(g=>d(Xt(g)))},[s,o,n]);return a.jsxs(ht,{onSubmit:p,children:[a.jsx(hr,{style:{flexDirection:"column"},children:r}),a.jsx(Rr,{issues:f}),a.jsxs(Be,{gap:"sm",children:[a.jsx(Ji,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:Lt(c,"password"),"data-testid":"auth.password"}),a.jsxs(no,{className:vW.userNotice,justify:"space-between",align:"center",px:"xs",bdrs:"sm",children:[a.jsxs(Ee,{size:"xs",children:["Logging in as ",a.jsx("em",{children:e.email})]}),a.jsx(Pe,{variant:"transparent",onClick:e.resetEmail,size:"compact-xs",children:"Change"})]})]}),a.jsxs(ye,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&a.jsx(Nt,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),a.jsx(Ln,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),a.jsx(Tr,{children:"Sign in"})]})]})}function SW(e){const t=Re(),n=Tl(),[r,o]=v.useState(""),[s,c]=v.useState();function d(g){return!!g?.toLowerCase()?.includes(r.toLowerCase())}function f(g){return d(g.profile?.display)||d(g.project?.display)}function p(g){t.post("auth/profile",{login:e.login,profile:g}).then(e.handleAuthResponse).catch(y=>c(Xt(y)))}const m=e.memberships.filter(f).slice(0,10).map(g=>a.jsx(Ye.Option,{value:g.id,children:a.jsx(jW,{...g})},g.id));return a.jsxs(Be,{children:[a.jsxs(no,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[a.jsx(Ui,{size:32}),a.jsx($e,{order:3,children:"Choose profile"})]}),a.jsx(Rr,{outcome:s}),a.jsxs(Ye,{store:n,onOptionSubmit:p,children:[a.jsx(Ye.EventsTarget,{children:a.jsx(He,{placeholder:"Search",value:r,onChange:g=>{o(g.currentTarget.value),n.updateSelectedOptionIndex()}})}),a.jsx("div",{children:a.jsx(Ye.Options,{children:m.length>0?m:a.jsx(Ye.Empty,{children:"Nothing found..."})})})]})]})}function wW(e){return e.identifier?.find(t=>t.system==="https://medplum.com/identifier/label")?.value}function jW(e){const t=wW(e);return a.jsxs(ye,{children:[a.jsx(fl,{radius:"xl"}),a.jsxs("div",{children:[a.jsx(Ee,{fz:"sm",fw:500,children:e.profile?.display}),a.jsxs(Ee,{fz:"xs",opacity:.6,children:[e.project?.display," ",t?` - ${t}`:""]})]})]})}const CW=/^patient\/Condition\.(?:\*|c?r?u?d?s?)$/,EW="?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis",TW="?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item",RW="?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern",_W=/^patient\/Observation\.(?:\*|c?r?u?d?s?)$/,AW="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-observation-category|clinical-test",DW="?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory",kW="?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history",PW="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh",NW="?category=http://terminology.hl7.org/CodeSystem/observation-category|survey",OW="?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs";function MW(e){const t=Re();return a.jsx(ht,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:a.jsxs(Be,{children:[a.jsxs(hr,{style:{flexDirection:"column"},children:[a.jsx(Ui,{size:32}),a.jsx($e,{children:"Choose scope"})]}),a.jsx(Be,{children:(e.scope??"openid").split(" ").map(n=>{let r;return CW.test(n)?r=[n+EW,n+TW,n+RW]:_W.test(n)&&(r=[n+AW,n+DW,n+kW,n+PW,n+NW,n+OW]),a.jsxs(a.Fragment,{children:[a.jsx(Ln,{id:n,name:n,label:n,defaultChecked:!0},n),r?.map(o=>a.jsx(Ln,{id:o,name:o,label:o},o))]},n+"_group")})}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(Tr,{children:"Set scope"})})]})})}function fP(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:o,onRegister:s,onCode:c,...d}=e,f=Re(),[p,m]=v.useState(),g=v.useRef(!1),[y,b]=v.useState(!1),[S,j]=v.useState(),[C,E]=v.useState(!1),[R,T]=v.useState(),_=v.useCallback(A=>{c?c(A):f.processCode(A).then(()=>{r&&r()}).catch(N=>Ne({color:"red",message:Qe(N)}))},[f,c,r]),k=v.useCallback(A=>{b(!!A.mfaEnrollRequired),j(A.enrollQrCode),E(!!A.mfaRequired),A.login&&m(A.login),A.memberships&&T(A.memberships),A.code&&(n?T(void 0):_(A.code))},[n,_]),L=v.useCallback(A=>{_(A.code)},[_]);return v.useEffect(()=>{t&&!g.current&&!p&&(g.current=!0,f.get("auth/login/"+t).then(k).catch(A=>Ne({color:"red",message:Qe(A)})))},[f,t,g,p,k]),a.jsx(ut,{width:450,px:"sm",py:"md",children:p?y&&S?a.jsx(zp,{title:"Enroll in MFA",buttonText:"Enroll",qrCodeUrl:S,onSubmit:async A=>{const N=await f.post("auth/mfa/login-enroll",{login:p,token:A.token});k(N)}}):C?a.jsx(zp,{title:"Enter MFA code",buttonText:"Submit code",onSubmit:async A=>{const N=await f.post("auth/mfa/verify",{login:p,token:A.token});k(N)}}):R?a.jsx(SW,{login:p,memberships:R,handleAuthResponse:k}):e.projectId==="new"?a.jsx(aP,{login:p,handleAuthResponse:k}):e.chooseScopes?a.jsx(MW,{login:p,scope:e.scope,handleAuthResponse:L}):a.jsx("div",{children:"Success"}):a.jsx(yW,{onForgotPassword:o,onRegister:s,handleAuthResponse:k,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...d,children:e.children})})}function _o(e){return a.jsx(a.Fragment,{children:gs(e.value)})}function LW(e){return a.jsx(a.Fragment,{children:ff(e.value)})}function hP(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("]")),a.jsx(a.Fragment,{children:n.join("").trim()})}function IW(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[t.name,t.name&&": ",t.telecom?.map(n=>a.jsx(hP,{value:n},`telecom-${t.name}-${n.value}`))]}):null}function tg(e,t,n){const r=Nd(e,t,{profileUrl:n});return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function zW(e,t,n){const r=qD(e,t,n);return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function $W(e){const{elementDefinitionType:t}=e,n=Re(),r=v.useContext(mn),[o,s]=v.useState(VD("Extension")),c=v.useMemo(()=>{if(Nn(t?.profile))return t.profile[0]},[t]),[d,f]=v.useState(c!==void 0);if(v.useEffect(()=>{c&&(f(!0),n.requestProfileSchema(c).then(()=>{const g=uu(c);f(!1),g&&s(g)}).catch(g=>{f(!1),console.warn(g)}))},[n,c]),c&&(d||!nS(c)))return a.jsx("div",{children:"Loading..."});if(o.elements["value[x]"]?.max!==0){const[g,y]=tg({type:"Extension",value:e.value},"value[x]",c??r.profileUrl);return a.jsx(oo,{propertyType:y,value:g})}return a.jsx(Up,{path:e.path,value:{type:o.type,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:c})}function UW(e){return a.jsxs("div",{children:[e.value?.system,": ",e.value?.value]})}function BW(e){return a.jsx(a.Fragment,{children:RB(e.value)})}function $d(e){return a.jsx(a.Fragment,{children:ol(e.value)})}function zS(e){return a.jsx(a.Fragment,{children:Md(e.value)})}function VW(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[a.jsx($d,{value:t.numerator})," / ",a.jsx($d,{value:t.denominator})]}):null}function $p(e){if(!e.value)return null;const t=e.value.display||e.value.reference||io(e.value);return e.link!==!1&&e.value.reference?a.jsx(yt,{to:e.value,children:t}):a.jsx(a.Fragment,{children:t})}function pP(e,t,n,r){if(!Nn(n?.slices))return[e];const o=new Array(t.length+1);for(let s=0;s<o.length;s++)o[s]=[];for(const s of e){const c=Ek(s,t,n.discriminator,r);let d=c?t.findIndex(f=>f.name===c):-1;d===-1&&(d=t.length),o[d].push(s)}return o}async function mP({medplum:e,property:t}){return new Promise((n,r)=>{if(!t.slicing){n([]);return}const o=[],s=[],c=[];for(const d of t.slicing.slices){if(!Ck(d)){console.debug("Unsupported slice definition",d);continue}let f;Nn(d.elements)||(f=d.type[0]?.profile?.[0]),o.push(d),s.push(f),f&&c.push(e.requestProfileSchema(f))}Promise.all(c).then(()=>{for(let d=0;d<o.length;d++){const f=o[d],p=s[d];if(p){const m=uu(p);f.typeSchema=m}}n(o)}).catch(r)})}function ng(e,t,n){return t!==void 0?a.jsx(e,{value:t,children:n}):n}function FW(e){const{slice:t,property:n}=e,r=t.typeSchema?.elements??t.elements,o=v.useContext(mn),s=v.useMemo(()=>{if(Nn(r))return Wc({parentContext:o,elements:r,path:e.path,profileUrl:t.typeSchema?.url})},[o,e.path,t.typeSchema?.url,r]);return ng(mn.Provider,s,a.jsx(a.Fragment,{children:e.value.map((c,d)=>a.jsx("div",{children:a.jsx(oo,{property:n,path:e.path,arrayElement:!0,elementDefinitionType:t.type[0],propertyType:t.type[0].code,value:c,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${d}-${e.value.length}`))}))}const hR=50;function HW(e){const{property:t,propertyType:n}=e,r=Re(),o=v.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[s,c]=v.useState(!0),[d,f]=v.useState([]),[p,m]=v.useState(()=>[o]),[g,y]=v.useState(0),b=v.useContext(mn);if(v.useEffect(()=>{mP({medplum:r,property:t}).then(C=>{y(o.length),f(C);const E=o.slice(0,hR),R=pP(E,C,t.slicing,b.profileUrl);m(R),c(!1)}).catch(C=>{console.error(C),c(!1)})},[r,t,b.profileUrl,m,o]),s)return a.jsx("div",{children:"Loading..."});let S;if(t.type[0]?.code!=="Extension"){const C=p[d.length],E=C.map((R,T)=>a.jsx("div",{children:a.jsx(oo,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:R,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${T}-${C.length}`));if(e.includeDescriptionListEntry){if(!Nn(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const R=e.path.split(".").pop();S=a.jsx(Mr,{term:ml(R),children:E})}else S=a.jsx(a.Fragment,{children:E})}return a.jsxs(a.Fragment,{children:[d.map((C,E)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let R=a.jsx(FW,{path:e.path,slice:C,property:t,value:p[E],ignoreMissingValues:e.ignoreMissingValues,link:e.link},C.name);return e.includeDescriptionListEntry&&(R=a.jsx(Mr,{term:ml(C.name),children:R},C.name)),R}),S,g>hR&&a.jsx(ye,{justify:"right",children:a.jsxs(Ee,{children:["... ",g," total values"]})})]})}function oo(e){const{property:t,propertyType:n,value:r}=e;if(t?.path?.endsWith(".id"))return a.jsxs(no,{gap:3,align:"center",children:[r,!Cn(r)&&a.jsx(v0,{value:r,timeout:2e3,children:({copied:s,copy:c})=>a.jsx(ro,{label:s?"Copied":"Copy",withArrow:!0,position:"right",children:a.jsx(Dn,{variant:"subtle",color:s?"teal":"gray",onClick:c,children:s?a.jsx(Fo,{size:"1rem"}):a.jsx(TS,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===ne.Attachment?a.jsx(lW,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):a.jsx(HW,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case ne.boolean:return a.jsx(a.Fragment,{children:r===void 0?"":(!!r).toString()});case ne.SystemString:case ne.string:return e.property?.path?.toLowerCase().includes("secret")?a.jsx(qW,{value:r}):a.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case ne.code:case ne.date:case ne.decimal:case ne.id:case ne.integer:case ne.positiveInt:case ne.unsignedInt:case ne.uri:case ne.url:case ne.xhtml:return a.jsx(a.Fragment,{children:r});case ne.canonical:return a.jsx($p,{value:{reference:r},link:e.link});case ne.dateTime:case ne.instant:return a.jsx(a.Fragment,{children:Cr(r)});case ne.markdown:return a.jsx("pre",{children:r});case ne.Address:return a.jsx(RH,{value:r});case ne.Annotation:return a.jsx(a.Fragment,{children:r?.text});case ne.Attachment:return a.jsx(yf,{value:r,maxWidth:e.maxWidth});case ne.CodeableConcept:return a.jsx(_o,{value:r});case ne.Coding:return a.jsx(LW,{value:r});case ne.ContactDetail:return a.jsx(IW,{value:r});case ne.ContactPoint:return a.jsx(hP,{value:r});case ne.HumanName:return a.jsx(PS,{value:r});case ne.Identifier:return a.jsx(UW,{value:r});case ne.Money:return a.jsx(BW,{value:r});case ne.Period:return a.jsx(a.Fragment,{children:wB(r)});case ne.Quantity:case ne.Duration:return a.jsx($d,{value:r});case ne.Range:return a.jsx(zS,{value:r});case ne.Ratio:return a.jsx(VW,{value:r});case ne.Reference:return a.jsx($p,{value:r,link:e.link});case ne.Timing:return a.jsx(a.Fragment,{children:lk(r)});case ne.Dosage:case ne.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(Up,{path:e.path,value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});case ne.Extension:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx($W,{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 a.jsx(Up,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}function qW(e){const[t,n]=v.useState(!1),r=e.value??"",o=!Cn(r),s="•".repeat(8);return a.jsxs(no,{gap:3,align:"center",children:[t?a.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r}):a.jsx("div",{style:{whiteSpace:"pre-wrap"},"aria-hidden":"true",children:o?s:""}),o&&a.jsxs(a.Fragment,{children:[a.jsx(v0,{value:e.value,timeout:2e3,children:({copied:c,copy:d})=>a.jsx(ro,{label:c?"Copied":"Copy secret",withArrow:!0,position:"right",children:a.jsx(Dn,{variant:"subtle",color:c?"teal":"gray",onClick:d,"aria-label":c?"Copied":"Copy secret",children:c?a.jsx(Fo,{size:"1rem"}):a.jsx(TS,{size:"1rem"})})})}),a.jsx(ro,{label:t?"Hide secret":"Show secret",withArrow:!0,position:"right",children:a.jsx(Dn,{variant:"subtle",color:"gray",onClick:()=>n(!t),"aria-label":t?"Hide secret":"Show secret",children:t?a.jsx(Rq,{size:"1rem"}):a.jsx(Aq,{size:"1rem"})})})]})]})}const gP=["extension","modifierExtension"],GW=zk.filter(e=>!gP.includes(e));function Up(e){const t=e.value,{value:n,type:r}=t,o=v.useContext(mn),s=e.profileUrl??o?.profileUrl,c=v.useMemo(()=>zm(r,s),[s,r]),d=v.useMemo(()=>{if(c)return Wc({parentContext:o,elements:c.elements,path:e.path,profileUrl:c.url,accessPolicyResource:e.accessPolicyResource})},[c,o,e.path,e.accessPolicyResource]);if(Cn(n))return null;if(!c)return a.jsxs("div",{children:[r," not implemented"]});if(typeof n=="object"&&"name"in n&&Object.keys(n).length===1&&typeof n.name=="string")return a.jsx("div",{children:n.name});const f=d??o;return ng(mn.Provider,d,a.jsx(xf,{compact:e.compact,children:Object.entries(f.elements).map(([p,m])=>{if(gP.includes(p)&&Cn(m.slicing?.slices))return null;if(GW.includes(p))return null;if($k.includes(p)&&m.path.split(".").length===2||p.includes("."))return null;const[g,y]=tg(t,p,f.profileUrl);if((e.ignoreMissingValues||m.max===0)&&Cn(g)||e.path.endsWith(".extension")&&(p==="url"||p==="id"))return null;const b=m.max>1||m.isArray,S=a.jsx(oo,{property:m,propertyType:y,path:e.path+"."+p,value:g,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:b,link:e.link},p);return b?S:a.jsx(Mr,{term:ml(p),children:S},p)})}))}const QW="_dimmed_11me5_1",WW="_preserveBreaks_11me5_5",Yx={dimmed:QW,preserveBreaks:WW},vP="Read Only";function yP(e,t){return e?a.jsx(ro.Floating,{label:e,children:t}):t}function xP(e){const{debugMode:t}=v.useContext(mn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,yP(e?.readonly?vP:void 0,a.jsxs(ye,{wrap:"nowrap","data-testid":e.testId,children:[a.jsx("div",{children:e.children}),a.jsx("div",{children:a.jsx(pn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e?.readonly?Yx.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function zt(e){const{debugMode:t}=v.useContext(mn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,yP(e?.readonly?vP:void 0,a.jsx(pn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:$t({[Yx.dimmed]:e?.readonly},Yx.preserveBreaks)},description:e.description,withAsterisk:e.withAsterisk,error:Lt(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function YW(e,t,n,r,o){const s=r.type;if(s.length>1)for(const c of s){const d=t.replace("[x]",Qn(c.code));d in e&&delete e[d]}return Cn(o)?e[n]=void 0:e[n]=o,e}function KW(e){return!!e&&!Cn(e.url)&&!Cn(e.name)}function XW(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:o,path:s,valuePath:c,...d}=e,[f,p]=v.useState(t);function m(g){const y=ZW(g);p(y),n&&n(y)}return a.jsx(vf,{defaultValue:f&&JW(f),onChange:m,withHelpText:r??!0,...d})}function JW(e){return e.coding?.map(t=>({system:t.system,code:t.code,display:t.display}))}function ZW(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function eY(e){const{defaultValue:t,onChange:n,withHelpText:r,response:o,...s}=e,[c,d]=v.useState(o?.answer?.[0]?.valueCoding??t);function f(p){const m=p[0],g=m&&nY(m);d(g),n&&n(g)}return a.jsx(vf,{defaultValue:c?tY(c):void 0,maxValues:1,onChange:f,withHelpText:r??!0,...s})}function tY(e){return{system:e.system,code:e.code,display:e.display}}function nY(e){return{system:e.system,code:e.code,display:e.display}}function bP(e){const{path:t,outcome:n}=e,{elementsByPath:r,getExtendedProps:o}=v.useContext(mn),[s,c]=v.useState(e.defaultValue),d=v.useRef(s);d.current=s;const[f,p,m]=v.useMemo(()=>["system","use","value"].map(T=>r[t+"."+T]),[r,t]),[g,y,b]=v.useMemo(()=>["system","use","value"].map(T=>o(t+"."+T)),[o,t]);function S(T){T&&Object.keys(T).length===0&&(T=void 0),c(T),e.onChange&&e.onChange(T)}function j(T){const _={...d.current,system:T};T||delete _.system,S(_)}function C(T){const _={...d.current,use:T};T||delete _.use,S(_)}function E(T){const _={...d.current,value:T};T||delete _.value,S(_)}const R=e.valuePath??t;return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(hn,{disabled:e.disabled||g?.readonly,"data-testid":"system",defaultValue:s?.system,required:(f?.min??0)>0,onChange:T=>j(T.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:Lt(n,R+".system")}),a.jsx(hn,{disabled:e.disabled||y?.readonly,"data-testid":"use",defaultValue:s?.use,required:(p?.min??0)>0,onChange:T=>C(T.currentTarget.value),data:["","home","work","temp","old","mobile"],error:Lt(n,R+".use")}),a.jsx(He,{disabled:e.disabled||b?.readonly,placeholder:"Value",defaultValue:s?.value,required:(m?.min??0)>0,onChange:T=>E(T.currentTarget.value),error:Lt(n,R+".value")})]})}function rY(e){const[t,n]=v.useState(e.defaultValue),r=v.useRef(t);r.current=t;const{getExtendedProps:o}=v.useContext(mn),[s,c]=v.useMemo(()=>["name","telecom"].map(m=>o(e.path+"."+m)),[o,e.path]);function d(m){n(m),e.onChange&&e.onChange(m)}function f(m){const g={...r.current,name:m};m||delete g.name,d(g)}function p(m){const g={...r.current,telecom:m&&[m]};m||delete g.telecom,d(g)}return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(He,{disabled:e.disabled||s?.readonly,"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t?.name,onChange:m=>f(m.currentTarget.value)}),a.jsx(bP,{disabled:e.disabled||c?.readonly,name:e.name+"-telecom",path:e.path+".telecom",defaultValue:t?.telecom?.[0],onChange:p,outcome:e.outcome})]})}function iY(e){if(!e)return"";const t=new Date(e);return Um(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function $S(e){if(!e)return"";const t=new Date(e);return Um(t)?t.toISOString():""}function Ao(e){return a.jsx(He,{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:oY(),step:1,defaultValue:iY(e.defaultValue),autoFocus:e.autoFocus,error:Lt(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange($S(n))}}})}function oY(){return"datetime-local"}function aY(e){const{propertyType:t}=e,n=Re(),r=v.useMemo(()=>{if(Nn(t.profile))return t.profile[0]},[t]),[o,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&&(o||!nS(r))?a.jsx("div",{children:"Loading..."}):a.jsx(FS,{profileUrl:r,path:e.path,typeName:"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function sY(e){const{outcome:t,path:n}=e,[r,o]=v.useState(e.defaultValue),{getExtendedProps:s}=v.useContext(mn),[c,d,f,p,m]=v.useMemo(()=>["use","prefix","given","family","suffix"].map(R=>s(e.path+"."+R)),[s,e.path]);function g(R){o(R),e.onChange&&e.onChange(R)}function y(R){g({...r,use:R||void 0})}function b(R){g({...r,prefix:R?R.split(" "):void 0})}function S(R){g({...r,given:R?R.split(" "):void 0})}function j(R){g({...r,family:R||void 0})}function C(R){g({...r,suffix:R?R.split(" "):void 0})}const E=e.valuePath??n;return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(hn,{disabled:e.disabled||c?.readonly,defaultValue:r?.use,name:e.name+"-use","data-testid":"use",onChange:R=>y(R.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:Lt(t,E+".use")}),a.jsx(He,{disabled:e.disabled||d?.readonly,placeholder:"Prefix",name:e.name+"-prefix",defaultValue:r?.prefix?.join(" "),onChange:R=>b(R.currentTarget.value),error:Lt(t,E+".prefix")}),a.jsx(He,{disabled:e.disabled||f?.readonly,placeholder:"Given",name:e.name+"-given",defaultValue:r?.given?.join(" "),onChange:R=>S(R.currentTarget.value),error:Lt(t,E+".given")}),a.jsx(He,{disabled:e.disabled||p?.readonly,name:e.name+"-family",placeholder:"Family",defaultValue:r?.family,onChange:R=>j(R.currentTarget.value),error:Lt(t,E+".family")}),a.jsx(He,{disabled:e.disabled||m?.readonly,placeholder:"Suffix",name:e.name+"-suffix",defaultValue:r?.suffix?.join(" "),onChange:R=>C(R.currentTarget.value),error:Lt(t,E+".suffix")})]})}function lY(e){const[t,n]=v.useState(e.defaultValue),{elementsByPath:r,getExtendedProps:o}=v.useContext(mn),[s,c]=v.useMemo(()=>["system","value"].map(g=>r[e.path+"."+g]),[r,e.path]),[d,f]=v.useMemo(()=>["system","value"].map(g=>o(e.path+"."+g)),[o,e.path]);function p(g){n(g),e.onChange&&e.onChange(g)}const m=e.valuePath??e.path;return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(He,{disabled:e.disabled||d?.readonly,placeholder:"System",required:(s?.min??0)>0,defaultValue:t?.system,onChange:g=>p({...t,system:g.currentTarget.value}),error:Lt(e.outcome,m+".system")}),a.jsx(He,{disabled:e.disabled||f?.readonly,placeholder:"Value",required:(c?.min??0)>0,defaultValue:t?.value,onChange:g=>p({...t,value:g.currentTarget.value}),error:Lt(e.outcome,m+".value")})]})}const cY=["USD","EUR","CAD","GBP","AUD"];function uY(e){const{onChange:t}=e,[n,r]=v.useState(e.defaultValue),{getExtendedProps:o}=v.useContext(mn),[s,c]=v.useMemo(()=>["currency","value"].map(g=>o(e.path+"."+g)),[o,e.path]),d=v.useCallback(g=>{r(g),t&&t(g)},[t]),f=v.useCallback(g=>{d({...n,currency:g.currentTarget.value})},[n,d]),p=v.useCallback(g=>{d({...n,value:g.currentTarget.valueAsNumber})},[n,d]),m=a.jsx(hn,{disabled:e.disabled||s?.readonly,defaultValue:n?.currency,data:cY,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:f});return a.jsx(He,{disabled:e.disabled||c?.readonly,type:"number",name:e.name,label:e.label,placeholder:e.placeholder??"Value",defaultValue:n?.value?.toString()??"USD",leftSection:a.jsx(gq,{size:14}),rightSection:m,rightSectionWidth:92,onChange:p})}function dY(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(mn),[o,s]=v.useMemo(()=>["start","end"].map(d=>r(e.path+"."+d)),[r,e.path]);function c(d){n(d),e.onChange&&e.onChange(d)}return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Ao,{disabled:e.disabled||o?.readonly,name:e.name+".start",placeholder:"Start",defaultValue:t?.start,onChange:d=>c({...t,start:d})}),a.jsx(Ao,{disabled:e.disabled||s?.readonly,name:e.name+".end",placeholder:"End",defaultValue:t?.end,onChange:d=>c({...t,end:d})})]})}function yl(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(mn),[o,s,c]=v.useMemo(()=>["comparator","value","unit"].map(f=>r(e.path+"."+f)),[r,e.path]);function d(f){n(f),e.onChange&&e.onChange(f)}return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(hn,{disabled:e.disabled||o?.readonly,style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t?.comparator,data:["","<","<=",">=",">"],onChange:f=>d({...t,comparator:f.currentTarget.value})}),a.jsx(He,{disabled:e.disabled||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?.value,autoFocus:e.autoFocus,step:"any",onWheel:f=>{e.disableWheel&&f.currentTarget.blur()},onChange:f=>{d({...t,value:fY(f.currentTarget.value)})}}),a.jsx(He,{disabled:e.disabled||c?.readonly,placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t?.unit,onChange:f=>d({...t,unit:f.currentTarget.value})})]})}function fY(e){if(e)return Number.parseFloat(e)}function US(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(mn),[o,s]=v.useMemo(()=>["low","high"].map(d=>r(e.path+"."+d)),[r,e.path]);function c(d){n(d),e.onChange&&e.onChange(d)}return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(yl,{path:e.path+".low",disabled:e.disabled||o?.readonly,name:e.name+"-low",defaultValue:t?.low,onChange:d=>c({...t,low:d})}),a.jsx(yl,{path:e.path+".high",disabled:e.disabled||s?.readonly,name:e.name+"-high",defaultValue:t?.high,onChange:d=>c({...t,high:d})})]})}function hY(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(mn),[o,s]=v.useMemo(()=>["numerator","denominator"].map(d=>r(e.path+"."+d)),[r,e.path]);function c(d){n(d),e.onChange&&e.onChange(d)}return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(yl,{path:e.path+".numerator",disabled:e.disabled||o?.readonly,name:e.name+"-numerator",defaultValue:t?.numerator,onChange:d=>c({...t,numerator:d})}),a.jsx(yl,{path:e.path+".denominator",disabled:e.disabled||s?.readonly,name:e.name+"-denominator",defaultValue:t?.denominator,onChange:d=>c({...t,denominator:d})})]})}const pY={Device:"device-name",Observation:"code",Subscription:"criteria",User:"email:contains"},mY=["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 gY(e){return{value:Mt(e)??"",label:ba(e),resource:e}}function kl(e){const t=Re(),{resourceType:n,searchCriteria:r}=e,[o,s]=v.useState(),c=Jt(e.defaultValue,s),d=e.itemComponent??vY,f=e.onChange,p=v.useCallback(async(g,y)=>{const b=yY(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 Nn(e.defaultValue)&&!o&&!c?null:a.jsx(NS,{disabled:e.disabled,name:e.name,label:e.label,error:e.error,required:e.required,itemComponent:d,defaultValue:c,placeholder:e.placeholder,maxValues:1,toOption:gY,loadOptions:p,onChange:m,clearable:!0})}const vY=v.forwardRef(({label:e,resource:t,active:n,...r},o)=>a.jsx("div",{ref:o,...r,children:a.jsxs(ye,{wrap:"nowrap",children:[a.jsx(Aa,{value:t}),a.jsxs("div",{children:[a.jsx(Ee,{children:e}),a.jsx(Ee,{size:"xs",c:"dimmed",children:t.birthDate||t.id})]})]})}));function yY(e){return pY[e]??(mY.includes(e)?"name":"_id")}function ps(e){const{onChange:t}=e,n=Re(),[r,o]=v.useState(e.defaultValue),[s,c]=v.useState(()=>xY(e.targetTypes)),[d,f]=v.useState(()=>bY(e.defaultValue,s)),p=v.useRef(new OD),m=v.useMemo(()=>d?.type==="profile"?{...e.searchCriteria,_profile:d.value}:e.searchCriteria,[e.searchCriteria,d]);v.useEffect(()=>{let b=!1;const S=s?.map(j=>{if(!wY(j))return Promise.resolve(j);b=!0;const C=j.value,E=p.current.get(C);if(E)return E;const R=SY(n,j.value).then(_=>{const k={...j};return _?Nn(_.type)?(k.resourceType=_.type,k.name=_.name,k.title=_.title):(console.error(`StructureDefinition.type missing for ${j.value}`),k.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${j.value}`),k.error="StructureDefinition not found"),k}).catch(_=>(console.error(_),{...j,error:_})),T=new Wi(R);return p.current.set(C,T),T});!S||!b||Promise.all(S).then(j=>{if(c(j),!d)return;const C=j.findIndex(E=>E.value===d.value||E.resourceType===d.resourceType);if(C===-1){console.debug(`defaultValue had unexpected resourceType: ${d.resourceType}`);return}f(j[C])}).catch(console.error)},[n,d,s]);const g=v.useCallback(b=>{const S=b?Yt(b):void 0;o(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 a.jsxs(a.Fragment,{children:[e.name&&a.jsx("input",{type:"hidden",name:e.name,value:r?.reference??""}),a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[s&&s.length>1&&a.jsx(hn,{name:e.name+"-resourceType",disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:d?.resourceType,autoFocus:e.autoFocus,onChange:b=>{const S=b.currentTarget.value,j=s.find(C=>C.value===S);f(j)},data:y}),!s&&a.jsx(LS,{disabled:e.disabled,autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:d?.resourceType,onChange:b=>{f(b?{type:"resourceType",value:b,resourceType:b}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),a.jsx(kl,{resourceType:d?.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:m,onChange:g,disabled:e.disabled})]})]})}function xY(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 bY(e,t){const n=e?.reference?.split("/")[0];if(n){const r=t?.find(o=>o.resourceType===n);return r||{type:"resourceType",value:n,resourceType:n}}if(t&&t.length>0)return t[0]}async function SY(e,t){const n=uu(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
|
|
227
|
+
StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
|
|
228
|
+
type,
|
|
229
|
+
name,
|
|
230
|
+
title,
|
|
231
|
+
}
|
|
232
|
+
}`.replaceAll(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function wY(e){return e.type==="profile"&&!e?.error&&Cn(e.resourceType)}function jY(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}const CY="_indented_ldk1d_1",SP={indented:CY};function BS({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?a.jsx(Pe,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:a.jsx(Lp,{size:"1.25rem"}),onClick:t,children:r}):a.jsx(Dn,{title:r,color:"green.6","data-testid":n,onClick:t,children:a.jsx(Lp,{size:"1.25rem"})})}function wP({propertyDisplayName:e,onClick:t,testId:n}){return a.jsx(Dn,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:a.jsx(Mp,{size:"1.25rem"})})}function EY(e){const{slice:t,property:n}=e,[r,o]=v.useState(e.defaultValue),s=t.typeSchema?.elements??t.elements,c=v.useContext(mn),d=v.useMemo(()=>{if(Nn(s))return Wc({parentContext:c,elements:s,path:e.path,profileUrl:t.typeSchema?.url})},[c,e.path,t.typeSchema?.url,s]);function f(b){o(b),e.onChange&&e.onChange(b)}const p=t.min>0,m=Cn(t.elements),g=dk(t.name),y=e.property.readonly&&r.length===0;return ng(mn.Provider,d,a.jsx(zt,{title:g,description:t.definition,withAsterisk:p,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:y?a.jsx(Ee,{c:"dimmed",children:"(empty)"}):a.jsxs(Be,{className:m?SP.indented:void 0,children:[r.map((b,S)=>a.jsxs(ye,{wrap:"nowrap",children:[a.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${S}`,children:a.jsx(VS,{elementDefinitionType:t.type[0],name:t.name,defaultValue:b,onChange:j=>{const C=[...r];C[S]=j,f(C)},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&&a.jsx(wP,{propertyDisplayName:g,testId:e.testId&&`${e.testId}-remove-${S}`,onClick:j=>{yn(j);const C=[...r];C.splice(S,1),f(C)}})]},`${S}-${r.length}`)),!e.property.readonly&&r.length<t.max&&a.jsx(ye,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx(BS,{propertyDisplayName:g,onClick:b=>{yn(b);const S=[...r,void 0];f(S)},testId:e.testId&&`${e.testId}-add`})})]})}))}function TY(e){const{property:t}=e,n=Re(),[r,o]=v.useState(!0),[s,c]=v.useState([]),[d]=v.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[f,p]=v.useState(()=>[d]),m=v.useContext(mn),g=t.type[0]?.code;v.useEffect(()=>{mP({medplum:n,property:t}).then(R=>{c(R);const T=pP(d,R,t.slicing,m.profileUrl);RY(T,R),p(T),o(!1)}).catch(R=>{console.error(R),o(!1)})},[n,t,d,m.profileUrl,p]);function y(R,T){const _=[...f];if(_[T]=R,p(_),e.onChange){const k=_.flat().filter(L=>L!==void 0);e.onChange(k)}}if(r)return a.jsx("div",{children:"Loading..."});const b=s.length,S=f[b],j=!(e.hideNonSliceValues??(g==="Extension"&&s.length>0)),C=ml(t.path),E=e.property.readonly&&s.length===0&&d.length===0;return a.jsxs(Be,{className:e.indent?SP.indented:void 0,children:[E&&a.jsx(Ee,{c:"dimmed",children:"(empty)"}),s.map((R,T)=>a.jsx(EY,{slice:R,path:e.path,valuePath:e.valuePath,property:t,defaultValue:f[T],onChange:_=>{y(_,T)},testId:`slice-${R.name}`},R.name)),j&&S.map((R,T)=>a.jsxs(ye,{wrap:"nowrap",style:{flexGrow:1},children:[a.jsx("div",{style:{flexGrow:1},children:a.jsx(bf,{arrayElement:!0,property:e.property,name:e.name+"."+T,path:e.path,valuePath:jY(e.path,e.valuePath,T),defaultValue:R,onChange:_=>{const k=[...S];k[T]=_,y(k,b)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&a.jsx(wP,{propertyDisplayName:C,testId:`nonsliced-remove-${T}`,onClick:_=>{yn(_);const k=[...S];k.splice(T,1),y(k,b)}})]},`${T}-${S.length}`)),!e.property.readonly&&j&&f.flat().length<t.max&&a.jsx(ye,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx(BS,{propertyDisplayName:C,onClick:R=>{yn(R);const T=[...S];T.push(void 0),y(T,b)},testId:"nonsliced-add"})})]})}function RY(e,t){for(let n=0;n<t.length;n++){const r=t[n],o=e[n];for(;o.length<r.min;)o.push(void 0)}}function _Y(e){const[t,n]=v.useState(!1),r=V2(),o=v.useRef(null),s={...e.styles};return t||(s.input||(s.input={}),s.input.WebkitTextSecurity="disc"),a.jsxs(no,{gap:"xs",children:[a.jsx(Rl,{...e,styles:{...s,root:{...s.root??{},flexGrow:1}},ref:o,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),a.jsx(Dn,{title:"Copy secret",onClick:()=>{r.copy(o.current?.value),Ne({color:"green",message:"Copied"})},children:a.jsx(TS,{})})]})}const AY=["sun","mon","tue","wed","thu","fri","sat"];function DY(e){const[t,n]=v.useState(e.defaultValue),[r,o]=v.useState(!e.disabled&&(e.defaultModalOpen??!1)),s=v.useRef(t);return s.current=t,a.jsxs(a.Fragment,{children:[a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx("span",{children:lk(s.current)||"No repeat"}),a.jsx(Pe,{disabled:e.disabled,onClick:()=>o(!0),children:"Edit"})]}),!e.disabled&&a.jsx(kY,{path:e.path,visible:r,defaultValue:s.current,onOk:c=>{e.onChange&&e.onChange(c),n(c),o(!1)},onCancel:()=>o(!1)})]})}const pR={repeat:{period:1,periodUnit:"d"}};function kY(e){const[t,n]=v.useState(e.defaultValue||pR),{getExtendedProps:r}=v.useContext(mn),[o,s,c,d,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){g({...p.current?.repeat,period:j})}function b(j){g({...p.current?.repeat,periodUnit:j})}function S(j){g({...p.current?.repeat,dayOfWeek:j})}return a.jsx(Un,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:a.jsxs(Be,{children:[a.jsx(zt,{title:"Starts on",htmlFor:"timing-dialog-start",children:a.jsx(Ao,{disabled:o?.readonly,name:"timing-dialog-start",onChange:j=>m(j)})}),a.jsx(af,{disabled:s?.readonly,label:"Repeat",checked:!!t.repeat,onChange:j=>g(j.currentTarget.checked?pR.repeat:void 0)}),t.repeat&&a.jsxs(a.Fragment,{children:[a.jsx(zt,{title:"Repeat every",htmlFor:"timing-dialog-period",children:a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(He,{disabled:c?.readonly,type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:j=>y(Number.parseInt(j.currentTarget.value,10)||1)}),a.jsx(hn,{disabled:d?.readonly,id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:j=>b(j.currentTarget.value),data:[{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"&&a.jsx(zt,{title:"Repeat on",children:a.jsx(Ad.Group,{multiple:!0,onChange:S,children:a.jsx(ye,{justify:"space-between",mt:"md",gap:"xs",children:AY.map(j=>a.jsx(Ad,{value:j,size:"xs",radius:"xl",disabled:f?.readonly,children:j.charAt(0).toUpperCase()},j))})})})]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(Pe,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function bf(e){const{property:t,name:n,onChange:r,defaultValue:o}=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===ne.Attachment)return a.jsx(cW,{name:n,defaultValue:o,onChange:r,disabled:t.readonly});const d=c[0]?.code!==ne.Extension;return a.jsx(TY,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:o,indent:d,onChange:r,outcome:e.outcome})}else return c.length>1?a.jsx(PY,{elementDefinitionTypes:c,...e}):a.jsx(VS,{name:n,defaultValue:o,onChange:d=>{if(e.onChange){const f=e.name.replace("[x]",Qn(c[0].code));e.onChange(d,f)}},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 PY(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(s=>s.code===e.defaultPropertyType)),n||(n=t[0]);const[r,o]=v.useState(n);return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(hn,{disabled:e.property.readonly,style:{width:"200px"},defaultValue:r.code,"data-testid":e.name&&e.name+"-selector",onChange:s=>{o(t.find(c=>c.code===s.currentTarget.value))},data:t.map(s=>({value:s.code,label:s.code}))}),a.jsx(VS,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:s=>{e.onChange&&e.onChange(s,e.name.replace("[x]",Qn(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 VS(e){const{name:t,onChange:n,outcome:r,binding:o,path:s,valuePath:c,readOnly:d}=e,f=e.min!==void 0&&e.min>0,p=e.elementDefinitionType.code,m=v.useContext(mn),g=v.useMemo(()=>{if(!sS(p)||!Cn(e.defaultValue))return e.defaultValue;const S=Object.create(null);if(m.path===e.path)QT(S,m.elements);else{const j=il(m.path,e.path);if(j===void 0)return e.defaultValue;QT(S,m.elements,j)}return Nn(S)?S:e.defaultValue},[p,m.path,m.elements,e.path,e.defaultValue]);if(!p)return a.jsx("div",{children:"Property type not specified "});function y(){return{name:t,defaultValue:g,onChange:n,outcome:r,path:s,valuePath:c,disabled:d}}function b(){const S=Lt(e.outcome,c??s);return{id:t,name:t,"data-testid":t,defaultValue:g,required:f,error:S,disabled:d}}switch(p){case ne.SystemString:case ne.canonical:case ne.string:case ne.time:case ne.uri:case ne.url:return e.path==="Project.secret.value[x]"?a.jsx(_Y,{...b(),onChange:S=>{e.onChange&&e.onChange(S.currentTarget.value)}}):a.jsx(He,{...b(),onChange:S=>{n&&n(S.currentTarget.value)}});case ne.date:return a.jsx(He,{...b(),type:"date",onChange:S=>{n&&n(S.currentTarget.value)}});case ne.dateTime:case ne.instant:return a.jsx(Ao,{...b(),onChange:n,outcome:r});case ne.decimal:case ne.integer:case ne.positiveInt:case ne.unsignedInt:return a.jsx(He,{...b(),type:"number",step:p===ne.decimal?"any":"1",onChange:S=>{if(n){const j=S.currentTarget.valueAsNumber;n(Number.isNaN(j)?void 0:j)}}});case ne.code:return a.jsx(rP,{...b(),error:void 0,onChange:n,binding:o?.valueSet,creatable:!0,maxValues:1});case ne.boolean:return a.jsx(Ln,{...b(),defaultChecked:!!g,onChange:S=>{n&&n(S.currentTarget.checked)}});case ne.base64Binary:case ne.markdown:case ne.xhtml:return a.jsx(Rl,{...b(),spellCheck:p!==ne.base64Binary,onChange:S=>{n&&n(S.currentTarget.value)}});case ne.Address:return a.jsx(DH,{...y()});case ne.Annotation:return a.jsx(kH,{...y()});case ne.Attachment:return a.jsx(iP,{...y()});case ne.CodeableConcept:return a.jsx(XW,{binding:o?.valueSet,...y()});case ne.Coding:return a.jsx(eY,{binding:o?.valueSet,...y()});case ne.ContactDetail:return a.jsx(rY,{...y()});case ne.ContactPoint:return a.jsx(bP,{...y()});case ne.Extension:return a.jsx(aY,{...y(),propertyType:e.elementDefinitionType});case ne.HumanName:return a.jsx(sY,{...y()});case ne.Identifier:return a.jsx(lY,{...y()});case ne.Money:return a.jsx(uY,{...y()});case ne.Period:return a.jsx(dY,{...y()});case ne.Duration:case ne.Quantity:return a.jsx(yl,{...y()});case ne.Range:return a.jsx(US,{...y()});case ne.Ratio:return a.jsx(hY,{...y()});case ne.Reference:return a.jsx(ps,{...y(),targetTypes:OY(e.elementDefinitionType)});case ne.Timing:return a.jsx(DY,{...y()});case ne.Dosage:case ne.UsageContext:default:return a.jsx(FS,{...y(),typeName:p})}}const NY=[`${ao}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function OY(e){return e?.targetProfile?.map(t=>{const n=NY.find(r=>t.startsWith(r));return n?t.slice(n.length):t})}function MY(e){const[t,n]=v.useState(e.defaultValue??{}),r=v.useContext(mn),o=v.useMemo(()=>AH(r.elements),[r.elements]);function s(d){n(d),e.onChange&&e.onChange(d)}const c={type:e.type,value:t};return a.jsx(Be,{style:{flexGrow:1},"data-testid":e.testId,children:o.map(([d,f])=>{const[p,m]=zW(c,d,f),g=f.min!==void 0&&f.min>0,y=e.valuePath?e.valuePath+"."+d:void 0,b=a.jsx(bf,{property:f,name:d,path:e.path+"."+d,valuePath:y,defaultValue:p,defaultPropertyType:m,onChange:(S,j)=>{s(YW({...t},d,j??d,f,S))},outcome:e.outcome},d);return e.type==="Extension"||jS.includes(d)?b:f.type.length===1&&f.type[0].code==="boolean"?a.jsx(xP,{title:ml(d),description:f.description,htmlFor:d,fhirPath:f.path,withAsterisk:g,readonly:f.readonly,children:b},d):a.jsx(zt,{title:ml(d),description:f.description,withAsterisk:g,htmlFor:d,outcome:e.outcome,fhirPath:f.path,errorExpression:y,readonly:f.readonly,children:b},d)})})}const LY="_nested_1ya4k_1",IY={nested:LY};function FS(e){const[t]=v.useState(()=>e.defaultValue??{}),n=v.useContext(mn),r=e.profileUrl??n?.profileUrl,o=v.useMemo(()=>zm(e.typeName,r),[e.typeName,r]),s=o?.type??e.typeName,c=v.useMemo(()=>{if(o)return Wc({parentContext:n,elements:o.elements,path:e.path,profileUrl:o.url,accessPolicyResource:e.accessPolicyResource})},[o,n,e.path,e.accessPolicyResource]);if(!o)return a.jsxs("div",{children:[s," not implemented"]});const d=n.path!=="";return ng(mn.Provider,c,a.jsx(ce,{className:$t({[IY.nested]:d}),children:a.jsx(MY,{path:e.path,valuePath:e.valuePath,type:s,defaultValue:t,onChange:e.onChange,outcome:e.outcome})}))}const zY="_noteCite_10swh_5",$Y="_noteRoot_10swh_10",mR={noteCite:zY,noteRoot:$Y};function jP({value:e}){return e?a.jsx(Be,{justify:"flex-start",gap:"xs",children:e.map(t=>t.text&&a.jsx(p0,{classNames:{cite:mR.noteCite,root:mR.noteRoot},cite:t.authorReference?.display||t.authorString,icon:null,children:t.text},`note-${t.text}`))}):null}function Pl(e){const{value:t,link:n,...r}=e,[o,s]=v.useState(),c=Jt(t,s);let d;if(o&&!LD(o))d=`[${Qe(o)}]`;else if(c)d=ba(c);else return null;return n?a.jsx(yt,{to:t,...r,children:d}):a.jsx(Ee,{component:"span",...r,children:d})}function Ic(e){return a.jsxs(ye,{gap:"xs",children:[a.jsx(Aa,{size:24,radius:12,value:e.value,link:e.link}),a.jsx(Pl,{value:e.value,link:e.link})]})}const UY={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 rg(e){const{status:t,...n}=e;return a.jsx(h0,{color:e.color||UY[t],...n,children:t.replaceAll("-"," ")})}const BY="_table_pe9td_1",VY="_criticalRow_pe9td_12",CP={table:BY,criticalRow:VY};HS.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1,hideSubject:!1};function HS(e){const t=Re(),n=Jt(e.value),[r,o]=v.useState();if(v.useEffect(()=>{n?.specimen&&Promise.allSettled(n.specimen.map(c=>t.readReference(c))).then(c=>c.filter(d=>d.status==="fulfilled").map(d=>d.value)).then(o).catch(console.error)},[t,n]),!n)return null;const s=r?.flatMap(c=>c.note||[])||[];if(n.presentedForm&&n.presentedForm.length>0){const c=n.presentedForm[0];c.contentType?.startsWith("text/plain")&&c.data&&s.push({text:window.atob(c.data)})}return a.jsxs(Be,{children:[a.jsx($e,{children:"Diagnostic Report"}),a.jsx(FY,{value:n,hideSubject:e.hideSubject}),r&&!e.hideSpecimenInfo&&HY(r),n.result&&a.jsx(qY,{hideObservationNotes:e.hideObservationNotes,value:n.result}),s.length>0&&a.jsx(jP,{value:s})]})}function FY({value:e,hideSubject:t=!1}){return a.jsxs(ye,{mt:"md",gap:30,children:[e.subject&&!t&&a.jsxs("div",{children:[a.jsx(Ee,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),a.jsx(Ic,{value:e.subject,link:!0})]}),e.resultsInterpreter?.map(n=>a.jsxs("div",{children:[a.jsx(Ee,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),a.jsx(Ic,{value:n,link:!0})]},n.reference)),e.performer?.map(n=>a.jsxs("div",{children:[a.jsx(Ee,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),a.jsx(Ic,{value:n,link:!0})]},n.reference)),e.issued&&a.jsxs("div",{children:[a.jsx(Ee,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),a.jsx(Ee,{children:Cr(e.issued)})]}),e.status&&a.jsxs("div",{children:[a.jsx(Ee,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),a.jsx(rg,{status:e.status})]})]})}function HY(e){return a.jsxs(Be,{gap:"xs",children:[a.jsx($e,{order:2,size:"h6",children:"Specimens"}),a.jsx(Pr,{type:"ordered",children:e?.map(t=>a.jsx(Pr.Item,{ml:"sm",children:a.jsxs(ye,{gap:20,children:[a.jsxs(ye,{gap:5,children:[a.jsx(Ee,{fw:500,children:"Collected:"})," ",Cr(t.collection?.collectedDateTime)]}),a.jsxs(ye,{gap:5,children:[a.jsx(Ee,{fw:500,children:"Received:"})," ",Cr(t.receivedTime)]})]})},`specimen-${t.id}`))})]})}function qY(e){return a.jsxs("table",{className:CP.table,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Test"}),a.jsx("th",{children:"Value"}),a.jsx("th",{children:"Reference Range"}),a.jsx("th",{children:"Interpretation"}),a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Performer"}),a.jsx("th",{children:"Status"})]})}),a.jsx("tbody",{children:a.jsx(EP,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function EP(e){return a.jsx(a.Fragment,{children:e.value?.map(t=>a.jsx(GY,{value:t,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${_a(t)?t.reference:t.id}`))})}function GY(e){const t=Jt(e.value);if(!t||e.ancestorIds?.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=YY(t);return a.jsxs(a.Fragment,{children:[a.jsxs("tr",{className:$t({[CP.criticalRow]:r}),children:[a.jsx("td",{rowSpan:n?2:1,children:a.jsx(yt,{to:t,children:a.jsx(_o,{value:t.code})})}),a.jsx("td",{children:a.jsx(QY,{value:t})}),a.jsx("td",{children:a.jsx(WY,{value:t.referenceRange})}),a.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&a.jsx(_o,{value:t.interpretation[0]})}),a.jsx("td",{children:t.category&&t.category.length>0&&a.jsx(a.Fragment,{children:t.category.map(o=>a.jsx("div",{children:a.jsx(_o,{value:o})},`category-${gs(o)}`))})}),a.jsx("td",{children:t.performer?.map(o=>a.jsx($p,{value:o},o.reference))}),a.jsx("td",{children:t.status&&a.jsx(rg,{status:t.status})})]}),t.hasMember&&a.jsx(EP,{value:t.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,t.id]:[t.id],hideObservationNotes:e.hideObservationNotes}),n&&a.jsx("tr",{children:a.jsx("td",{colSpan:6,children:a.jsx(jP,{value:t.note})})})]})}function QY(e){const t=e.value;return a.jsx(a.Fragment,{children:ck(t)})}function WY(e){const t=e.value&&e.value.length>0&&e.value[0];return t?t.text?a.jsx(a.Fragment,{children:t.text}):a.jsx(zS,{value:t}):null}function YY(e){const t=e.interpretation?.[0]?.coding?.[0]?.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}var tx={},da={},gR;function TP(){if(gR)return da;gR=1,Object.defineProperty(da,"__esModule",{value:!0}),da.Pointer=da.escapeToken=da.unescapeToken=void 0;function e(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}da.unescapeToken=e;function t(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}da.escapeToken=t;var n=(function(){function r(o){o===void 0&&(o=[""]),this.tokens=o}return r.fromJSON=function(o){var s=o.split("/").map(e);if(s[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(o));return new r(s)},r.prototype.toString=function(){return this.tokens.map(t).join("/")},r.prototype.evaluate=function(o){for(var s=null,c="",d=o,f=1,p=this.tokens.length;f<p;f++)s=d,c=this.tokens[f],!(c=="__proto__"||c=="constructor"||c=="prototype")&&(d=(s||{})[c]);return{parent:s,key:c,value:d}},r.prototype.get=function(o){return this.evaluate(o).value},r.prototype.set=function(o,s){var c=this.evaluate(o);c.parent&&(c.parent[c.key]=s)},r.prototype.push=function(o){this.tokens.push(o)},r.prototype.add=function(o){var s=this.tokens.concat(String(o));return new r(s)},r})();return da.Pointer=n,da}var Sn={},nx={},vR;function RP(){return vR||(vR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.clone=e.objectType=e.hasOwnProperty=void 0,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(o){return o===void 0?"undefined":o===null?"null":Array.isArray(o)?"array":typeof o}e.objectType=t;function n(o){return o!=null&&typeof o=="object"}function r(o){if(!n(o))return o;if(o.constructor==Array){for(var s=o.length,c=new Array(s),d=0;d<s;d++)c[d]=r(o[d]);return c}if(o.constructor==Date){var f=new Date(+o);return f}var p={};for(var m in o)e.hasOwnProperty.call(o,m)&&(p[m]=r(o[m]));return p}e.clone=r})(nx)),nx}var Dr={},yR;function _P(){if(yR)return Dr;yR=1,Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.diffAny=Dr.diffObjects=Dr.diffArrays=Dr.intersection=Dr.subtract=Dr.isDestructive=void 0;var e=RP();function t(m){var g=m.op;return g==="remove"||g==="replace"||g==="copy"||g==="move"}Dr.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)}Dr.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)}Dr.intersection=r;function o(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 d(m,g,y,b){b===void 0&&(b=p);var S={"0,0":{operations:[],cost:0}};function j(_,k){var L="".concat(_,",").concat(k),A=S[L];if(A===void 0){if(_>0&&k>0&&!b(m[_-1],g[k-1],y.add(String(_-1))).length)A=j(_-1,k-1);else{var N=[];if(_>0){var z=j(_-1,k),B={op:"remove",index:_-1};N.push(c(z,B))}if(k>0){var G=j(_,k-1),Y={op:"add",index:_-1,value:g[k-1]};N.push(c(G,Y))}if(_>0&&k>0){var J=j(_-1,k-1),U={op:"replace",index:_-1,original:m[_-1],value:g[k-1]};N.push(c(J,U))}var W=N.sort(function(O,I){return O.cost-I.cost})[0];A=W}S[L]=A}return A}var C=isNaN(m.length)||m.length<=0?0:m.length,E=isNaN(g.length)||g.length<=0?0:g.length,R=j(C,E).operations,T=R.reduce(function(_,k){var L=_[0],A=_[1];if(o(k)){var N=k.index+1+A,z=N<C+A?String(N):"-",B={op:k.op,path:y.add(z).toString(),value:k.value};return[L.concat(B),A+1]}else if(s(k)){var B={op:k.op,path:y.add(String(k.index+A)).toString()};return[L.concat(B),A-1]}else{var G=y.add(String(k.index+A)),Y=b(k.original,k.value,G);return[L.concat.apply(L,Y),A]}},[[],0])[0];return T}Dr.diffArrays=d;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}Dr.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"?d(m,g,y,b):S=="object"&&j=="object"?f(m,g,y,b):[{op:"replace",path:y.toString(),value:g}]}return Dr.diffAny=p,Dr}var xR;function KY(){if(xR)return Sn;xR=1;var e=Sn&&Sn.__extends||(function(){var C=function(E,R){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,_){T.__proto__=_}||function(T,_){for(var k in _)Object.prototype.hasOwnProperty.call(_,k)&&(T[k]=_[k])},C(E,R)};return function(E,R){if(typeof R!="function"&&R!==null)throw new TypeError("Class extends value "+String(R)+" is not a constructor or null");C(E,R);function T(){this.constructor=E}E.prototype=R===null?Object.create(R):(T.prototype=R.prototype,new T)}})();Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.apply=Sn.InvalidOperationError=Sn.test=Sn.copy=Sn.move=Sn.replace=Sn.remove=Sn.add=Sn.TestError=Sn.MissingError=void 0;var t=TP(),n=RP(),r=_P(),o=(function(C){e(E,C);function E(R){var T=C.call(this,"Value required at path: ".concat(R))||this;return T.path=R,T.name="MissingError",T}return E})(Error);Sn.MissingError=o;var s=(function(C){e(E,C);function E(R,T){var _=C.call(this,"Test failed: ".concat(R," != ").concat(T))||this;return _.actual=R,_.expected=T,_.name="TestError",_}return E})(Error);Sn.TestError=s;function c(C,E,R){if(Array.isArray(C))if(E=="-")C.push(R);else{var T=parseInt(E,10);C.splice(T,0,R)}else C[E]=R}function d(C,E){if(Array.isArray(C)){var R=parseInt(E,10);C.splice(R,1)}else delete C[E]}function f(C,E){var R=t.Pointer.fromJSON(E.path).evaluate(C);return R.parent===void 0?new o(E.path):(c(R.parent,R.key,(0,n.clone)(E.value)),null)}Sn.add=f;function p(C,E){var R=t.Pointer.fromJSON(E.path).evaluate(C);return R.value===void 0?new o(E.path):(d(R.parent,R.key),null)}Sn.remove=p;function m(C,E){var R=t.Pointer.fromJSON(E.path).evaluate(C);if(R.parent===null)return new o(E.path);if(Array.isArray(R.parent)){if(parseInt(R.key,10)>=R.parent.length)return new o(E.path)}else if(R.value===void 0)return new o(E.path);return R.parent[R.key]=(0,n.clone)(E.value),null}Sn.replace=m;function g(C,E){var R=t.Pointer.fromJSON(E.from).evaluate(C);if(R.value===void 0)return new o(E.from);var T=t.Pointer.fromJSON(E.path).evaluate(C);return T.parent===void 0?new o(E.path):(d(R.parent,R.key),c(T.parent,T.key,R.value),null)}Sn.move=g;function y(C,E){var R=t.Pointer.fromJSON(E.from).evaluate(C);if(R.value===void 0)return new o(E.from);var T=t.Pointer.fromJSON(E.path).evaluate(C);return T.parent===void 0?new o(E.path):(c(T.parent,T.key,(0,n.clone)(R.value)),null)}Sn.copy=y;function b(C,E){var R=t.Pointer.fromJSON(E.path).evaluate(C);return(0,r.diffAny)(R.value,E.value,new t.Pointer).length?new s(R.value,E.value):null}Sn.test=b;var S=(function(C){e(E,C);function E(R){var T=C.call(this,"Invalid operation: ".concat(R.op))||this;return T.operation=R,T.name="InvalidOperationError",T}return E})(Error);Sn.InvalidOperationError=S;function j(C,E){switch(E.op){case"add":return f(C,E);case"remove":return p(C,E);case"replace":return m(C,E);case"move":return g(C,E);case"copy":return y(C,E);case"test":return b(C,E)}return new S(E)}return Sn.apply=j,Sn}var bR;function XY(){return bR||(bR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=TP();Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=KY(),r=_P();function o(p,m){return m.map(function(g){return(0,n.apply)(p,g)})}e.applyPatch=o;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 d(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=d(p,y.path);if(b&&g.push(b),"from"in y){var S=d(p,y.from);S&&g.push(S)}}),g}e.createTests=f})(tx)),tx}var AP=XY();const JY="_removed_el5zk_1",ZY="_added_el5zk_6",SR={removed:JY,added:ZY};function eK(e){const{name:t,path:n,property:r,originalValue:o,revisedValue:s}=e,c=!!r?.type?.find(m=>m.code==="Attachment"),[d,f]=v.useState(c),p=()=>f(m=>!m);return a.jsx(a.Fragment,{children:c&&!d||!c?a.jsx(a.Fragment,{children:a.jsxs(ue.Tr,{children:[a.jsx(ue.Td,{children:t}),a.jsx(ue.Td,{className:SR.removed,children:o&&a.jsx(oo,{path:n,property:r,propertyType:o.type,value:o.value,ignoreMissingValues:!0})}),a.jsx(ue.Td,{className:SR.added,children:s&&a.jsx(oo,{path:n,property:r,propertyType:s.type,value:s.value,ignoreMissingValues:!0})})]})}):a.jsxs(ue.Tr,{children:[a.jsx(ue.Td,{children:t}),a.jsx(ue.Td,{colSpan:2,style:{textAlign:"right"},children:a.jsx(Pe,{onClick:p,variant:"light",children:"Expand"})})]})})}const tK="_root_15xvr_1",nK={root:tK};function rK(e){const t=Re(),{original:n,revised:r}=e,[o,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(!o)return null;const d=[fi(n)],f=[fi(r)],p=[],m=iK(AP.createPatch(n,r));for(const g of m){const y=g.path,b=oK(y),S=aK(n.resourceType,b),j=g.op==="add"?void 0:vs(b,d),C=g.op==="remove"?void 0:vs(b,f);p.push({key:`op-${g.op}-${g.path}`,name:`${Qn(g.op)} ${b}`,path:S?.path??n.resourceType+"."+b,property:S,originalValue:wR(S,j),revisedValue:wR(S,C)})}return p},[o,n,r]);return c?a.jsxs(ue,{className:nK.root,children:[a.jsx(ue.Thead,{children:a.jsxs(ue.Tr,{children:[a.jsx(ue.Th,{}),a.jsx(ue.Th,{children:"Before"}),a.jsx(ue.Th,{children:"After"})]})}),a.jsx(ue.Tbody,{children:c.map(d=>{const{key:f,...p}=d;return a.jsx(eK,{...p},f)})})]}):null}function iK(e){const t=[];for(const n of e){const{op:r,path:o}=n;if(o.startsWith("/meta/author")||o.startsWith("/meta/compartment")||o.startsWith("/meta/lastUpdated")||o.startsWith("/meta/versionId"))continue;const s=e.filter(d=>d.op===r&&d.path===o).length,c={op:r,path:o};s>1&&(r==="add"||r==="remove")&&/\/[0-9-]+$/.test(o)&&(c.op="replace",c.path=o.replace(/\/[^/]+$/,"")),t.some(d=>d.op===c.op&&d.path===c.path)||t.push(c)}return t}function oK(e){const t=e.split("/").filter(Boolean);let n="";for(let r=0;r<t.length;r++){const o=t[r];o==="-"?n+=".last()":/^\d+$/.test(o)?n+=`[${o}]`:(r>0&&(n+="."),n+=o)}return n.endsWith(".url")&&(n=n.replace(/\.url$/,"")),n}function aK(e,t){try{return Gm(e,{resourceType:"SearchParameter",base:[e],code:e+"."+t,expression:e+"."+t})?.elementDefinitions?.[0]}catch(n){console.warn("Failed to get element definition",{resourceType:e,fhirPath:t,err:n});return}}function wR(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:sK(t,!!e?.isArray)}}function sK(e,t){const n=pB(e).flatMap(r=>r.value);return t?n:n[0]}function qS(e){const{profileUrl:t}=e,n=Re(),r=n.getAccessPolicy(),o=Jt(e.value),[s,c]=v.useState(!1);v.useEffect(()=>{if(o)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{uu(t)?c(!0):console.error(`Schema not found for ${t}`)}).catch(f=>{console.error("Error in requestProfileSchema",f)});else{const f=o.resourceType;n.requestSchema(f).then(()=>{c(!0)}).catch(console.error)}},[n,t,o]);const d=v.useMemo(()=>o&&mk(o,al.READ,r),[r,o]);return!s||!o?null:a.jsx(Up,{path:o.resourceType,value:{type:o.resourceType,value:e.forceUseInput?e.value:o},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:d})}const lK="_item_5q6yx_1",cK="_itemPadding_5q6yx_5",jR={item:lK,itemPadding:cK};function uK(e){return a.jsx(hu,{children:e.children})}function xl(e){const{resource:t,profile:n,padding:r,popupMenuItems:o,...s}=e,c=n??t.meta?.author,d=e.dateTime??t.meta?.lastUpdated;return a.jsxs(Dl,{"data-testid":"timeline-item",fill:!0,...s,children:[a.jsxs(ye,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[a.jsx(Aa,{value:c,link:!0,size:"md"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(Ee,{size:"sm",children:a.jsx(Pl,{c:"dark",fw:500,value:c,link:!0})}),a.jsxs(Ee,{size:"xs",children:[a.jsx(yt,{c:"dimmed",to:e.resource,children:Cr(d)}),a.jsx(Ee,{component:"span",c:"dimmed",mx:8,children:"·"}),a.jsx(yt,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&a.jsxs(be,{position:"bottom-end",shadow:"md",width:200,children:[a.jsx(be.Target,{children:a.jsx(Dn,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${Mt(e.resource)}`,children:a.jsx(wq,{})})}),o]})]}),a.jsx(DS,{children:a.jsx("div",{className:$t(jR.item,{[jR.itemPadding]:r}),children:e.children})})]})}function DP(e,t){e.sort((n,r)=>{const o=CR(n,t),s=CR(r,t);return o>s?1:o<s?-1:ER(n,t)-ER(r,t)})}function CR(e,t){if(!kP(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function ER(e,t){if(!kP(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=e.meta?.lastUpdated;return n?new Date(n).getTime():0}function kP(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const dK="_pinnedComment_u08s5_1",fK={pinnedComment:dK};function ig(e){const t=Re(),n=t.getProfile(),r=v.useRef(null),o=Jt(e.value),[s,c]=v.useState(),[d,f]=v.useState([]),[p,m]=v.useState(10),g=e.loadTimelineResources,y=v.useRef(d);y.current=d;const b=v.useCallback(A=>{DP(A,o),A.reverse(),f(A)},[o]),S=v.useCallback(A=>{const N=[];for(const z of A){if(z.status!=="fulfilled")continue;const B=z.value;if(B.type==="history"&&c(B),B.entry)for(const G of B.entry)N.push(G.resource)}b(N)},[b]),j=v.useCallback(A=>b([...y.current,A]),[b]),C=v.useCallback(()=>{let A,N;"resourceType"in e.value?(A=e.value.resourceType,N=e.value.id):[A,N]=e.value.reference?.split("/"),g(t,A,N).then(S).catch(console.error)},[t,e.value,g,S]);v.useEffect(()=>C(),[C]);function E(A){!o||!e.createCommunication||t.createResource(e.createCommunication(o,n,A)).then(N=>j(N)).catch(console.error)}function R(A){!o||!e.createMedia||t.createResource(e.createMedia(o,n,A)).then(N=>j(N)).then(()=>nl({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:a.jsx(Fo,{size:16}),autoClose:2e3})).catch(N=>nl({id:"upload-notification",color:"red",title:"Upload error",message:Qe(N),icon:a.jsx(tR,{size:16}),autoClose:2e3}))}function T(){Ne({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function _(A){nl({id:"upload-notification",loading:!0,title:"Uploading...",message:xK(A),autoClose:!1,withCloseButton:!1})}function k(A){nl({id:"upload-notification",color:"red",title:"Upload error",message:Qe(A),icon:a.jsx(tR,{size:16}),autoClose:2e3})}if(!o)return a.jsx(hr,{style:{width:"100%",height:"100%"},children:a.jsx(jr,{})});const L=d.filter(A=>A).slice(0,p);return a.jsxs(uK,{children:[e.createCommunication&&a.jsx(Dl,{children:a.jsx(ht,{testid:"timeline-form",onSubmit:A=>{E(A.text);const N=r.current;N&&(N.value="",N.focus())},children:a.jsxs(ye,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[a.jsx(Aa,{value:n}),a.jsx(He,{name:"text",ref:r,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),a.jsx(Dn,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:a.jsx(Xq,{size:16})}),a.jsx(IS,{securityContext:Yt(o),onUpload:R,onUploadStart:T,onUploadProgress:_,onUploadError:k,children:A=>a.jsx(Dn,{...A,radius:"xl",color:"blue",variant:"filled",children:a.jsx(ES,{size:16})})})]})})}),L.map(A=>{const N=`${A.resourceType}/${A.id}/${A.meta?.versionId}`,z=e.getMenu?e.getMenu({primaryResource:o,currentResource:A,reloadTimeline:C}):void 0;if(A.resourceType===o.resourceType&&A.id===o.id)return a.jsx(hK,{history:s,resource:A,popupMenuItems:z},N);switch(A.resourceType){case"AuditEvent":return a.jsx(vK,{resource:A,popupMenuItems:z},N);case"Communication":return a.jsx(mK,{resource:A,popupMenuItems:z},N);case"DiagnosticReport":return a.jsx(yK,{resource:A,popupMenuItems:z},N);case"Media":return a.jsx(gK,{resource:A,popupMenuItems:z},N);default:return a.jsx(xl,{resource:A,padding:!0,children:a.jsx(qS,{value:A,ignoreMissingValues:!0})},N)}}),p<d.length&&a.jsx(ye,{justify:"center",pb:"lg",children:a.jsx(Pe,{onClick:()=>m(p+10),children:"Show More"})})]})}function hK(e){const{history:t,resource:n,...r}=e,o=pK(t,n);return o?a.jsx(xl,{resource:n,padding:!0,...r,children:a.jsx(rK,{original:o,revised:e.resource})}):a.jsxs(xl,{resource:n,padding:!0,...r,children:[a.jsx("h3",{children:"Created"}),a.jsx(qS,{value:n,ignoreMissingValues:!0,forceUseInput:!0})]})}function pK(e,t){const n=e.entry??[],r=n.findIndex(o=>o.resource?.meta?.versionId===t.meta?.versionId);if(!(r>=n.length-1))return n[r+1].resource}function mK(e){const n=!e.resource.priority||e.resource.priority==="routine"?void 0:fK.pinnedComment;return a.jsx(xl,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:e.popupMenuItems,children:a.jsx("p",{children:e.resource.payload?.[0]?.contentString})})}function gK(e){const t=e.resource.content?.contentType,n=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return a.jsx(xl,{resource:e.resource,padding:!!n,popupMenuItems:e.popupMenuItems,children:a.jsx(yf,{value:e.resource.content})})}function vK(e){return a.jsx(xl,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:a.jsx(Yr,{children:a.jsx("pre",{children:e.resource.outcomeDesc})})})}function yK(e){return a.jsx(xl,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:a.jsx(HS,{value:e.resource})})}function xK(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${rx(e.loaded)} / ${rx(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${rx(e.loaded)}`}function rx(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 bK(e){const{resource:t,...n}=e;return a.jsx(ig,{value:t,loadTimelineResources:async(r,o,s)=>{const c=`${o}/${s}`;return Promise.allSettled([r.readHistory(o,s),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:100})])},...n})}function SK(e){const{encounter:t,...n}=e;return a.jsx(ig,{value:t,loadTimelineResources:async(r,o,s)=>Promise.allSettled([r.readHistory("Encounter",s),r.search("Communication","encounter=Encounter/"+s),r.search("Media","encounter=Encounter/"+s)]),createCommunication:(r,o,s)=>({resourceType:"Communication",status:"completed",encounter:Yt(r),subject:r.subject,sender:Yt(o),sent:new Date().toISOString(),payload:[{contentString:s}]}),createMedia:(r,o,s)=>({resourceType:"Media",status:"completed",encounter:Yt(r),subject:r.subject,operator:Yt(o),issued:new Date().toISOString(),content:s}),...n})}function wK(e){let t;try{t=sV(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 a.jsx(oo,{value:t[0]||"",propertyType:e.propertyType})}function jK(e){return a.jsxs(Un,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[a.jsxs(ce,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&a.jsx(TR,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&a.jsx(TR,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),a.jsx(Ee,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function TR(e){return a.jsx(Pe,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const CK={string:[he.EQUALS,he.NOT,he.CONTAINS,he.EXACT],fulltext:[he.EQUALS,he.NOT,he.CONTAINS,he.EXACT],token:[he.EQUALS,he.NOT],reference:[he.EQUALS,he.NOT],numeric:[he.EQUALS,he.NOT_EQUALS,he.GREATER_THAN,he.LESS_THAN,he.GREATER_THAN_OR_EQUALS,he.LESS_THAN_OR_EQUALS],quantity:[he.EQUALS,he.NOT_EQUALS,he.GREATER_THAN,he.LESS_THAN,he.GREATER_THAN_OR_EQUALS,he.LESS_THAN_OR_EQUALS],date:[he.EQUALS,he.NOT_EQUALS,he.GREATER_THAN,he.LESS_THAN,he.GREATER_THAN_OR_EQUALS,he.LESS_THAN_OR_EQUALS,he.STARTS_AFTER,he.ENDS_BEFORE,he.APPROXIMATELY],datetime:[he.EQUALS,he.NOT_EQUALS,he.GREATER_THAN,he.LESS_THAN,he.GREATER_THAN_OR_EQUALS,he.LESS_THAN_OR_EQUALS,he.STARTS_AFTER,he.ENDS_BEFORE,he.APPROXIMATELY],uri:[he.EQUALS,he.NOT,he.ABOVE,he.BELOW]},EK={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 GS(e,t){return{...e,filters:t,offset:0,name:void 0}}function PP(e,t){return GS(e,(e.filters??[]).filter(n=>n.code!==t))}function og(e,t,n,r,o){const s=[];return e.filters&&s.push(...e.filters),s.push({code:t,operator:n,value:r??""}),GS(e,s)}function TK(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function RK(e,t){return QS(e,t,-1)}function _K(e,t){return QS(e,t,0)}function AK(e,t){return QS(e,t,1)}function QS(e,t,n){const r=new Date;r.setDate(r.getDate()+n),r.setHours(0,0,0,0);const o=new Date(r.getTime());return o.setDate(o.getDate()+1),o.setTime(o.getTime()-1),ag(e,t,r,o)}function DK(e,t){const n=new Date,r=new Date(n.getTime()+1440*60*1e3);return ag(e,t,n,r)}function kK(e,t){return WS(e,t,-1)}function PK(e,t){return WS(e,t,0)}function NK(e,t){return WS(e,t,1)}function WS(e,t,n){const r=new Date;r.setMonth(r.getMonth()+n),r.setDate(1),r.setHours(0,0,0,0);const o=new Date(r.getTime());return o.setMonth(o.getMonth()+1),o.setDate(1),o.setHours(0,0,0,0),o.setTime(o.getTime()-1),ag(e,t,r,o)}function OK(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),ag(e,t,n,new Date)}function ag(e,t,n,r){return e=PP(e,t),e=RR(e,t,he.GREATER_THAN_OR_EQUALS,n),e=RR(e,t,he.LESS_THAN_OR_EQUALS,r),e}function RR(e,t,n,r){return og(e,t,n,r.toISOString())}function _R(e,t,n=!0){return og(e,t,he.MISSING,n.toString())}function MK(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function LK(e,t){const n=e.count??Vm,r=(t-1)*n;return MK(e,r)}function IK(e,t,n){return t===zK(e)&&n!==void 0&&n===$K(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function zK(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function $K(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function UK(e){return CK[e.type]}function NP(e){return EK[e]??""}function bl(e){let t=e;return t.includes(".")&&(t=t.split(".").pop()),t==="versionId"?"Version ID":(t=t.replace("[x]",""),t=t.replaceAll(/([A-Z])/g," $1"),t=t.replaceAll(/[-_]/g," "),t=t.replaceAll(/\s+/g," "),t=t.trim(),t.toLowerCase()==="id"?"ID":t.split(/\s/).map(Qn).join(" "))}function BK(e,t){const n=t.name;return n==="id"?a.jsx(yt,{to:`/${e.resourceType}/${e.id}`,children:e.id}):n==="meta.versionId"?e.meta?.versionId:n==="_lastUpdated"?Cr(e.meta?.lastUpdated):`${e.resourceType}.${t.name}`===t.elementDefinition?.path?VK(e,t.elementDefinition):t.searchParams?.length===1&&t.name===t.searchParams[0].code?FK(e,t.searchParams[0]):null}function VK(e,t){const n=t.path?.split(".")?.pop()?.replaceAll("[x]","")??"",[r,o]=tg({type:e.resourceType,value:e},n);return r?a.jsx(oo,{path:t.path,property:t,propertyType:o,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function FK(e,t){const n=vs(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:a.jsx(a.Fragment,{children:n.map((r,o)=>a.jsx(oo,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${n.length}`))})}function HK(e){const t=v.useRef(!1),[n,r]=v.useState({search:JSON.parse(io(e.search))}),[o,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=VD(f),m=cS(f);return Qc(qK(p,m)).map(g=>({value:g,label:bl(g)}))},[e.visible,e.search.resourceType]);function d(f){r({search:{...n.search,fields:f}})}return a.jsx(Un,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=o},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:a.jsx("div",{"data-testid":"overlay-child"})},children:a.jsxs(Be,{children:[a.jsx(Rm,{style:{width:550},placeholder:"Select fields to display",data:c,value:n.search.fields??[],onChange:d,onDropdownOpen:()=>s(!0),onDropdownClose:()=>s(!1),maxDropdownHeight:"250px",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),a.jsx(ye,{justify:"flex-end",children:a.jsx(Pe,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function qK(e,t){const n=[],r=new Set,o=new Set;for(const s of Object.keys(e.elements))n.push(s),r.add(s.toLowerCase()),o.add(bl(s));if(t)for(const s of Object.keys(t)){const c=bl(s);!r.has(s)&&!o.has(c)&&(n.push(s),r.add(s),o.add(c))}return n}function OP(e){const t=Gm(e.resourceType,e.searchParam),n=e.name??"filter-value";switch(t.type){case xr.REFERENCE:return a.jsx(ps,{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 xr.BOOLEAN:return a.jsx(Ln,{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 xr.DATE:return a.jsx(He,{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 xr.DATETIME:return a.jsx(Ao,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case xr.NUMBER:return a.jsx(He,{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 xr.QUANTITY:return a.jsx(yl,{name:n,path:"",defaultValue:GK(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return a.jsx(He,{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 GK(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:Number.parseFloat(t),system:n,unit:r}}}function QK(e){const[t,n]=v.useState(hi(e.search)),r=v.useRef(t);r.current=t,v.useEffect(()=>{n(hi(e.search))},[e.search]);function o(f){n(og(r.current,f.code,f.operator,f.value))}const s=e.search.resourceType,c=cS(s)??{},d=t.filters||[];return a.jsx(Un,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:a.jsxs(ht,{onSubmit:()=>e.onOk(r.current),children:[a.jsxs("div",{children:[a.jsxs("table",{children:[a.jsxs("colgroup",{children:[a.jsx("col",{style:{width:200}}),a.jsx("col",{style:{width:200}}),a.jsx("col",{style:{width:380}}),a.jsx("col",{style:{width:40}})]}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Field"}),a.jsx("th",{children:"Operation"}),a.jsx("th",{children:"Value"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:d.map((f,p)=>a.jsx(WK,{id:`filter-${p}-row`,resourceType:s,searchParams:c,value:f,onChange:m=>{const g=[...d];g[p]=m,n(GS(r.current,g))},onDelete:()=>n(TK(r.current,p))},`filter-${p}-row`))})]}),a.jsx(BS,{propertyDisplayName:"Filter",onClick:()=>o({})})]}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(Tr,{children:"OK"})})]})})}function WK(e){const t=e.value,n=v.useRef(t);n.current=t;function r(f){n.current.code=f,n.current.operator=he.EQUALS,n.current.value="",e.onChange(n.current)}function o(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],d=c&&UK(c);return a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(hn,{"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:bl(f)}))]})}),a.jsx("td",{children:d&&a.jsx(hn,{"data-testid":`${e.id}-filter-operation`,defaultValue:t.operator,onChange:f=>o(f.currentTarget.value),data:["",...d.map(f=>({value:f,label:NP(f)}))]},`${e.id}-filter-value-${e.value.code}`)}),a.jsx("td",{children:c&&t.operator&&a.jsx(OP,{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}`)}),a.jsx("td",{children:e.onDelete&&a.jsx(Dn,{variant:"outline",color:"red",radius:"xl","aria-label":"Delete filter",onClick:e.onDelete,children:a.jsx(vl,{style:{width:"70%",height:"70%"},stroke:1.5})})})]})}function YK(e){const[t,n]=v.useState(e.defaultValue??"");if(!e.searchParam||!e.filter)return null;function r(){e.onOk({...e.filter,value:t})}return a.jsx(Un,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:a.jsx(ht,{onSubmit:r,children:a.jsxs(wr,{children:[a.jsx(wr.Col,{span:10,children:a.jsx(OP,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),a.jsx(wr.Col,{span:2,children:a.jsx(Pe,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function KK(e){const{resourceType:t,filter:n}=e,r=No.types[t].searchParams?.[n.code];if(r){if(r.type==="reference"&&(n.operator===he.EQUALS||n.operator===he.NOT_EQUALS))return a.jsx(Pl,{value:{reference:n.value}});const o=Gm(t,r);if(n.code==="_lastUpdated"||o.type===xr.DATETIME)return a.jsx(a.Fragment,{children:Cr(n.value)})}return a.jsx(a.Fragment,{children:n.value})}function XK(e){if(!e.searchParams)return null;function t(s,c){o(IK(e.search,s.code,c))}function n(s){o(PP(e.search,s.code))}function r(s,c){e.onPrompt(s,{code:s.code,operator:c,value:""})}function o(s){e.onChange(s)}return e.searchParams.length===1?a.jsx(JK,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:o,onClear:n}):a.jsx(be.Dropdown,{children:e.searchParams.map(s=>a.jsx(be.Item,{children:bl(s.code)},s.code))})}function JK(e){switch(e.searchParam.type){case"date":return a.jsx(ZK,{...e});case"number":case"quantity":return a.jsx(eX,{...e});case"reference":return a.jsx(tX,{...e});case"string":return a.jsx(nX,{...e});case"token":case"uri":return a.jsx(rX,{...e});default:return a.jsxs(a.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function ZK(e){const{searchParam:t}=e,n=t.code;return a.jsxs(be.Dropdown,{children:[a.jsx(be.Item,{leftSection:a.jsx(_S,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),a.jsx(be.Item,{leftSection:a.jsx(AS,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),a.jsx(be.Divider,{}),a.jsx(be.Item,{leftSection:a.jsx(mf,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Equals..."}),a.jsx(be.Item,{leftSection:a.jsx(pf,{size:14}),onClick:()=>e.onPrompt(t,he.NOT_EQUALS),children:"Does not equal..."}),a.jsx(be.Divider,{}),a.jsx(be.Item,{leftSection:a.jsx(Vk,{size:14}),onClick:()=>e.onPrompt(t,he.ENDS_BEFORE),children:"Before..."}),a.jsx(be.Item,{leftSection:a.jsx(Bk,{size:14}),onClick:()=>e.onPrompt(t,he.STARTS_AFTER),children:"After..."}),a.jsx(be.Item,{leftSection:a.jsx(QH,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Between..."}),a.jsx(be.Divider,{}),a.jsx(be.Item,{leftSection:a.jsx(rs,{size:14}),onClick:()=>e.onChange(AK(e.search,n)),children:"Tomorrow"}),a.jsx(be.Item,{leftSection:a.jsx(rs,{size:14}),onClick:()=>e.onChange(_K(e.search,n)),children:"Today"}),a.jsx(be.Item,{leftSection:a.jsx(rs,{size:14}),onClick:()=>e.onChange(RK(e.search,n)),children:"Yesterday"}),a.jsx(be.Item,{leftSection:a.jsx(rs,{size:14}),onClick:()=>e.onChange(DK(e.search,n)),children:"Next 24 Hours"}),a.jsx(be.Divider,{}),a.jsx(be.Item,{leftSection:a.jsx(rs,{size:14}),onClick:()=>e.onChange(NK(e.search,n)),children:"Next Month"}),a.jsx(be.Item,{leftSection:a.jsx(rs,{size:14}),onClick:()=>e.onChange(PK(e.search,n)),children:"This Month"}),a.jsx(be.Item,{leftSection:a.jsx(rs,{size:14}),onClick:()=>e.onChange(kK(e.search,n)),children:"Last Month"}),a.jsx(be.Divider,{}),a.jsx(be.Item,{leftSection:a.jsx(rs,{size:14}),onClick:()=>e.onChange(OK(e.search,n)),children:"Year to date"}),a.jsx(Sf,{...e})]})}function eX(e){const{searchParam:t}=e;return a.jsxs(be.Dropdown,{children:[a.jsx(be.Item,{leftSection:a.jsx(_S,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),a.jsx(be.Item,{leftSection:a.jsx(AS,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),a.jsx(be.Divider,{}),a.jsx(be.Item,{leftSection:a.jsx(mf,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Equals..."}),a.jsx(be.Item,{leftSection:a.jsx(pf,{size:14}),onClick:()=>e.onPrompt(t,he.NOT_EQUALS),children:"Does not equal..."}),a.jsx(be.Divider,{}),a.jsx(be.Item,{leftSection:a.jsx(Bk,{size:14}),onClick:()=>e.onPrompt(t,he.GREATER_THAN),children:"Greater than..."}),a.jsx(be.Item,{leftSection:a.jsx(Wx,{size:14}),onClick:()=>e.onPrompt(t,he.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),a.jsx(be.Item,{leftSection:a.jsx(Vk,{size:14}),onClick:()=>e.onPrompt(t,he.LESS_THAN),children:"Less than..."}),a.jsx(be.Item,{leftSection:a.jsx(Wx,{size:14}),onClick:()=>e.onPrompt(t,he.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),a.jsx(Sf,{...e})]})}function tX(e){const{searchParam:t}=e;return a.jsxs(be.Dropdown,{children:[a.jsx(be.Item,{leftSection:a.jsx(mf,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Equals..."}),a.jsx(be.Item,{leftSection:a.jsx(pf,{size:14}),onClick:()=>e.onPrompt(t,he.NOT),children:"Does not equal..."}),a.jsx(Sf,{...e})]})}function nX(e){const{searchParam:t}=e;return a.jsxs(be.Dropdown,{children:[a.jsx(be.Item,{leftSection:a.jsx(_S,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),a.jsx(be.Item,{leftSection:a.jsx(AS,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),a.jsx(be.Divider,{}),a.jsx(be.Item,{leftSection:a.jsx(mf,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Equals..."}),a.jsx(be.Item,{leftSection:a.jsx(pf,{size:14}),onClick:()=>e.onPrompt(t,he.NOT),children:"Does not equal..."}),a.jsx(be.Divider,{}),a.jsx(be.Item,{leftSection:a.jsx(ZH,{size:14}),onClick:()=>e.onPrompt(t,he.CONTAINS),children:"Contains..."}),a.jsx(be.Item,{leftSection:a.jsx(XH,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Does not contain..."}),a.jsx(Sf,{...e})]})}function rX(e){const{searchParam:t}=e;return a.jsxs(be.Dropdown,{children:[a.jsx(be.Item,{leftSection:a.jsx(mf,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Equals..."}),a.jsx(be.Item,{leftSection:a.jsx(pf,{size:14}),onClick:()=>e.onPrompt(t,he.NOT),children:"Does not equal..."}),a.jsx(Sf,{...e})]})}function Sf(e){const{searchParam:t}=e,n=t.code;return a.jsxs(a.Fragment,{children:[a.jsx(be.Divider,{}),a.jsx(be.Item,{leftSection:a.jsx(FH,{size:14}),onClick:()=>e.onChange(_R(e.search,n)),children:"Missing"}),a.jsx(be.Item,{leftSection:a.jsx(BH,{size:14}),onClick:()=>e.onChange(_R(e.search,n,!1)),children:"Not missing"}),a.jsx(be.Divider,{}),a.jsx(be.Item,{leftSection:a.jsx(vl,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}function MP(e){switch(e){case"next":return{"aria-label":"Next page"};case"previous":return{"aria-label":"Previous page"};case"first":return{"aria-label":"First page"};case"last":return{"aria-label":"Last page"};default:return{}}}const iX="_root_vlout_1",oX="_table_vlout_8",aX="_tr_vlout_12",sX="_control_vlout_22",lX="_icon_vlout_31",ud={root:iX,table:oX,tr:aX,control:sX,icon:lX};function cX(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(uX(t,r));return n}function uX(e,t){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=Es(e,t),r=kB(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const o=cS(e);let s;if(o){const c=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);s=Object.values(o).filter(d=>!!d.expression&&c.test(d?.expression)),s.length===0&&(s=void 0)}return{name:t,elementDefinition:n,searchParams:s}}if(r){const o=Gm(e,r);return{name:t,elementDefinition:o.elementDefinitions?.[0],searchParams:[r]}}return{name:t}}class dX extends Event{definition;constructor(t){super("change"),this.definition=t}}class fX extends Event{response;constructor(t){super("load"),this.response=t}}class Bp extends Event{resource;browserEvent;constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function mu(e){const t=Re(),[n,r]=v.useState(),{search:o,onLoad:s}=e,[c,d]=v.useState(o);Po(o,c)||d(o);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(U=>{r(void 0),t.requestSchema(c.resourceType).then(()=>t.search(c.resourceType,ds({...c,total:g,fields:void 0}),U)).then(W=>{p({...m.current,searchResponse:W}),s&&s(new fX(W))}).catch(W=>{p({...m.current,searchResponse:void 0}),r(Xt(W))})},[t,c,g,s]),b=v.useCallback(()=>{p({...m.current,searchResponse:void 0}),y({cache:"reload"})},[y]);v.useEffect(()=>{y()},[y]);function S(U,W){U.stopPropagation();const I=U.target.checked,$={...m.current.selected};I?$[W]=!0:delete $[W],p({...m.current,selected:$})}function j(U){U.stopPropagation();const O=U.target.checked,I={},$=m.current.searchResponse;O&&$?.entry&&$.entry.forEach(H=>{H.resource?.id&&(I[H.resource.id]=!0)}),p({...m.current,selected:I})}function C(){const U=m.current;if(!U.searchResponse?.entry||U.searchResponse.entry.length===0)return!1;for(const W of U.searchResponse.entry)if(W.resource?.id&&!U.selected[W.resource.id])return!1;return!0}function E(U){e.onChange&&e.onChange(new dX(U))}function R(U,W){if(qk(U.target)||U.button===2)return;yn(U);const O=kS(U);!O&&e.onClick&&e.onClick(new Bp(W,U)),O&&e.onAuxClick&&e.onAuxClick(new Bp(W,U))}function T(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(n)return a.jsx(Rr,{outcome:n});if(!BD(c.resourceType))return a.jsx(hr,{style:{width:"100%",height:"100%"},children:a.jsx(jr,{})});const _=e.checkboxesEnabled,k=cX(c),L=c.resourceType,A=f.searchResponse,z=A?.entry?.map(U=>U.resource),B="subtle",G="gray",Y=16,J=window.innerWidth<768;return a.jsxs("div",{className:ud.root,"data-testid":"search-control",children:[!e.hideToolbar&&a.jsxs(ye,{justify:"space-between",mb:"xl",children:[a.jsxs(ye,{gap:2,children:[a.jsx(Pe,{size:"compact-md",variant:B,color:G,leftSection:a.jsx(hq,{size:Y}),onClick:()=>p({...m.current,fieldEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Fields"}),a.jsx(Pe,{size:"compact-md",variant:B,color:G,leftSection:a.jsx(Oq,{size:Y}),onClick:()=>p({...m.current,filterEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Filters"}),e.onNew&&a.jsx(Pe,{size:"compact-md",variant:B,color:G,leftSection:a.jsx(Pq,{size:Y}),onClick:e.onNew,children:"New..."}),!J&&T()&&a.jsx(Pe,{size:"compact-md",variant:B,color:G,leftSection:a.jsx(kG,{size:Y}),onClick:e.onExport?e.onExport:()=>p({...m.current,exportDialogVisible:!0,dialogOpenTime:Date.now()}),children:"Export..."}),!J&&e.onDelete&&a.jsx(Pe,{size:"compact-md",variant:B,color:G,leftSection:a.jsx(Wm,{size:Y}),onClick:()=>e.onDelete(Object.keys(f.selected)),children:"Delete..."}),!J&&e.onBulk&&a.jsx(Pe,{size:"compact-md",variant:B,color:G,leftSection:a.jsx(qH,{size:Y}),onClick:()=>e.onBulk(Object.keys(f.selected)),children:"Bulk..."})]}),a.jsxs(ye,{gap:2,children:[A&&a.jsxs(Ee,{size:"xs",c:"dimmed","data-testid":"count-display",children:[LP(c,A).toLocaleString(),"-",gX(c,A).toLocaleString(),A.total!==void 0&&` of ${c.total==="estimate"?"~":""}${A.total?.toLocaleString()}`]}),a.jsx(Dn,{variant:B,color:G,title:"Refresh",onClick:b,children:a.jsx(Hk,{size:Y})})]})]}),a.jsxs(ue,{className:ud.table,children:[a.jsxs(ue.Thead,{children:[a.jsxs(ue.Tr,{children:[_&&a.jsx(ue.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:U=>j(U)})}),k.map(U=>a.jsx(ue.Th,{children:a.jsxs(be,{shadow:"md",width:240,position:"bottom-end",children:[a.jsx(be.Target,{children:a.jsx(In,{className:ud.control,p:2,children:a.jsxs(ye,{justify:"space-between",wrap:"nowrap",children:[a.jsx(Ee,{fw:500,children:bl(U.name)}),a.jsx(hr,{className:ud.icon,children:a.jsx(OH,{size:14,stroke:1.5})})]})})}),a.jsx(XK,{search:c,searchParams:U.searchParams,onPrompt:(W,O)=>{p({...m.current,filterDialogVisible:!0,filterDialogSearchParam:W,filterDialogFilter:O,dialogOpenTime:Date.now()})},onChange:W=>{E(W)}})]})},U.name))]}),!e.hideFilters&&a.jsxs(ue.Tr,{children:[_&&a.jsx(ue.Th,{}),k.map(U=>a.jsx(ue.Th,{children:U.searchParams&&a.jsx(hX,{resourceType:L,searchParams:U.searchParams,filters:c.filters})},U.name))]})]}),a.jsx(ue.Tbody,{children:z?.map(U=>U&&a.jsxs(ue.Tr,{className:ud.tr,"data-testid":"search-control-row",onClick:W=>R(W,U),onAuxClick:W=>R(W,U),children:[_&&a.jsx(ue.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${U.id}`,checked:!!f.selected[U.id],onChange:W=>S(W,U.id)})}),k.map(W=>a.jsx(ue.Td,{children:BK(U,W)},W.name))]},U.id))})]}),!z?.length&&a.jsx(hu,{children:a.jsx(hr,{style:{height:150},children:a.jsx(Ee,{size:"xl",c:"dimmed",children:"No results"})})}),A&&a.jsx(hr,{m:"md",p:"md",children:a.jsx($i,{value:pX(c),total:mX(c,A),onChange:U=>E(LK(c,U)),getControlProps:MP})}),a.jsx(HK,{search:c,visible:m.current.fieldEditorVisible,onOk:U=>{E(U),p({...m.current,fieldEditorVisible:!1})},onCancel:()=>{p({...m.current,fieldEditorVisible:!1})}},`search-field-editor-${f.dialogOpenTime}`),a.jsx(QK,{search:c,visible:m.current.filterEditorVisible,onOk:U=>{E(U),p({...m.current,filterEditorVisible:!1})},onCancel:()=>{p({...m.current,filterEditorVisible:!1})}},`search-filter-editor-${f.dialogOpenTime}`),a.jsx(jK,{visible:m.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{p({...m.current,exportDialogVisible:!1})}},`search-export-dialog-${f.dialogOpenTime}`),a.jsx(YK,{visible:m.current.filterDialogVisible,title:f.filterDialogSearchParam?.code?bl(f.filterDialogSearchParam.code):"",resourceType:L,searchParam:f.filterDialogSearchParam,filter:f.filterDialogFilter,defaultValue:"",onOk:U=>{E(og(c,U.code,U.operator,U.value)),p({...m.current,filterDialogVisible:!1})},onCancel:()=>{p({...m.current,filterDialogVisible:!1})}},`search-filter-dialog-${f.dialogOpenTime}`)]})}function hX(e){const t=(e.filters??[]).filter(n=>e.searchParams.find(r=>r.code===n.code));return t.length===0?a.jsx("span",{children:"no filters"}):a.jsx(a.Fragment,{children:t.map(n=>a.jsxs("div",{children:[NP(n.operator)," ",a.jsx(KK,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function pX(e){return Math.floor((e.offset??0)/(e.count??Vm))+1}function mX(e,t){const n=e.count??Vm,r=IP(e,t);return Math.ceil(r/n)}function LP(e,t){return Math.min(IP(e,t),(e.offset??0)+1)}function gX(e,t){return Math.max(LP(e,t)+(t.entry?.length??0)-1,0)}function IP(e,t){let n=t.total;return n===void 0&&(n=(e.offset??0)+(t.entry?.length??0)+(t.link?.some(r=>r.relation==="next")?1:0)),n}function vX(e){const t=Re(),[n,r]=v.useState(!1),[o,s]=v.useState(),{query:c,fields:d}=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(T=>s(Xt(T)))},[t,c]);function S(T,_){T.stopPropagation();const L=T.target.checked,A={...b.current};L?A[_]=!0:delete A[_],g(A)}function j(T){T.stopPropagation();const k=T.target.checked,L={},A=y.current?.data.ResourceList;k&&A&&A.forEach(N=>{N.id&&(L[N.id]=!0)}),g(L)}function C(){const T=y.current?.data.ResourceList;if(!T||T.length===0)return!1;for(const _ of T)if(_.id&&!b.current[_.id])return!1;return!0}function E(T,_){qk(T.target)||(yn(T),T.button!==1&&e.onClick&&e.onClick(new Bp(_,T)),T.button===1&&e.onAuxClick&&e.onAuxClick(new Bp(_,T)))}if(v.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return a.jsx(jr,{});const R=e.checkboxesEnabled;return a.jsxs("div",{onContextMenu:T=>yn(T),"data-testid":"search-control",children:[a.jsxs(ue,{children:[a.jsx(ue.Thead,{children:a.jsxs(ue.Tr,{children:[R&&a.jsx(ue.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:T=>j(T)})}),d.map(T=>a.jsx(ue.Th,{children:T.name},T.name))]})}),a.jsx(ue.Tbody,{children:f?.data.ResourceList.map(T=>T&&a.jsxs(ue.Tr,{"data-testid":"search-control-row",onClick:_=>E(_,T),onAuxClick:_=>E(_,T),children:[R&&a.jsx(ue.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${T.id}`,checked:!!m[T.id],onChange:_=>S(_,T.id)})}),d.map(_=>a.jsx(ue.Td,{children:a.jsx(wK,{propertyType:_.propertyType,path:_.fhirPath,resource:T})},_.name))]},T.id))})]}),f?.data.ResourceList.length===0&&a.jsx("div",{"data-testid":"empty-search",children:"No results"}),o&&a.jsx("div",{"data-testid":"search-error",children:a.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),e.onBulk&&a.jsx(Pe,{onClick:()=>e.onBulk(Object.keys(b.current)),children:"Bulk..."})]})}const yX=v.memo(vX),xX="_root_1fbwr_1",bX="_entry_1fbwr_8",SX="_key_1fbwr_13",wX="_value_1fbwr_20",sg={root:xX,entry:bX,key:SX,value:wX};function vt(e){return a.jsx(Yr,{children:a.jsx("div",{className:sg.root,children:e.children})})}vt.Entry=function(t){return a.jsx("div",{className:sg.entry,children:t.children})};vt.Key=function(t){return a.jsx("div",{className:sg.key,children:t.children})};vt.Value=function(t){return a.jsx("div",{className:sg.value,children:t.children})};const jX="_list_y4z6g_1",CX="_link_y4z6g_6",AR={list:jX,link:CX};function YS(e){const{baseUrl:t,tabs:n,children:r,...o}=e,s=EX(n),c=du(),[d,f]=v.useState(()=>{const m=Zn.getPathname().split("/").pop();return m&&s.some(g=>g.value===m)?m:s[0].value});function p(m){m=m||s[0].value,f(m),c(`${t}/${m}`)}return a.jsxs(Wt,{value:d.toLowerCase(),onChange:p,...o,children:[a.jsx(Wt.List,{className:AR.list,children:s.map(m=>a.jsx(Wt.Tab,{value:m.value,children:a.jsx(Nt,{className:AR.link,href:`${t}/${m.value}`,onClick:TX,children:m.label})},m.value))}),r]})}function EX(e){return e.map(t=>tk(t)?{label:t,value:t.toLowerCase()}:t)}function TX(e){kS(e)||e.preventDefault()}function RX(e){const{group:t}=e;return a.jsx(Nr,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:a.jsxs(ye,{children:[t.measureScore&&a.jsx(DX,{group:t}),!t.measureScore&&a.jsx(AX,{group:t})]})})}function _X(e){const{measure:t}=e;return a.jsxs(a.Fragment,{children:[a.jsx(Ee,{fz:"md",fw:500,mb:8,children:t.title}),a.jsx(Ee,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function AX(e){const{group:t}=e,n=t.population,r=n?.find(f=>gs(f.code)==="numerator"),o=n?.find(f=>gs(f.code)==="denominator"),s=r?.count,c=o?.count;if(c===0)return a.jsxs(ce,{children:[a.jsx($e,{order:3,children:"Not Applicable"}),a.jsx(Ee,{children:`Denominator: ${c}`})]});if(s===void 0||c===void 0)return a.jsxs(ce,{children:[a.jsx($e,{order:3,children:"Insufficient Data"}),a.jsx(Ee,{children:`Numerator: ${s}`}),a.jsx(Ee,{children:`Denominator: ${c}`})]});const d=s/c*100;return a.jsx(Om,{size:120,thickness:12,roundCaps:!0,sections:[{value:d,color:zP(d)}],label:a.jsx(no,{justify:"center",children:a.jsxs(Ee,{fw:700,fz:18,children:[s," / ",c]})})})}function DX(e){const{group:t}=e,n=t.measureScore?.unit??t.measureScore?.code;return a.jsx(a.Fragment,{children:n==="%"?a.jsx(Om,{size:120,thickness:12,roundCaps:!0,sections:[{value:kX(t),color:zP(t?.measureScore?.value??0)}],label:a.jsx(no,{justify:"center",children:a.jsx(Ee,{fw:700,fz:18,children:a.jsx($d,{value:t.measureScore})})})}):a.jsx(no,{h:120,align:"center",children:a.jsx($e,{order:3,children:a.jsx($d,{value:t.measureScore})})})})}function kX(e){const t=e.measureScore?.value,n=e.measureScore?.unit;return t?t<=1&&n==="%"?t*100:t:0}function zP(e){return e<=33?"red":e<=67?"yellow":"green"}function PX(e){const t=Jt(e.measureReport),[n]=TH("Measure",{url:t?.measure});return t?a.jsxs(ce,{children:[n&&a.jsx(_X,{measure:n}),a.jsx(Mm,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:t.group?.map((r,o)=>a.jsx(RX,{group:r},r.id??o))})]}):null}const ix="patient-export",ox="Patient Export",NX={everything:{operation:"$everything",extension:"json",contentType:rn.FHIR_JSON},summary:{operation:"$summary",extension:"json",contentType:rn.FHIR_JSON},ccda:{operation:"$ccda-export",extension:"xml",contentType:rn.CDA_XML},ccdaReferral:{operation:"$ccda-export",type:"referral",extension:"xml",contentType:rn.CDA_XML}};function OX(e){const t=Re(),{patient:n}=e,r=v.useCallback(async o=>{const s=hl(n),c=o.format,{operation:d,type:f,contentType:p,extension:m}=NX[c],g=t.fhirUrl("Patient",s,d),y={};f&&(y.type=f),o.author&&(y.author={reference:o.author}),o.authoredOn&&(y.authoredOn=$S(o.authoredOn)),o.startDate&&(y.start=o.startDate),o.endDate&&(y.end=o.endDate),ki.show({id:ix,title:ox,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}`;MX(b,S,p),ki.update({id:ix,title:ox,color:"green",message:"Done",icon:a.jsx(Fo,{size:"1rem"}),loading:!1,autoClose:!0,withCloseButton:!0})}catch(b){ki.update({id:ix,title:ox,color:"red",message:Qe(b),icon:a.jsx(vl,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}},[t,n]);return a.jsx(ht,{onSubmit:r,children:a.jsxs(Be,{children:[a.jsx(zt,{title:"Export Format",description:"Required",withAsterisk:!0,children:a.jsx(qc,{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})}),a.jsx(zt,{title:"Author",description:"Optional author for composition. Default value is current user.",children:a.jsx(ps,{name:"author",placeholder:"Author",targetTypes:["Organization","Practitioner","PractitionerRole"]})}),a.jsx(zt,{title:"Authored On",description:"Optional date for composition authored on. Default value is current date.",children:a.jsx(Ao,{name:"authoredOn",placeholder:"Authored on"})}),a.jsx(zt,{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:a.jsx(Ao,{name:"startDate",placeholder:"Start date"})}),a.jsx(zt,{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:a.jsx(Ao,{name:"endDate",placeholder:"End date"})}),a.jsx(ye,{justify:"right",children:a.jsx(Tr,{children:"Request Export"})})]})})}function MX(e,t,n){const r=typeof e=="string"?e:JSON.stringify(e,null,2),o=new Blob([r],{type:n}),s=window.URL.createObjectURL(o),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 LX(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function $P(e){const t=Jt(e.patient);return t?a.jsxs(vt,{children:[a.jsx(Aa,{value:t,size:"lg",color:LX(t)}),a.jsxs(vt.Entry,{children:[a.jsx(vt.Key,{children:"Name"}),a.jsx(vt.Value,{children:a.jsx(yt,{to:t,fw:500,children:t.name?a.jsx(PS,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&a.jsxs(a.Fragment,{children:[a.jsxs(vt.Entry,{children:[a.jsx(vt.Key,{children:"DoB"}),a.jsx(vt.Value,{children:t.birthDate})]}),a.jsxs(vt.Entry,{children:[a.jsx(vt.Key,{children:"Age"}),a.jsx(vt.Value,{children:nB(t.birthDate)})]})]}),t.gender&&a.jsxs(vt.Entry,{children:[a.jsx(vt.Key,{children:"Gender"}),a.jsx(vt.Value,{children:t.gender})]}),t.address&&a.jsxs(vt.Entry,{children:[a.jsx(vt.Key,{children:"State"}),a.jsx(vt.Value,{children:t.address[0]?.state})]}),t.identifier?.map(n=>a.jsxs(vt.Entry,{children:[a.jsx(vt.Key,{children:n?.system}),a.jsx(vt.Value,{children:n?.value})]},`${n?.system}-${n?.value}`))]}):null}function IX(e){const{patient:t,...n}=e,r=v.useCallback((o,s,c)=>{const d=`${s}/${c}`,f=100;return Promise.allSettled([o.readHistory("Patient",c),o.search("Communication",{subject:d,_count:f}),o.search("Device",{patient:d,_count:f}),o.search("DeviceRequest",{patient:d,_count:f}),o.search("DiagnosticReport",{subject:d,_count:f}),o.search("Media",{subject:d,_count:f}),o.search("ServiceRequest",{subject:d,_count:f}),o.search("Task",{subject:d,_count:f})])},[]);return a.jsx(ig,{value:t,loadTimelineResources:r,createCommunication:(o,s,c)=>({resourceType:"Communication",status:"completed",subject:Yt(o),sender:Yt(s),sent:new Date().toISOString(),payload:[{contentString:c}]}),createMedia:(o,s,c)=>({resourceType:"Media",status:"completed",subject:Yt(o),operator:Yt(s),issued:new Date().toISOString(),content:c}),...n})}const zX="_section_pqpwm_1",$X="_hovering_pqpwm_7",Kx={section:zX,hovering:$X};function UX(e){const t=Re(),n=Jt(e.value),[r,o]=v.useState(!1),[s,c]=v.useState(),[d,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(()=>o(!0)).catch(console.log)},[t]),v.useEffect(()=>(m(qX(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 a.jsx("div",{children:a.jsxs(ht,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(p),children:[a.jsx(He,{label:"Plan Title",py:"md",defaultValue:p.title,onChange:j=>S("title",j.currentTarget.value)}),a.jsx(BX,{actions:p.action||[],selectedKey:s,setSelectedKey:c,hoverKey:d,setHoverKey:f,onChange:j=>S("action",j)}),a.jsx(Tr,{children:"Save"})]})})}function BX(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 o(s){e.onChange(t.current.filter(c=>c!==s))}return a.jsxs(Be,{gap:"md",className:Kx.section,children:[e.actions.map(s=>a.jsx(VX,{action:s,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>o(s)},s.id)),a.jsx("div",{children:a.jsx(Pe,{variant:"outline",onClick:s=>{yn(s),r({id:UP()})},children:"Add action"})})]})}function VX(e){const{action:t}=e;function n(o){o.stopPropagation(),e.setSelectedKey(e.action.id)}function r(o){yn(o),e.setHoverKey(e.action.id)}return a.jsx("div",{onClick:n,onMouseOver:r,onFocus:r,children:a.jsx(FX,{action:t,onChange:e.onChange,selectedKey:e.selectedKey,hoverKey:e.hoverKey,onRemove:e.onRemove})})}function FX(e){const{action:t}=e,[n,r]=v.useState(),o=Re(),[s,c]=v.useState(!1),[d,f]=v.useState(),p=e.selectedKey===e.action.id,m=e.hoverKey===e.action.id;function g(b,S){e.onChange({...t,[b]:S})}const y=$t(Kx.section,{[Kx.hovering]:m&&!p});return v.useEffect(()=>{(async()=>{if(!t.definitionCanonical)return;c(!0);const S=await o.readCanonical(["Questionnaire","ActivityDefinition"],t.definitionCanonical);r(HX(S)),f(S),c(!1)})().catch(console.error)},[t.definitionCanonical,o]),s?a.jsx(jr,{}):a.jsxs(Nr,{"data-testid":t.id,className:y,p:0,radius:"sm",withBorder:!0,children:[a.jsxs(no,{w:"100%",p:"xs",bg:"gray.0",gap:"md",align:"center",justify:"space-between",children:[a.jsx(He,{w:"100%",name:`actionTitle-${t.id}`,defaultValue:t.title,placeholder:"Title",onChange:b=>g("title",b.currentTarget.value)}),a.jsx(bs,{"data-testid":"close-button",onClick:e.onRemove})]}),p&&a.jsxs(Be,{gap:"xl",p:"md",children:[a.jsx(ce,{children:a.jsx(He,{label:"Task Description",placeholder:"Enter task description",name:`actionDescription-${t.id}`,defaultValue:t.description,onChange:b=>g("description",b.currentTarget.value)})}),a.jsx(ce,{children:a.jsx(hn,{label:"Type of Action",value:n,onChange:b=>{const S=b.currentTarget.value==="standard"?void 0:b.currentTarget.value;r(S),e.onChange({...e.action,definitionCanonical:S==="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"&&a.jsxs(Be,{gap:0,children:[a.jsxs(ye,{gap:0,mb:"xs",children:[a.jsx(Ee,{fw:600,children:"Select questionnaire"}),a.jsx(Ee,{c:"red",children:"*"})]}),a.jsxs(Ee,{size:"sm",c:"dimmed",mb:"sm",children:["Questionnaire to be shown in the task in Encounter view. You can create new one from"," ",a.jsx(Nt,{href:"/Questionnaire",target:"_blank",c:"blue",children:"questionnaires list"})]}),a.jsx(DR,{resource:d,resourceType:"Questionnaire",action:t,onChange:e.onChange,placeholder:"Search for questionnaire"})]}),n==="activitydefinition"&&a.jsxs(Be,{gap:0,children:[a.jsxs(ye,{gap:0,mb:"xs",children:[a.jsx(Ee,{fw:600,children:"Select activity definition"}),a.jsx(Ee,{c:"red",children:"*"})]}),a.jsxs(Ee,{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"," ",a.jsx(Nt,{href:"/ActivityDefinition",target:"_blank",c:"blue",children:"activity definitions list"})]}),a.jsx(DR,{resource:d,resourceType:"ActivityDefinition",action:t,onChange:e.onChange,placeholder:"Search for activity definition"})]})]})]})}function DR(e){const{id:t}=e.action,{resource:n}=e;return a.jsx(kl,{name:t,placeholder:e.placeholder,resourceType:e.resourceType,defaultValue:n,onChange:r=>{r?e.onChange({...e.action,definitionCanonical:"url"in r?r.url:void 0,definitionUri:"url"in r?void 0:Mt(r)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function HX(e){return e===void 0?"standard":e.resourceType.toLowerCase()}let ax=1;function UP(e){if(e){if(e.startsWith("id-")){const t=Number.parseInt(e.substring(3),10);Number.isNaN(t)||(ax=Math.max(ax,t+1))}return e}return"id-"+ax++}function qX(e){return{...e,action:BP(e.action)}}function BP(e){if(e)return e.map(t=>({...t,id:UP(t.id),action:BP(t.action)}))}const cl=30,Vp=50;function Fp(e){const t=e.formState,n=e.item,r=e.responseItem;function o(g){t&&e.context&&t.onChangeAnswer(e.context,e.item,g)}const s=n.type;if(!s)return null;const c=n.linkId;if(!c)return null;let d;n.initial&&n.initial.length>0?d=n.initial[0]:n.answerOption&&n.answerOption.length>0&&(d=n.answerOption.find(g=>g.initialSelected));const f=XS(r,e.index)??wS(d),p=Bo(r,`${ao}/fhir/StructureDefinition/questionnaire-validationError`);let m=null;switch(s){case jt.display:m=a.jsx("p",{children:e.item.text},e.item.linkId);break;case jt.boolean:m=a.jsx(xP,{title:e.item.text,htmlFor:e.item.linkId,children:a.jsx(Ln,{id:e.item.linkId,name:e.item.linkId,required:e.required??n.required,defaultChecked:f?.value,onChange:g=>o([{valueBoolean:g.currentTarget.checked}])})},e.item.linkId);break;case jt.decimal:m=a.jsx(He,{type:"number",step:"any",id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o(g.currentTarget.value===""?[]:[{valueDecimal:g.currentTarget.valueAsNumber}])});break;case jt.integer:m=a.jsx(He,{type:"number",step:1,id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o(g.currentTarget.value===""?[]:[{valueInteger:g.currentTarget.valueAsNumber}])});break;case jt.date:m=a.jsx(He,{type:"date",id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o([{valueDate:g.currentTarget.value}])});break;case jt.dateTime:m=a.jsx(Ao,{name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o([{valueDateTime:g}])});break;case jt.time:m=a.jsx(He,{type:"time",id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o([{valueTime:g.currentTarget.value}])});break;case jt.string:case jt.url:m=a.jsx(He,{id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>{const y=g.currentTarget.value;o(y===""?[]:[{valueString:y}])}});break;case jt.text:m=a.jsx(Rl,{id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>{const y=g.currentTarget.value;o(y===""?[]:[{valueString:y}])}});break;case jt.attachment:m=a.jsx(ye,{py:4,children:a.jsx(iP,{path:"",name:c,defaultValue:f?.value,onChange:g=>o([{valueAttachment:g}])})});break;case jt.reference:m=a.jsx(ps,{name:c,required:e.required??n.required,targetTypes:Nk(n),searchCriteria:gH(n,t?.subject,t?.encounter),defaultValue:f?.value,onChange:g=>o([{valueReference:g}])});break;case jt.quantity:m=a.jsx(yl,{path:"",name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o([{valueQuantity:g}]),disableWheel:!0});break;case jt.choice:case jt.openChoice:JX(n)?m=a.jsx(YX,{name:c,item:n,required:e.required??n.required,initial:d,response:r,onChangeAnswer:g=>o(g)}):XX(n)||n.answerValueSet&&!ZX(n)?m=a.jsx(GX,{name:c,item:n,required:e.required??n.required,initial:d,response:r,onChangeAnswer:g=>o(g)}):m=a.jsx(WX,{name:c,item:n,required:e.required??n.required,initial:d,response:r,onChangeAnswer:g=>o(g)});break;default:return null}return a.jsxs(a.Fragment,{children:[m,p?.valueString&&a.jsx(Ee,{c:"red",size:"lg",mt:4,children:p.valueString})]})}function GX(e){const{name:t,item:n,required:r,initial:o,onChangeAnswer:s,response:c}=e;if(!n.answerOption?.length&&!n.answerValueSet)return a.jsx(KS,{});const d=wS(o),f=XS(c)??d,p=HP(c),m=n.repeats||eJ(n);if(n.answerValueSet)return a.jsx(vf,{name:t,placeholder:"Select items",binding:n.answerValueSet,maxValues:m?void 0:1,required:r,onChange:g=>{m?g.length===0?s([{}]):s(g.map(y=>({valueCoding:y}))):s([{valueCoding:g[0]}])},defaultValue:f?.value});if(m){const{propertyName:g,data:y}=tJ(n);return a.jsx(Rm,{data:y,placeholder:"Select items",searchable:!0,defaultValue:p||[pl(d)],required:r,onChange:b=>{if(b.length===0)s([{}]);else{const S=kk(b,g,n);s(S)}}})}else{const g=[""];if(n.answerOption)for(const y of n.answerOption){const b=Oo(y);g.push(pl(b))}return a.jsx(hn,{id:t,name:t,required:r,onChange:y=>{const b=y.currentTarget.selectedIndex;if(b===0){s([{}]);return}const S=n.answerOption[b-1],j=Oo(S),C="value"+Qn(j.type);s([{[C]:j.value}])},defaultValue:ff(f?.value)||f?.value,data:g})}}function QX(e,t){return e?t.valueSetExpand({url:e,count:cl+1}).then(n=>n.expansion?.contains??[]):Promise.resolve([])}function VP(e){const t=Re(),[n,r]=v.useState([]),[o,s]=v.useState(!1);return v.useEffect(()=>{async function c(){if(e){s(!0);try{const d=await QX(e,t);r(d)}catch(d){console.error("Error loading value set:",d)}finally{s(!1)}}}c().catch(console.error)},[e,t]),[n,o]}function FP(e,t){return e.map((n,r)=>{const o=`${t}-valueset-${r}`,s={type:"Coding",value:{system:n.system,code:n.code,display:n.display}};return[o,s]})}function WX(e){const{name:t,item:n,required:r,initial:o,onChangeAnswer:s,response:c}=e,d=Es("QuestionnaireItemAnswerOption","value[x]"),f=wS(o),[p,m]=VP(n.answerValueSet),g=[];let y;if(n.answerValueSet)g.push(...FP(p,t));else if(n.answerOption){const C=n.answerOption.slice(0,Vp).map((E,R)=>{const T=`${t}-option-${R}`,_=Oo(E);return _?.value?(f&&io(_)===io(f)&&(y=T),[T,_]):null}).filter(E=>E!==null);g.push(...C)}const b=XS(c),S=KX(g,b);if(m)return a.jsx(Ee,{children:"Loading options..."});if(g.length===0)return a.jsx(KS,{});const j=g.slice(0,cl);return a.jsxs(a.Fragment,{children:[a.jsx(yr.Group,{name:t,value:S??y,required:r,onChange:C=>{const E=g.find(R=>R[0]===C);if(E){const R=E[1],T="value"+Qn(R.type);s([{[T]:R.value}])}},children:j.map(([C,E])=>a.jsx(yr,{id:C,value:C,py:4,required:r,label:a.jsx(oo,{property:d,propertyType:E.type,value:E.value})},C))}),(n.answerValueSet&&g.length>cl||n.answerOption&&g.length>Vp)&&a.jsxs(Ee,{size:"sm",c:"dimmed",mt:"xs",children:["Showing first ",cl," options"]})]})}function YX(e){const{name:t,item:n,onChangeAnswer:r,response:o}=e,s=Es("QuestionnaireItemAnswerOption","value[x]"),[c,d]=VP(n.answerValueSet),f=n.answerValueSet?(o?.answer?.map(S=>S.valueCoding)||[]).filter(S=>S!==void 0):HP(o),[p,m]=v.useState(f),g=[];if(n.answerValueSet)g.push(...FP(c,t));else if(n.answerOption){const S=n.answerOption.slice(0,Vp).map((j,C)=>{const E=`${t}-option-${C}`,R=Oo(j);return R?.value?[E,R]:null}).filter(j=>j!==null);g.push(...S)}if(d)return a.jsx(Ee,{children:"Loading options..."});if(g.length===0)return a.jsx(KS,{});const y=g.slice(0,cl),b=(S,j)=>{if(n.answerValueSet){const C=p;let E;j?E=[...C,S.value]:E=C.filter(R=>!Po(R,S.value)),m(E),E.length===0?r([{}]):r(E.map(R=>({valueCoding:R})))}else{const C=p,E=pl(S);let R;if(j?R=[...C,E]:R=C.filter(T=>T!==E),m(R),R.length===0)r([{}]);else{const T=kk(R,"value"+Qn(S.type),n);r(T)}}};return a.jsxs(ye,{style:{flexDirection:"column",alignItems:"flex-start"},children:[y.map(([S,j])=>{const C=pl(j),E=n.answerValueSet?p.some(R=>Po(R,j.value)):p.includes(C);return a.jsx(Ln,{id:S,label:a.jsx(oo,{property:s,propertyType:j.type,value:j.value}),checked:E,onChange:R=>b(j,R.currentTarget.checked)},S)}),(n.answerValueSet&&g.length>cl||n.answerOption&&g.length>Vp)&&a.jsxs(Ee,{size:"sm",c:"dimmed",children:["Showing first ",cl," options"]})]})}function KS(){return a.jsx(He,{disabled:!0,placeholder:"No Answers Defined"})}function XS(e,t=0){return Oo(e?.answer?.[t]??{})}function HP(e){const t=e?.answer;return t?t.map(r=>Oo(r)).map(r=>ff(r?.value)||r?.value).filter(Boolean):[]}function KX(e,t){return e.find(n=>Po(n[1].value,t?.value))?.[0]}function lg(e,t){return!!e.extension?.some(n=>n.url===bS&&n.valueCodeableConcept?.coding?.[0]?.code===t)}function XX(e){return lg(e,"drop-down")}function JX(e){return lg(e,"check-box")}function ZX(e){return lg(e,"radio-button")}function eJ(e){return lg(e,"multi-select")}function tJ(e){if(e.answerOption?.length===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=Oo(t),r="value"+Qn(n.type),o=(e.answerOption??[]).map(s=>{const c=Oo(s),d=pl(c);return{value:d,label:d}});return{propertyName:r,data:o}}const nJ="_section_my8o4_1",rJ="_hovering_my8o4_10",iJ="_editing_my8o4_14",oJ="_questionBody_my8o4_20",aJ="_topActions_my8o4_24",sJ="_bottomActions_my8o4_33",lJ="_movementActions_my8o4_44",cJ="_movementIcons_my8o4_56",uJ="_columnAlignment_my8o4_60",dJ="_linkIdInput_my8o4_65",fJ="_typeSelect_my8o4_70",hJ="_preserveBreaks_my8o4_74",ci={section:nJ,hovering:rJ,editing:iJ,questionBody:oJ,topActions:aJ,bottomActions:sJ,movementActions:lJ,movementIcons:cJ,columnAlignment:uJ,linkIdInput:dJ,typeSelect:fJ,preserveBreaks:hJ};function pJ(e){const t=Re(),n=Jt(e.questionnaire),[r,o]=v.useState(!1),[s,c]=v.useState(),[d,f]=v.useState(),[p,m]=v.useState();function g(){m(void 0)}function y(){f(void 0)}v.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>o(!0)).catch(console.log)},[t]),v.useEffect(()=>(c(yJ(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:a.jsx("div",{children:a.jsxs(ht,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(s),children:[a.jsx(qP,{item:s,selectedKey:d,setSelectedKey:f,hoverKey:p,setHoverKey:m,onChange:b}),a.jsx(Tr,{children:"Save"})]})})}function qP(e){const t=e.item,n=e.item,r=Vo(e.item),o=r||n.type===jt.group,s=n.linkId??"[untitled]",c=e.selectedKey===e.item.id,d=e.hoverKey===e.item.id,f=v.useRef(e.item);f.current=e.item;function p(T){yn(T),e.setSelectedKey(e.item.id)}function m(T){yn(T),e.setHoverKey(e.item.id)}function g(T){const _=f.current;e.onChange({..._,item:_.item?.map(k=>k.id===T.id?T:k)})}function y(T,_){e.onChange({...e.item,item:[...e.item.item??[],T]},_)}function b(T){e.onChange({...e.item,item:e.item.item?.filter(_=>_!==T)})}function S(T,_){e.onChange({...f.current,[T]:_})}function j(T){e.onChange({...e.item,...T})}function C(T){e.onChange({...e.item,item:e.item.item?.map(_=>_===T?{..._,repeats:!_.repeats}:_)})}function E(T,_){const k=SJ(e.item.item,T,_);e.onChange({...e.item,item:k})}const R=$t(ci.section,{[ci.editing]:c,[ci.hovering]:d&&!c});return a.jsxs("div",{"data-testid":n.linkId,className:R,onClick:p,onMouseOver:m,onFocus:m,children:[a.jsx("div",{className:ci.questionBody,children:c?a.jsxs(a.Fragment,{children:[r&&a.jsx(He,{size:"xl",defaultValue:t.title,onBlur:T=>S("title",T.currentTarget.value)}),!r&&a.jsx(Rl,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:T=>S("text",T.currentTarget.value)}),n.type==="reference"&&a.jsx(vJ,{item:n,onChange:j}),aH(n)&&a.jsx(mJ,{item:n,onChange:T=>j(T)})]}):a.jsxs(a.Fragment,{children:[t.title&&a.jsx($e,{children:t.title}),n.text&&a.jsx("div",{className:ci.preserveBreaks,children:n.text}),!o&&a.jsx(Fp,{item:n,index:0,required:!1,responseItem:{linkId:n.linkId}})]})}),n.item?.map((T,_)=>a.jsx("div",{children:a.jsx(qP,{item:T,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:_===0,isLast:_===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:g,onRemove:()=>b(T),onRepeatable:C,onMoveUp:()=>E(_,-1),onMoveDown:()=>E(_,1)})},T.id)),!o&&a.jsx("div",{className:ci.topActions,children:c?a.jsxs(a.Fragment,{children:[a.jsx(He,{size:"xs",className:ci.linkIdInput,defaultValue:n.linkId,onBlur:T=>S("linkId",T.currentTarget.value)}),!o&&a.jsx(hn,{size:"xs",className:ci.typeSelect,defaultValue:n.type,onChange:T=>S("type",T.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"}]})]}):a.jsx("div",{children:s})}),!r&&a.jsx(ce,{className:ci.movementActions,children:a.jsxs(ce,{className:ci.columnAlignment,children:[!e.isFirst&&a.jsx(Nt,{href:"#",onClick:T=>{T.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:a.jsx($H,{"data-testid":"up-button",size:15,className:ci.movementIcons})}),!e.isLast&&a.jsx(Nt,{href:"#",onClick:T=>{T.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:a.jsx(IH,{"data-testid":"down-button",size:15,className:ci.movementIcons})})]})}),a.jsxs("div",{className:ci.bottomActions,children:[o&&a.jsxs(a.Fragment,{children:[a.jsx(Nt,{href:"#",onClick:T=>{T.preventDefault(),y({id:Sl(),linkId:Zx("q"),type:"string",text:"Question"})},children:"Add item"}),a.jsx(Nt,{href:"#",onClick:T=>{T.preventDefault(),y({id:Sl(),linkId:Zx("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&a.jsx(Nt,{href:"#",onClick:T=>{T.preventDefault(),y(bJ(),!0)},children:"Add Page"}),c&&!r&&a.jsxs(a.Fragment,{children:[a.jsx(Nt,{href:"#",onClick:T=>{T.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),a.jsx(Nt,{href:"#",onClick:T=>{T.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function mJ(e){const t=Es("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return a.jsxs("div",{children:[e.item.answerValueSet!==void 0?a.jsx(He,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):a.jsx(gJ,{options:n,property:t,item:e.item,onChange:e.onChange}),a.jsxs(ce,{display:"flex",children:[a.jsx(Nt,{href:"#",onClick:r=>{yn(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:Sl()}]})},children:"Add choice"}),a.jsx(Lm,{w:"lg"}),a.jsx(Nt,{href:"#",onClick:r=>{yn(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function gJ(e){return a.jsx("div",{children:e.options.map(t=>{const[n,r]=tg({type:"QuestionnaireItemAnswerOption",value:t},"value");return a.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"},children:[a.jsx("div",{children:a.jsx(bf,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(o,s)=>{const c=[...e.options],d=c.findIndex(f=>f.id===t.id);c[d]={id:t.id,[s]:o},e.onChange({...e.item,answerOption:c})},outcome:void 0},t.id)}),a.jsx("div",{children:a.jsx(Nt,{href:"#",onClick:o=>{yn(o),e.onChange({...e.item,answerOption:e.options.filter(s=>s.id!==t.id)})},children:"Remove"})})]},t.id)})})}function vJ(e){const t=Nk(e.item)??[];return a.jsxs(a.Fragment,{children:[t.map((n,r)=>a.jsxs(ye,{children:[a.jsx(LS,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:o=>{e.onChange(Zy(e.item,t.map(s=>s===n?o:s)))}}),a.jsx(Nt,{href:"#",onClick:o=>{yn(o),e.onChange(Zy(e.item,t.filter(s=>s!==n)))},children:"Remove"})]},`${n}-${r}`)),a.jsx(Nt,{href:"#",onClick:n=>{yn(n),e.onChange(Zy(e.item,[...t,""]))},children:"Add Resource Type"})]})}let Xx=1,Jx=1;function Zx(e){return e+Xx++}function Sl(){return"id-"+Jx++}function yJ(e){return{...e,id:e.id||Sl(),item:GP(e.item)}}function GP(e){if(e)return e.forEach(t=>{t.id?.match(/^id-\d+$/)&&(Jx=Math.max(Jx,Number.parseInt(t.id.substring(3),10)+1)),t.linkId?.match(/^q\d+$/)&&(Xx=Math.max(Xx,Number.parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||Sl(),item:GP(t.item),answerOption:xJ(t.answerOption)}))}function xJ(e){if(e)return e.map(t=>({...t,id:t.id||Sl()}))}function bJ(){return{id:Sl(),linkId:Zx("s"),type:"group",text:"New Page",extension:[{url:bS,valueCodeableConcept:{coding:[{system:"http://hl7.org/fhir/questionnaire-item-control",code:"page"}]}}]}}function SJ(e,t,n){const r=e??[],o=t+n;if(o<0||o>=r.length)return r;const s=[...r];return[s[t],s[o]]=[s[o],s[t]],s}var Hp=class{x;y;pressure;time;constructor(e,t,n,r){if(isNaN(e)||isNaN(t))throw new Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=n||0,this.time=r||Date.now()}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}equals(e){return this.x===e.x&&this.y===e.y&&this.pressure===e.pressure&&this.time===e.time}velocityFrom(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0}},wJ=class QP{constructor(t,n,r,o,s,c){this.startPoint=t,this.control2=n,this.control1=r,this.endPoint=o,this.startWidth=s,this.endWidth=c}static fromPoints(t,n){const r=this.calculateControlPoints(t[0],t[1],t[2]).c2,o=this.calculateControlPoints(t[1],t[2],t[3]).c1;return new QP(t[1],r,o,t[2],n.start,n.end)}static calculateControlPoints(t,n,r){const o=t.x-n.x,s=t.y-n.y,c=n.x-r.x,d=n.y-r.y,f={x:(t.x+n.x)/2,y:(t.y+n.y)/2},p={x:(n.x+r.x)/2,y:(n.y+r.y)/2},m=Math.sqrt(o*o+s*s),g=Math.sqrt(c*c+d*d),y=f.x-p.x,b=f.y-p.y,S=m+g==0?0:g/(m+g),j={x:p.x+y*S,y:p.y+b*S},C=n.x-j.x,E=n.y-j.y;return{c1:new Hp(f.x+C,f.y+E),c2:new Hp(p.x+C,p.y+E)}}length(){let n=0,r,o;for(let s=0;s<=10;s+=1){const c=s/10,d=this.point(c,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),f=this.point(c,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(s>0){const p=d-r,m=f-o;n+=Math.sqrt(p*p+m*m)}r=d,o=f}return n}point(t,n,r,o,s){return n*(1-t)*(1-t)*(1-t)+3*r*(1-t)*(1-t)*t+3*o*(1-t)*t*t+s*t*t*t}},jJ=class{_et;constructor(){try{this._et=new EventTarget}catch{this._et=document}}addEventListener(e,t,n){this._et.addEventListener(e,t,n)}dispatchEvent(e){return this._et.dispatchEvent(e)}removeEventListener(e,t,n){this._et.removeEventListener(e,t,n)}};function CJ(e,t=250){let n=0,r=null,o,s,c;const d=()=>{n=Date.now(),r=null,o=e.apply(s,c),r||(s=null,c=[])};return function(...p){const m=Date.now(),g=t-(m-n);return s=this,c=p,g<=0||g>t?(r&&(clearTimeout(r),r=null),n=m,o=e.apply(s,c),r||(s=null,c=[])):r||(r=window.setTimeout(d,g)),o}}var EJ=class eb extends jJ{constructor(t,n={}){super(),this.canvas=t,this.velocityFilterWeight=n.velocityFilterWeight||.7,this.minWidth=n.minWidth||.5,this.maxWidth=n.maxWidth||2.5,this.throttle=n.throttle??16,this.minDistance=n.minDistance??5,this.dotSize=n.dotSize||0,this.penColor=n.penColor||"black",this.backgroundColor=n.backgroundColor||"rgba(0,0,0,0)",this.compositeOperation=n.compositeOperation||"source-over",this.canvasContextOptions=n.canvasContextOptions??{},this._strokeMoveUpdate=this.throttle?CJ(eb.prototype._strokeUpdate,this.throttle):eb.prototype._strokeUpdate,this._handleMouseDown=this._handleMouseDown.bind(this),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this._handleTouchStart=this._handleTouchStart.bind(this),this._handleTouchMove=this._handleTouchMove.bind(this),this._handleTouchEnd=this._handleTouchEnd.bind(this),this._handlePointerDown=this._handlePointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._handlePointerCancel=this._handlePointerCancel.bind(this),this._handleTouchCancel=this._handleTouchCancel.bind(this),this._ctx=t.getContext("2d",this.canvasContextOptions),this.clear(),this.on()}dotSize;minWidth;maxWidth;penColor;minDistance;velocityFilterWeight;compositeOperation;backgroundColor;throttle;canvasContextOptions;_ctx;_drawingStroke=!1;_isEmpty=!0;_dataUrl;_dataUrlOptions;_lastPoints=[];_data=[];_lastVelocity=0;_lastWidth=0;_strokeMoveUpdate;_strokePointerId;clear(){const{_ctx:t,canvas:n}=this;t.fillStyle=this.backgroundColor,t.clearRect(0,0,n.width,n.height),t.fillRect(0,0,n.width,n.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0,this._dataUrl=void 0,this._dataUrlOptions=void 0,this._strokePointerId=void 0}redraw(){const t=this._data,n=this._dataUrl,r=this._dataUrlOptions;this.clear(),n&&this.fromDataURL(n,r),this.fromData(t,{clear:!1})}fromDataURL(t,n={}){return new Promise((r,o)=>{const s=new Image,c=n.ratio||window.devicePixelRatio||1,d=n.width||this.canvas.width/c,f=n.height||this.canvas.height/c,p=n.xOffset||0,m=n.yOffset||0;this._reset(this._getPointGroupOptions()),s.onload=()=>{this._ctx.drawImage(s,p,m,d,f),r()},s.onerror=g=>{o(g)},s.crossOrigin="anonymous",s.src=t,this._isEmpty=!1,this._dataUrl=t,this._dataUrlOptions={...n}})}toDataURL(t="image/png",n){switch(t){case"image/svg+xml":return typeof n!="object"&&(n=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(n))}`;default:return typeof n!="number"&&(n=void 0),this.canvas.toDataURL(t,n)}}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none",this.canvas.style.webkitUserSelect="none";const t=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!t?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.style.userSelect="auto",this.canvas.style.webkitUserSelect="auto",this.canvas.removeEventListener("pointerdown",this._handlePointerDown),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this._removeMoveUpEventListeners()}_getListenerFunctions(){const t=window.document===this.canvas.ownerDocument?window:this.canvas.ownerDocument.defaultView??this.canvas.ownerDocument;return{addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}_removeMoveUpEventListeners(){const{removeEventListener:t}=this._getListenerFunctions();t("pointermove",this._handlePointerMove),t("pointerup",this._handlePointerUp),t("pointercancel",this._handlePointerCancel),t("mousemove",this._handleMouseMove),t("mouseup",this._handleMouseUp),t("touchmove",this._handleTouchMove),t("touchend",this._handleTouchEnd),t("touchcancel",this._handleTouchCancel)}isEmpty(){return this._isEmpty}fromData(t,{clear:n=!0}={}){n&&this.clear(),this._fromData(t,this._drawCurve.bind(this),this._drawDot.bind(this)),this._data=this._data.concat(t)}toData(){return this._data}_isLeftButtonPressed(t,n){return n?t.buttons===1:(t.buttons&1)===1}_pointerEventToSignatureEvent(t){return{event:t,type:t.type,x:t.clientX,y:t.clientY,pressure:"pressure"in t?t.pressure:0}}_touchEventToSignatureEvent(t){const n=t.changedTouches[0];return{event:t,type:t.type,x:n.clientX,y:n.clientY,pressure:n.force}}_handleMouseDown(t){!this._isLeftButtonPressed(t,!0)||this._drawingStroke||this._strokeBegin(this._pointerEventToSignatureEvent(t))}_handleMouseMove(t){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}_handleMouseUp(t){this._isLeftButtonPressed(t)||this._strokeEnd(this._pointerEventToSignatureEvent(t))}_handleTouchStart(t){t.targetTouches.length!==1||this._drawingStroke||(t.cancelable&&t.preventDefault(),this._strokeBegin(this._touchEventToSignatureEvent(t)))}_handleTouchMove(t){if(t.targetTouches.length===1){if(t.cancelable&&t.preventDefault(),!this._drawingStroke){this._strokeEnd(this._touchEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._touchEventToSignatureEvent(t))}}_handleTouchEnd(t){t.targetTouches.length===0&&(t.cancelable&&t.preventDefault(),this._strokeEnd(this._touchEventToSignatureEvent(t)))}_handlePointerCancel(t){this._allowPointerId(t)&&(t.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(t),!1))}_handleTouchCancel(t){t.cancelable&&t.preventDefault(),this._strokeEnd(this._touchEventToSignatureEvent(t),!1)}_getPointerId(t){return t.persistentDeviceId||t.pointerId}_allowPointerId(t,n=!1){return typeof this._strokePointerId>"u"?n:this._getPointerId(t)===this._strokePointerId}_handlePointerDown(t){this._drawingStroke||!this._isLeftButtonPressed(t)||!this._allowPointerId(t,!0)||(this._strokePointerId=this._getPointerId(t),t.preventDefault(),this._strokeBegin(this._pointerEventToSignatureEvent(t)))}_handlePointerMove(t){if(this._allowPointerId(t)){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}t.preventDefault(),this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}}_handlePointerUp(t){this._isLeftButtonPressed(t)||!this._allowPointerId(t)||(t.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(t)))}_getPointGroupOptions(t){return{penColor:t&&"penColor"in t?t.penColor:this.penColor,dotSize:t&&"dotSize"in t?t.dotSize:this.dotSize,minWidth:t&&"minWidth"in t?t.minWidth:this.minWidth,maxWidth:t&&"maxWidth"in t?t.maxWidth:this.maxWidth,velocityFilterWeight:t&&"velocityFilterWeight"in t?t.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:t&&"compositeOperation"in t?t.compositeOperation:this.compositeOperation}}_strokeBegin(t){if(!this.dispatchEvent(new CustomEvent("beginStroke",{detail:t,cancelable:!0})))return;const{addEventListener:r}=this._getListenerFunctions();switch(t.event.type){case"mousedown":r("mousemove",this._handleMouseMove,{passive:!1}),r("mouseup",this._handleMouseUp,{passive:!1});break;case"touchstart":r("touchmove",this._handleTouchMove,{passive:!1}),r("touchend",this._handleTouchEnd,{passive:!1}),r("touchcancel",this._handleTouchCancel,{passive:!1});break;case"pointerdown":r("pointermove",this._handlePointerMove,{passive:!1}),r("pointerup",this._handlePointerUp,{passive:!1}),r("pointercancel",this._handlePointerCancel,{passive:!1});break}this._drawingStroke=!0;const o=this._getPointGroupOptions(),s={...o,points:[]};this._data.push(s),this._reset(o),this._strokeUpdate(t)}_strokeUpdate(t){if(!this._drawingStroke)return;if(this._data.length===0){this._strokeBegin(t);return}this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:t}));const n=this._createPoint(t.x,t.y,t.pressure),r=this._data[this._data.length-1],o=r.points,s=o.length>0&&o[o.length-1],c=s?n.distanceTo(s)<=this.minDistance:!1,d=this._getPointGroupOptions(r);if(!s||!(s&&c)){const f=this._addPoint(n,d);s?f&&this._drawCurve(f,d):this._drawDot(n,d),o.push({time:n.time,x:n.x,y:n.y,pressure:n.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:t}))}_strokeEnd(t,n=!0){this._removeMoveUpEventListeners(),this._drawingStroke&&(n&&this._strokeUpdate(t),this._drawingStroke=!1,this._strokePointerId=void 0,this.dispatchEvent(new CustomEvent("endStroke",{detail:t})))}_handlePointerEvents(){this._drawingStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerDown,{passive:!1})}_handleMouseEvents(){this._drawingStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown,{passive:!1})}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart,{passive:!1})}_reset(t){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(t.minWidth+t.maxWidth)/2,this._ctx.fillStyle=t.penColor,this._ctx.globalCompositeOperation=t.compositeOperation}_createPoint(t,n,r){const o=this.canvas.getBoundingClientRect();return new Hp(t-o.left,n-o.top,r,new Date().getTime())}_addPoint(t,n){const{_lastPoints:r}=this;if(r.push(t),r.length>2){r.length===3&&r.unshift(r[0]);const o=this._calculateCurveWidths(r[1],r[2],n),s=wJ.fromPoints(r,o);return r.shift(),s}return null}_calculateCurveWidths(t,n,r){const o=r.velocityFilterWeight*n.velocityFrom(t)+(1-r.velocityFilterWeight)*this._lastVelocity,s=this._strokeWidth(o,r),c={end:s,start:this._lastWidth};return this._lastVelocity=o,this._lastWidth=s,c}_strokeWidth(t,n){return Math.max(n.maxWidth/(t+1),n.minWidth)}_drawCurveSegment(t,n,r){const o=this._ctx;o.moveTo(t,n),o.arc(t,n,r,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(t,n){const r=this._ctx,o=t.endWidth-t.startWidth,s=Math.ceil(t.length())*2;r.beginPath(),r.fillStyle=n.penColor;for(let c=0;c<s;c+=1){const d=c/s,f=d*d,p=f*d,m=1-d,g=m*m,y=g*m;let b=y*t.startPoint.x;b+=3*g*d*t.control1.x,b+=3*m*f*t.control2.x,b+=p*t.endPoint.x;let S=y*t.startPoint.y;S+=3*g*d*t.control1.y,S+=3*m*f*t.control2.y,S+=p*t.endPoint.y;const j=Math.min(t.startWidth+p*o,n.maxWidth);this._drawCurveSegment(b,S,j)}r.closePath(),r.fill()}_drawDot(t,n){const r=this._ctx,o=n.dotSize>0?n.dotSize:(n.minWidth+n.maxWidth)/2;r.beginPath(),this._drawCurveSegment(t.x,t.y,o),r.closePath(),r.fillStyle=n.penColor,r.fill()}_fromData(t,n,r){for(const o of t){const{points:s}=o,c=this._getPointGroupOptions(o);if(s.length>1)for(let d=0;d<s.length;d+=1){const f=s[d],p=new Hp(f.x,f.y,f.pressure,f.time);d===0&&this._reset(c);const m=this._addPoint(p,c);m&&n(m,c)}else this._reset(c),r(s[0],c)}}toSVG({includeBackgroundColor:t=!1,includeDataUrl:n=!1}={}){const r=this._data,o=Math.max(window.devicePixelRatio||1,1),s=0,c=0,d=this.canvas.width/o,f=this.canvas.height/o,p=document.createElementNS("http://www.w3.org/2000/svg","svg");if(p.setAttribute("xmlns","http://www.w3.org/2000/svg"),p.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),p.setAttribute("viewBox",`${s} ${c} ${d} ${f}`),p.setAttribute("width",d.toString()),p.setAttribute("height",f.toString()),t&&this.backgroundColor){const m=document.createElement("rect");m.setAttribute("width","100%"),m.setAttribute("height","100%"),m.setAttribute("fill",this.backgroundColor),p.appendChild(m)}if(n&&this._dataUrl){const m=this._dataUrlOptions?.ratio||window.devicePixelRatio||1,g=this._dataUrlOptions?.width||this.canvas.width/m,y=this._dataUrlOptions?.height||this.canvas.height/m,b=this._dataUrlOptions?.xOffset||0,S=this._dataUrlOptions?.yOffset||0,j=document.createElement("image");j.setAttribute("x",b.toString()),j.setAttribute("y",S.toString()),j.setAttribute("width",g.toString()),j.setAttribute("height",y.toString()),j.setAttribute("preserveAspectRatio","none"),j.setAttribute("href",this._dataUrl),p.appendChild(j)}return this._fromData(r,(m,{penColor:g})=>{const y=document.createElement("path");if(!isNaN(m.control1.x)&&!isNaN(m.control1.y)&&!isNaN(m.control2.x)&&!isNaN(m.control2.y)){const b=`M ${m.startPoint.x.toFixed(3)},${m.startPoint.y.toFixed(3)} C ${m.control1.x.toFixed(3)},${m.control1.y.toFixed(3)} ${m.control2.x.toFixed(3)},${m.control2.y.toFixed(3)} ${m.endPoint.x.toFixed(3)},${m.endPoint.y.toFixed(3)}`;y.setAttribute("d",b),y.setAttribute("stroke-width",(m.endWidth*2.25).toFixed(3)),y.setAttribute("stroke",g),y.setAttribute("fill","none"),y.setAttribute("stroke-linecap","round"),p.appendChild(y)}},(m,{penColor:g,dotSize:y,minWidth:b,maxWidth:S})=>{const j=document.createElement("circle"),C=y>0?y:(b+S)/2;j.setAttribute("r",C.toString()),j.setAttribute("cx",m.x.toString()),j.setAttribute("cy",m.y.toString()),j.setAttribute("fill",g),p.appendChild(j)}),p.outerHTML}};function TJ(e){const t=Re(),{width:n=500,height:r=200,defaultValue:o,who:s,onChange:c,...d}=e,f=v.useRef(null),p=v.useRef(null),m=v.useRef(c);m.current=c,v.useEffect(()=>{function y(){m.current?.({type:[{system:ao+"/fhir/signature-type",code:"ProofOfOrigin",display:"Proof of Origin"}],when:new Date().toISOString(),who:s??Yt(t.getProfile()),data:p.current?.toDataURL().split(",")[1]})}if(f.current){const b=new EJ(f.current);o?.data&&b.fromDataURL(o.data).catch(console.error),b.addEventListener("endStroke",y),p.current=b}return()=>{p.current&&p.current.removeEventListener("beginStroke",y)}},[t,o,s]);const g=()=>{p.current&&p.current.clear(),m.current?.(void 0)};return a.jsxs(Nr,{withBorder:!0,p:0,w:n,h:r,pos:"relative",...d,children:[a.jsx("canvas",{ref:f,width:n,height:r,"aria-label":"Signature input area"}),a.jsx(Pe,{onClick:g,"aria-label":"Clear signature",pos:"absolute",top:0,right:0,size:"xs",leftSection:a.jsx(Wm,{size:16}),variant:"subtle",color:"gray",children:"Clear"})]})}function WP(e){const t=[...e.context,e.responseItem];return a.jsxs("div",{children:[e.item.text&&a.jsx($e,{order:3,mb:"md",children:e.item.text}),a.jsx(tb,{formState:e.formState,context:t,items:e.item.item??[],responseItems:e.responseItem.item??[]})]},e.item.linkId)}function RJ(e){return a.jsxs(a.Fragment,{children:[e.responseItems.map(t=>a.jsx(WP,{formState:e.formState,context:e.context,item:e.item,responseItem:t},`group-${t.id}`)),a.jsx(Nt,{onClick:()=>e.formState.onAddGroup(e.context,e.item),children:`Add Group: ${e.item.text}`})]})}function _J(e){const{formState:t,context:n,item:r,responseItem:o}=e,s=r.type!==jt.choice&&r.type!==jt.openChoice,c=o.answer&&o.answer.length>0?o.answer:[{}];return a.jsxs(zt,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[a.jsx(Be,{gap:"xs",children:c?.map((d,f)=>a.jsx(Fp,{formState:t,context:n,item:r,responseItem:o,index:f},`${r.linkId}-${f}`))}),s&&a.jsx(Nt,{onClick:()=>t.onAddAnswer(n,r),children:"Add Item"})]},e.item.linkId)}function tb(e){const{formState:t,context:n,items:r,responseItems:o}=e;return a.jsx(Be,{children:r.map((s,c)=>{if(!sH(s,t.questionnaireResponse))return null;if(s.type===jt.display)return a.jsx("p",{children:s.text},`display-${s.id}-${c}`);const d=o.filter(f=>f.linkId===s.linkId);return s.type===jt.group&&s.repeats?a.jsx(RJ,{formState:t,context:n,item:s,responseItems:d},`repeating-group-${s.id}-${c}`):s.type===jt.group?a.jsx(WP,{formState:t,context:n,item:s,responseItem:d[0]},`group-${s.id}-${c}`):s.type===jt.boolean?a.jsx(Fp,{formState:t,context:n,item:s,responseItem:d[0],index:0},`boolean-item-${s.id}-${c}`):s.repeats?a.jsx(_J,{formState:t,context:n,item:s,responseItem:d[0]},`repeating-item-${s.id}-${c}`):a.jsx(zt,{htmlFor:s.linkId,title:s.text,withAsterisk:s.required,children:a.jsx(Fp,{formState:t,context:n,item:s,responseItem:d[0],index:0})},`repeating-item-${s.id}-${c}`)})})}function AJ(e){const{formState:t,submitButtonText:n,excludeButtons:r,children:o}=e,s=t.pages,c=t.activePage,d=c>0,f=c<s.length-1,p=c===s.length-1;return a.jsxs(a.Fragment,{children:[a.jsx(Gc,{active:c,allowNextStepsSelect:!1,p:6,children:s.map((m,g)=>a.jsx(Gc.Step,{label:m.title,children:g===c&&o},m.linkId))}),!r&&a.jsxs(ye,{justify:"flex-end",mt:"xl",gap:"xs",children:[d&&a.jsx(Pe,{onClick:t.onPrevPage,children:"Back"}),f&&a.jsx(Pe,{onClick:m=>{m.currentTarget.closest("form").reportValidity()&&t.onNextPage()},children:"Next"}),p&&a.jsx(Tr,{children:n??"Submit"})]})]})}function YP(e){const t=Re(),[n,r]=v.useState(!1),o=v.useRef(e);o.current=e;const s=v.useCallback(g=>{r(!1),o.current.onChange?.(g)},[]),c=bH({questionnaire:e.questionnaire,defaultValue:e.questionnaireResponse,subject:e.subject,encounter:e.encounter,source:e.source,disablePagination:e.disablePagination,onChange:s}),d=v.useRef(c);d.current=c;const f=v.useMemo(()=>c.loading?!1:!!Bo(c.questionnaire,oH),[c]),p=v.useMemo(()=>c.loading?!1:!!c.questionnaireResponse.extension?.find(g=>g.url===pp),[c]),m=v.useCallback(()=>{const g=d.current;if(g.loading)return;const y=o.current.onSubmit;if(!y)return;if(f&&!p){r(!0);return}const b=g.questionnaire,S=g.questionnaireResponse,j=o.current.subject;let C=o.current.source;if(!C){const E=t.getProfile();E&&(C=Yt(E))}y({...S,questionnaire:b.url??Mt(b),subject:j,source:C,authored:new Date().toISOString(),status:"completed"})},[t,f,p]);return c.loading?null:a.jsxs(ht,{testid:"questionnaire-form",onSubmit:m,children:[c.questionnaire.title&&a.jsx($e,{children:c.questionnaire.title}),c.pagination?a.jsx(AJ,{formState:c,submitButtonText:e.submitButtonText,excludeButtons:e.excludeButtons,children:a.jsx(tb,{formState:c,context:[],items:c.items,responseItems:c.responseItems})}):a.jsxs(a.Fragment,{children:[a.jsx(tb,{formState:c,context:[],items:c.items,responseItems:c.responseItems}),f&&a.jsxs(Be,{mt:"md",gap:0,children:[a.jsx(Ee,{size:"sm",fw:500,children:"Signature"}),a.jsx(TJ,{onChange:c.onChangeSignature}),!p&&n&&a.jsx(Ee,{c:"red",size:"sm",children:"Signature is required."})]}),!e.excludeButtons&&a.jsx(ye,{justify:"flex-end",mt:"xl",gap:"xs",children:a.jsx(Tr,{children:e.submitButtonText??"Submit"})})]})]})}const DJ="_section_4m5it_1",kJ={section:DJ},PJ=["gender","age","gestationalAge","context","appliesTo","category"],NJ={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function OJ(e){e=Object.assign(NJ,e);const t=e.definition,[n,r]=v.useState([]),[o,s]=v.useState(1),[c,d]=v.useState(1);return v.useEffect(()=>{const S=IJ(t,d);r(zJ(S.qualifiedInterval||[],s))},[t]),a.jsxs(ht,{testid:"reference-range-editor",onSubmit:f,children:[a.jsx(Be,{children:n.map(S=>a.jsx(MJ,{unit:UJ(t.quantitativeDetails?.unit),onChange:g,onAdd:y,onRemove:b,onRemoveGroup:m,intervalGroup:S},`group-${S.id}`))}),a.jsx(Dn,{title:"Add Group",variant:"subtle",size:"sm",onClick:S=>{yn(S),p({id:`group-id-${o}`,filters:{},intervals:[]}),s(j=>j+1)},children:a.jsx(Lp,{})}),a.jsx(ye,{justify:"flex-end",children:a.jsx(Tr,{children:"Save"})})]});function f(){const S=n.flatMap(j=>j.intervals).filter(j=>!BJ(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 E=C.find(T=>T.id===S),R=E?.intervals.findIndex(T=>T.id===j.id);return R!==void 0&&E?.intervals[R]&&(E.intervals[R]=j),C})}function y(S,j){j.id===void 0&&(j.id=`id-${c}`,d(C=>C+1)),r(C=>{C=[...C];const E=C.findIndex(R=>R.id===S);if(E!==-1){const R={...C[E]};j={...j,...R.filters},R.intervals=[...R.intervals,j],C[E]=R}return C})}function b(S,j){r(C=>{C=[...C];const E=C.find(R=>R.id===S);return E&&(E.intervals=E.intervals.filter(R=>R.id!==j.id)),C})}}function MJ(e){const{intervalGroup:t,unit:n}=e;return a.jsx(hu,{"data-testid":t.id,className:kJ.section,children:a.jsxs(Be,{gap:"lg",children:[a.jsx(ye,{justify:"flex-end",children:a.jsx(Dn,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{yn(r),e.onRemoveGroup(t)},children:a.jsx(Mp,{})},`remove-group-button-${t.id}`)}),a.jsx(LJ,{intervalGroup:t,onChange:e.onChange}),a.jsx(An,{}),t.intervals.map(r=>a.jsxs(Be,{gap:"xs",children:[a.jsxs(ye,{children:[a.jsx(He,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:o=>{yn(o),e.onChange(t.id,{...r,condition:o.currentTarget.value.trim()})}},`condition-${r.id}`),a.jsx(Dn,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:o=>{yn(o),e.onRemove(t.id,r)},children:a.jsx(Mp,{})},`remove-interval-${r.id}`)]}),a.jsx(US,{path:"",onChange:o=>{e.onChange(t.id,{...r,range:o})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),a.jsx(Dn,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{yn(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:a.jsx(Lp,{})})]})})}function LJ(e){const{intervalGroup:t,onChange:n}=e;t.filters.age||(t.filters.age={});for(const r of["low","high"])t.filters.age[r]?.unit||(t.filters.age[r]={...t.filters.age[r],unit:"years",system:"http://unitsofmeasure.org"});return a.jsxs(Be,{style:{maxWidth:"50%"},children:[a.jsx(ye,{children:a.jsx(hn,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:r=>{for(const o of t.intervals){let s=r.currentTarget.value;s===""&&(s=void 0),n(t.id,{...o,gender:s})}}})}),a.jsxs(ye,{gap:"xs",children:[a.jsx(Ee,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),a.jsx("div",{id:`div-age-${t.id}`,children:a.jsx(US,{path:"",name:`age-${t.id}`,defaultValue:t.filters.age,onChange:r=>{for(const o of t.intervals)n(t.id,{...o,age:r})}},`age-${t.id}`)})]}),a.jsx(hn,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:t.filters.context?.text||"",onChange:r=>{for(const o of t.intervals){let s=r.currentTarget.value;s===""?(s=void 0,n(t.id,{...o,context:void 0})):n(t.id,{...o,context:{text:s,coding:[{code:s,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),a.jsx(hn,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:r=>{for(const o of t.intervals){const s=r.currentTarget.value;s===""?n(t.id,{...o,category:void 0}):n(t.id,{...o,category:s})}}})]})}function IJ(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(o=>{const s=Number.parseInt(o.id?.substring(3)||"",10);return Number.isNaN(s)?Number.NEGATIVE_INFINITY:s}))+1;return Number.isFinite(r)||(r=1),e={...e,qualifiedInterval:n.map(o=>({...o,id:o.id||`id-${r++}`}))},t(r),e}function zJ(e,t){let n=1;const r={};for(const o of e){const s=$J(o);s in r||(r[s]={id:`group-id-${n++}`,filters:Object.fromEntries(PJ.map(c=>[c,o[c]])),intervals:[]}),r[s].intervals.push(o)}return t(n),Object.values(r)}function $J(e){return[`gender=${e.gender}`,`age=${Md(e.age)}`,`gestationalAge=${Md(e.gestationalAge)}`,`context=${e.context?.text}`,`appliesTo=${e.appliesTo?.map(n=>n.text).join("+")}`,`category=${e.category}`].join(":")}function UJ(e){return e&&(hB(e,"http://unitsofmeasure.org")||e.text)}function BJ(e){return e.range?.low?.value===void 0&&e.range?.high?.value===void 0}function VJ(e){const t=Re(),n=Jt(e.value),[r,o]=v.useState(!1),[s,c]=v.useState();if(v.useEffect(()=>{n&&!r&&(t.executeBatch(d(n)).then(c).catch(console.log),o(!0))},[t,n,r]),!n||!s)return null;return a.jsx(wr,{children:n.action?.map((p,m)=>{const g=p.resource&&f(p.resource),y=g?.input?.[0]?.valueReference,b=g?.output?.[0]?.valueReference;return a.jsxs(v.Fragment,{children:[a.jsx(wr.Col,{span:1,p:"md",children:g?.status==="completed"?a.jsx(oq,{}):a.jsx(EG,{color:"gray"})}),a.jsxs(wr.Col,{span:9,p:"xs",children:[a.jsx(Ee,{fw:500,children:p.title}),p.description&&a.jsx("div",{children:p.description}),a.jsxs("div",{children:["Last edited by ",a.jsx(Pl,{value:g?.meta?.author})," on ",Cr(g?.meta?.lastUpdated)]}),a.jsxs("div",{children:["Status: ",a.jsx(rg,{status:g?.status||"unknown"})]})]}),a.jsxs(wr.Col,{span:2,p:"md",children:[y&&!b&&a.jsx(Pe,{onClick:()=>e.onStart(g,y),children:"Start"}),y&&b&&a.jsx(Pe,{onClick:()=>e.onEdit(g,y,b),children:"Edit"})]})]},`action-${m}`)})});function d(p){const m=[];if(p.action)for(const g of p.action)g.resource?.reference&&m.push({request:{method:"GET",url:g.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:m}}function f(p){for(const m of s?.entry??[])if(m.resource&&p.reference===Mt(m.resource))return m.resource}}function KP(e,t){const n=FJ(e,t);return HJ(n,e,t)}function FJ(e,t){const n=e.length,r=t.length,o=n+r+1,s=1+2*o,c=Math.trunc(s/2),d=new Array(s);d[c+1]={i:0,j:-1,prev:void 0,snake:!0};for(let f=0;f<o;f++){for(let p=-f;p<=f;p+=2){const m=c+p,g=m+1,y=m-1,b=d[g],S=d[y];let j,C=0;p===-f||p!==f&&S.i<b.i?(C=b.i,j=b):(C=S.i+1,j=S),d[y]=void 0;let E=C-p,R={i:C,j:E,prev:qJ(j),snake:!1};for(;C<n&&E<r&&e[C]===t[E];)C++,E++;if(C>R.i&&(R={i:C,j:E,prev:R,snake:!0}),d[m]=R,C>=n&&E>=r)return d[m]}d[c+f-1]=void 0}}function HJ(e,t,n){const r=[];let o=e;for(o.snake&&(o=o.prev);o?.prev&&o.prev.j>=0;){const s=o.i,c=o.j;o=o.prev;const d=o.i,f=o.j,p={position:d,lines:t.slice(d,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}),o.snake&&(o=o.prev)}return r}function qJ(e){return e&&!e.snake&&e.prev?e.prev:e}function GJ(e){const t=(e.entry??[]).filter(r=>!!r.resource).map(r=>({meta:r.resource?.meta,lines:io(r.resource,!0).match(/[^\r\n]+/g)})).sort((r,o)=>r.meta.lastUpdated.localeCompare(o.meta.lastUpdated));if(!t.length)return[];const n=t[0].lines.map(r=>({id:t[0].meta.versionId,meta:t[0].meta,value:r,span:1}));return QJ(n,t),WJ(n),n}function QJ(e,t){for(let n=1;n<t.length;n++){const r=KP(t[n-1].lines,t[n].lines);for(const o of r){const s=o.original.position,c=o.original.lines,d=o.revised.lines;if((o.type==="delete"||o.type==="change")&&e.splice(s,c.length),o.type==="insert"||o.type==="change")for(let f=0;f<o.revised.lines.length;f++)e.splice(s+f,0,{id:t[n].meta.versionId,meta:t[n].meta,value:d[f],span:1})}}}function WJ(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 YJ="_container_1tyf3_1",KJ="_root_1tyf3_5",XJ="_startRow_1tyf3_20",JJ="_normalRow_1tyf3_25",ZJ="_author_1tyf3_30",eZ="_dateTime_1tyf3_34",tZ="_lineNumber_1tyf3_40",nZ="_line_1tyf3_40",rZ="_pre_1tyf3_55",fa={container:YJ,root:KJ,startRow:XJ,normalRow:JJ,author:ZJ,dateTime:eZ,lineNumber:tZ,line:nZ,pre:rZ};function iZ(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function oZ(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return Rc(n,"year");const r=Math.floor(t/2592e3);if(r>0)return Rc(r,"month");const o=Math.floor(t/86400);if(o>0)return Rc(o,"day");const s=Math.floor(t/3600);if(s>0)return Rc(s,"hour");const c=Math.floor(t/60);return c>0?Rc(c,"minute"):Rc(t,"second")}function Rc(e,t){return`${e} ${e===1?t:t+"s"} ago`}function aZ(e){const t=Re(),[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 a.jsx("div",{children:"Loading..."});const o=n.entry?.[0]?.resource;if(!o)return null;const s=GJ(n);return a.jsx("div",{className:fa.container,children:a.jsx("table",{className:fa.root,children:a.jsx("tbody",{children:s.map((c,d)=>a.jsxs("tr",{className:c.span>0?fa.startRow:fa.normalRow,children:[c.span>0&&a.jsxs(a.Fragment,{children:[a.jsx("td",{className:fa.author,rowSpan:c.span,children:a.jsx(Pl,{value:c.meta.author,link:!0,fz:"xs"})}),a.jsx("td",{className:fa.dateTime,rowSpan:c.span,children:a.jsx(yt,{to:iZ(o,c.meta.versionId),fz:"xs",children:oZ(c.meta.lastUpdated)})})]}),a.jsx("td",{className:fa.lineNumber,children:d+1}),a.jsx("td",{className:fa.line,children:a.jsx("pre",{className:fa.pre,children:c.value})})]},"row-"+d))})})})}const sZ="_removed_el5zk_1",lZ="_added_el5zk_6",kR={removed:sZ,added:lZ};function cZ(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=io(t,!0).match(/[^\r\n]+/g),o=io(n,!0).match(/[^\r\n]+/g),s=KP(r,o);return a.jsx("pre",{style:{color:"gray"},children:s.map((c,d)=>a.jsx(uZ,{delta:c},"delta"+d))})}function uZ(e){return a.jsxs(a.Fragment,{children:["...",a.jsx("br",{}),e.delta.original.lines.length>0&&a.jsx("div",{className:kR.removed,children:e.delta.original.lines.join(`
|
|
233
|
+
`)}),e.delta.revised.lines.length>0&&a.jsx("div",{className:kR.added,children:e.delta.revised.lines.join(`
|
|
234
|
+
`)}),"...",a.jsx("br",{})]})}const dZ="_splitButton_1i0gi_1",fZ="_menuControl_1i0gi_6",PR={splitButton:dZ,menuControl:fZ};function qp(e){const{outcome:t}=e,n=Re(),r=Jt(e.defaultValue),o=r?.resourceType,[s,c]=v.useState(!1),[d,f]=v.useState(),p=n.getAccessPolicy(),m=En();v.useEffect(()=>{if(r)if(e.profileUrl){const b=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const S=uu(b);if(S){c(!0);const j=zF(r,S);f(j)}else console.error(`Schema not found for ${b}`)}).catch(S=>{console.error("Error in requestProfileSchema",S)})}else n.requestSchema(o).then(()=>{f(r),c(!0)}).catch(console.log)},[n,r,o,e.profileUrl]);const g=v.useMemo(()=>r&&mk(r,al.READ,p),[p,r]),y=v.useMemo(()=>n.isSuperAdmin()||!p||!Nn(d?.resourceType)?!0:UV(p,d?.resourceType),[n,p,d?.resourceType]);return!s||!d?a.jsx("div",{children:"Loading..."}):y?a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:b=>{b.preventDefault(),e.onSubmit&&e.onSubmit(d)},children:[a.jsxs(Be,{mb:"xl",children:[a.jsx(zt,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:a.jsx(He,{name:"resourceType",defaultValue:d.resourceType,disabled:!0})}),a.jsx(zt,{title:"ID",htmlFor:"id",outcome:t,children:a.jsx(He,{name:"id",defaultValue:d.id,disabled:!0})})]}),a.jsx(FS,{path:d.resourceType,valuePath:d.resourceType,typeName:o,defaultValue:d,outcome:t,onChange:f,profileUrl:e.profileUrl,accessPolicyResource:g}),a.jsxs(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",gap:0,children:[a.jsx(Pe,{type:"submit",className:$t((e.onPatch||e.onDelete)&&PR.splitButton),children:r?.id?"Update":"Create"}),(e.onPatch||e.onDelete)&&a.jsxs(be,{transitionProps:{transition:"pop"},position:"bottom-end",withinPortal:!0,children:[a.jsx(be.Target,{children:a.jsx(Dn,{variant:"filled",color:m.primaryColor,size:36,className:PR.menuControl,"aria-label":"More actions",children:a.jsx(CS,{size:14,stroke:1.5})})}),a.jsxs(be.Dropdown,{children:[e.onPatch&&a.jsx(be.Item,{leftSection:a.jsx(Uk,{size:14,stroke:1.5}),onClick:()=>{e.onPatch(d)},children:"Patch"}),e.onDelete&&a.jsx(be.Item,{color:"red",leftSection:a.jsx(Wm,{size:14,stroke:1.5,color:"red"}),onClick:()=>{e.onDelete(d)},children:"Delete"})]})]})]})]}):a.jsxs(Uo,{color:"red",title:"Permission denied",icon:a.jsx(Ts,{}),children:["Your access level prevents you from editing and creating ",d.resourceType," resources."]})}function hZ(e){const t=Re(),[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?a.jsxs(ue,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx(ue.Thead,{children:a.jsxs(ue.Tr,{children:[a.jsx(ue.Th,{children:"Author"}),a.jsx(ue.Th,{children:"Date"}),a.jsx(ue.Th,{children:"Version"})]})}),a.jsx(ue.Tbody,{children:n.entry?.map((o,s)=>a.jsx(pZ,{entry:o},"entry-"+s))})]}):a.jsx("div",{children:"Loading..."})}function pZ(e){const{response:t,resource:n}=e.entry;return n?a.jsxs(ue.Tr,{children:[a.jsx(ue.Td,{children:a.jsx(Ic,{value:n.meta?.author,link:!0})}),a.jsx(ue.Td,{children:Cr(n.meta?.lastUpdated)}),a.jsx(ue.Td,{children:a.jsx(yt,{to:mZ(n),children:n.meta?.versionId})})]}):a.jsx(ue.Tr,{children:a.jsx(ue.Td,{colSpan:3,children:Qe(t?.outcome)})})}function mZ(e){return`/${e.resourceType}/${e.id}/_history/${e.meta?.versionId}`}function gZ(e){const{serviceRequest:t,...n}=e;return a.jsx(ig,{value:t,loadTimelineResources:async(r,o,s)=>{const c=`${o}/${s}`,d=100;return Promise.allSettled([r.readHistory("ServiceRequest",s),r.search("Communication",{"based-on":c,_count:d}),r.search("DiagnosticReport",{"based-on":c,_count:d}),r.search("Media",{"based-on":c,_count:d}),r.search("DocumentReference",{related:c,_count:d}),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:d})])},createCommunication:(r,o,s)=>({resourceType:"Communication",status:"completed",basedOn:[Yt(r)],subject:r.subject,sender:Yt(o),sent:new Date().toISOString(),payload:[{contentString:s}]}),createMedia:(r,o,s)=>({resourceType:"Media",status:"completed",basedOn:[Yt(r)],subject:r.subject,operator:Yt(o),issued:new Date().toISOString(),content:s}),...n})}function vZ(e){const t=Re(),{client:n,patient:r,encounter:o,children:s,...c}=e;function d(){t.createResource({resourceType:"SmartAppLaunch",patient:r,encounter:o}).then(f=>{const p=new URL(n.launchUri);p.searchParams.set("iss",lS(t.fhirUrl().toString())),p.searchParams.set("launch",f.id),Zn.assign(p.toString())}).catch(f=>Ne({color:"red",message:Qe(f),autoClose:!1}))}return a.jsx(Nt,{onClick:()=>d(),...c,children:s})}var sx={exports:{}},dd={},lx={exports:{}},cx={};var NR;function yZ(){return NR||(NR=1,(function(e){function t(O,I){var $=O.length;O.push(I);e:for(;0<$;){var H=$-1>>>1,K=O[H];if(0<o(K,I))O[H]=I,O[$]=K,$=H;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var I=O[0],$=O.pop();if($!==I){O[0]=$;e:for(var H=0,K=O.length,M=K>>>1;H<M;){var F=2*(H+1)-1,ae=O[F],de=F+1,xe=O[de];if(0>o(ae,$))de<K&&0>o(xe,ae)?(O[H]=xe,O[de]=$,H=de):(O[H]=ae,O[F]=$,H=F);else if(de<K&&0>o(xe,$))O[H]=xe,O[de]=$,H=de;else break e}}return I}function o(O,I){var $=O.sortIndex-I.sortIndex;return $!==0?$:O.id-I.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,d=c.now();e.unstable_now=function(){return c.now()-d}}var f=[],p=[],m=1,g=null,y=3,b=!1,S=!1,j=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function _(O){for(var I=n(p);I!==null;){if(I.callback===null)r(p);else if(I.startTime<=O)r(p),I.sortIndex=I.expirationTime,t(f,I);else break;I=n(p)}}function k(O){if(j=!1,_(O),!S)if(n(f)!==null)S=!0,L||(L=!0,Y());else{var I=n(p);I!==null&&W(k,I.startTime-O)}}var L=!1,A=-1,N=5,z=-1;function B(){return C?!0:!(e.unstable_now()-z<N)}function G(){if(C=!1,L){var O=e.unstable_now();z=O;var I=!0;try{e:{S=!1,j&&(j=!1,R(A),A=-1),b=!0;var $=y;try{t:{for(_(O),g=n(f);g!==null&&!(g.expirationTime>O&&B());){var H=g.callback;if(typeof H=="function"){g.callback=null,y=g.priorityLevel;var K=H(g.expirationTime<=O);if(O=e.unstable_now(),typeof K=="function"){g.callback=K,_(O),I=!0;break t}g===n(f)&&r(f),_(O)}else r(f);g=n(f)}if(g!==null)I=!0;else{var M=n(p);M!==null&&W(k,M.startTime-O),I=!1}}break e}finally{g=null,y=$,b=!1}I=void 0}}finally{I?Y():L=!1}}}var Y;if(typeof T=="function")Y=function(){T(G)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,U=J.port2;J.port1.onmessage=G,Y=function(){U.postMessage(null)}}else Y=function(){E(G,0)};function W(O,I){A=E(function(){O(e.unstable_now())},I)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(O){switch(y){case 1:case 2:case 3:var I=3;break;default:I=y}var $=y;y=I;try{return O()}finally{y=$}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(O,I){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var $=y;y=O;try{return I()}finally{y=$}},e.unstable_scheduleCallback=function(O,I,$){var H=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?H+$:H):$=H,O){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=$+K,O={id:m++,callback:I,priorityLevel:O,startTime:$,expirationTime:K,sortIndex:-1},$>H?(O.sortIndex=$,t(p,O),n(f)===null&&O===n(p)&&(j?(R(A),A=-1):j=!0,W(k,$-H))):(O.sortIndex=K,t(f,O),S||b||(S=!0,L||(L=!0,Y()))),O},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(O){var I=y;return function(){var $=y;y=I;try{return O.apply(this,arguments)}finally{y=$}}}})(cx)),cx}var OR;function xZ(){return OR||(OR=1,lx.exports=yZ()),lx.exports}var MR;function bZ(){if(MR)return dd;MR=1;var e=xZ(),t=mb(),n=s_();function r(i){var l="https://react.dev/errors/"+i;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)l+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function s(i){var l=i,u=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(u=l.return),i=l.return;while(i)}return l.tag===3?u:null}function c(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function d(i){if(i.tag===31){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function f(i){if(s(i)!==i)throw Error(r(188))}function p(i){var l=i.alternate;if(!l){if(l=s(i),l===null)throw Error(r(188));return l!==i?null:i}for(var u=i,h=l;;){var x=u.return;if(x===null)break;var w=x.alternate;if(w===null){if(h=x.return,h!==null){u=h;continue}break}if(x.child===w.child){for(w=x.child;w;){if(w===u)return f(x),i;if(w===h)return f(x),l;w=w.sibling}throw Error(r(188))}if(u.return!==h.return)u=x,h=w;else{for(var D=!1,P=x.child;P;){if(P===u){D=!0,u=x,h=w;break}if(P===h){D=!0,h=x,u=w;break}P=P.sibling}if(!D){for(P=w.child;P;){if(P===u){D=!0,u=w,h=x;break}if(P===h){D=!0,h=w,u=x;break}P=P.sibling}if(!D)throw Error(r(189))}}if(u.alternate!==h)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?i:l}function m(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i;for(i=i.child;i!==null;){if(l=m(i),l!==null)return l;i=i.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),T=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function Y(i){return i===null||typeof i!="object"?null:(i=G&&i[G]||i["@@iterator"],typeof i=="function"?i:null)}var J=Symbol.for("react.client.reference");function U(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===J?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case j:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case k:return"Suspense";case L:return"SuspenseList";case z:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case T:return i.displayName||"Context";case R:return(i._context.displayName||"Context")+".Consumer";case _:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case A:return l=i.displayName||null,l!==null?l:U(i.type)||"Memo";case N:l=i._payload,i=i._init;try{return U(i(l))}catch{}}return null}var W=Array.isArray,O=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},H=[],K=-1;function M(i){return{current:i}}function F(i){0>K||(i.current=H[K],H[K]=null,K--)}function ae(i,l){K++,H[K]=i.current,i.current=l}var de=M(null),xe=M(null),Se=M(null),Ce=M(null);function Ke(i,l){switch(ae(Se,l),ae(xe,i),ae(de,null),l.nodeType){case 9:case 11:i=(i=l.documentElement)&&(i=i.namespaceURI)?jC(i):0;break;default:if(i=l.tagName,l=l.namespaceURI)l=jC(l),i=CC(l,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}F(de),ae(de,i)}function Ae(){F(de),F(xe),F(Se)}function dt(i){i.memoizedState!==null&&ae(Ce,i);var l=de.current,u=CC(l,i.type);l!==u&&(ae(xe,i),ae(de,u))}function Ct(i){xe.current===i&&(F(de),F(xe)),Ce.current===i&&(F(Ce),td._currentValue=$)}var ot,it;function pt(i){if(ot===void 0)try{throw Error()}catch(u){var l=u.stack.trim().match(/\n( *(at )?)/);ot=l&&l[1]||"",it=-1<u.stack.indexOf(`
|
|
235
|
+
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
236
|
+
`+ot+i+it}var Et=!1;function wt(i,l){if(!i||Et)return"";Et=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(l){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(se){var re=se}Reflect.construct(i,[],ve)}else{try{ve.call()}catch(se){re=se}i.call(ve.prototype)}}else{try{throw Error()}catch(se){re=se}(ve=i())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(se){if(se&&re&&typeof se.stack=="string")return[se.stack,re.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(),D=w[0],P=w[1];if(D&&P){var q=D.split(`
|
|
237
|
+
`),te=P.split(`
|
|
238
|
+
`);for(x=h=0;h<q.length&&!q[h].includes("DetermineComponentFrameRoot");)h++;for(;x<te.length&&!te[x].includes("DetermineComponentFrameRoot");)x++;if(h===q.length||x===te.length)for(h=q.length-1,x=te.length-1;1<=h&&0<=x&&q[h]!==te[x];)x--;for(;1<=h&&0<=x;h--,x--)if(q[h]!==te[x]){if(h!==1||x!==1)do if(h--,x--,0>x||q[h]!==te[x]){var fe=`
|
|
239
|
+
`+q[h].replace(" at new "," at ");return i.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",i.displayName)),fe}while(1<=h&&0<=x);break}}}finally{Et=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?pt(u):""}function Te(i,l){switch(i.tag){case 26:case 27:case 5:return pt(i.type);case 16:return pt("Lazy");case 13:return i.child!==l&&l!==null?pt("Suspense Fallback"):pt("Suspense");case 19:return pt("SuspenseList");case 0:case 15:return wt(i.type,!1);case 11:return wt(i.type.render,!1);case 1:return wt(i.type,!0);case 31:return pt("Activity");default:return""}}function _e(i){try{var l="",u=null;do l+=Te(i,u),u=i,i=i.return;while(i);return l}catch(h){return`
|
|
240
|
+
Error generating stack: `+h.message+`
|
|
241
|
+
`+h.stack}}var Le=Object.prototype.hasOwnProperty,Me=e.unstable_scheduleCallback,lt=e.unstable_cancelCallback,nt=e.unstable_shouldYield,ft=e.unstable_requestPaint,pe=e.unstable_now,Ve=e.unstable_getCurrentPriorityLevel,je=e.unstable_ImmediatePriority,ke=e.unstable_UserBlockingPriority,At=e.unstable_NormalPriority,gn=e.unstable_LowPriority,vn=e.unstable_IdlePriority,Bn=e.log,ln=e.unstable_setDisableYieldValue,gr=null,Qt=null;function ar(i){if(typeof Bn=="function"&&ln(i),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(gr,i)}catch{}}var Tn=Math.clz32?Math.clz32:ka,co=Math.log,Ho=Math.LN2;function ka(i){return i>>>=0,i===0?32:31-(co(i)/Ho|0)|0}var zr=256,qo=262144,Bi=4194304;function Jr(i){var l=i&42;if(l!==0)return l;switch(i&-i){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:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Vi(i,l,u){var h=i.pendingLanes;if(h===0)return 0;var x=0,w=i.suspendedLanes,D=i.pingedLanes;i=i.warmLanes;var P=h&134217727;return P!==0?(h=P&~w,h!==0?x=Jr(h):(D&=P,D!==0?x=Jr(D):u||(u=P&~i,u!==0&&(x=Jr(u))))):(P=h&~w,P!==0?x=Jr(P):D!==0?x=Jr(D):u||(u=h&~i,u!==0&&(x=Jr(u)))),x===0?0:l!==0&&l!==x&&(l&w)===0&&(w=x&-x,u=l&-l,w>=u||w===32&&(u&4194048)!==0)?l:x}function sr(i,l){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&l)===0}function As(i,l){switch(i){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 Vn(){var i=Bi;return Bi<<=1,(Bi&62914560)===0&&(Bi=4194304),i}function uo(i){for(var l=[],u=0;31>u;u++)l.push(i);return l}function Go(i,l){i.pendingLanes|=l,l!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function gu(i,l,u,h,x,w){var D=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var P=i.entanglements,q=i.expirationTimes,te=i.hiddenUpdates;for(u=D&~u;0<u;){var fe=31-Tn(u),ve=1<<fe;P[fe]=0,q[fe]=-1;var re=te[fe];if(re!==null)for(te[fe]=null,fe=0;fe<re.length;fe++){var se=re[fe];se!==null&&(se.lane&=-536870913)}u&=~ve}h!==0&&Ml(i,h,0),w!==0&&x===0&&i.tag!==0&&(i.suspendedLanes|=w&~(D&~l))}function Ml(i,l,u){i.pendingLanes|=l,i.suspendedLanes&=~l;var h=31-Tn(l);i.entangledLanes|=l,i.entanglements[h]=i.entanglements[h]|1073741824|u&261930}function V(i,l){var u=i.entangledLanes|=l;for(i=i.entanglements;u;){var h=31-Tn(u),x=1<<h;x&l|i[h]&l&&(i[h]|=l),u&=~x}}function X(i,l){var u=l&-l;return u=(u&42)!==0?1:ie(u),(u&(i.suspendedLanes|l))!==0?0:u}function ie(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function we(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function De(){var i=I.p;return i!==0?i:(i=window.event,i===void 0?32:QC(i.type))}function We(i,l){var u=I.p;try{return I.p=i,l()}finally{I.p=u}}var qe=Math.random().toString(36).slice(2),Oe="__reactFiber$"+qe,ze="__reactProps$"+qe,Xe="__reactContainer$"+qe,et="__reactEvents$"+qe,rt="__reactListeners$"+qe,Tt="__reactHandles$"+qe,tt="__reactResources$"+qe,Zt="__reactMarker$"+qe;function Rn(i){delete i[Oe],delete i[ze],delete i[et],delete i[rt],delete i[Tt]}function It(i){var l=i[Oe];if(l)return l;for(var u=i.parentNode;u;){if(l=u[Xe]||u[Oe]){if(u=l.alternate,l.child!==null||u!==null&&u.child!==null)for(i=kC(i);i!==null;){if(u=i[Oe])return u;i=kC(i)}return l}i=u,u=i.parentNode}return null}function Ut(i){if(i=i[Oe]||i[Xe]){var l=i.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return i}return null}function Zr(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i.stateNode;throw Error(r(33))}function gi(i){var l=i[tt];return l||(l=i[tt]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function cn(i){i[Zt]=!0}var ei=new Set,Ll={};function ti(i,l){$r(i,l),$r(i+"Capture",l)}function $r(i,l){for(Ll[i]=l,i=0;i<l.length;i++)ei.add(l[i])}var Il=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]*$"),Ds={},Dt={};function nr(i){return Le.call(Dt,i)?!0:Le.call(Ds,i)?!1:Il.test(i)?Dt[i]=!0:(Ds[i]=!0,!1)}function Fi(i,l,u){if(nr(l))if(u===null)i.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(l);return;case"boolean":var h=l.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){i.removeAttribute(l);return}}i.setAttribute(l,""+u)}}function vi(i,l,u){if(u===null)i.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(l);return}i.setAttribute(l,""+u)}}function Bt(i,l,u,h){if(h===null)i.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(l,u,""+h)}}function lr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function vu(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function pg(i,l,u){var h=Object.getOwnPropertyDescriptor(i.constructor.prototype,l);if(!i.hasOwnProperty(l)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var x=h.get,w=h.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return x.call(this)},set:function(D){u=""+D,w.call(this,D)}}),Object.defineProperty(i,l,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(D){u=""+D},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function mg(i){if(!i._valueTracker){var l=vu(i)?"checked":"value";i._valueTracker=pg(i,l,""+i[l])}}function g1(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var u=l.getValue(),h="";return i&&(h=vu(i)?i.checked?"true":"false":i.value),i=h,i!==u?(l.setValue(i),!0):!1}function _f(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var WN=/[\n"\\]/g;function yi(i){return i.replace(WN,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function gg(i,l,u,h,x,w,D,P){i.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?i.type=D:i.removeAttribute("type"),l!=null?D==="number"?(l===0&&i.value===""||i.value!=l)&&(i.value=""+lr(l)):i.value!==""+lr(l)&&(i.value=""+lr(l)):D!=="submit"&&D!=="reset"||i.removeAttribute("value"),l!=null?vg(i,D,lr(l)):u!=null?vg(i,D,lr(u)):h!=null&&i.removeAttribute("value"),x==null&&w!=null&&(i.defaultChecked=!!w),x!=null&&(i.checked=x&&typeof x!="function"&&typeof x!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?i.name=""+lr(P):i.removeAttribute("name")}function v1(i,l,u,h,x,w,D,P){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(i.type=w),l!=null||u!=null){if(!(w!=="submit"&&w!=="reset"||l!=null)){mg(i);return}u=u!=null?""+lr(u):"",l=l!=null?""+lr(l):u,P||l===i.value||(i.value=l),i.defaultValue=l}h=h??x,h=typeof h!="function"&&typeof h!="symbol"&&!!h,i.checked=P?i.checked:!!h,i.defaultChecked=!!h,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(i.name=D),mg(i)}function vg(i,l,u){l==="number"&&_f(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function zl(i,l,u,h){if(i=i.options,l){l={};for(var x=0;x<u.length;x++)l["$"+u[x]]=!0;for(u=0;u<i.length;u++)x=l.hasOwnProperty("$"+i[u].value),i[u].selected!==x&&(i[u].selected=x),x&&h&&(i[u].defaultSelected=!0)}else{for(u=""+lr(u),l=null,x=0;x<i.length;x++){if(i[x].value===u){i[x].selected=!0,h&&(i[x].defaultSelected=!0);return}l!==null||i[x].disabled||(l=i[x])}l!==null&&(l.selected=!0)}}function y1(i,l,u){if(l!=null&&(l=""+lr(l),l!==i.value&&(i.value=l),u==null)){i.defaultValue!==l&&(i.defaultValue=l);return}i.defaultValue=u!=null?""+lr(u):""}function x1(i,l,u,h){if(l==null){if(h!=null){if(u!=null)throw Error(r(92));if(W(h)){if(1<h.length)throw Error(r(93));h=h[0]}u=h}u==null&&(u=""),l=u}u=lr(l),i.defaultValue=u,h=i.textContent,h===u&&h!==""&&h!==null&&(i.value=h),mg(i)}function $l(i,l){if(l){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=l;return}}i.textContent=l}var YN=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 b1(i,l,u){var h=l.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?i.setProperty(l,""):l==="float"?i.cssFloat="":i[l]="":h?i.setProperty(l,u):typeof u!="number"||u===0||YN.has(l)?l==="float"?i.cssFloat=u:i[l]=(""+u).trim():i[l]=u+"px"}function S1(i,l,u){if(l!=null&&typeof l!="object")throw Error(r(62));if(i=i.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||l!=null&&l.hasOwnProperty(h)||(h.indexOf("--")===0?i.setProperty(h,""):h==="float"?i.cssFloat="":i[h]="");for(var x in l)h=l[x],l.hasOwnProperty(x)&&u[x]!==h&&b1(i,x,h)}else for(var w in l)l.hasOwnProperty(w)&&b1(i,w,l[w])}function yg(i){if(i.indexOf("-")===-1)return!1;switch(i){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 KN=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"]]),XN=/^[\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 Af(i){return XN.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Qo(){}var xg=null;function bg(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Ul=null,Bl=null;function w1(i){var l=Ut(i);if(l&&(i=l.stateNode)){var u=i[ze]||null;e:switch(i=l.stateNode,l.type){case"input":if(gg(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),l=u.name,u.type==="radio"&&l!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+yi(""+l)+'"][type="radio"]'),l=0;l<u.length;l++){var h=u[l];if(h!==i&&h.form===i.form){var x=h[ze]||null;if(!x)throw Error(r(90));gg(h,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(l=0;l<u.length;l++)h=u[l],h.form===i.form&&g1(h)}break e;case"textarea":y1(i,u.value,u.defaultValue);break e;case"select":l=u.value,l!=null&&zl(i,!!u.multiple,l,!1)}}}var Sg=!1;function j1(i,l,u){if(Sg)return i(l,u);Sg=!0;try{var h=i(l);return h}finally{if(Sg=!1,(Ul!==null||Bl!==null)&&(gh(),Ul&&(l=Ul,i=Bl,Bl=Ul=null,w1(l),i)))for(l=0;l<i.length;l++)w1(i[l])}}function yu(i,l){var u=i.stateNode;if(u===null)return null;var h=u[ze]||null;if(h===null)return null;u=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)||(i=i.type,h=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!h;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,l,typeof u));return u}var Wo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wg=!1;if(Wo)try{var xu={};Object.defineProperty(xu,"passive",{get:function(){wg=!0}}),window.addEventListener("test",xu,xu),window.removeEventListener("test",xu,xu)}catch{wg=!1}var Pa=null,jg=null,Df=null;function C1(){if(Df)return Df;var i,l=jg,u=l.length,h,x="value"in Pa?Pa.value:Pa.textContent,w=x.length;for(i=0;i<u&&l[i]===x[i];i++);var D=u-i;for(h=1;h<=D&&l[u-h]===x[w-h];h++);return Df=x.slice(i,1<h?1-h:void 0)}function kf(i){var l=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&l===13&&(i=13)):i=l,i===10&&(i=13),32<=i||i===13?i:0}function Pf(){return!0}function E1(){return!1}function Ur(i){function l(u,h,x,w,D){this._reactName=u,this._targetInst=x,this.type=h,this.nativeEvent=w,this.target=D,this.currentTarget=null;for(var P in i)i.hasOwnProperty(P)&&(u=i[P],this[P]=u?u(w):w[P]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?Pf:E1,this.isPropagationStopped=E1,this}return g(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Pf)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Pf)},persist:function(){},isPersistent:Pf}),l}var ks={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nf=Ur(ks),bu=g({},ks,{view:0,detail:0}),JN=Ur(bu),Cg,Eg,Su,Of=g({},bu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rg,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Su&&(Su&&i.type==="mousemove"?(Cg=i.screenX-Su.screenX,Eg=i.screenY-Su.screenY):Eg=Cg=0,Su=i),Cg)},movementY:function(i){return"movementY"in i?i.movementY:Eg}}),T1=Ur(Of),ZN=g({},Of,{dataTransfer:0}),eO=Ur(ZN),tO=g({},bu,{relatedTarget:0}),Tg=Ur(tO),nO=g({},ks,{animationName:0,elapsedTime:0,pseudoElement:0}),rO=Ur(nO),iO=g({},ks,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),oO=Ur(iO),aO=g({},ks,{data:0}),R1=Ur(aO),sO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lO={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"},cO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function uO(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=cO[i])?!!l[i]:!1}function Rg(){return uO}var dO=g({},bu,{key:function(i){if(i.key){var l=sO[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=kf(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?lO[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rg,charCode:function(i){return i.type==="keypress"?kf(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?kf(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),fO=Ur(dO),hO=g({},Of,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_1=Ur(hO),pO=g({},bu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rg}),mO=Ur(pO),gO=g({},ks,{propertyName:0,elapsedTime:0,pseudoElement:0}),vO=Ur(gO),yO=g({},Of,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),xO=Ur(yO),bO=g({},ks,{newState:0,oldState:0}),SO=Ur(bO),wO=[9,13,27,32],_g=Wo&&"CompositionEvent"in window,wu=null;Wo&&"documentMode"in document&&(wu=document.documentMode);var jO=Wo&&"TextEvent"in window&&!wu,A1=Wo&&(!_g||wu&&8<wu&&11>=wu),D1=" ",k1=!1;function P1(i,l){switch(i){case"keyup":return wO.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function N1(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Vl=!1;function CO(i,l){switch(i){case"compositionend":return N1(l);case"keypress":return l.which!==32?null:(k1=!0,D1);case"textInput":return i=l.data,i===D1&&k1?null:i;default:return null}}function EO(i,l){if(Vl)return i==="compositionend"||!_g&&P1(i,l)?(i=C1(),Df=jg=Pa=null,Vl=!1,i):null;switch(i){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 A1&&l.locale!=="ko"?null:l.data;default:return null}}var TO={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 O1(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!TO[i.type]:l==="textarea"}function M1(i,l,u,h){Ul?Bl?Bl.push(h):Bl=[h]:Ul=h,l=jh(l,"onChange"),0<l.length&&(u=new Nf("onChange","change",null,u,h),i.push({event:u,listeners:l}))}var ju=null,Cu=null;function RO(i){vC(i,0)}function Mf(i){var l=Zr(i);if(g1(l))return i}function L1(i,l){if(i==="change")return l}var I1=!1;if(Wo){var Ag;if(Wo){var Dg="oninput"in document;if(!Dg){var z1=document.createElement("div");z1.setAttribute("oninput","return;"),Dg=typeof z1.oninput=="function"}Ag=Dg}else Ag=!1;I1=Ag&&(!document.documentMode||9<document.documentMode)}function $1(){ju&&(ju.detachEvent("onpropertychange",U1),Cu=ju=null)}function U1(i){if(i.propertyName==="value"&&Mf(Cu)){var l=[];M1(l,Cu,i,bg(i)),j1(RO,l)}}function _O(i,l,u){i==="focusin"?($1(),ju=l,Cu=u,ju.attachEvent("onpropertychange",U1)):i==="focusout"&&$1()}function AO(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Mf(Cu)}function DO(i,l){if(i==="click")return Mf(l)}function kO(i,l){if(i==="input"||i==="change")return Mf(l)}function PO(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var ni=typeof Object.is=="function"?Object.is:PO;function Eu(i,l){if(ni(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var u=Object.keys(i),h=Object.keys(l);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var x=u[h];if(!Le.call(l,x)||!ni(i[x],l[x]))return!1}return!0}function B1(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function V1(i,l){var u=B1(i);i=0;for(var h;u;){if(u.nodeType===3){if(h=i+u.textContent.length,i<=l&&h>=l)return{node:u,offset:l-i};i=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=B1(u)}}function F1(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?F1(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function H1(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var l=_f(i.document);l instanceof i.HTMLIFrameElement;){try{var u=typeof l.contentWindow.location.href=="string"}catch{u=!1}if(u)i=l.contentWindow;else break;l=_f(i.document)}return l}function kg(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}var NO=Wo&&"documentMode"in document&&11>=document.documentMode,Fl=null,Pg=null,Tu=null,Ng=!1;function q1(i,l,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Ng||Fl==null||Fl!==_f(h)||(h=Fl,"selectionStart"in h&&kg(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}),Tu&&Eu(Tu,h)||(Tu=h,h=jh(Pg,"onSelect"),0<h.length&&(l=new Nf("onSelect","select",null,l,u),i.push({event:l,listeners:h}),l.target=Fl)))}function Ps(i,l){var u={};return u[i.toLowerCase()]=l.toLowerCase(),u["Webkit"+i]="webkit"+l,u["Moz"+i]="moz"+l,u}var Hl={animationend:Ps("Animation","AnimationEnd"),animationiteration:Ps("Animation","AnimationIteration"),animationstart:Ps("Animation","AnimationStart"),transitionrun:Ps("Transition","TransitionRun"),transitionstart:Ps("Transition","TransitionStart"),transitioncancel:Ps("Transition","TransitionCancel"),transitionend:Ps("Transition","TransitionEnd")},Og={},G1={};Wo&&(G1=document.createElement("div").style,"AnimationEvent"in window||(delete Hl.animationend.animation,delete Hl.animationiteration.animation,delete Hl.animationstart.animation),"TransitionEvent"in window||delete Hl.transitionend.transition);function Ns(i){if(Og[i])return Og[i];if(!Hl[i])return i;var l=Hl[i],u;for(u in l)if(l.hasOwnProperty(u)&&u in G1)return Og[i]=l[u];return i}var Q1=Ns("animationend"),W1=Ns("animationiteration"),Y1=Ns("animationstart"),OO=Ns("transitionrun"),MO=Ns("transitionstart"),LO=Ns("transitioncancel"),K1=Ns("transitionend"),X1=new Map,Mg="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(" ");Mg.push("scrollEnd");function Hi(i,l){X1.set(i,l),ti(l,[i])}var Lf=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},xi=[],ql=0,Lg=0;function If(){for(var i=ql,l=Lg=ql=0;l<i;){var u=xi[l];xi[l++]=null;var h=xi[l];xi[l++]=null;var x=xi[l];xi[l++]=null;var w=xi[l];if(xi[l++]=null,h!==null&&x!==null){var D=h.pending;D===null?x.next=x:(x.next=D.next,D.next=x),h.pending=x}w!==0&&J1(u,x,w)}}function zf(i,l,u,h){xi[ql++]=i,xi[ql++]=l,xi[ql++]=u,xi[ql++]=h,Lg|=h,i.lanes|=h,i=i.alternate,i!==null&&(i.lanes|=h)}function Ig(i,l,u,h){return zf(i,l,u,h),$f(i)}function Os(i,l){return zf(i,null,null,l),$f(i)}function J1(i,l,u){i.lanes|=u;var h=i.alternate;h!==null&&(h.lanes|=u);for(var x=!1,w=i.return;w!==null;)w.childLanes|=u,h=w.alternate,h!==null&&(h.childLanes|=u),w.tag===22&&(i=w.stateNode,i===null||i._visibility&1||(x=!0)),i=w,w=w.return;return i.tag===3?(w=i.stateNode,x&&l!==null&&(x=31-Tn(u),i=w.hiddenUpdates,h=i[x],h===null?i[x]=[l]:h.push(l),l.lane=u|536870912),w):null}function $f(i){if(50<Wu)throw Wu=0,Gv=null,Error(r(185));for(var l=i.return;l!==null;)i=l,l=i.return;return i.tag===3?i.stateNode:null}var Gl={};function IO(i,l,u,h){this.tag=i,this.key=u,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 ri(i,l,u,h){return new IO(i,l,u,h)}function zg(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Yo(i,l){var u=i.alternate;return u===null?(u=ri(i.tag,l,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=l,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,l=i.dependencies,u.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function Z1(i,l){i.flags&=65011714;var u=i.alternate;return u===null?(i.childLanes=0,i.lanes=l,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,l=u.dependencies,i.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),i}function Uf(i,l,u,h,x,w){var D=0;if(h=i,typeof i=="function")zg(i)&&(D=1);else if(typeof i=="string")D=V3(i,u,de.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case z:return i=ri(31,u,l,x),i.elementType=z,i.lanes=w,i;case j:return Ms(u.children,x,w,l);case C:D=8,x|=24;break;case E:return i=ri(12,u,l,x|2),i.elementType=E,i.lanes=w,i;case k:return i=ri(13,u,l,x),i.elementType=k,i.lanes=w,i;case L:return i=ri(19,u,l,x),i.elementType=L,i.lanes=w,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case T:D=10;break e;case R:D=9;break e;case _:D=11;break e;case A:D=14;break e;case N:D=16,h=null;break e}D=29,u=Error(r(130,i===null?"null":typeof i,"")),h=null}return l=ri(D,u,l,x),l.elementType=i,l.type=h,l.lanes=w,l}function Ms(i,l,u,h){return i=ri(7,i,h,l),i.lanes=u,i}function $g(i,l,u){return i=ri(6,i,null,l),i.lanes=u,i}function ew(i){var l=ri(18,null,null,0);return l.stateNode=i,l}function Ug(i,l,u){return l=ri(4,i.children!==null?i.children:[],i.key,l),l.lanes=u,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}var tw=new WeakMap;function bi(i,l){if(typeof i=="object"&&i!==null){var u=tw.get(i);return u!==void 0?u:(l={value:i,source:l,stack:_e(l)},tw.set(i,l),l)}return{value:i,source:l,stack:_e(l)}}var Ql=[],Wl=0,Bf=null,Ru=0,Si=[],wi=0,Na=null,fo=1,ho="";function Ko(i,l){Ql[Wl++]=Ru,Ql[Wl++]=Bf,Bf=i,Ru=l}function nw(i,l,u){Si[wi++]=fo,Si[wi++]=ho,Si[wi++]=Na,Na=i;var h=fo;i=ho;var x=32-Tn(h)-1;h&=~(1<<x),u+=1;var w=32-Tn(l)+x;if(30<w){var D=x-x%5;w=(h&(1<<D)-1).toString(32),h>>=D,x-=D,fo=1<<32-Tn(l)+x|u<<x|h,ho=w+i}else fo=1<<w|u<<x|h,ho=i}function Bg(i){i.return!==null&&(Ko(i,1),nw(i,1,0))}function Vg(i){for(;i===Bf;)Bf=Ql[--Wl],Ql[Wl]=null,Ru=Ql[--Wl],Ql[Wl]=null;for(;i===Na;)Na=Si[--wi],Si[wi]=null,ho=Si[--wi],Si[wi]=null,fo=Si[--wi],Si[wi]=null}function rw(i,l){Si[wi++]=fo,Si[wi++]=ho,Si[wi++]=Na,fo=l.id,ho=l.overflow,Na=i}var cr=null,xn=null,Ot=!1,Oa=null,ji=!1,Fg=Error(r(519));function Ma(i){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _u(bi(l,i)),Fg}function iw(i){var l=i.stateNode,u=i.type,h=i.memoizedProps;switch(l[Oe]=i,l[ze]=h,u){case"dialog":_t("cancel",l),_t("close",l);break;case"iframe":case"object":case"embed":_t("load",l);break;case"video":case"audio":for(u=0;u<Ku.length;u++)_t(Ku[u],l);break;case"source":_t("error",l);break;case"img":case"image":case"link":_t("error",l),_t("load",l);break;case"details":_t("toggle",l);break;case"input":_t("invalid",l),v1(l,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":_t("invalid",l);break;case"textarea":_t("invalid",l),x1(l,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||l.textContent===""+u||h.suppressHydrationWarning===!0||SC(l.textContent,u)?(h.popover!=null&&(_t("beforetoggle",l),_t("toggle",l)),h.onScroll!=null&&_t("scroll",l),h.onScrollEnd!=null&&_t("scrollend",l),h.onClick!=null&&(l.onclick=Qo),l=!0):l=!1,l||Ma(i,!0)}function ow(i){for(cr=i.return;cr;)switch(cr.tag){case 5:case 31:case 13:ji=!1;return;case 27:case 3:ji=!0;return;default:cr=cr.return}}function Yl(i){if(i!==cr)return!1;if(!Ot)return ow(i),Ot=!0,!1;var l=i.tag,u;if((u=l!==3&&l!==27)&&((u=l===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||sy(i.type,i.memoizedProps)),u=!u),u&&xn&&Ma(i),ow(i),l===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));xn=DC(i)}else if(l===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));xn=DC(i)}else l===27?(l=xn,Ya(i.type)?(i=fy,fy=null,xn=i):xn=l):xn=cr?Ei(i.stateNode.nextSibling):null;return!0}function Ls(){xn=cr=null,Ot=!1}function Hg(){var i=Oa;return i!==null&&(Hr===null?Hr=i:Hr.push.apply(Hr,i),Oa=null),i}function _u(i){Oa===null?Oa=[i]:Oa.push(i)}var qg=M(null),Is=null,Xo=null;function La(i,l,u){ae(qg,l._currentValue),l._currentValue=u}function Jo(i){i._currentValue=qg.current,F(qg)}function Gg(i,l,u){for(;i!==null;){var h=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,h!==null&&(h.childLanes|=l)):h!==null&&(h.childLanes&l)!==l&&(h.childLanes|=l),i===u)break;i=i.return}}function Qg(i,l,u,h){var x=i.child;for(x!==null&&(x.return=i);x!==null;){var w=x.dependencies;if(w!==null){var D=x.child;w=w.firstContext;e:for(;w!==null;){var P=w;w=x;for(var q=0;q<l.length;q++)if(P.context===l[q]){w.lanes|=u,P=w.alternate,P!==null&&(P.lanes|=u),Gg(w.return,u,i),h||(D=null);break e}w=P.next}}else if(x.tag===18){if(D=x.return,D===null)throw Error(r(341));D.lanes|=u,w=D.alternate,w!==null&&(w.lanes|=u),Gg(D,u,i),D=null}else D=x.child;if(D!==null)D.return=x;else for(D=x;D!==null;){if(D===i){D=null;break}if(x=D.sibling,x!==null){x.return=D.return,D=x;break}D=D.return}x=D}}function Kl(i,l,u,h){i=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 D=x.alternate;if(D===null)throw Error(r(387));if(D=D.memoizedProps,D!==null){var P=x.type;ni(x.pendingProps.value,D.value)||(i!==null?i.push(P):i=[P])}}else if(x===Ce.current){if(D=x.alternate,D===null)throw Error(r(387));D.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(i!==null?i.push(td):i=[td])}x=x.return}i!==null&&Qg(l,i,u,h),l.flags|=262144}function Vf(i){for(i=i.firstContext;i!==null;){if(!ni(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function zs(i){Is=i,Xo=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function ur(i){return aw(Is,i)}function Ff(i,l){return Is===null&&zs(i),aw(i,l)}function aw(i,l){var u=l._currentValue;if(l={context:l,memoizedValue:u,next:null},Xo===null){if(i===null)throw Error(r(308));Xo=l,i.dependencies={lanes:0,firstContext:l},i.flags|=524288}else Xo=Xo.next=l;return u}var zO=typeof AbortController<"u"?AbortController:function(){var i=[],l=this.signal={aborted:!1,addEventListener:function(u,h){i.push(h)}};this.abort=function(){l.aborted=!0,i.forEach(function(u){return u()})}},$O=e.unstable_scheduleCallback,UO=e.unstable_NormalPriority,Yn={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Wg(){return{controller:new zO,data:new Map,refCount:0}}function Au(i){i.refCount--,i.refCount===0&&$O(UO,function(){i.controller.abort()})}var Du=null,Yg=0,Xl=0,Jl=null;function BO(i,l){if(Du===null){var u=Du=[];Yg=0,Xl=Jv(),Jl={status:"pending",value:void 0,then:function(h){u.push(h)}}}return Yg++,l.then(sw,sw),l}function sw(){if(--Yg===0&&Du!==null){Jl!==null&&(Jl.status="fulfilled");var i=Du;Du=null,Xl=0,Jl=null;for(var l=0;l<i.length;l++)(0,i[l])()}}function VO(i,l){var u=[],h={status:"pending",value:null,reason:null,then:function(x){u.push(x)}};return i.then(function(){h.status="fulfilled",h.value=l;for(var x=0;x<u.length;x++)(0,u[x])(l)},function(x){for(h.status="rejected",h.reason=x,x=0;x<u.length;x++)(0,u[x])(void 0)}),h}var lw=O.S;O.S=function(i,l){qj=pe(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&BO(i,l),lw!==null&&lw(i,l)};var $s=M(null);function Kg(){var i=$s.current;return i!==null?i:un.pooledCache}function Hf(i,l){l===null?ae($s,$s.current):ae($s,l.pool)}function cw(){var i=Kg();return i===null?null:{parent:Yn._currentValue,pool:i}}var Zl=Error(r(460)),Xg=Error(r(474)),qf=Error(r(542)),Gf={then:function(){}};function uw(i){return i=i.status,i==="fulfilled"||i==="rejected"}function dw(i,l,u){switch(u=i[u],u===void 0?i.push(l):u!==l&&(l.then(Qo,Qo),l=u),l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,hw(i),i;default:if(typeof l.status=="string")l.then(Qo,Qo);else{if(i=un,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=l,i.status="pending",i.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 i=l.reason,hw(i),i}throw Bs=l,Zl}}function Us(i){try{var l=i._init;return l(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Bs=u,Zl):u}}var Bs=null;function fw(){if(Bs===null)throw Error(r(459));var i=Bs;return Bs=null,i}function hw(i){if(i===Zl||i===qf)throw Error(r(483))}var ec=null,ku=0;function Qf(i){var l=ku;return ku+=1,ec===null&&(ec=[]),dw(ec,i,l)}function Pu(i,l){l=l.props.ref,i.ref=l!==void 0?l:null}function Wf(i,l){throw l.$$typeof===y?Error(r(525)):(i=Object.prototype.toString.call(l),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i)))}function pw(i){function l(Z,Q){if(i){var ee=Z.deletions;ee===null?(Z.deletions=[Q],Z.flags|=16):ee.push(Q)}}function u(Z,Q){if(!i)return null;for(;Q!==null;)l(Z,Q),Q=Q.sibling;return null}function h(Z){for(var Q=new Map;Z!==null;)Z.key!==null?Q.set(Z.key,Z):Q.set(Z.index,Z),Z=Z.sibling;return Q}function x(Z,Q){return Z=Yo(Z,Q),Z.index=0,Z.sibling=null,Z}function w(Z,Q,ee){return Z.index=ee,i?(ee=Z.alternate,ee!==null?(ee=ee.index,ee<Q?(Z.flags|=67108866,Q):ee):(Z.flags|=67108866,Q)):(Z.flags|=1048576,Q)}function D(Z){return i&&Z.alternate===null&&(Z.flags|=67108866),Z}function P(Z,Q,ee,me){return Q===null||Q.tag!==6?(Q=$g(ee,Z.mode,me),Q.return=Z,Q):(Q=x(Q,ee),Q.return=Z,Q)}function q(Z,Q,ee,me){var at=ee.type;return at===j?fe(Z,Q,ee.props.children,me,ee.key):Q!==null&&(Q.elementType===at||typeof at=="object"&&at!==null&&at.$$typeof===N&&Us(at)===Q.type)?(Q=x(Q,ee.props),Pu(Q,ee),Q.return=Z,Q):(Q=Uf(ee.type,ee.key,ee.props,null,Z.mode,me),Pu(Q,ee),Q.return=Z,Q)}function te(Z,Q,ee,me){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==ee.containerInfo||Q.stateNode.implementation!==ee.implementation?(Q=Ug(ee,Z.mode,me),Q.return=Z,Q):(Q=x(Q,ee.children||[]),Q.return=Z,Q)}function fe(Z,Q,ee,me,at){return Q===null||Q.tag!==7?(Q=Ms(ee,Z.mode,me,at),Q.return=Z,Q):(Q=x(Q,ee),Q.return=Z,Q)}function ve(Z,Q,ee){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=$g(""+Q,Z.mode,ee),Q.return=Z,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case b:return ee=Uf(Q.type,Q.key,Q.props,null,Z.mode,ee),Pu(ee,Q),ee.return=Z,ee;case S:return Q=Ug(Q,Z.mode,ee),Q.return=Z,Q;case N:return Q=Us(Q),ve(Z,Q,ee)}if(W(Q)||Y(Q))return Q=Ms(Q,Z.mode,ee,null),Q.return=Z,Q;if(typeof Q.then=="function")return ve(Z,Qf(Q),ee);if(Q.$$typeof===T)return ve(Z,Ff(Z,Q),ee);Wf(Z,Q)}return null}function re(Z,Q,ee,me){var at=Q!==null?Q.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return at!==null?null:P(Z,Q,""+ee,me);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return ee.key===at?q(Z,Q,ee,me):null;case S:return ee.key===at?te(Z,Q,ee,me):null;case N:return ee=Us(ee),re(Z,Q,ee,me)}if(W(ee)||Y(ee))return at!==null?null:fe(Z,Q,ee,me,null);if(typeof ee.then=="function")return re(Z,Q,Qf(ee),me);if(ee.$$typeof===T)return re(Z,Q,Ff(Z,ee),me);Wf(Z,ee)}return null}function se(Z,Q,ee,me,at){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return Z=Z.get(ee)||null,P(Q,Z,""+me,at);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case b:return Z=Z.get(me.key===null?ee:me.key)||null,q(Q,Z,me,at);case S:return Z=Z.get(me.key===null?ee:me.key)||null,te(Q,Z,me,at);case N:return me=Us(me),se(Z,Q,ee,me,at)}if(W(me)||Y(me))return Z=Z.get(ee)||null,fe(Q,Z,me,at,null);if(typeof me.then=="function")return se(Z,Q,ee,Qf(me),at);if(me.$$typeof===T)return se(Z,Q,ee,Ff(Q,me),at);Wf(Q,me)}return null}function Ge(Z,Q,ee,me){for(var at=null,Vt=null,Je=Q,St=Q=0,Pt=null;Je!==null&&St<ee.length;St++){Je.index>St?(Pt=Je,Je=null):Pt=Je.sibling;var Ft=re(Z,Je,ee[St],me);if(Ft===null){Je===null&&(Je=Pt);break}i&&Je&&Ft.alternate===null&&l(Z,Je),Q=w(Ft,Q,St),Vt===null?at=Ft:Vt.sibling=Ft,Vt=Ft,Je=Pt}if(St===ee.length)return u(Z,Je),Ot&&Ko(Z,St),at;if(Je===null){for(;St<ee.length;St++)Je=ve(Z,ee[St],me),Je!==null&&(Q=w(Je,Q,St),Vt===null?at=Je:Vt.sibling=Je,Vt=Je);return Ot&&Ko(Z,St),at}for(Je=h(Je);St<ee.length;St++)Pt=se(Je,Z,St,ee[St],me),Pt!==null&&(i&&Pt.alternate!==null&&Je.delete(Pt.key===null?St:Pt.key),Q=w(Pt,Q,St),Vt===null?at=Pt:Vt.sibling=Pt,Vt=Pt);return i&&Je.forEach(function(es){return l(Z,es)}),Ot&&Ko(Z,St),at}function ct(Z,Q,ee,me){if(ee==null)throw Error(r(151));for(var at=null,Vt=null,Je=Q,St=Q=0,Pt=null,Ft=ee.next();Je!==null&&!Ft.done;St++,Ft=ee.next()){Je.index>St?(Pt=Je,Je=null):Pt=Je.sibling;var es=re(Z,Je,Ft.value,me);if(es===null){Je===null&&(Je=Pt);break}i&&Je&&es.alternate===null&&l(Z,Je),Q=w(es,Q,St),Vt===null?at=es:Vt.sibling=es,Vt=es,Je=Pt}if(Ft.done)return u(Z,Je),Ot&&Ko(Z,St),at;if(Je===null){for(;!Ft.done;St++,Ft=ee.next())Ft=ve(Z,Ft.value,me),Ft!==null&&(Q=w(Ft,Q,St),Vt===null?at=Ft:Vt.sibling=Ft,Vt=Ft);return Ot&&Ko(Z,St),at}for(Je=h(Je);!Ft.done;St++,Ft=ee.next())Ft=se(Je,Z,St,Ft.value,me),Ft!==null&&(i&&Ft.alternate!==null&&Je.delete(Ft.key===null?St:Ft.key),Q=w(Ft,Q,St),Vt===null?at=Ft:Vt.sibling=Ft,Vt=Ft);return i&&Je.forEach(function(Z3){return l(Z,Z3)}),Ot&&Ko(Z,St),at}function sn(Z,Q,ee,me){if(typeof ee=="object"&&ee!==null&&ee.type===j&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:e:{for(var at=ee.key;Q!==null;){if(Q.key===at){if(at=ee.type,at===j){if(Q.tag===7){u(Z,Q.sibling),me=x(Q,ee.props.children),me.return=Z,Z=me;break e}}else if(Q.elementType===at||typeof at=="object"&&at!==null&&at.$$typeof===N&&Us(at)===Q.type){u(Z,Q.sibling),me=x(Q,ee.props),Pu(me,ee),me.return=Z,Z=me;break e}u(Z,Q);break}else l(Z,Q);Q=Q.sibling}ee.type===j?(me=Ms(ee.props.children,Z.mode,me,ee.key),me.return=Z,Z=me):(me=Uf(ee.type,ee.key,ee.props,null,Z.mode,me),Pu(me,ee),me.return=Z,Z=me)}return D(Z);case S:e:{for(at=ee.key;Q!==null;){if(Q.key===at)if(Q.tag===4&&Q.stateNode.containerInfo===ee.containerInfo&&Q.stateNode.implementation===ee.implementation){u(Z,Q.sibling),me=x(Q,ee.children||[]),me.return=Z,Z=me;break e}else{u(Z,Q);break}else l(Z,Q);Q=Q.sibling}me=Ug(ee,Z.mode,me),me.return=Z,Z=me}return D(Z);case N:return ee=Us(ee),sn(Z,Q,ee,me)}if(W(ee))return Ge(Z,Q,ee,me);if(Y(ee)){if(at=Y(ee),typeof at!="function")throw Error(r(150));return ee=at.call(ee),ct(Z,Q,ee,me)}if(typeof ee.then=="function")return sn(Z,Q,Qf(ee),me);if(ee.$$typeof===T)return sn(Z,Q,Ff(Z,ee),me);Wf(Z,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,Q!==null&&Q.tag===6?(u(Z,Q.sibling),me=x(Q,ee),me.return=Z,Z=me):(u(Z,Q),me=$g(ee,Z.mode,me),me.return=Z,Z=me),D(Z)):u(Z,Q)}return function(Z,Q,ee,me){try{ku=0;var at=sn(Z,Q,ee,me);return ec=null,at}catch(Je){if(Je===Zl||Je===qf)throw Je;var Vt=ri(29,Je,null,Z.mode);return Vt.lanes=me,Vt.return=Z,Vt}}}var Vs=pw(!0),mw=pw(!1),Ia=!1;function Jg(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Zg(i,l){i=i.updateQueue,l.updateQueue===i&&(l.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function za(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function $a(i,l,u){var h=i.updateQueue;if(h===null)return null;if(h=h.shared,(Gt&2)!==0){var x=h.pending;return x===null?l.next=l:(l.next=x.next,x.next=l),h.pending=l,l=$f(i),J1(i,null,u),l}return zf(i,h,l,u),$f(i)}function Nu(i,l,u){if(l=l.updateQueue,l!==null&&(l=l.shared,(u&4194048)!==0)){var h=l.lanes;h&=i.pendingLanes,u|=h,l.lanes=u,V(i,u)}}function ev(i,l){var u=i.updateQueue,h=i.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var x=null,w=null;if(u=u.firstBaseUpdate,u!==null){do{var D={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};w===null?x=w=D:w=w.next=D,u=u.next}while(u!==null);w===null?x=w=l:w=w.next=l}else x=w=l;u={baseState:h.baseState,firstBaseUpdate:x,lastBaseUpdate:w,shared:h.shared,callbacks:h.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=l:i.next=l,u.lastBaseUpdate=l}var tv=!1;function Ou(){if(tv){var i=Jl;if(i!==null)throw i}}function Mu(i,l,u,h){tv=!1;var x=i.updateQueue;Ia=!1;var w=x.firstBaseUpdate,D=x.lastBaseUpdate,P=x.shared.pending;if(P!==null){x.shared.pending=null;var q=P,te=q.next;q.next=null,D===null?w=te:D.next=te,D=q;var fe=i.alternate;fe!==null&&(fe=fe.updateQueue,P=fe.lastBaseUpdate,P!==D&&(P===null?fe.firstBaseUpdate=te:P.next=te,fe.lastBaseUpdate=q))}if(w!==null){var ve=x.baseState;D=0,fe=te=q=null,P=w;do{var re=P.lane&-536870913,se=re!==P.lane;if(se?(kt&re)===re:(h&re)===re){re!==0&&re===Xl&&(tv=!0),fe!==null&&(fe=fe.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Ge=i,ct=P;re=l;var sn=u;switch(ct.tag){case 1:if(Ge=ct.payload,typeof Ge=="function"){ve=Ge.call(sn,ve,re);break e}ve=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=ct.payload,re=typeof Ge=="function"?Ge.call(sn,ve,re):Ge,re==null)break e;ve=g({},ve,re);break e;case 2:Ia=!0}}re=P.callback,re!==null&&(i.flags|=64,se&&(i.flags|=8192),se=x.callbacks,se===null?x.callbacks=[re]:se.push(re))}else se={lane:re,tag:P.tag,payload:P.payload,callback:P.callback,next:null},fe===null?(te=fe=se,q=ve):fe=fe.next=se,D|=re;if(P=P.next,P===null){if(P=x.shared.pending,P===null)break;se=P,P=se.next,se.next=null,x.lastBaseUpdate=se,x.shared.pending=null}}while(!0);fe===null&&(q=ve),x.baseState=q,x.firstBaseUpdate=te,x.lastBaseUpdate=fe,w===null&&(x.shared.lanes=0),Ha|=D,i.lanes=D,i.memoizedState=ve}}function gw(i,l){if(typeof i!="function")throw Error(r(191,i));i.call(l)}function vw(i,l){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)gw(u[i],l)}var tc=M(null),Yf=M(0);function yw(i,l){i=sa,ae(Yf,i),ae(tc,l),sa=i|l.baseLanes}function nv(){ae(Yf,sa),ae(tc,tc.current)}function rv(){sa=Yf.current,F(tc),F(Yf)}var ii=M(null),Ci=null;function Ua(i){var l=i.alternate;ae(Fn,Fn.current&1),ae(ii,i),Ci===null&&(l===null||tc.current!==null||l.memoizedState!==null)&&(Ci=i)}function iv(i){ae(Fn,Fn.current),ae(ii,i),Ci===null&&(Ci=i)}function xw(i){i.tag===22?(ae(Fn,Fn.current),ae(ii,i),Ci===null&&(Ci=i)):Ba()}function Ba(){ae(Fn,Fn.current),ae(ii,ii.current)}function oi(i){F(ii),Ci===i&&(Ci=null),F(Fn)}var Fn=M(0);function Kf(i){for(var l=i;l!==null;){if(l.tag===13){var u=l.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||uy(u)||dy(u)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Zo=0,xt=null,on=null,Kn=null,Xf=!1,nc=!1,Fs=!1,Jf=0,Lu=0,rc=null,FO=0;function On(){throw Error(r(321))}function ov(i,l){if(l===null)return!1;for(var u=0;u<l.length&&u<i.length;u++)if(!ni(i[u],l[u]))return!1;return!0}function av(i,l,u,h,x,w){return Zo=w,xt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,O.H=i===null||i.memoizedState===null?nj:Sv,Fs=!1,w=u(h,x),Fs=!1,nc&&(w=Sw(l,u,h,x)),bw(i),w}function bw(i){O.H=$u;var l=on!==null&&on.next!==null;if(Zo=0,Kn=on=xt=null,Xf=!1,Lu=0,rc=null,l)throw Error(r(300));i===null||Xn||(i=i.dependencies,i!==null&&Vf(i)&&(Xn=!0))}function Sw(i,l,u,h){xt=i;var x=0;do{if(nc&&(rc=null),Lu=0,nc=!1,25<=x)throw Error(r(301));if(x+=1,Kn=on=null,i.updateQueue!=null){var w=i.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}O.H=rj,w=l(u,h)}while(nc);return w}function HO(){var i=O.H,l=i.useState()[0];return l=typeof l.then=="function"?Iu(l):l,i=i.useState()[0],(on!==null?on.memoizedState:null)!==i&&(xt.flags|=1024),l}function sv(){var i=Jf!==0;return Jf=0,i}function lv(i,l,u){l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~u}function cv(i){if(Xf){for(i=i.memoizedState;i!==null;){var l=i.queue;l!==null&&(l.pending=null),i=i.next}Xf=!1}Zo=0,Kn=on=xt=null,nc=!1,Lu=Jf=0,rc=null}function _r(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kn===null?xt.memoizedState=Kn=i:Kn=Kn.next=i,Kn}function Hn(){if(on===null){var i=xt.alternate;i=i!==null?i.memoizedState:null}else i=on.next;var l=Kn===null?xt.memoizedState:Kn.next;if(l!==null)Kn=l,on=i;else{if(i===null)throw xt.alternate===null?Error(r(467)):Error(r(310));on=i,i={memoizedState:on.memoizedState,baseState:on.baseState,baseQueue:on.baseQueue,queue:on.queue,next:null},Kn===null?xt.memoizedState=Kn=i:Kn=Kn.next=i}return Kn}function Zf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Iu(i){var l=Lu;return Lu+=1,rc===null&&(rc=[]),i=dw(rc,i,l),l=xt,(Kn===null?l.memoizedState:Kn.next)===null&&(l=l.alternate,O.H=l===null||l.memoizedState===null?nj:Sv),i}function eh(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Iu(i);if(i.$$typeof===T)return ur(i)}throw Error(r(438,String(i)))}function uv(i){var l=null,u=xt.updateQueue;if(u!==null&&(l=u.memoCache),l==null){var h=xt.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}),u===null&&(u=Zf(),xt.updateQueue=u),u.memoCache=l,u=l.data[l.index],u===void 0)for(u=l.data[l.index]=Array(i),h=0;h<i;h++)u[h]=B;return l.index++,u}function ea(i,l){return typeof l=="function"?l(i):l}function th(i){var l=Hn();return dv(l,on,i)}function dv(i,l,u){var h=i.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=u;var x=i.baseQueue,w=h.pending;if(w!==null){if(x!==null){var D=x.next;x.next=w.next,w.next=D}l.baseQueue=x=w,h.pending=null}if(w=i.baseState,x===null)i.memoizedState=w;else{l=x.next;var P=D=null,q=null,te=l,fe=!1;do{var ve=te.lane&-536870913;if(ve!==te.lane?(kt&ve)===ve:(Zo&ve)===ve){var re=te.revertLane;if(re===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),ve===Xl&&(fe=!0);else if((Zo&re)===re){te=te.next,re===Xl&&(fe=!0);continue}else ve={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},q===null?(P=q=ve,D=w):q=q.next=ve,xt.lanes|=re,Ha|=re;ve=te.action,Fs&&u(w,ve),w=te.hasEagerState?te.eagerState:u(w,ve)}else re={lane:ve,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},q===null?(P=q=re,D=w):q=q.next=re,xt.lanes|=ve,Ha|=ve;te=te.next}while(te!==null&&te!==l);if(q===null?D=w:q.next=P,!ni(w,i.memoizedState)&&(Xn=!0,fe&&(u=Jl,u!==null)))throw u;i.memoizedState=w,i.baseState=D,i.baseQueue=q,h.lastRenderedState=w}return x===null&&(h.lanes=0),[i.memoizedState,h.dispatch]}function fv(i){var l=Hn(),u=l.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var h=u.dispatch,x=u.pending,w=l.memoizedState;if(x!==null){u.pending=null;var D=x=x.next;do w=i(w,D.action),D=D.next;while(D!==x);ni(w,l.memoizedState)||(Xn=!0),l.memoizedState=w,l.baseQueue===null&&(l.baseState=w),u.lastRenderedState=w}return[w,h]}function ww(i,l,u){var h=xt,x=Hn(),w=Ot;if(w){if(u===void 0)throw Error(r(407));u=u()}else u=l();var D=!ni((on||x).memoizedState,u);if(D&&(x.memoizedState=u,Xn=!0),x=x.queue,mv(Ew.bind(null,h,x,i),[i]),x.getSnapshot!==l||D||Kn!==null&&Kn.memoizedState.tag&1){if(h.flags|=2048,ic(9,{destroy:void 0},Cw.bind(null,h,x,u,l),null),un===null)throw Error(r(349));w||(Zo&127)!==0||jw(h,l,u)}return u}function jw(i,l,u){i.flags|=16384,i={getSnapshot:l,value:u},l=xt.updateQueue,l===null?(l=Zf(),xt.updateQueue=l,l.stores=[i]):(u=l.stores,u===null?l.stores=[i]:u.push(i))}function Cw(i,l,u,h){l.value=u,l.getSnapshot=h,Tw(l)&&Rw(i)}function Ew(i,l,u){return u(function(){Tw(l)&&Rw(i)})}function Tw(i){var l=i.getSnapshot;i=i.value;try{var u=l();return!ni(i,u)}catch{return!0}}function Rw(i){var l=Os(i,2);l!==null&&qr(l,i,2)}function hv(i){var l=_r();if(typeof i=="function"){var u=i;if(i=u(),Fs){ar(!0);try{u()}finally{ar(!1)}}}return l.memoizedState=l.baseState=i,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:i},l}function _w(i,l,u,h){return i.baseState=u,dv(i,on,typeof h=="function"?h:ea)}function qO(i,l,u,h,x){if(ih(i))throw Error(r(485));if(i=l.action,i!==null){var w={payload:x,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){w.listeners.push(D)}};O.T!==null?u(!0):w.isTransition=!1,h(w),u=l.pending,u===null?(w.next=l.pending=w,Aw(l,w)):(w.next=u.next,l.pending=u.next=w)}}function Aw(i,l){var u=l.action,h=l.payload,x=i.state;if(l.isTransition){var w=O.T,D={};O.T=D;try{var P=u(x,h),q=O.S;q!==null&&q(D,P),Dw(i,l,P)}catch(te){pv(i,l,te)}finally{w!==null&&D.types!==null&&(w.types=D.types),O.T=w}}else try{w=u(x,h),Dw(i,l,w)}catch(te){pv(i,l,te)}}function Dw(i,l,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){kw(i,l,h)},function(h){return pv(i,l,h)}):kw(i,l,u)}function kw(i,l,u){l.status="fulfilled",l.value=u,Pw(l),i.state=u,l=i.pending,l!==null&&(u=l.next,u===l?i.pending=null:(u=u.next,l.next=u,Aw(i,u)))}function pv(i,l,u){var h=i.pending;if(i.pending=null,h!==null){h=h.next;do l.status="rejected",l.reason=u,Pw(l),l=l.next;while(l!==h)}i.action=null}function Pw(i){i=i.listeners;for(var l=0;l<i.length;l++)(0,i[l])()}function Nw(i,l){return l}function Ow(i,l){if(Ot){var u=un.formState;if(u!==null){e:{var h=xt;if(Ot){if(xn){t:{for(var x=xn,w=ji;x.nodeType!==8;){if(!w){x=null;break t}if(x=Ei(x.nextSibling),x===null){x=null;break t}}w=x.data,x=w==="F!"||w==="F"?x:null}if(x){xn=Ei(x.nextSibling),h=x.data==="F!";break e}}Ma(h)}h=!1}h&&(l=u[0])}}return u=_r(),u.memoizedState=u.baseState=l,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nw,lastRenderedState:l},u.queue=h,u=Zw.bind(null,xt,h),h.dispatch=u,h=hv(!1),w=bv.bind(null,xt,!1,h.queue),h=_r(),x={state:l,dispatch:null,action:i,pending:null},h.queue=x,u=qO.bind(null,xt,x,w,u),x.dispatch=u,h.memoizedState=i,[l,u,!1]}function Mw(i){var l=Hn();return Lw(l,on,i)}function Lw(i,l,u){if(l=dv(i,l,Nw)[0],i=th(ea)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var h=Iu(l)}catch(D){throw D===Zl?qf:D}else h=l;l=Hn();var x=l.queue,w=x.dispatch;return u!==l.memoizedState&&(xt.flags|=2048,ic(9,{destroy:void 0},GO.bind(null,x,u),null)),[h,w,i]}function GO(i,l){i.action=l}function Iw(i){var l=Hn(),u=on;if(u!==null)return Lw(l,u,i);Hn(),l=l.memoizedState,u=Hn();var h=u.queue.dispatch;return u.memoizedState=i,[l,h,!1]}function ic(i,l,u,h){return i={tag:i,create:u,deps:h,inst:l,next:null},l=xt.updateQueue,l===null&&(l=Zf(),xt.updateQueue=l),u=l.lastEffect,u===null?l.lastEffect=i.next=i:(h=u.next,u.next=i,i.next=h,l.lastEffect=i),i}function zw(){return Hn().memoizedState}function nh(i,l,u,h){var x=_r();xt.flags|=i,x.memoizedState=ic(1|l,{destroy:void 0},u,h===void 0?null:h)}function rh(i,l,u,h){var x=Hn();h=h===void 0?null:h;var w=x.memoizedState.inst;on!==null&&h!==null&&ov(h,on.memoizedState.deps)?x.memoizedState=ic(l,w,u,h):(xt.flags|=i,x.memoizedState=ic(1|l,w,u,h))}function $w(i,l){nh(8390656,8,i,l)}function mv(i,l){rh(2048,8,i,l)}function QO(i){xt.flags|=4;var l=xt.updateQueue;if(l===null)l=Zf(),xt.updateQueue=l,l.events=[i];else{var u=l.events;u===null?l.events=[i]:u.push(i)}}function Uw(i){var l=Hn().memoizedState;return QO({ref:l,nextImpl:i}),function(){if((Gt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function Bw(i,l){return rh(4,2,i,l)}function Vw(i,l){return rh(4,4,i,l)}function Fw(i,l){if(typeof l=="function"){i=i();var u=l(i);return function(){typeof u=="function"?u():l(null)}}if(l!=null)return i=i(),l.current=i,function(){l.current=null}}function Hw(i,l,u){u=u!=null?u.concat([i]):null,rh(4,4,Fw.bind(null,l,i),u)}function gv(){}function qw(i,l){var u=Hn();l=l===void 0?null:l;var h=u.memoizedState;return l!==null&&ov(l,h[1])?h[0]:(u.memoizedState=[i,l],i)}function Gw(i,l){var u=Hn();l=l===void 0?null:l;var h=u.memoizedState;if(l!==null&&ov(l,h[1]))return h[0];if(h=i(),Fs){ar(!0);try{i()}finally{ar(!1)}}return u.memoizedState=[h,l],h}function vv(i,l,u){return u===void 0||(Zo&1073741824)!==0&&(kt&261930)===0?i.memoizedState=l:(i.memoizedState=u,i=Qj(),xt.lanes|=i,Ha|=i,u)}function Qw(i,l,u,h){return ni(u,l)?u:tc.current!==null?(i=vv(i,u,h),ni(i,l)||(Xn=!0),i):(Zo&42)===0||(Zo&1073741824)!==0&&(kt&261930)===0?(Xn=!0,i.memoizedState=u):(i=Qj(),xt.lanes|=i,Ha|=i,l)}function Ww(i,l,u,h,x){var w=I.p;I.p=w!==0&&8>w?w:8;var D=O.T,P={};O.T=P,bv(i,!1,l,u);try{var q=x(),te=O.S;if(te!==null&&te(P,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var fe=VO(q,h);zu(i,l,fe,li(i))}else zu(i,l,h,li(i))}catch(ve){zu(i,l,{then:function(){},status:"rejected",reason:ve},li())}finally{I.p=w,D!==null&&P.types!==null&&(D.types=P.types),O.T=D}}function WO(){}function yv(i,l,u,h){if(i.tag!==5)throw Error(r(476));var x=Yw(i).queue;Ww(i,x,l,$,u===null?WO:function(){return Kw(i),u(h)})}function Yw(i){var l=i.memoizedState;if(l!==null)return l;l={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:$},next:null};var u={};return l.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:u},next:null},i.memoizedState=l,i=i.alternate,i!==null&&(i.memoizedState=l),l}function Kw(i){var l=Yw(i);l.next===null&&(l=i.alternate.memoizedState),zu(i,l.next.queue,{},li())}function xv(){return ur(td)}function Xw(){return Hn().memoizedState}function Jw(){return Hn().memoizedState}function YO(i){for(var l=i.return;l!==null;){switch(l.tag){case 24:case 3:var u=li();i=za(u);var h=$a(l,i,u);h!==null&&(qr(h,l,u),Nu(h,l,u)),l={cache:Wg()},i.payload=l;return}l=l.return}}function KO(i,l,u){var h=li();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},ih(i)?ej(l,u):(u=Ig(i,l,u,h),u!==null&&(qr(u,i,h),tj(u,l,h)))}function Zw(i,l,u){var h=li();zu(i,l,u,h)}function zu(i,l,u,h){var x={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(ih(i))ej(l,x);else{var w=i.alternate;if(i.lanes===0&&(w===null||w.lanes===0)&&(w=l.lastRenderedReducer,w!==null))try{var D=l.lastRenderedState,P=w(D,u);if(x.hasEagerState=!0,x.eagerState=P,ni(P,D))return zf(i,l,x,0),un===null&&If(),!1}catch{}if(u=Ig(i,l,x,h),u!==null)return qr(u,i,h),tj(u,l,h),!0}return!1}function bv(i,l,u,h){if(h={lane:2,revertLane:Jv(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},ih(i)){if(l)throw Error(r(479))}else l=Ig(i,u,h,2),l!==null&&qr(l,i,2)}function ih(i){var l=i.alternate;return i===xt||l!==null&&l===xt}function ej(i,l){nc=Xf=!0;var u=i.pending;u===null?l.next=l:(l.next=u.next,u.next=l),i.pending=l}function tj(i,l,u){if((u&4194048)!==0){var h=l.lanes;h&=i.pendingLanes,u|=h,l.lanes=u,V(i,u)}}var $u={readContext:ur,use:eh,useCallback:On,useContext:On,useEffect:On,useImperativeHandle:On,useLayoutEffect:On,useInsertionEffect:On,useMemo:On,useReducer:On,useRef:On,useState:On,useDebugValue:On,useDeferredValue:On,useTransition:On,useSyncExternalStore:On,useId:On,useHostTransitionStatus:On,useFormState:On,useActionState:On,useOptimistic:On,useMemoCache:On,useCacheRefresh:On};$u.useEffectEvent=On;var nj={readContext:ur,use:eh,useCallback:function(i,l){return _r().memoizedState=[i,l===void 0?null:l],i},useContext:ur,useEffect:$w,useImperativeHandle:function(i,l,u){u=u!=null?u.concat([i]):null,nh(4194308,4,Fw.bind(null,l,i),u)},useLayoutEffect:function(i,l){return nh(4194308,4,i,l)},useInsertionEffect:function(i,l){nh(4,2,i,l)},useMemo:function(i,l){var u=_r();l=l===void 0?null:l;var h=i();if(Fs){ar(!0);try{i()}finally{ar(!1)}}return u.memoizedState=[h,l],h},useReducer:function(i,l,u){var h=_r();if(u!==void 0){var x=u(l);if(Fs){ar(!0);try{u(l)}finally{ar(!1)}}}else x=l;return h.memoizedState=h.baseState=x,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:x},h.queue=i,i=i.dispatch=KO.bind(null,xt,i),[h.memoizedState,i]},useRef:function(i){var l=_r();return i={current:i},l.memoizedState=i},useState:function(i){i=hv(i);var l=i.queue,u=Zw.bind(null,xt,l);return l.dispatch=u,[i.memoizedState,u]},useDebugValue:gv,useDeferredValue:function(i,l){var u=_r();return vv(u,i,l)},useTransition:function(){var i=hv(!1);return i=Ww.bind(null,xt,i.queue,!0,!1),_r().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,l,u){var h=xt,x=_r();if(Ot){if(u===void 0)throw Error(r(407));u=u()}else{if(u=l(),un===null)throw Error(r(349));(kt&127)!==0||jw(h,l,u)}x.memoizedState=u;var w={value:u,getSnapshot:l};return x.queue=w,$w(Ew.bind(null,h,w,i),[i]),h.flags|=2048,ic(9,{destroy:void 0},Cw.bind(null,h,w,u,l),null),u},useId:function(){var i=_r(),l=un.identifierPrefix;if(Ot){var u=ho,h=fo;u=(h&~(1<<32-Tn(h)-1)).toString(32)+u,l="_"+l+"R_"+u,u=Jf++,0<u&&(l+="H"+u.toString(32)),l+="_"}else u=FO++,l="_"+l+"r_"+u.toString(32)+"_";return i.memoizedState=l},useHostTransitionStatus:xv,useFormState:Ow,useActionState:Ow,useOptimistic:function(i){var l=_r();l.memoizedState=l.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=u,l=bv.bind(null,xt,!0,u),u.dispatch=l,[i,l]},useMemoCache:uv,useCacheRefresh:function(){return _r().memoizedState=YO.bind(null,xt)},useEffectEvent:function(i){var l=_r(),u={impl:i};return l.memoizedState=u,function(){if((Gt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Sv={readContext:ur,use:eh,useCallback:qw,useContext:ur,useEffect:mv,useImperativeHandle:Hw,useInsertionEffect:Bw,useLayoutEffect:Vw,useMemo:Gw,useReducer:th,useRef:zw,useState:function(){return th(ea)},useDebugValue:gv,useDeferredValue:function(i,l){var u=Hn();return Qw(u,on.memoizedState,i,l)},useTransition:function(){var i=th(ea)[0],l=Hn().memoizedState;return[typeof i=="boolean"?i:Iu(i),l]},useSyncExternalStore:ww,useId:Xw,useHostTransitionStatus:xv,useFormState:Mw,useActionState:Mw,useOptimistic:function(i,l){var u=Hn();return _w(u,on,i,l)},useMemoCache:uv,useCacheRefresh:Jw};Sv.useEffectEvent=Uw;var rj={readContext:ur,use:eh,useCallback:qw,useContext:ur,useEffect:mv,useImperativeHandle:Hw,useInsertionEffect:Bw,useLayoutEffect:Vw,useMemo:Gw,useReducer:fv,useRef:zw,useState:function(){return fv(ea)},useDebugValue:gv,useDeferredValue:function(i,l){var u=Hn();return on===null?vv(u,i,l):Qw(u,on.memoizedState,i,l)},useTransition:function(){var i=fv(ea)[0],l=Hn().memoizedState;return[typeof i=="boolean"?i:Iu(i),l]},useSyncExternalStore:ww,useId:Xw,useHostTransitionStatus:xv,useFormState:Iw,useActionState:Iw,useOptimistic:function(i,l){var u=Hn();return on!==null?_w(u,on,i,l):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:uv,useCacheRefresh:Jw};rj.useEffectEvent=Uw;function wv(i,l,u,h){l=i.memoizedState,u=u(h,l),u=u==null?l:g({},l,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var jv={enqueueSetState:function(i,l,u){i=i._reactInternals;var h=li(),x=za(h);x.payload=l,u!=null&&(x.callback=u),l=$a(i,x,h),l!==null&&(qr(l,i,h),Nu(l,i,h))},enqueueReplaceState:function(i,l,u){i=i._reactInternals;var h=li(),x=za(h);x.tag=1,x.payload=l,u!=null&&(x.callback=u),l=$a(i,x,h),l!==null&&(qr(l,i,h),Nu(l,i,h))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var u=li(),h=za(u);h.tag=2,l!=null&&(h.callback=l),l=$a(i,h,u),l!==null&&(qr(l,i,u),Nu(l,i,u))}};function ij(i,l,u,h,x,w,D){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(h,w,D):l.prototype&&l.prototype.isPureReactComponent?!Eu(u,h)||!Eu(x,w):!0}function oj(i,l,u,h){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(u,h),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(u,h),l.state!==i&&jv.enqueueReplaceState(l,l.state,null)}function Hs(i,l){var u=l;if("ref"in l){u={};for(var h in l)h!=="ref"&&(u[h]=l[h])}if(i=i.defaultProps){u===l&&(u=g({},u));for(var x in i)u[x]===void 0&&(u[x]=i[x])}return u}function aj(i){Lf(i)}function sj(i){console.error(i)}function lj(i){Lf(i)}function oh(i,l){try{var u=i.onUncaughtError;u(l.value,{componentStack:l.stack})}catch(h){setTimeout(function(){throw h})}}function cj(i,l,u){try{var h=i.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function Cv(i,l,u){return u=za(u),u.tag=3,u.payload={element:null},u.callback=function(){oh(i,l)},u}function uj(i){return i=za(i),i.tag=3,i}function dj(i,l,u,h){var x=u.type.getDerivedStateFromError;if(typeof x=="function"){var w=h.value;i.payload=function(){return x(w)},i.callback=function(){cj(l,u,h)}}var D=u.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(i.callback=function(){cj(l,u,h),typeof x!="function"&&(qa===null?qa=new Set([this]):qa.add(this));var P=h.stack;this.componentDidCatch(h.value,{componentStack:P!==null?P:""})})}function XO(i,l,u,h,x){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(l=u.alternate,l!==null&&Kl(l,u,x,!0),u=ii.current,u!==null){switch(u.tag){case 31:case 13:return Ci===null?vh():u.alternate===null&&Mn===0&&(Mn=3),u.flags&=-257,u.flags|=65536,u.lanes=x,h===Gf?u.flags|=16384:(l=u.updateQueue,l===null?u.updateQueue=new Set([h]):l.add(h),Yv(i,h,x)),!1;case 22:return u.flags|=65536,h===Gf?u.flags|=16384:(l=u.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=l):(u=l.retryQueue,u===null?l.retryQueue=new Set([h]):u.add(h)),Yv(i,h,x)),!1}throw Error(r(435,u.tag))}return Yv(i,h,x),vh(),!1}if(Ot)return l=ii.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=x,h!==Fg&&(i=Error(r(422),{cause:h}),_u(bi(i,u)))):(h!==Fg&&(l=Error(r(423),{cause:h}),_u(bi(l,u))),i=i.current.alternate,i.flags|=65536,x&=-x,i.lanes|=x,h=bi(h,u),x=Cv(i.stateNode,h,x),ev(i,x),Mn!==4&&(Mn=2)),!1;var w=Error(r(520),{cause:h});if(w=bi(w,u),Qu===null?Qu=[w]:Qu.push(w),Mn!==4&&(Mn=2),l===null)return!0;h=bi(h,u),u=l;do{switch(u.tag){case 3:return u.flags|=65536,i=x&-x,u.lanes|=i,i=Cv(u.stateNode,h,i),ev(u,i),!1;case 1:if(l=u.type,w=u.stateNode,(u.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(qa===null||!qa.has(w))))return u.flags|=65536,x&=-x,u.lanes|=x,x=uj(x),dj(x,i,u,h),ev(u,x),!1}u=u.return}while(u!==null);return!1}var Ev=Error(r(461)),Xn=!1;function dr(i,l,u,h){l.child=i===null?mw(l,null,u,h):Vs(l,i.child,u,h)}function fj(i,l,u,h,x){u=u.render;var w=l.ref;if("ref"in h){var D={};for(var P in h)P!=="ref"&&(D[P]=h[P])}else D=h;return zs(l),h=av(i,l,u,D,w,x),P=sv(),i!==null&&!Xn?(lv(i,l,x),ta(i,l,x)):(Ot&&P&&Bg(l),l.flags|=1,dr(i,l,h,x),l.child)}function hj(i,l,u,h,x){if(i===null){var w=u.type;return typeof w=="function"&&!zg(w)&&w.defaultProps===void 0&&u.compare===null?(l.tag=15,l.type=w,pj(i,l,w,h,x)):(i=Uf(u.type,null,h,l,l.mode,x),i.ref=l.ref,i.return=l,l.child=i)}if(w=i.child,!Nv(i,x)){var D=w.memoizedProps;if(u=u.compare,u=u!==null?u:Eu,u(D,h)&&i.ref===l.ref)return ta(i,l,x)}return l.flags|=1,i=Yo(w,h),i.ref=l.ref,i.return=l,l.child=i}function pj(i,l,u,h,x){if(i!==null){var w=i.memoizedProps;if(Eu(w,h)&&i.ref===l.ref)if(Xn=!1,l.pendingProps=h=w,Nv(i,x))(i.flags&131072)!==0&&(Xn=!0);else return l.lanes=i.lanes,ta(i,l,x)}return Tv(i,l,u,h,x)}function mj(i,l,u,h){var x=h.children,w=i!==null?i.memoizedState:null;if(i===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((l.flags&128)!==0){if(w=w!==null?w.baseLanes|u:u,i!==null){for(h=l.child=i.child,x=0;h!==null;)x=x|h.lanes|h.childLanes,h=h.sibling;h=x&~w}else h=0,l.child=null;return gj(i,l,w,u,h)}if((u&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},i!==null&&Hf(l,w!==null?w.cachePool:null),w!==null?yw(l,w):nv(),xw(l);else return h=l.lanes=536870912,gj(i,l,w!==null?w.baseLanes|u:u,u,h)}else w!==null?(Hf(l,w.cachePool),yw(l,w),Ba(),l.memoizedState=null):(i!==null&&Hf(l,null),nv(),Ba());return dr(i,l,x,u),l.child}function Uu(i,l){return i!==null&&i.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function gj(i,l,u,h,x){var w=Kg();return w=w===null?null:{parent:Yn._currentValue,pool:w},l.memoizedState={baseLanes:u,cachePool:w},i!==null&&Hf(l,null),nv(),xw(l),i!==null&&Kl(i,l,h,!0),l.childLanes=x,null}function ah(i,l){return l=lh({mode:l.mode,children:l.children},i.mode),l.ref=i.ref,i.child=l,l.return=i,l}function vj(i,l,u){return Vs(l,i.child,null,u),i=ah(l,l.pendingProps),i.flags|=2,oi(l),l.memoizedState=null,i}function JO(i,l,u){var h=l.pendingProps,x=(l.flags&128)!==0;if(l.flags&=-129,i===null){if(Ot){if(h.mode==="hidden")return i=ah(l,h),l.lanes=536870912,Uu(null,i);if(iv(l),(i=xn)?(i=AC(i,ji),i=i!==null&&i.data==="&"?i:null,i!==null&&(l.memoizedState={dehydrated:i,treeContext:Na!==null?{id:fo,overflow:ho}:null,retryLane:536870912,hydrationErrors:null},u=ew(i),u.return=l,l.child=u,cr=l,xn=null)):i=null,i===null)throw Ma(l);return l.lanes=536870912,null}return ah(l,h)}var w=i.memoizedState;if(w!==null){var D=w.dehydrated;if(iv(l),x)if(l.flags&256)l.flags&=-257,l=vj(i,l,u);else if(l.memoizedState!==null)l.child=i.child,l.flags|=128,l=null;else throw Error(r(558));else if(Xn||Kl(i,l,u,!1),x=(u&i.childLanes)!==0,Xn||x){if(h=un,h!==null&&(D=X(h,u),D!==0&&D!==w.retryLane))throw w.retryLane=D,Os(i,D),qr(h,i,D),Ev;vh(),l=vj(i,l,u)}else i=w.treeContext,xn=Ei(D.nextSibling),cr=l,Ot=!0,Oa=null,ji=!1,i!==null&&rw(l,i),l=ah(l,h),l.flags|=4096;return l}return i=Yo(i.child,{mode:h.mode,children:h.children}),i.ref=l.ref,l.child=i,i.return=l,i}function sh(i,l){var u=l.ref;if(u===null)i!==null&&i.ref!==null&&(l.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(i===null||i.ref!==u)&&(l.flags|=4194816)}}function Tv(i,l,u,h,x){return zs(l),u=av(i,l,u,h,void 0,x),h=sv(),i!==null&&!Xn?(lv(i,l,x),ta(i,l,x)):(Ot&&h&&Bg(l),l.flags|=1,dr(i,l,u,x),l.child)}function yj(i,l,u,h,x,w){return zs(l),l.updateQueue=null,u=Sw(l,h,u,x),bw(i),h=sv(),i!==null&&!Xn?(lv(i,l,w),ta(i,l,w)):(Ot&&h&&Bg(l),l.flags|=1,dr(i,l,u,w),l.child)}function xj(i,l,u,h,x){if(zs(l),l.stateNode===null){var w=Gl,D=u.contextType;typeof D=="object"&&D!==null&&(w=ur(D)),w=new u(h,w),l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=jv,l.stateNode=w,w._reactInternals=l,w=l.stateNode,w.props=h,w.state=l.memoizedState,w.refs={},Jg(l),D=u.contextType,w.context=typeof D=="object"&&D!==null?ur(D):Gl,w.state=l.memoizedState,D=u.getDerivedStateFromProps,typeof D=="function"&&(wv(l,u,D,h),w.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(D=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),D!==w.state&&jv.enqueueReplaceState(w,w.state,null),Mu(l,h,w,x),Ou(),w.state=l.memoizedState),typeof w.componentDidMount=="function"&&(l.flags|=4194308),h=!0}else if(i===null){w=l.stateNode;var P=l.memoizedProps,q=Hs(u,P);w.props=q;var te=w.context,fe=u.contextType;D=Gl,typeof fe=="object"&&fe!==null&&(D=ur(fe));var ve=u.getDerivedStateFromProps;fe=typeof ve=="function"||typeof w.getSnapshotBeforeUpdate=="function",P=l.pendingProps!==P,fe||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(P||te!==D)&&oj(l,w,h,D),Ia=!1;var re=l.memoizedState;w.state=re,Mu(l,h,w,x),Ou(),te=l.memoizedState,P||re!==te||Ia?(typeof ve=="function"&&(wv(l,u,ve,h),te=l.memoizedState),(q=Ia||ij(l,u,q,h,re,te,D))?(fe||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=te),w.props=h,w.state=te,w.context=D,h=q):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),h=!1)}else{w=l.stateNode,Zg(i,l),D=l.memoizedProps,fe=Hs(u,D),w.props=fe,ve=l.pendingProps,re=w.context,te=u.contextType,q=Gl,typeof te=="object"&&te!==null&&(q=ur(te)),P=u.getDerivedStateFromProps,(te=typeof P=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(D!==ve||re!==q)&&oj(l,w,h,q),Ia=!1,re=l.memoizedState,w.state=re,Mu(l,h,w,x),Ou();var se=l.memoizedState;D!==ve||re!==se||Ia||i!==null&&i.dependencies!==null&&Vf(i.dependencies)?(typeof P=="function"&&(wv(l,u,P,h),se=l.memoizedState),(fe=Ia||ij(l,u,fe,h,re,se,q)||i!==null&&i.dependencies!==null&&Vf(i.dependencies))?(te||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(h,se,q),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(h,se,q)),typeof w.componentDidUpdate=="function"&&(l.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof w.componentDidUpdate!="function"||D===i.memoizedProps&&re===i.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||D===i.memoizedProps&&re===i.memoizedState||(l.flags|=1024),l.memoizedProps=h,l.memoizedState=se),w.props=h,w.state=se,w.context=q,h=fe):(typeof w.componentDidUpdate!="function"||D===i.memoizedProps&&re===i.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||D===i.memoizedProps&&re===i.memoizedState||(l.flags|=1024),h=!1)}return w=h,sh(i,l),h=(l.flags&128)!==0,w||h?(w=l.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:w.render(),l.flags|=1,i!==null&&h?(l.child=Vs(l,i.child,null,x),l.child=Vs(l,null,u,x)):dr(i,l,u,x),l.memoizedState=w.state,i=l.child):i=ta(i,l,x),i}function bj(i,l,u,h){return Ls(),l.flags|=256,dr(i,l,u,h),l.child}var Rv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _v(i){return{baseLanes:i,cachePool:cw()}}function Av(i,l,u){return i=i!==null?i.childLanes&~u:0,l&&(i|=si),i}function Sj(i,l,u){var h=l.pendingProps,x=!1,w=(l.flags&128)!==0,D;if((D=w)||(D=i!==null&&i.memoizedState===null?!1:(Fn.current&2)!==0),D&&(x=!0,l.flags&=-129),D=(l.flags&32)!==0,l.flags&=-33,i===null){if(Ot){if(x?Ua(l):Ba(),(i=xn)?(i=AC(i,ji),i=i!==null&&i.data!=="&"?i:null,i!==null&&(l.memoizedState={dehydrated:i,treeContext:Na!==null?{id:fo,overflow:ho}:null,retryLane:536870912,hydrationErrors:null},u=ew(i),u.return=l,l.child=u,cr=l,xn=null)):i=null,i===null)throw Ma(l);return dy(i)?l.lanes=32:l.lanes=536870912,null}var P=h.children;return h=h.fallback,x?(Ba(),x=l.mode,P=lh({mode:"hidden",children:P},x),h=Ms(h,x,u,null),P.return=l,h.return=l,P.sibling=h,l.child=P,h=l.child,h.memoizedState=_v(u),h.childLanes=Av(i,D,u),l.memoizedState=Rv,Uu(null,h)):(Ua(l),Dv(l,P))}var q=i.memoizedState;if(q!==null&&(P=q.dehydrated,P!==null)){if(w)l.flags&256?(Ua(l),l.flags&=-257,l=kv(i,l,u)):l.memoizedState!==null?(Ba(),l.child=i.child,l.flags|=128,l=null):(Ba(),P=h.fallback,x=l.mode,h=lh({mode:"visible",children:h.children},x),P=Ms(P,x,u,null),P.flags|=2,h.return=l,P.return=l,h.sibling=P,l.child=h,Vs(l,i.child,null,u),h=l.child,h.memoizedState=_v(u),h.childLanes=Av(i,D,u),l.memoizedState=Rv,l=Uu(null,h));else if(Ua(l),dy(P)){if(D=P.nextSibling&&P.nextSibling.dataset,D)var te=D.dgst;D=te,h=Error(r(419)),h.stack="",h.digest=D,_u({value:h,source:null,stack:null}),l=kv(i,l,u)}else if(Xn||Kl(i,l,u,!1),D=(u&i.childLanes)!==0,Xn||D){if(D=un,D!==null&&(h=X(D,u),h!==0&&h!==q.retryLane))throw q.retryLane=h,Os(i,h),qr(D,i,h),Ev;uy(P)||vh(),l=kv(i,l,u)}else uy(P)?(l.flags|=192,l.child=i.child,l=null):(i=q.treeContext,xn=Ei(P.nextSibling),cr=l,Ot=!0,Oa=null,ji=!1,i!==null&&rw(l,i),l=Dv(l,h.children),l.flags|=4096);return l}return x?(Ba(),P=h.fallback,x=l.mode,q=i.child,te=q.sibling,h=Yo(q,{mode:"hidden",children:h.children}),h.subtreeFlags=q.subtreeFlags&65011712,te!==null?P=Yo(te,P):(P=Ms(P,x,u,null),P.flags|=2),P.return=l,h.return=l,h.sibling=P,l.child=h,Uu(null,h),h=l.child,P=i.child.memoizedState,P===null?P=_v(u):(x=P.cachePool,x!==null?(q=Yn._currentValue,x=x.parent!==q?{parent:q,pool:q}:x):x=cw(),P={baseLanes:P.baseLanes|u,cachePool:x}),h.memoizedState=P,h.childLanes=Av(i,D,u),l.memoizedState=Rv,Uu(i.child,h)):(Ua(l),u=i.child,i=u.sibling,u=Yo(u,{mode:"visible",children:h.children}),u.return=l,u.sibling=null,i!==null&&(D=l.deletions,D===null?(l.deletions=[i],l.flags|=16):D.push(i)),l.child=u,l.memoizedState=null,u)}function Dv(i,l){return l=lh({mode:"visible",children:l},i.mode),l.return=i,i.child=l}function lh(i,l){return i=ri(22,i,null,l),i.lanes=0,i}function kv(i,l,u){return Vs(l,i.child,null,u),i=Dv(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function wj(i,l,u){i.lanes|=l;var h=i.alternate;h!==null&&(h.lanes|=l),Gg(i.return,l,u)}function Pv(i,l,u,h,x,w){var D=i.memoizedState;D===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:x,treeForkCount:w}:(D.isBackwards=l,D.rendering=null,D.renderingStartTime=0,D.last=h,D.tail=u,D.tailMode=x,D.treeForkCount=w)}function jj(i,l,u){var h=l.pendingProps,x=h.revealOrder,w=h.tail;h=h.children;var D=Fn.current,P=(D&2)!==0;if(P?(D=D&1|2,l.flags|=128):D&=1,ae(Fn,D),dr(i,l,h,u),h=Ot?Ru:0,!P&&i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&wj(i,u,l);else if(i.tag===19)wj(i,u,l);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break e;for(;i.sibling===null;){if(i.return===null||i.return===l)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(x){case"forwards":for(u=l.child,x=null;u!==null;)i=u.alternate,i!==null&&Kf(i)===null&&(x=u),u=u.sibling;u=x,u===null?(x=l.child,l.child=null):(x=u.sibling,u.sibling=null),Pv(l,!1,x,u,w,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,x=l.child,l.child=null;x!==null;){if(i=x.alternate,i!==null&&Kf(i)===null){l.child=x;break}i=x.sibling,x.sibling=u,u=x,x=i}Pv(l,!0,u,null,w,h);break;case"together":Pv(l,!1,null,null,void 0,h);break;default:l.memoizedState=null}return l.child}function ta(i,l,u){if(i!==null&&(l.dependencies=i.dependencies),Ha|=l.lanes,(u&l.childLanes)===0)if(i!==null){if(Kl(i,l,u,!1),(u&l.childLanes)===0)return null}else return null;if(i!==null&&l.child!==i.child)throw Error(r(153));if(l.child!==null){for(i=l.child,u=Yo(i,i.pendingProps),l.child=u,u.return=l;i.sibling!==null;)i=i.sibling,u=u.sibling=Yo(i,i.pendingProps),u.return=l;u.sibling=null}return l.child}function Nv(i,l){return(i.lanes&l)!==0?!0:(i=i.dependencies,!!(i!==null&&Vf(i)))}function ZO(i,l,u){switch(l.tag){case 3:Ke(l,l.stateNode.containerInfo),La(l,Yn,i.memoizedState.cache),Ls();break;case 27:case 5:dt(l);break;case 4:Ke(l,l.stateNode.containerInfo);break;case 10:La(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,iv(l),null;break;case 13:var h=l.memoizedState;if(h!==null)return h.dehydrated!==null?(Ua(l),l.flags|=128,null):(u&l.child.childLanes)!==0?Sj(i,l,u):(Ua(l),i=ta(i,l,u),i!==null?i.sibling:null);Ua(l);break;case 19:var x=(i.flags&128)!==0;if(h=(u&l.childLanes)!==0,h||(Kl(i,l,u,!1),h=(u&l.childLanes)!==0),x){if(h)return jj(i,l,u);l.flags|=128}if(x=l.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),ae(Fn,Fn.current),h)break;return null;case 22:return l.lanes=0,mj(i,l,u,l.pendingProps);case 24:La(l,Yn,i.memoizedState.cache)}return ta(i,l,u)}function Cj(i,l,u){if(i!==null)if(i.memoizedProps!==l.pendingProps)Xn=!0;else{if(!Nv(i,u)&&(l.flags&128)===0)return Xn=!1,ZO(i,l,u);Xn=(i.flags&131072)!==0}else Xn=!1,Ot&&(l.flags&1048576)!==0&&nw(l,Ru,l.index);switch(l.lanes=0,l.tag){case 16:e:{var h=l.pendingProps;if(i=Us(l.elementType),l.type=i,typeof i=="function")zg(i)?(h=Hs(i,h),l.tag=1,l=xj(null,l,i,h,u)):(l.tag=0,l=Tv(null,l,i,h,u));else{if(i!=null){var x=i.$$typeof;if(x===_){l.tag=11,l=fj(null,l,i,h,u);break e}else if(x===A){l.tag=14,l=hj(null,l,i,h,u);break e}}throw l=U(i)||i,Error(r(306,l,""))}}return l;case 0:return Tv(i,l,l.type,l.pendingProps,u);case 1:return h=l.type,x=Hs(h,l.pendingProps),xj(i,l,h,x,u);case 3:e:{if(Ke(l,l.stateNode.containerInfo),i===null)throw Error(r(387));h=l.pendingProps;var w=l.memoizedState;x=w.element,Zg(i,l),Mu(l,h,null,u);var D=l.memoizedState;if(h=D.cache,La(l,Yn,h),h!==w.cache&&Qg(l,[Yn],u,!0),Ou(),h=D.element,w.isDehydrated)if(w={element:h,isDehydrated:!1,cache:D.cache},l.updateQueue.baseState=w,l.memoizedState=w,l.flags&256){l=bj(i,l,h,u);break e}else if(h!==x){x=bi(Error(r(424)),l),_u(x),l=bj(i,l,h,u);break e}else{switch(i=l.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(xn=Ei(i.firstChild),cr=l,Ot=!0,Oa=null,ji=!0,u=mw(l,null,h,u),l.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Ls(),h===x){l=ta(i,l,u);break e}dr(i,l,h,u)}l=l.child}return l;case 26:return sh(i,l),i===null?(u=MC(l.type,null,l.pendingProps,null))?l.memoizedState=u:Ot||(u=l.type,i=l.pendingProps,h=Ch(Se.current).createElement(u),h[Oe]=l,h[ze]=i,fr(h,u,i),cn(h),l.stateNode=h):l.memoizedState=MC(l.type,i.memoizedProps,l.pendingProps,i.memoizedState),null;case 27:return dt(l),i===null&&Ot&&(h=l.stateNode=PC(l.type,l.pendingProps,Se.current),cr=l,ji=!0,x=xn,Ya(l.type)?(fy=x,xn=Ei(h.firstChild)):xn=x),dr(i,l,l.pendingProps.children,u),sh(i,l),i===null&&(l.flags|=4194304),l.child;case 5:return i===null&&Ot&&((x=h=xn)&&(h=A3(h,l.type,l.pendingProps,ji),h!==null?(l.stateNode=h,cr=l,xn=Ei(h.firstChild),ji=!1,x=!0):x=!1),x||Ma(l)),dt(l),x=l.type,w=l.pendingProps,D=i!==null?i.memoizedProps:null,h=w.children,sy(x,w)?h=null:D!==null&&sy(x,D)&&(l.flags|=32),l.memoizedState!==null&&(x=av(i,l,HO,null,null,u),td._currentValue=x),sh(i,l),dr(i,l,h,u),l.child;case 6:return i===null&&Ot&&((i=u=xn)&&(u=D3(u,l.pendingProps,ji),u!==null?(l.stateNode=u,cr=l,xn=null,i=!0):i=!1),i||Ma(l)),null;case 13:return Sj(i,l,u);case 4:return Ke(l,l.stateNode.containerInfo),h=l.pendingProps,i===null?l.child=Vs(l,null,h,u):dr(i,l,h,u),l.child;case 11:return fj(i,l,l.type,l.pendingProps,u);case 7:return dr(i,l,l.pendingProps,u),l.child;case 8:return dr(i,l,l.pendingProps.children,u),l.child;case 12:return dr(i,l,l.pendingProps.children,u),l.child;case 10:return h=l.pendingProps,La(l,l.type,h.value),dr(i,l,h.children,u),l.child;case 9:return x=l.type._context,h=l.pendingProps.children,zs(l),x=ur(x),h=h(x),l.flags|=1,dr(i,l,h,u),l.child;case 14:return hj(i,l,l.type,l.pendingProps,u);case 15:return pj(i,l,l.type,l.pendingProps,u);case 19:return jj(i,l,u);case 31:return JO(i,l,u);case 22:return mj(i,l,u,l.pendingProps);case 24:return zs(l),h=ur(Yn),i===null?(x=Kg(),x===null&&(x=un,w=Wg(),x.pooledCache=w,w.refCount++,w!==null&&(x.pooledCacheLanes|=u),x=w),l.memoizedState={parent:h,cache:x},Jg(l),La(l,Yn,x)):((i.lanes&u)!==0&&(Zg(i,l),Mu(l,null,null,u),Ou()),x=i.memoizedState,w=l.memoizedState,x.parent!==h?(x={parent:h,cache:h},l.memoizedState=x,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=x),La(l,Yn,h)):(h=w.cache,La(l,Yn,h),h!==x.cache&&Qg(l,[Yn],u,!0))),dr(i,l,l.pendingProps.children,u),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function na(i){i.flags|=4}function Ov(i,l,u,h,x){if((l=(i.mode&32)!==0)&&(l=!1),l){if(i.flags|=16777216,(x&335544128)===x)if(i.stateNode.complete)i.flags|=8192;else if(Xj())i.flags|=8192;else throw Bs=Gf,Xg}else i.flags&=-16777217}function Ej(i,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!UC(l))if(Xj())i.flags|=8192;else throw Bs=Gf,Xg}function ch(i,l){l!==null&&(i.flags|=4),i.flags&16384&&(l=i.tag!==22?Vn():536870912,i.lanes|=l,lc|=l)}function Bu(i,l){if(!Ot)switch(i.tailMode){case"hidden":l=i.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:h.sibling=null}}function bn(i){var l=i.alternate!==null&&i.alternate.child===i.child,u=0,h=0;if(l)for(var x=i.child;x!==null;)u|=x.lanes|x.childLanes,h|=x.subtreeFlags&65011712,h|=x.flags&65011712,x.return=i,x=x.sibling;else for(x=i.child;x!==null;)u|=x.lanes|x.childLanes,h|=x.subtreeFlags,h|=x.flags,x.return=i,x=x.sibling;return i.subtreeFlags|=h,i.childLanes=u,l}function e3(i,l,u){var h=l.pendingProps;switch(Vg(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bn(l),null;case 1:return bn(l),null;case 3:return u=l.stateNode,h=null,i!==null&&(h=i.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),Jo(Yn),Ae(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(Yl(l)?na(l):i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Hg())),bn(l),null;case 26:var x=l.type,w=l.memoizedState;return i===null?(na(l),w!==null?(bn(l),Ej(l,w)):(bn(l),Ov(l,x,null,h,u))):w?w!==i.memoizedState?(na(l),bn(l),Ej(l,w)):(bn(l),l.flags&=-16777217):(i=i.memoizedProps,i!==h&&na(l),bn(l),Ov(l,x,i,h,u)),null;case 27:if(Ct(l),u=Se.current,x=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==h&&na(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return bn(l),null}i=de.current,Yl(l)?iw(l):(i=PC(x,h,u),l.stateNode=i,na(l))}return bn(l),null;case 5:if(Ct(l),x=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==h&&na(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return bn(l),null}if(w=de.current,Yl(l))iw(l);else{var D=Ch(Se.current);switch(w){case 1:w=D.createElementNS("http://www.w3.org/2000/svg",x);break;case 2:w=D.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;default:switch(x){case"svg":w=D.createElementNS("http://www.w3.org/2000/svg",x);break;case"math":w=D.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;case"script":w=D.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof h.is=="string"?D.createElement("select",{is:h.is}):D.createElement("select"),h.multiple?w.multiple=!0:h.size&&(w.size=h.size);break;default:w=typeof h.is=="string"?D.createElement(x,{is:h.is}):D.createElement(x)}}w[Oe]=l,w[ze]=h;e:for(D=l.child;D!==null;){if(D.tag===5||D.tag===6)w.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===l)break e;for(;D.sibling===null;){if(D.return===null||D.return===l)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}l.stateNode=w;e:switch(fr(w,x,h),x){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&na(l)}}return bn(l),Ov(l,l.type,i===null?null:i.memoizedProps,l.pendingProps,u),null;case 6:if(i&&l.stateNode!=null)i.memoizedProps!==h&&na(l);else{if(typeof h!="string"&&l.stateNode===null)throw Error(r(166));if(i=Se.current,Yl(l)){if(i=l.stateNode,u=l.memoizedProps,h=null,x=cr,x!==null)switch(x.tag){case 27:case 5:h=x.memoizedProps}i[Oe]=l,i=!!(i.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||SC(i.nodeValue,u)),i||Ma(l,!0)}else i=Ch(i).createTextNode(h),i[Oe]=l,l.stateNode=i}return bn(l),null;case 31:if(u=l.memoizedState,i===null||i.memoizedState!==null){if(h=Yl(l),u!==null){if(i===null){if(!h)throw Error(r(318));if(i=l.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Oe]=l}else Ls(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;bn(l),i=!1}else u=Hg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return l.flags&256?(oi(l),l):(oi(l),null);if((l.flags&128)!==0)throw Error(r(558))}return bn(l),null;case 13:if(h=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(x=Yl(l),h!==null&&h.dehydrated!==null){if(i===null){if(!x)throw Error(r(318));if(x=l.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[Oe]=l}else Ls(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;bn(l),x=!1}else x=Hg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=x),x=!0;if(!x)return l.flags&256?(oi(l),l):(oi(l),null)}return oi(l),(l.flags&128)!==0?(l.lanes=u,l):(u=h!==null,i=i!==null&&i.memoizedState!==null,u&&(h=l.child,x=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(x=h.alternate.memoizedState.cachePool.pool),w=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(w=h.memoizedState.cachePool.pool),w!==x&&(h.flags|=2048)),u!==i&&u&&(l.child.flags|=8192),ch(l,l.updateQueue),bn(l),null);case 4:return Ae(),i===null&&ny(l.stateNode.containerInfo),bn(l),null;case 10:return Jo(l.type),bn(l),null;case 19:if(F(Fn),h=l.memoizedState,h===null)return bn(l),null;if(x=(l.flags&128)!==0,w=h.rendering,w===null)if(x)Bu(h,!1);else{if(Mn!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(w=Kf(i),w!==null){for(l.flags|=128,Bu(h,!1),i=w.updateQueue,l.updateQueue=i,ch(l,i),l.subtreeFlags=0,i=u,u=l.child;u!==null;)Z1(u,i),u=u.sibling;return ae(Fn,Fn.current&1|2),Ot&&Ko(l,h.treeForkCount),l.child}i=i.sibling}h.tail!==null&&pe()>ph&&(l.flags|=128,x=!0,Bu(h,!1),l.lanes=4194304)}else{if(!x)if(i=Kf(w),i!==null){if(l.flags|=128,x=!0,i=i.updateQueue,l.updateQueue=i,ch(l,i),Bu(h,!0),h.tail===null&&h.tailMode==="hidden"&&!w.alternate&&!Ot)return bn(l),null}else 2*pe()-h.renderingStartTime>ph&&u!==536870912&&(l.flags|=128,x=!0,Bu(h,!1),l.lanes=4194304);h.isBackwards?(w.sibling=l.child,l.child=w):(i=h.last,i!==null?i.sibling=w:l.child=w,h.last=w)}return h.tail!==null?(i=h.tail,h.rendering=i,h.tail=i.sibling,h.renderingStartTime=pe(),i.sibling=null,u=Fn.current,ae(Fn,x?u&1|2:u&1),Ot&&Ko(l,h.treeForkCount),i):(bn(l),null);case 22:case 23:return oi(l),rv(),h=l.memoizedState!==null,i!==null?i.memoizedState!==null!==h&&(l.flags|=8192):h&&(l.flags|=8192),h?(u&536870912)!==0&&(l.flags&128)===0&&(bn(l),l.subtreeFlags&6&&(l.flags|=8192)):bn(l),u=l.updateQueue,u!==null&&ch(l,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==u&&(l.flags|=2048),i!==null&&F($s),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),l.memoizedState.cache!==u&&(l.flags|=2048),Jo(Yn),bn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function t3(i,l){switch(Vg(l),l.tag){case 1:return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return Jo(Yn),Ae(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 26:case 27:case 5:return Ct(l),null;case 31:if(l.memoizedState!==null){if(oi(l),l.alternate===null)throw Error(r(340));Ls()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 13:if(oi(l),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Ls()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return F(Fn),null;case 4:return Ae(),null;case 10:return Jo(l.type),null;case 22:case 23:return oi(l),rv(),i!==null&&F($s),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 24:return Jo(Yn),null;case 25:return null;default:return null}}function Tj(i,l){switch(Vg(l),l.tag){case 3:Jo(Yn),Ae();break;case 26:case 27:case 5:Ct(l);break;case 4:Ae();break;case 31:l.memoizedState!==null&&oi(l);break;case 13:oi(l);break;case 19:F(Fn);break;case 10:Jo(l.type);break;case 22:case 23:oi(l),rv(),i!==null&&F($s);break;case 24:Jo(Yn)}}function Vu(i,l){try{var u=l.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var x=h.next;u=x;do{if((u.tag&i)===i){h=void 0;var w=u.create,D=u.inst;h=w(),D.destroy=h}u=u.next}while(u!==x)}}catch(P){tn(l,l.return,P)}}function Va(i,l,u){try{var h=l.updateQueue,x=h!==null?h.lastEffect:null;if(x!==null){var w=x.next;h=w;do{if((h.tag&i)===i){var D=h.inst,P=D.destroy;if(P!==void 0){D.destroy=void 0,x=l;var q=u,te=P;try{te()}catch(fe){tn(x,q,fe)}}}h=h.next}while(h!==w)}}catch(fe){tn(l,l.return,fe)}}function Rj(i){var l=i.updateQueue;if(l!==null){var u=i.stateNode;try{vw(l,u)}catch(h){tn(i,i.return,h)}}}function _j(i,l,u){u.props=Hs(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(h){tn(i,l,h)}}function Fu(i,l){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var h=i.stateNode;break;case 30:h=i.stateNode;break;default:h=i.stateNode}typeof u=="function"?i.refCleanup=u(h):u.current=h}}catch(x){tn(i,l,x)}}function po(i,l){var u=i.ref,h=i.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(x){tn(i,l,x)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(x){tn(i,l,x)}else u.current=null}function Aj(i){var l=i.type,u=i.memoizedProps,h=i.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(x){tn(i,i.return,x)}}function Mv(i,l,u){try{var h=i.stateNode;j3(h,i.type,u,l),h[ze]=l}catch(x){tn(i,i.return,x)}}function Dj(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Ya(i.type)||i.tag===4}function Lv(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Dj(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Ya(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Iv(i,l,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,l?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,l):(l=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,l.appendChild(i),u=u._reactRootContainer,u!=null||l.onclick!==null||(l.onclick=Qo));else if(h!==4&&(h===27&&Ya(i.type)&&(u=i.stateNode,l=null),i=i.child,i!==null))for(Iv(i,l,u),i=i.sibling;i!==null;)Iv(i,l,u),i=i.sibling}function uh(i,l,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,l?u.insertBefore(i,l):u.appendChild(i);else if(h!==4&&(h===27&&Ya(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(uh(i,l,u),i=i.sibling;i!==null;)uh(i,l,u),i=i.sibling}function kj(i){var l=i.stateNode,u=i.memoizedProps;try{for(var h=i.type,x=l.attributes;x.length;)l.removeAttributeNode(x[0]);fr(l,h,u),l[Oe]=i,l[ze]=u}catch(w){tn(i,i.return,w)}}var ra=!1,Jn=!1,zv=!1,Pj=typeof WeakSet=="function"?WeakSet:Set,rr=null;function n3(i,l){if(i=i.containerInfo,oy=kh,i=H1(i),kg(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var x=h.anchorOffset,w=h.focusNode;h=h.focusOffset;try{u.nodeType,w.nodeType}catch{u=null;break e}var D=0,P=-1,q=-1,te=0,fe=0,ve=i,re=null;t:for(;;){for(var se;ve!==u||x!==0&&ve.nodeType!==3||(P=D+x),ve!==w||h!==0&&ve.nodeType!==3||(q=D+h),ve.nodeType===3&&(D+=ve.nodeValue.length),(se=ve.firstChild)!==null;)re=ve,ve=se;for(;;){if(ve===i)break t;if(re===u&&++te===x&&(P=D),re===w&&++fe===h&&(q=D),(se=ve.nextSibling)!==null)break;ve=re,re=ve.parentNode}ve=se}u=P===-1||q===-1?null:{start:P,end:q}}else u=null}u=u||{start:0,end:0}}else u=null;for(ay={focusedElem:i,selectionRange:u},kh=!1,rr=l;rr!==null;)if(l=rr,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,rr=i;else for(;rr!==null;){switch(l=rr,w=l.alternate,i=l.flags,l.tag){case 0:if((i&4)!==0&&(i=l.updateQueue,i=i!==null?i.events:null,i!==null))for(u=0;u<i.length;u++)x=i[u],x.ref.impl=x.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&w!==null){i=void 0,u=l,x=w.memoizedProps,w=w.memoizedState,h=u.stateNode;try{var Ge=Hs(u.type,x);i=h.getSnapshotBeforeUpdate(Ge,w),h.__reactInternalSnapshotBeforeUpdate=i}catch(ct){tn(u,u.return,ct)}}break;case 3:if((i&1024)!==0){if(i=l.stateNode.containerInfo,u=i.nodeType,u===9)cy(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":cy(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=l.sibling,i!==null){i.return=l.return,rr=i;break}rr=l.return}}function Nj(i,l,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:oa(i,u),h&4&&Vu(5,u);break;case 1:if(oa(i,u),h&4)if(i=u.stateNode,l===null)try{i.componentDidMount()}catch(D){tn(u,u.return,D)}else{var x=Hs(u.type,l.memoizedProps);l=l.memoizedState;try{i.componentDidUpdate(x,l,i.__reactInternalSnapshotBeforeUpdate)}catch(D){tn(u,u.return,D)}}h&64&&Rj(u),h&512&&Fu(u,u.return);break;case 3:if(oa(i,u),h&64&&(i=u.updateQueue,i!==null)){if(l=null,u.child!==null)switch(u.child.tag){case 27:case 5:l=u.child.stateNode;break;case 1:l=u.child.stateNode}try{vw(i,l)}catch(D){tn(u,u.return,D)}}break;case 27:l===null&&h&4&&kj(u);case 26:case 5:oa(i,u),l===null&&h&4&&Aj(u),h&512&&Fu(u,u.return);break;case 12:oa(i,u);break;case 31:oa(i,u),h&4&&Lj(i,u);break;case 13:oa(i,u),h&4&&Ij(i,u),h&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=d3.bind(null,u),k3(i,u))));break;case 22:if(h=u.memoizedState!==null||ra,!h){l=l!==null&&l.memoizedState!==null||Jn,x=ra;var w=Jn;ra=h,(Jn=l)&&!w?aa(i,u,(u.subtreeFlags&8772)!==0):oa(i,u),ra=x,Jn=w}break;case 30:break;default:oa(i,u)}}function Oj(i){var l=i.alternate;l!==null&&(i.alternate=null,Oj(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&Rn(l)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var _n=null,Br=!1;function ia(i,l,u){for(u=u.child;u!==null;)Mj(i,l,u),u=u.sibling}function Mj(i,l,u){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(gr,u)}catch{}switch(u.tag){case 26:Jn||po(u,l),ia(i,l,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Jn||po(u,l);var h=_n,x=Br;Ya(u.type)&&(_n=u.stateNode,Br=!1),ia(i,l,u),Ju(u.stateNode),_n=h,Br=x;break;case 5:Jn||po(u,l);case 6:if(h=_n,x=Br,_n=null,ia(i,l,u),_n=h,Br=x,_n!==null)if(Br)try{(_n.nodeType===9?_n.body:_n.nodeName==="HTML"?_n.ownerDocument.body:_n).removeChild(u.stateNode)}catch(w){tn(u,l,w)}else try{_n.removeChild(u.stateNode)}catch(w){tn(u,l,w)}break;case 18:_n!==null&&(Br?(i=_n,RC(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),gc(i)):RC(_n,u.stateNode));break;case 4:h=_n,x=Br,_n=u.stateNode.containerInfo,Br=!0,ia(i,l,u),_n=h,Br=x;break;case 0:case 11:case 14:case 15:Va(2,u,l),Jn||Va(4,u,l),ia(i,l,u);break;case 1:Jn||(po(u,l),h=u.stateNode,typeof h.componentWillUnmount=="function"&&_j(u,l,h)),ia(i,l,u);break;case 21:ia(i,l,u);break;case 22:Jn=(h=Jn)||u.memoizedState!==null,ia(i,l,u),Jn=h;break;default:ia(i,l,u)}}function Lj(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{gc(i)}catch(u){tn(l,l.return,u)}}}function Ij(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{gc(i)}catch(u){tn(l,l.return,u)}}function r3(i){switch(i.tag){case 31:case 13:case 19:var l=i.stateNode;return l===null&&(l=i.stateNode=new Pj),l;case 22:return i=i.stateNode,l=i._retryCache,l===null&&(l=i._retryCache=new Pj),l;default:throw Error(r(435,i.tag))}}function dh(i,l){var u=r3(i);l.forEach(function(h){if(!u.has(h)){u.add(h);var x=f3.bind(null,i,h);h.then(x,x)}})}function Vr(i,l){var u=l.deletions;if(u!==null)for(var h=0;h<u.length;h++){var x=u[h],w=i,D=l,P=D;e:for(;P!==null;){switch(P.tag){case 27:if(Ya(P.type)){_n=P.stateNode,Br=!1;break e}break;case 5:_n=P.stateNode,Br=!1;break e;case 3:case 4:_n=P.stateNode.containerInfo,Br=!0;break e}P=P.return}if(_n===null)throw Error(r(160));Mj(w,D,x),_n=null,Br=!1,w=x.alternate,w!==null&&(w.return=null),x.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)zj(l,i),l=l.sibling}var qi=null;function zj(i,l){var u=i.alternate,h=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Vr(l,i),Fr(i),h&4&&(Va(3,i,i.return),Vu(3,i),Va(5,i,i.return));break;case 1:Vr(l,i),Fr(i),h&512&&(Jn||u===null||po(u,u.return)),h&64&&ra&&(i=i.updateQueue,i!==null&&(h=i.callbacks,h!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var x=qi;if(Vr(l,i),Fr(i),h&512&&(Jn||u===null||po(u,u.return)),h&4){var w=u!==null?u.memoizedState:null;if(h=i.memoizedState,u===null)if(h===null)if(i.stateNode===null){e:{h=i.type,u=i.memoizedProps,x=x.ownerDocument||x;t:switch(h){case"title":w=x.getElementsByTagName("title")[0],(!w||w[Zt]||w[Oe]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=x.createElement(h),x.head.insertBefore(w,x.querySelector("head > title"))),fr(w,h,u),w[Oe]=i,cn(w),h=w;break e;case"link":var D=zC("link","href",x).get(h+(u.href||""));if(D){for(var P=0;P<D.length;P++)if(w=D[P],w.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&w.getAttribute("rel")===(u.rel==null?null:u.rel)&&w.getAttribute("title")===(u.title==null?null:u.title)&&w.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){D.splice(P,1);break t}}w=x.createElement(h),fr(w,h,u),x.head.appendChild(w);break;case"meta":if(D=zC("meta","content",x).get(h+(u.content||""))){for(P=0;P<D.length;P++)if(w=D[P],w.getAttribute("content")===(u.content==null?null:""+u.content)&&w.getAttribute("name")===(u.name==null?null:u.name)&&w.getAttribute("property")===(u.property==null?null:u.property)&&w.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&w.getAttribute("charset")===(u.charSet==null?null:u.charSet)){D.splice(P,1);break t}}w=x.createElement(h),fr(w,h,u),x.head.appendChild(w);break;default:throw Error(r(468,h))}w[Oe]=i,cn(w),h=w}i.stateNode=h}else $C(x,i.type,i.stateNode);else i.stateNode=IC(x,h,i.memoizedProps);else w!==h?(w===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):w.count--,h===null?$C(x,i.type,i.stateNode):IC(x,h,i.memoizedProps)):h===null&&i.stateNode!==null&&Mv(i,i.memoizedProps,u.memoizedProps)}break;case 27:Vr(l,i),Fr(i),h&512&&(Jn||u===null||po(u,u.return)),u!==null&&h&4&&Mv(i,i.memoizedProps,u.memoizedProps);break;case 5:if(Vr(l,i),Fr(i),h&512&&(Jn||u===null||po(u,u.return)),i.flags&32){x=i.stateNode;try{$l(x,"")}catch(Ge){tn(i,i.return,Ge)}}h&4&&i.stateNode!=null&&(x=i.memoizedProps,Mv(i,x,u!==null?u.memoizedProps:x)),h&1024&&(zv=!0);break;case 6:if(Vr(l,i),Fr(i),h&4){if(i.stateNode===null)throw Error(r(162));h=i.memoizedProps,u=i.stateNode;try{u.nodeValue=h}catch(Ge){tn(i,i.return,Ge)}}break;case 3:if(Rh=null,x=qi,qi=Eh(l.containerInfo),Vr(l,i),qi=x,Fr(i),h&4&&u!==null&&u.memoizedState.isDehydrated)try{gc(l.containerInfo)}catch(Ge){tn(i,i.return,Ge)}zv&&(zv=!1,$j(i));break;case 4:h=qi,qi=Eh(i.stateNode.containerInfo),Vr(l,i),Fr(i),qi=h;break;case 12:Vr(l,i),Fr(i);break;case 31:Vr(l,i),Fr(i),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,dh(i,h)));break;case 13:Vr(l,i),Fr(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(hh=pe()),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,dh(i,h)));break;case 22:x=i.memoizedState!==null;var q=u!==null&&u.memoizedState!==null,te=ra,fe=Jn;if(ra=te||x,Jn=fe||q,Vr(l,i),Jn=fe,ra=te,Fr(i),h&8192)e:for(l=i.stateNode,l._visibility=x?l._visibility&-2:l._visibility|1,x&&(u===null||q||ra||Jn||qs(i)),u=null,l=i;;){if(l.tag===5||l.tag===26){if(u===null){q=u=l;try{if(w=q.stateNode,x)D=w.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{P=q.stateNode;var ve=q.memoizedProps.style,re=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;P.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(Ge){tn(q,q.return,Ge)}}}else if(l.tag===6){if(u===null){q=l;try{q.stateNode.nodeValue=x?"":q.memoizedProps}catch(Ge){tn(q,q.return,Ge)}}}else if(l.tag===18){if(u===null){q=l;try{var se=q.stateNode;x?_C(se,!0):_C(q.stateNode,!1)}catch(Ge){tn(q,q.return,Ge)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===i)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break e;for(;l.sibling===null;){if(l.return===null||l.return===i)break e;u===l&&(u=null),l=l.return}u===l&&(u=null),l.sibling.return=l.return,l=l.sibling}h&4&&(h=i.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,dh(i,u))));break;case 19:Vr(l,i),Fr(i),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,dh(i,h)));break;case 30:break;case 21:break;default:Vr(l,i),Fr(i)}}function Fr(i){var l=i.flags;if(l&2){try{for(var u,h=i.return;h!==null;){if(Dj(h)){u=h;break}h=h.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var x=u.stateNode,w=Lv(i);uh(i,w,x);break;case 5:var D=u.stateNode;u.flags&32&&($l(D,""),u.flags&=-33);var P=Lv(i);uh(i,P,D);break;case 3:case 4:var q=u.stateNode.containerInfo,te=Lv(i);Iv(i,te,q);break;default:throw Error(r(161))}}catch(fe){tn(i,i.return,fe)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function $j(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var l=i;$j(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),i=i.sibling}}function oa(i,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)Nj(i,l.alternate,l),l=l.sibling}function qs(i){for(i=i.child;i!==null;){var l=i;switch(l.tag){case 0:case 11:case 14:case 15:Va(4,l,l.return),qs(l);break;case 1:po(l,l.return);var u=l.stateNode;typeof u.componentWillUnmount=="function"&&_j(l,l.return,u),qs(l);break;case 27:Ju(l.stateNode);case 26:case 5:po(l,l.return),qs(l);break;case 22:l.memoizedState===null&&qs(l);break;case 30:qs(l);break;default:qs(l)}i=i.sibling}}function aa(i,l,u){for(u=u&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var h=l.alternate,x=i,w=l,D=w.flags;switch(w.tag){case 0:case 11:case 15:aa(x,w,u),Vu(4,w);break;case 1:if(aa(x,w,u),h=w,x=h.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(te){tn(h,h.return,te)}if(h=w,x=h.updateQueue,x!==null){var P=h.stateNode;try{var q=x.shared.hiddenCallbacks;if(q!==null)for(x.shared.hiddenCallbacks=null,x=0;x<q.length;x++)gw(q[x],P)}catch(te){tn(h,h.return,te)}}u&&D&64&&Rj(w),Fu(w,w.return);break;case 27:kj(w);case 26:case 5:aa(x,w,u),u&&h===null&&D&4&&Aj(w),Fu(w,w.return);break;case 12:aa(x,w,u);break;case 31:aa(x,w,u),u&&D&4&&Lj(x,w);break;case 13:aa(x,w,u),u&&D&4&&Ij(x,w);break;case 22:w.memoizedState===null&&aa(x,w,u),Fu(w,w.return);break;case 30:break;default:aa(x,w,u)}l=l.sibling}}function $v(i,l){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&Au(u))}function Uv(i,l){i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Au(i))}function Gi(i,l,u,h){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Uj(i,l,u,h),l=l.sibling}function Uj(i,l,u,h){var x=l.flags;switch(l.tag){case 0:case 11:case 15:Gi(i,l,u,h),x&2048&&Vu(9,l);break;case 1:Gi(i,l,u,h);break;case 3:Gi(i,l,u,h),x&2048&&(i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Au(i)));break;case 12:if(x&2048){Gi(i,l,u,h),i=l.stateNode;try{var w=l.memoizedProps,D=w.id,P=w.onPostCommit;typeof P=="function"&&P(D,l.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(q){tn(l,l.return,q)}}else Gi(i,l,u,h);break;case 31:Gi(i,l,u,h);break;case 13:Gi(i,l,u,h);break;case 23:break;case 22:w=l.stateNode,D=l.alternate,l.memoizedState!==null?w._visibility&2?Gi(i,l,u,h):Hu(i,l):w._visibility&2?Gi(i,l,u,h):(w._visibility|=2,oc(i,l,u,h,(l.subtreeFlags&10256)!==0||!1)),x&2048&&$v(D,l);break;case 24:Gi(i,l,u,h),x&2048&&Uv(l.alternate,l);break;default:Gi(i,l,u,h)}}function oc(i,l,u,h,x){for(x=x&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var w=i,D=l,P=u,q=h,te=D.flags;switch(D.tag){case 0:case 11:case 15:oc(w,D,P,q,x),Vu(8,D);break;case 23:break;case 22:var fe=D.stateNode;D.memoizedState!==null?fe._visibility&2?oc(w,D,P,q,x):Hu(w,D):(fe._visibility|=2,oc(w,D,P,q,x)),x&&te&2048&&$v(D.alternate,D);break;case 24:oc(w,D,P,q,x),x&&te&2048&&Uv(D.alternate,D);break;default:oc(w,D,P,q,x)}l=l.sibling}}function Hu(i,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var u=i,h=l,x=h.flags;switch(h.tag){case 22:Hu(u,h),x&2048&&$v(h.alternate,h);break;case 24:Hu(u,h),x&2048&&Uv(h.alternate,h);break;default:Hu(u,h)}l=l.sibling}}var qu=8192;function ac(i,l,u){if(i.subtreeFlags&qu)for(i=i.child;i!==null;)Bj(i,l,u),i=i.sibling}function Bj(i,l,u){switch(i.tag){case 26:ac(i,l,u),i.flags&qu&&i.memoizedState!==null&&F3(u,qi,i.memoizedState,i.memoizedProps);break;case 5:ac(i,l,u);break;case 3:case 4:var h=qi;qi=Eh(i.stateNode.containerInfo),ac(i,l,u),qi=h;break;case 22:i.memoizedState===null&&(h=i.alternate,h!==null&&h.memoizedState!==null?(h=qu,qu=16777216,ac(i,l,u),qu=h):ac(i,l,u));break;default:ac(i,l,u)}}function Vj(i){var l=i.alternate;if(l!==null&&(i=l.child,i!==null)){l.child=null;do l=i.sibling,i.sibling=null,i=l;while(i!==null)}}function Gu(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var h=l[u];rr=h,Hj(h,i)}Vj(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Fj(i),i=i.sibling}function Fj(i){switch(i.tag){case 0:case 11:case 15:Gu(i),i.flags&2048&&Va(9,i,i.return);break;case 3:Gu(i);break;case 12:Gu(i);break;case 22:var l=i.stateNode;i.memoizedState!==null&&l._visibility&2&&(i.return===null||i.return.tag!==13)?(l._visibility&=-3,fh(i)):Gu(i);break;default:Gu(i)}}function fh(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var h=l[u];rr=h,Hj(h,i)}Vj(i)}for(i=i.child;i!==null;){switch(l=i,l.tag){case 0:case 11:case 15:Va(8,l,l.return),fh(l);break;case 22:u=l.stateNode,u._visibility&2&&(u._visibility&=-3,fh(l));break;default:fh(l)}i=i.sibling}}function Hj(i,l){for(;rr!==null;){var u=rr;switch(u.tag){case 0:case 11:case 15:Va(8,u,l);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Au(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,rr=h;else e:for(u=i;rr!==null;){h=rr;var x=h.sibling,w=h.return;if(Oj(h),h===u){rr=null;break e}if(x!==null){x.return=w,rr=x;break e}rr=w}}}var i3={getCacheForType:function(i){var l=ur(Yn),u=l.data.get(i);return u===void 0&&(u=i(),l.data.set(i,u)),u},cacheSignal:function(){return ur(Yn).controller.signal}},o3=typeof WeakMap=="function"?WeakMap:Map,Gt=0,un=null,Rt=null,kt=0,en=0,ai=null,Fa=!1,sc=!1,Bv=!1,sa=0,Mn=0,Ha=0,Gs=0,Vv=0,si=0,lc=0,Qu=null,Hr=null,Fv=!1,hh=0,qj=0,ph=1/0,mh=null,qa=null,er=0,Ga=null,cc=null,la=0,Hv=0,qv=null,Gj=null,Wu=0,Gv=null;function li(){return(Gt&2)!==0&&kt!==0?kt&-kt:O.T!==null?Jv():De()}function Qj(){if(si===0)if((kt&536870912)===0||Ot){var i=qo;qo<<=1,(qo&3932160)===0&&(qo=262144),si=i}else si=536870912;return i=ii.current,i!==null&&(i.flags|=32),si}function qr(i,l,u){(i===un&&(en===2||en===9)||i.cancelPendingCommit!==null)&&(uc(i,0),Qa(i,kt,si,!1)),Go(i,u),((Gt&2)===0||i!==un)&&(i===un&&((Gt&2)===0&&(Gs|=u),Mn===4&&Qa(i,kt,si,!1)),mo(i))}function Wj(i,l,u){if((Gt&6)!==0)throw Error(r(327));var h=!u&&(l&127)===0&&(l&i.expiredLanes)===0||sr(i,l),x=h?l3(i,l):Wv(i,l,!0),w=h;do{if(x===0){sc&&!h&&Qa(i,l,0,!1);break}else{if(u=i.current.alternate,w&&!a3(u)){x=Wv(i,l,!1),w=!1;continue}if(x===2){if(w=l,i.errorRecoveryDisabledLanes&w)var D=0;else D=i.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){l=D;e:{var P=i;x=Qu;var q=P.current.memoizedState.isDehydrated;if(q&&(uc(P,D).flags|=256),D=Wv(P,D,!1),D!==2){if(Bv&&!q){P.errorRecoveryDisabledLanes|=w,Gs|=w,x=4;break e}w=Hr,Hr=x,w!==null&&(Hr===null?Hr=w:Hr.push.apply(Hr,w))}x=D}if(w=!1,x!==2)continue}}if(x===1){uc(i,0),Qa(i,l,0,!0);break}e:{switch(h=i,w=x,w){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Qa(h,l,si,!Fa);break e;case 2:Hr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(x=hh+300-pe(),10<x)){if(Qa(h,l,si,!Fa),Vi(h,0,!0)!==0)break e;la=l,h.timeoutHandle=EC(Yj.bind(null,h,u,Hr,mh,Fv,l,si,Gs,lc,Fa,w,"Throttled",-0,0),x);break e}Yj(h,u,Hr,mh,Fv,l,si,Gs,lc,Fa,w,null,-0,0)}}break}while(!0);mo(i)}function Yj(i,l,u,h,x,w,D,P,q,te,fe,ve,re,se){if(i.timeoutHandle=-1,ve=l.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qo},Bj(l,w,ve);var Ge=(w&62914560)===w?hh-pe():(w&4194048)===w?qj-pe():0;if(Ge=H3(ve,Ge),Ge!==null){la=w,i.cancelPendingCommit=Ge(rC.bind(null,i,l,w,u,h,x,D,P,q,fe,ve,null,re,se)),Qa(i,w,D,!te);return}}rC(i,l,w,u,h,x,D,P,q)}function a3(i){for(var l=i;;){var u=l.tag;if((u===0||u===11||u===15)&&l.flags&16384&&(u=l.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var x=u[h],w=x.getSnapshot;x=x.value;try{if(!ni(w(),x))return!1}catch{return!1}}if(u=l.child,l.subtreeFlags&16384&&u!==null)u.return=l,l=u;else{if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Qa(i,l,u,h){l&=~Vv,l&=~Gs,i.suspendedLanes|=l,i.pingedLanes&=~l,h&&(i.warmLanes|=l),h=i.expirationTimes;for(var x=l;0<x;){var w=31-Tn(x),D=1<<w;h[w]=-1,x&=~D}u!==0&&Ml(i,u,l)}function gh(){return(Gt&6)===0?(Yu(0),!1):!0}function Qv(){if(Rt!==null){if(en===0)var i=Rt.return;else i=Rt,Xo=Is=null,cv(i),ec=null,ku=0,i=Rt;for(;i!==null;)Tj(i.alternate,i),i=i.return;Rt=null}}function uc(i,l){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,T3(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),la=0,Qv(),un=i,Rt=u=Yo(i.current,null),kt=l,en=0,ai=null,Fa=!1,sc=sr(i,l),Bv=!1,lc=si=Vv=Gs=Ha=Mn=0,Hr=Qu=null,Fv=!1,(l&8)!==0&&(l|=l&32);var h=i.entangledLanes;if(h!==0)for(i=i.entanglements,h&=l;0<h;){var x=31-Tn(h),w=1<<x;l|=i[x],h&=~w}return sa=l,If(),u}function Kj(i,l){xt=null,O.H=$u,l===Zl||l===qf?(l=fw(),en=3):l===Xg?(l=fw(),en=4):en=l===Ev?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,ai=l,Rt===null&&(Mn=1,oh(i,bi(l,i.current)))}function Xj(){var i=ii.current;return i===null?!0:(kt&4194048)===kt?Ci===null:(kt&62914560)===kt||(kt&536870912)!==0?i===Ci:!1}function Jj(){var i=O.H;return O.H=$u,i===null?$u:i}function Zj(){var i=O.A;return O.A=i3,i}function vh(){Mn=4,Fa||(kt&4194048)!==kt&&ii.current!==null||(sc=!0),(Ha&134217727)===0&&(Gs&134217727)===0||un===null||Qa(un,kt,si,!1)}function Wv(i,l,u){var h=Gt;Gt|=2;var x=Jj(),w=Zj();(un!==i||kt!==l)&&(mh=null,uc(i,l)),l=!1;var D=Mn;e:do try{if(en!==0&&Rt!==null){var P=Rt,q=ai;switch(en){case 8:Qv(),D=6;break e;case 3:case 2:case 9:case 6:ii.current===null&&(l=!0);var te=en;if(en=0,ai=null,dc(i,P,q,te),u&&sc){D=0;break e}break;default:te=en,en=0,ai=null,dc(i,P,q,te)}}s3(),D=Mn;break}catch(fe){Kj(i,fe)}while(!0);return l&&i.shellSuspendCounter++,Xo=Is=null,Gt=h,O.H=x,O.A=w,Rt===null&&(un=null,kt=0,If()),D}function s3(){for(;Rt!==null;)eC(Rt)}function l3(i,l){var u=Gt;Gt|=2;var h=Jj(),x=Zj();un!==i||kt!==l?(mh=null,ph=pe()+500,uc(i,l)):sc=sr(i,l);e:do try{if(en!==0&&Rt!==null){l=Rt;var w=ai;t:switch(en){case 1:en=0,ai=null,dc(i,l,w,1);break;case 2:case 9:if(uw(w)){en=0,ai=null,tC(l);break}l=function(){en!==2&&en!==9||un!==i||(en=7),mo(i)},w.then(l,l);break e;case 3:en=7;break e;case 4:en=5;break e;case 7:uw(w)?(en=0,ai=null,tC(l)):(en=0,ai=null,dc(i,l,w,7));break;case 5:var D=null;switch(Rt.tag){case 26:D=Rt.memoizedState;case 5:case 27:var P=Rt;if(D?UC(D):P.stateNode.complete){en=0,ai=null;var q=P.sibling;if(q!==null)Rt=q;else{var te=P.return;te!==null?(Rt=te,yh(te)):Rt=null}break t}}en=0,ai=null,dc(i,l,w,5);break;case 6:en=0,ai=null,dc(i,l,w,6);break;case 8:Qv(),Mn=6;break e;default:throw Error(r(462))}}c3();break}catch(fe){Kj(i,fe)}while(!0);return Xo=Is=null,O.H=h,O.A=x,Gt=u,Rt!==null?0:(un=null,kt=0,If(),Mn)}function c3(){for(;Rt!==null&&!nt();)eC(Rt)}function eC(i){var l=Cj(i.alternate,i,sa);i.memoizedProps=i.pendingProps,l===null?yh(i):Rt=l}function tC(i){var l=i,u=l.alternate;switch(l.tag){case 15:case 0:l=yj(u,l,l.pendingProps,l.type,void 0,kt);break;case 11:l=yj(u,l,l.pendingProps,l.type.render,l.ref,kt);break;case 5:cv(l);default:Tj(u,l),l=Rt=Z1(l,sa),l=Cj(u,l,sa)}i.memoizedProps=i.pendingProps,l===null?yh(i):Rt=l}function dc(i,l,u,h){Xo=Is=null,cv(l),ec=null,ku=0;var x=l.return;try{if(XO(i,x,l,u,kt)){Mn=1,oh(i,bi(u,i.current)),Rt=null;return}}catch(w){if(x!==null)throw Rt=x,w;Mn=1,oh(i,bi(u,i.current)),Rt=null;return}l.flags&32768?(Ot||h===1?i=!0:sc||(kt&536870912)!==0?i=!1:(Fa=i=!0,(h===2||h===9||h===3||h===6)&&(h=ii.current,h!==null&&h.tag===13&&(h.flags|=16384))),nC(l,i)):yh(l)}function yh(i){var l=i;do{if((l.flags&32768)!==0){nC(l,Fa);return}i=l.return;var u=e3(l.alternate,l,sa);if(u!==null){Rt=u;return}if(l=l.sibling,l!==null){Rt=l;return}Rt=l=i}while(l!==null);Mn===0&&(Mn=5)}function nC(i,l){do{var u=t3(i.alternate,i);if(u!==null){u.flags&=32767,Rt=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!l&&(i=i.sibling,i!==null)){Rt=i;return}Rt=i=u}while(i!==null);Mn=6,Rt=null}function rC(i,l,u,h,x,w,D,P,q){i.cancelPendingCommit=null;do xh();while(er!==0);if((Gt&6)!==0)throw Error(r(327));if(l!==null){if(l===i.current)throw Error(r(177));if(w=l.lanes|l.childLanes,w|=Lg,gu(i,u,w,D,P,q),i===un&&(Rt=un=null,kt=0),cc=l,Ga=i,la=u,Hv=w,qv=x,Gj=h,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,h3(At,function(){return lC(),null})):(i.callbackNode=null,i.callbackPriority=0),h=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||h){h=O.T,O.T=null,x=I.p,I.p=2,D=Gt,Gt|=4;try{n3(i,l,u)}finally{Gt=D,I.p=x,O.T=h}}er=1,iC(),oC(),aC()}}function iC(){if(er===1){er=0;var i=Ga,l=cc,u=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||u){u=O.T,O.T=null;var h=I.p;I.p=2;var x=Gt;Gt|=4;try{zj(l,i);var w=ay,D=H1(i.containerInfo),P=w.focusedElem,q=w.selectionRange;if(D!==P&&P&&P.ownerDocument&&F1(P.ownerDocument.documentElement,P)){if(q!==null&&kg(P)){var te=q.start,fe=q.end;if(fe===void 0&&(fe=te),"selectionStart"in P)P.selectionStart=te,P.selectionEnd=Math.min(fe,P.value.length);else{var ve=P.ownerDocument||document,re=ve&&ve.defaultView||window;if(re.getSelection){var se=re.getSelection(),Ge=P.textContent.length,ct=Math.min(q.start,Ge),sn=q.end===void 0?ct:Math.min(q.end,Ge);!se.extend&&ct>sn&&(D=sn,sn=ct,ct=D);var Z=V1(P,ct),Q=V1(P,sn);if(Z&&Q&&(se.rangeCount!==1||se.anchorNode!==Z.node||se.anchorOffset!==Z.offset||se.focusNode!==Q.node||se.focusOffset!==Q.offset)){var ee=ve.createRange();ee.setStart(Z.node,Z.offset),se.removeAllRanges(),ct>sn?(se.addRange(ee),se.extend(Q.node,Q.offset)):(ee.setEnd(Q.node,Q.offset),se.addRange(ee))}}}}for(ve=[],se=P;se=se.parentNode;)se.nodeType===1&&ve.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<ve.length;P++){var me=ve[P];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}kh=!!oy,ay=oy=null}finally{Gt=x,I.p=h,O.T=u}}i.current=l,er=2}}function oC(){if(er===2){er=0;var i=Ga,l=cc,u=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||u){u=O.T,O.T=null;var h=I.p;I.p=2;var x=Gt;Gt|=4;try{Nj(i,l.alternate,l)}finally{Gt=x,I.p=h,O.T=u}}er=3}}function aC(){if(er===4||er===3){er=0,ft();var i=Ga,l=cc,u=la,h=Gj;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?er=5:(er=0,cc=Ga=null,sC(i,i.pendingLanes));var x=i.pendingLanes;if(x===0&&(qa=null),we(u),l=l.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(gr,l,void 0,(l.current.flags&128)===128)}catch{}if(h!==null){l=O.T,x=I.p,I.p=2,O.T=null;try{for(var w=i.onRecoverableError,D=0;D<h.length;D++){var P=h[D];w(P.value,{componentStack:P.stack})}}finally{O.T=l,I.p=x}}(la&3)!==0&&xh(),mo(i),x=i.pendingLanes,(u&261930)!==0&&(x&42)!==0?i===Gv?Wu++:(Wu=0,Gv=i):Wu=0,Yu(0)}}function sC(i,l){(i.pooledCacheLanes&=l)===0&&(l=i.pooledCache,l!=null&&(i.pooledCache=null,Au(l)))}function xh(){return iC(),oC(),aC(),lC()}function lC(){if(er!==5)return!1;var i=Ga,l=Hv;Hv=0;var u=we(la),h=O.T,x=I.p;try{I.p=32>u?32:u,O.T=null,u=qv,qv=null;var w=Ga,D=la;if(er=0,cc=Ga=null,la=0,(Gt&6)!==0)throw Error(r(331));var P=Gt;if(Gt|=4,Fj(w.current),Uj(w,w.current,D,u),Gt=P,Yu(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(gr,w)}catch{}return!0}finally{I.p=x,O.T=h,sC(i,l)}}function cC(i,l,u){l=bi(u,l),l=Cv(i.stateNode,l,2),i=$a(i,l,2),i!==null&&(Go(i,2),mo(i))}function tn(i,l,u){if(i.tag===3)cC(i,i,u);else for(;l!==null;){if(l.tag===3){cC(l,i,u);break}else if(l.tag===1){var h=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(qa===null||!qa.has(h))){i=bi(u,i),u=uj(2),h=$a(l,u,2),h!==null&&(dj(u,h,l,i),Go(h,2),mo(h));break}}l=l.return}}function Yv(i,l,u){var h=i.pingCache;if(h===null){h=i.pingCache=new o3;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(u)||(Bv=!0,x.add(u),i=u3.bind(null,i,l,u),l.then(i,i))}function u3(i,l,u){var h=i.pingCache;h!==null&&h.delete(l),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,un===i&&(kt&u)===u&&(Mn===4||Mn===3&&(kt&62914560)===kt&&300>pe()-hh?(Gt&2)===0&&uc(i,0):Vv|=u,lc===kt&&(lc=0)),mo(i)}function uC(i,l){l===0&&(l=Vn()),i=Os(i,l),i!==null&&(Go(i,l),mo(i))}function d3(i){var l=i.memoizedState,u=0;l!==null&&(u=l.retryLane),uC(i,u)}function f3(i,l){var u=0;switch(i.tag){case 31:case 13:var h=i.stateNode,x=i.memoizedState;x!==null&&(u=x.retryLane);break;case 19:h=i.stateNode;break;case 22:h=i.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(l),uC(i,u)}function h3(i,l){return Me(i,l)}var bh=null,fc=null,Kv=!1,Sh=!1,Xv=!1,Wa=0;function mo(i){i!==fc&&i.next===null&&(fc===null?bh=fc=i:fc=fc.next=i),Sh=!0,Kv||(Kv=!0,m3())}function Yu(i,l){if(!Xv&&Sh){Xv=!0;do for(var u=!1,h=bh;h!==null;){if(i!==0){var x=h.pendingLanes;if(x===0)var w=0;else{var D=h.suspendedLanes,P=h.pingedLanes;w=(1<<31-Tn(42|i)+1)-1,w&=x&~(D&~P),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(u=!0,pC(h,w))}else w=kt,w=Vi(h,h===un?w:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(w&3)===0||sr(h,w)||(u=!0,pC(h,w));h=h.next}while(u);Xv=!1}}function p3(){dC()}function dC(){Sh=Kv=!1;var i=0;Wa!==0&&E3()&&(i=Wa);for(var l=pe(),u=null,h=bh;h!==null;){var x=h.next,w=fC(h,l);w===0?(h.next=null,u===null?bh=x:u.next=x,x===null&&(fc=u)):(u=h,(i!==0||(w&3)!==0)&&(Sh=!0)),h=x}er!==0&&er!==5||Yu(i),Wa!==0&&(Wa=0)}function fC(i,l){for(var u=i.suspendedLanes,h=i.pingedLanes,x=i.expirationTimes,w=i.pendingLanes&-62914561;0<w;){var D=31-Tn(w),P=1<<D,q=x[D];q===-1?((P&u)===0||(P&h)!==0)&&(x[D]=As(P,l)):q<=l&&(i.expiredLanes|=P),w&=~P}if(l=un,u=kt,u=Vi(i,i===l?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h=i.callbackNode,u===0||i===l&&(en===2||en===9)||i.cancelPendingCommit!==null)return h!==null&&h!==null&<(h),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||sr(i,u)){if(l=u&-u,l===i.callbackPriority)return l;switch(h!==null&<(h),we(u)){case 2:case 8:u=ke;break;case 32:u=At;break;case 268435456:u=vn;break;default:u=At}return h=hC.bind(null,i),u=Me(u,h),i.callbackPriority=l,i.callbackNode=u,l}return h!==null&&h!==null&<(h),i.callbackPriority=2,i.callbackNode=null,2}function hC(i,l){if(er!==0&&er!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(xh()&&i.callbackNode!==u)return null;var h=kt;return h=Vi(i,i===un?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h===0?null:(Wj(i,h,l),fC(i,pe()),i.callbackNode!=null&&i.callbackNode===u?hC.bind(null,i):null)}function pC(i,l){if(xh())return null;Wj(i,l,!0)}function m3(){R3(function(){(Gt&6)!==0?Me(je,p3):dC()})}function Jv(){if(Wa===0){var i=Xl;i===0&&(i=zr,zr<<=1,(zr&261888)===0&&(zr=256)),Wa=i}return Wa}function mC(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Af(""+i)}function gC(i,l){var u=l.ownerDocument.createElement("input");return u.name=l.name,u.value=l.value,i.id&&u.setAttribute("form",i.id),l.parentNode.insertBefore(u,l),i=new FormData(i),u.parentNode.removeChild(u),i}function g3(i,l,u,h,x){if(l==="submit"&&u&&u.stateNode===x){var w=mC((x[ze]||null).action),D=h.submitter;D&&(l=(l=D[ze]||null)?mC(l.formAction):D.getAttribute("formAction"),l!==null&&(w=l,D=null));var P=new Nf("action","action",null,h,x);i.push({event:P,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Wa!==0){var q=D?gC(x,D):new FormData(x);yv(u,{pending:!0,data:q,method:x.method,action:w},null,q)}}else typeof w=="function"&&(P.preventDefault(),q=D?gC(x,D):new FormData(x),yv(u,{pending:!0,data:q,method:x.method,action:w},w,q))},currentTarget:x}]})}}for(var Zv=0;Zv<Mg.length;Zv++){var ey=Mg[Zv],v3=ey.toLowerCase(),y3=ey[0].toUpperCase()+ey.slice(1);Hi(v3,"on"+y3)}Hi(Q1,"onAnimationEnd"),Hi(W1,"onAnimationIteration"),Hi(Y1,"onAnimationStart"),Hi("dblclick","onDoubleClick"),Hi("focusin","onFocus"),Hi("focusout","onBlur"),Hi(OO,"onTransitionRun"),Hi(MO,"onTransitionStart"),Hi(LO,"onTransitionCancel"),Hi(K1,"onTransitionEnd"),$r("onMouseEnter",["mouseout","mouseover"]),$r("onMouseLeave",["mouseout","mouseover"]),$r("onPointerEnter",["pointerout","pointerover"]),$r("onPointerLeave",["pointerout","pointerover"]),ti("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ti("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ti("onBeforeInput",["compositionend","keypress","textInput","paste"]),ti("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ti("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ti("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ku="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(" "),x3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ku));function vC(i,l){l=(l&4)!==0;for(var u=0;u<i.length;u++){var h=i[u],x=h.event;h=h.listeners;e:{var w=void 0;if(l)for(var D=h.length-1;0<=D;D--){var P=h[D],q=P.instance,te=P.currentTarget;if(P=P.listener,q!==w&&x.isPropagationStopped())break e;w=P,x.currentTarget=te;try{w(x)}catch(fe){Lf(fe)}x.currentTarget=null,w=q}else for(D=0;D<h.length;D++){if(P=h[D],q=P.instance,te=P.currentTarget,P=P.listener,q!==w&&x.isPropagationStopped())break e;w=P,x.currentTarget=te;try{w(x)}catch(fe){Lf(fe)}x.currentTarget=null,w=q}}}}function _t(i,l){var u=l[et];u===void 0&&(u=l[et]=new Set);var h=i+"__bubble";u.has(h)||(yC(l,i,2,!1),u.add(h))}function ty(i,l,u){var h=0;l&&(h|=4),yC(u,i,h,l)}var wh="_reactListening"+Math.random().toString(36).slice(2);function ny(i){if(!i[wh]){i[wh]=!0,ei.forEach(function(u){u!=="selectionchange"&&(x3.has(u)||ty(u,!1,i),ty(u,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[wh]||(l[wh]=!0,ty("selectionchange",!1,l))}}function yC(i,l,u,h){switch(QC(l)){case 2:var x=Q3;break;case 8:x=W3;break;default:x=vy}u=x.bind(null,l,u,i),x=void 0,!wg||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(x=!0),h?x!==void 0?i.addEventListener(l,u,{capture:!0,passive:x}):i.addEventListener(l,u,!0):x!==void 0?i.addEventListener(l,u,{passive:x}):i.addEventListener(l,u,!1)}function ry(i,l,u,h,x){var w=h;if((l&1)===0&&(l&2)===0&&h!==null)e:for(;;){if(h===null)return;var D=h.tag;if(D===3||D===4){var P=h.stateNode.containerInfo;if(P===x)break;if(D===4)for(D=h.return;D!==null;){var q=D.tag;if((q===3||q===4)&&D.stateNode.containerInfo===x)return;D=D.return}for(;P!==null;){if(D=It(P),D===null)return;if(q=D.tag,q===5||q===6||q===26||q===27){h=w=D;continue e}P=P.parentNode}}h=h.return}j1(function(){var te=w,fe=bg(u),ve=[];e:{var re=X1.get(i);if(re!==void 0){var se=Nf,Ge=i;switch(i){case"keypress":if(kf(u)===0)break e;case"keydown":case"keyup":se=fO;break;case"focusin":Ge="focus",se=Tg;break;case"focusout":Ge="blur",se=Tg;break;case"beforeblur":case"afterblur":se=Tg;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=T1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=eO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=mO;break;case Q1:case W1:case Y1:se=rO;break;case K1:se=vO;break;case"scroll":case"scrollend":se=JN;break;case"wheel":se=xO;break;case"copy":case"cut":case"paste":se=oO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=_1;break;case"toggle":case"beforetoggle":se=SO}var ct=(l&4)!==0,sn=!ct&&(i==="scroll"||i==="scrollend"),Z=ct?re!==null?re+"Capture":null:re;ct=[];for(var Q=te,ee;Q!==null;){var me=Q;if(ee=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||ee===null||Z===null||(me=yu(Q,Z),me!=null&&ct.push(Xu(Q,me,ee))),sn)break;Q=Q.return}0<ct.length&&(re=new se(re,Ge,null,u,fe),ve.push({event:re,listeners:ct}))}}if((l&7)===0){e:{if(re=i==="mouseover"||i==="pointerover",se=i==="mouseout"||i==="pointerout",re&&u!==xg&&(Ge=u.relatedTarget||u.fromElement)&&(It(Ge)||Ge[Xe]))break e;if((se||re)&&(re=fe.window===fe?fe:(re=fe.ownerDocument)?re.defaultView||re.parentWindow:window,se?(Ge=u.relatedTarget||u.toElement,se=te,Ge=Ge?It(Ge):null,Ge!==null&&(sn=s(Ge),ct=Ge.tag,Ge!==sn||ct!==5&&ct!==27&&ct!==6)&&(Ge=null)):(se=null,Ge=te),se!==Ge)){if(ct=T1,me="onMouseLeave",Z="onMouseEnter",Q="mouse",(i==="pointerout"||i==="pointerover")&&(ct=_1,me="onPointerLeave",Z="onPointerEnter",Q="pointer"),sn=se==null?re:Zr(se),ee=Ge==null?re:Zr(Ge),re=new ct(me,Q+"leave",se,u,fe),re.target=sn,re.relatedTarget=ee,me=null,It(fe)===te&&(ct=new ct(Z,Q+"enter",Ge,u,fe),ct.target=ee,ct.relatedTarget=sn,me=ct),sn=me,se&&Ge)t:{for(ct=b3,Z=se,Q=Ge,ee=0,me=Z;me;me=ct(me))ee++;me=0;for(var at=Q;at;at=ct(at))me++;for(;0<ee-me;)Z=ct(Z),ee--;for(;0<me-ee;)Q=ct(Q),me--;for(;ee--;){if(Z===Q||Q!==null&&Z===Q.alternate){ct=Z;break t}Z=ct(Z),Q=ct(Q)}ct=null}else ct=null;se!==null&&xC(ve,re,se,ct,!1),Ge!==null&&sn!==null&&xC(ve,sn,Ge,ct,!0)}}e:{if(re=te?Zr(te):window,se=re.nodeName&&re.nodeName.toLowerCase(),se==="select"||se==="input"&&re.type==="file")var Vt=L1;else if(O1(re))if(I1)Vt=kO;else{Vt=AO;var Je=_O}else se=re.nodeName,!se||se.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?te&&yg(te.elementType)&&(Vt=L1):Vt=DO;if(Vt&&(Vt=Vt(i,te))){M1(ve,Vt,u,fe);break e}Je&&Je(i,re,te),i==="focusout"&&te&&re.type==="number"&&te.memoizedProps.value!=null&&vg(re,"number",re.value)}switch(Je=te?Zr(te):window,i){case"focusin":(O1(Je)||Je.contentEditable==="true")&&(Fl=Je,Pg=te,Tu=null);break;case"focusout":Tu=Pg=Fl=null;break;case"mousedown":Ng=!0;break;case"contextmenu":case"mouseup":case"dragend":Ng=!1,q1(ve,u,fe);break;case"selectionchange":if(NO)break;case"keydown":case"keyup":q1(ve,u,fe)}var St;if(_g)e:{switch(i){case"compositionstart":var Pt="onCompositionStart";break e;case"compositionend":Pt="onCompositionEnd";break e;case"compositionupdate":Pt="onCompositionUpdate";break e}Pt=void 0}else Vl?P1(i,u)&&(Pt="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(Pt="onCompositionStart");Pt&&(A1&&u.locale!=="ko"&&(Vl||Pt!=="onCompositionStart"?Pt==="onCompositionEnd"&&Vl&&(St=C1()):(Pa=fe,jg="value"in Pa?Pa.value:Pa.textContent,Vl=!0)),Je=jh(te,Pt),0<Je.length&&(Pt=new R1(Pt,i,null,u,fe),ve.push({event:Pt,listeners:Je}),St?Pt.data=St:(St=N1(u),St!==null&&(Pt.data=St)))),(St=jO?CO(i,u):EO(i,u))&&(Pt=jh(te,"onBeforeInput"),0<Pt.length&&(Je=new R1("onBeforeInput","beforeinput",null,u,fe),ve.push({event:Je,listeners:Pt}),Je.data=St)),g3(ve,i,te,u,fe)}vC(ve,l)})}function Xu(i,l,u){return{instance:i,listener:l,currentTarget:u}}function jh(i,l){for(var u=l+"Capture",h=[];i!==null;){var x=i,w=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||w===null||(x=yu(i,u),x!=null&&h.unshift(Xu(i,x,w)),x=yu(i,l),x!=null&&h.push(Xu(i,x,w))),i.tag===3)return h;i=i.return}return[]}function b3(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function xC(i,l,u,h,x){for(var w=l._reactName,D=[];u!==null&&u!==h;){var P=u,q=P.alternate,te=P.stateNode;if(P=P.tag,q!==null&&q===h)break;P!==5&&P!==26&&P!==27||te===null||(q=te,x?(te=yu(u,w),te!=null&&D.unshift(Xu(u,te,q))):x||(te=yu(u,w),te!=null&&D.push(Xu(u,te,q)))),u=u.return}D.length!==0&&i.push({event:l,listeners:D})}var S3=/\r\n?/g,w3=/\u0000|\uFFFD/g;function bC(i){return(typeof i=="string"?i:""+i).replace(S3,`
|
|
242
|
+
`).replace(w3,"")}function SC(i,l){return l=bC(l),bC(i)===l}function an(i,l,u,h,x,w){switch(u){case"children":typeof h=="string"?l==="body"||l==="textarea"&&h===""||$l(i,h):(typeof h=="number"||typeof h=="bigint")&&l!=="body"&&$l(i,""+h);break;case"className":vi(i,"class",h);break;case"tabIndex":vi(i,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":vi(i,u,h);break;case"style":S1(i,h,w);break;case"data":if(l!=="object"){vi(i,"data",h);break}case"src":case"href":if(h===""&&(l!=="a"||u!=="href")){i.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(u);break}h=Af(""+h),i.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){i.setAttribute(u,"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"&&(u==="formAction"?(l!=="input"&&an(i,l,"name",x.name,x,null),an(i,l,"formEncType",x.formEncType,x,null),an(i,l,"formMethod",x.formMethod,x,null),an(i,l,"formTarget",x.formTarget,x,null)):(an(i,l,"encType",x.encType,x,null),an(i,l,"method",x.method,x,null),an(i,l,"target",x.target,x,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(u);break}h=Af(""+h),i.setAttribute(u,h);break;case"onClick":h!=null&&(i.onclick=Qo);break;case"onScroll":h!=null&&_t("scroll",i);break;case"onScrollEnd":h!=null&&_t("scrollend",i);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(x.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"multiple":i.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":i.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"){i.removeAttribute("xlink:href");break}u=Af(""+h),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);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"?i.setAttribute(u,""+h):i.removeAttribute(u);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"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":h===!0?i.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(u,h):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?i.setAttribute(u,h):i.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?i.removeAttribute(u):i.setAttribute(u,h);break;case"popover":_t("beforetoggle",i),_t("toggle",i),Fi(i,"popover",h);break;case"xlinkActuate":Bt(i,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Bt(i,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Bt(i,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Bt(i,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Bt(i,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Bt(i,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Bt(i,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Bt(i,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Bt(i,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":Fi(i,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=KN.get(u)||u,Fi(i,u,h))}}function iy(i,l,u,h,x,w){switch(u){case"style":S1(i,h,w);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(x.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"children":typeof h=="string"?$l(i,h):(typeof h=="number"||typeof h=="bigint")&&$l(i,""+h);break;case"onScroll":h!=null&&_t("scroll",i);break;case"onScrollEnd":h!=null&&_t("scrollend",i);break;case"onClick":h!=null&&(i.onclick=Qo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ll.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(x=u.endsWith("Capture"),l=u.slice(2,x?u.length-7:void 0),w=i[ze]||null,w=w!=null?w[u]:null,typeof w=="function"&&i.removeEventListener(l,w,x),typeof h=="function")){typeof w!="function"&&w!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(l,h,x);break e}u in i?i[u]=h:h===!0?i.setAttribute(u,""):Fi(i,u,h)}}}function fr(i,l,u){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":_t("error",i),_t("load",i);var h=!1,x=!1,w;for(w in u)if(u.hasOwnProperty(w)){var D=u[w];if(D!=null)switch(w){case"src":h=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:an(i,l,w,D,u,null)}}x&&an(i,l,"srcSet",u.srcSet,u,null),h&&an(i,l,"src",u.src,u,null);return;case"input":_t("invalid",i);var P=w=D=x=null,q=null,te=null;for(h in u)if(u.hasOwnProperty(h)){var fe=u[h];if(fe!=null)switch(h){case"name":x=fe;break;case"type":D=fe;break;case"checked":q=fe;break;case"defaultChecked":te=fe;break;case"value":w=fe;break;case"defaultValue":P=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,l));break;default:an(i,l,h,fe,u,null)}}v1(i,w,P,q,te,D,x,!1);return;case"select":_t("invalid",i),h=D=w=null;for(x in u)if(u.hasOwnProperty(x)&&(P=u[x],P!=null))switch(x){case"value":w=P;break;case"defaultValue":D=P;break;case"multiple":h=P;default:an(i,l,x,P,u,null)}l=w,u=D,i.multiple=!!h,l!=null?zl(i,!!h,l,!1):u!=null&&zl(i,!!h,u,!0);return;case"textarea":_t("invalid",i),w=x=h=null;for(D in u)if(u.hasOwnProperty(D)&&(P=u[D],P!=null))switch(D){case"value":h=P;break;case"defaultValue":x=P;break;case"children":w=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(r(91));break;default:an(i,l,D,P,u,null)}x1(i,h,x,w);return;case"option":for(q in u)if(u.hasOwnProperty(q)&&(h=u[q],h!=null))switch(q){case"selected":i.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:an(i,l,q,h,u,null)}return;case"dialog":_t("beforetoggle",i),_t("toggle",i),_t("cancel",i),_t("close",i);break;case"iframe":case"object":_t("load",i);break;case"video":case"audio":for(h=0;h<Ku.length;h++)_t(Ku[h],i);break;case"image":_t("error",i),_t("load",i);break;case"details":_t("toggle",i);break;case"embed":case"source":case"link":_t("error",i),_t("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(te in u)if(u.hasOwnProperty(te)&&(h=u[te],h!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:an(i,l,te,h,u,null)}return;default:if(yg(l)){for(fe in u)u.hasOwnProperty(fe)&&(h=u[fe],h!==void 0&&iy(i,l,fe,h,u,void 0));return}}for(P in u)u.hasOwnProperty(P)&&(h=u[P],h!=null&&an(i,l,P,h,u,null))}function j3(i,l,u,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,D=null,P=null,q=null,te=null,fe=null;for(se in u){var ve=u[se];if(u.hasOwnProperty(se)&&ve!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":q=ve;default:h.hasOwnProperty(se)||an(i,l,se,null,h,ve)}}for(var re in h){var se=h[re];if(ve=u[re],h.hasOwnProperty(re)&&(se!=null||ve!=null))switch(re){case"type":w=se;break;case"name":x=se;break;case"checked":te=se;break;case"defaultChecked":fe=se;break;case"value":D=se;break;case"defaultValue":P=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,l));break;default:se!==ve&&an(i,l,re,se,h,ve)}}gg(i,D,P,q,te,fe,w,x);return;case"select":se=D=P=re=null;for(w in u)if(q=u[w],u.hasOwnProperty(w)&&q!=null)switch(w){case"value":break;case"multiple":se=q;default:h.hasOwnProperty(w)||an(i,l,w,null,h,q)}for(x in h)if(w=h[x],q=u[x],h.hasOwnProperty(x)&&(w!=null||q!=null))switch(x){case"value":re=w;break;case"defaultValue":P=w;break;case"multiple":D=w;default:w!==q&&an(i,l,x,w,h,q)}l=P,u=D,h=se,re!=null?zl(i,!!u,re,!1):!!h!=!!u&&(l!=null?zl(i,!!u,l,!0):zl(i,!!u,u?[]:"",!1));return;case"textarea":se=re=null;for(P in u)if(x=u[P],u.hasOwnProperty(P)&&x!=null&&!h.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:an(i,l,P,null,h,x)}for(D in h)if(x=h[D],w=u[D],h.hasOwnProperty(D)&&(x!=null||w!=null))switch(D){case"value":re=x;break;case"defaultValue":se=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:x!==w&&an(i,l,D,x,h,w)}y1(i,re,se);return;case"option":for(var Ge in u)if(re=u[Ge],u.hasOwnProperty(Ge)&&re!=null&&!h.hasOwnProperty(Ge))switch(Ge){case"selected":i.selected=!1;break;default:an(i,l,Ge,null,h,re)}for(q in h)if(re=h[q],se=u[q],h.hasOwnProperty(q)&&re!==se&&(re!=null||se!=null))switch(q){case"selected":i.selected=re&&typeof re!="function"&&typeof re!="symbol";break;default:an(i,l,q,re,h,se)}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 ct in u)re=u[ct],u.hasOwnProperty(ct)&&re!=null&&!h.hasOwnProperty(ct)&&an(i,l,ct,null,h,re);for(te in h)if(re=h[te],se=u[te],h.hasOwnProperty(te)&&re!==se&&(re!=null||se!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,l));break;default:an(i,l,te,re,h,se)}return;default:if(yg(l)){for(var sn in u)re=u[sn],u.hasOwnProperty(sn)&&re!==void 0&&!h.hasOwnProperty(sn)&&iy(i,l,sn,void 0,h,re);for(fe in h)re=h[fe],se=u[fe],!h.hasOwnProperty(fe)||re===se||re===void 0&&se===void 0||iy(i,l,fe,re,h,se);return}}for(var Z in u)re=u[Z],u.hasOwnProperty(Z)&&re!=null&&!h.hasOwnProperty(Z)&&an(i,l,Z,null,h,re);for(ve in h)re=h[ve],se=u[ve],!h.hasOwnProperty(ve)||re===se||re==null&&se==null||an(i,l,ve,re,h,se)}function wC(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function C3(){if(typeof performance.getEntriesByType=="function"){for(var i=0,l=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var x=u[h],w=x.transferSize,D=x.initiatorType,P=x.duration;if(w&&P&&wC(D)){for(D=0,P=x.responseEnd,h+=1;h<u.length;h++){var q=u[h],te=q.startTime;if(te>P)break;var fe=q.transferSize,ve=q.initiatorType;fe&&wC(ve)&&(q=q.responseEnd,D+=fe*(q<P?1:(P-te)/(q-te)))}if(--h,l+=8*(w+D)/(x.duration/1e3),i++,10<i)break}}if(0<i)return l/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var oy=null,ay=null;function Ch(i){return i.nodeType===9?i:i.ownerDocument}function jC(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function CC(i,l){if(i===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&l==="foreignObject"?0:i}function sy(i,l){return i==="textarea"||i==="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 ly=null;function E3(){var i=window.event;return i&&i.type==="popstate"?i===ly?!1:(ly=i,!0):(ly=null,!1)}var EC=typeof setTimeout=="function"?setTimeout:void 0,T3=typeof clearTimeout=="function"?clearTimeout:void 0,TC=typeof Promise=="function"?Promise:void 0,R3=typeof queueMicrotask=="function"?queueMicrotask:typeof TC<"u"?function(i){return TC.resolve(null).then(i).catch(_3)}:EC;function _3(i){setTimeout(function(){throw i})}function Ya(i){return i==="head"}function RC(i,l){var u=l,h=0;do{var x=u.nextSibling;if(i.removeChild(u),x&&x.nodeType===8)if(u=x.data,u==="/$"||u==="/&"){if(h===0){i.removeChild(x),gc(l);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")Ju(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,Ju(u);for(var w=u.firstChild;w;){var D=w.nextSibling,P=w.nodeName;w[Zt]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&w.rel.toLowerCase()==="stylesheet"||u.removeChild(w),w=D}}else u==="body"&&Ju(i.ownerDocument.body);u=x}while(u);gc(l)}function _C(i,l){var u=i;i=0;do{var h=u.nextSibling;if(u.nodeType===1?l?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(l?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(i===0)break;i--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||i++;u=h}while(u)}function cy(i){var l=i.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var u=l;switch(l=l.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":cy(u),Rn(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function A3(i,l,u,h){for(;i.nodeType===1;){var x=u;if(i.nodeName.toLowerCase()!==l.toLowerCase()){if(!h&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(h){if(!i[Zt])switch(l){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(w=i.getAttribute("rel"),w==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(w!==x.rel||i.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||i.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||i.getAttribute("title")!==(x.title==null?null:x.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(w=i.getAttribute("src"),(w!==(x.src==null?null:x.src)||i.getAttribute("type")!==(x.type==null?null:x.type)||i.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&w&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(l==="input"&&i.type==="hidden"){var w=x.name==null?null:""+x.name;if(x.type==="hidden"&&i.getAttribute("name")===w)return i}else return i;if(i=Ei(i.nextSibling),i===null)break}return null}function D3(i,l,u){if(l==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=Ei(i.nextSibling),i===null))return null;return i}function AC(i,l){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!l||(i=Ei(i.nextSibling),i===null))return null;return i}function uy(i){return i.data==="$?"||i.data==="$~"}function dy(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function k3(i,l){var u=i.ownerDocument;if(i.data==="$~")i._reactRetry=l;else if(i.data!=="$?"||u.readyState!=="loading")l();else{var h=function(){l(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),i._reactRetry=h}}function Ei(i){for(;i!=null;i=i.nextSibling){var l=i.nodeType;if(l===1||l===3)break;if(l===8){if(l=i.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return i}var fy=null;function DC(i){i=i.nextSibling;for(var l=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(l===0)return Ei(i.nextSibling);l--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||l++}i=i.nextSibling}return null}function kC(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(l===0)return i;l--}else u!=="/$"&&u!=="/&"||l++}i=i.previousSibling}return null}function PC(i,l,u){switch(l=Ch(u),i){case"html":if(i=l.documentElement,!i)throw Error(r(452));return i;case"head":if(i=l.head,!i)throw Error(r(453));return i;case"body":if(i=l.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function Ju(i){for(var l=i.attributes;l.length;)i.removeAttributeNode(l[0]);Rn(i)}var Ti=new Map,NC=new Set;function Eh(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var ca=I.d;I.d={f:P3,r:N3,D:O3,C:M3,L:L3,m:I3,X:$3,S:z3,M:U3};function P3(){var i=ca.f(),l=gh();return i||l}function N3(i){var l=Ut(i);l!==null&&l.tag===5&&l.type==="form"?Kw(l):ca.r(i)}var hc=typeof document>"u"?null:document;function OC(i,l,u){var h=hc;if(h&&typeof l=="string"&&l){var x=yi(l);x='link[rel="'+i+'"][href="'+x+'"]',typeof u=="string"&&(x+='[crossorigin="'+u+'"]'),NC.has(x)||(NC.add(x),i={rel:i,crossOrigin:u,href:l},h.querySelector(x)===null&&(l=h.createElement("link"),fr(l,"link",i),cn(l),h.head.appendChild(l)))}}function O3(i){ca.D(i),OC("dns-prefetch",i,null)}function M3(i,l){ca.C(i,l),OC("preconnect",i,l)}function L3(i,l,u){ca.L(i,l,u);var h=hc;if(h&&i&&l){var x='link[rel="preload"][as="'+yi(l)+'"]';l==="image"&&u&&u.imageSrcSet?(x+='[imagesrcset="'+yi(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(x+='[imagesizes="'+yi(u.imageSizes)+'"]')):x+='[href="'+yi(i)+'"]';var w=x;switch(l){case"style":w=pc(i);break;case"script":w=mc(i)}Ti.has(w)||(i=g({rel:"preload",href:l==="image"&&u&&u.imageSrcSet?void 0:i,as:l},u),Ti.set(w,i),h.querySelector(x)!==null||l==="style"&&h.querySelector(Zu(w))||l==="script"&&h.querySelector(ed(w))||(l=h.createElement("link"),fr(l,"link",i),cn(l),h.head.appendChild(l)))}}function I3(i,l){ca.m(i,l);var u=hc;if(u&&i){var h=l&&typeof l.as=="string"?l.as:"script",x='link[rel="modulepreload"][as="'+yi(h)+'"][href="'+yi(i)+'"]',w=x;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=mc(i)}if(!Ti.has(w)&&(i=g({rel:"modulepreload",href:i},l),Ti.set(w,i),u.querySelector(x)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(ed(w)))return}h=u.createElement("link"),fr(h,"link",i),cn(h),u.head.appendChild(h)}}}function z3(i,l,u){ca.S(i,l,u);var h=hc;if(h&&i){var x=gi(h).hoistableStyles,w=pc(i);l=l||"default";var D=x.get(w);if(!D){var P={loading:0,preload:null};if(D=h.querySelector(Zu(w)))P.loading=5;else{i=g({rel:"stylesheet",href:i,"data-precedence":l},u),(u=Ti.get(w))&&hy(i,u);var q=D=h.createElement("link");cn(q),fr(q,"link",i),q._p=new Promise(function(te,fe){q.onload=te,q.onerror=fe}),q.addEventListener("load",function(){P.loading|=1}),q.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Th(D,l,h)}D={type:"stylesheet",instance:D,count:1,state:P},x.set(w,D)}}}function $3(i,l){ca.X(i,l);var u=hc;if(u&&i){var h=gi(u).hoistableScripts,x=mc(i),w=h.get(x);w||(w=u.querySelector(ed(x)),w||(i=g({src:i,async:!0},l),(l=Ti.get(x))&&py(i,l),w=u.createElement("script"),cn(w),fr(w,"link",i),u.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(x,w))}}function U3(i,l){ca.M(i,l);var u=hc;if(u&&i){var h=gi(u).hoistableScripts,x=mc(i),w=h.get(x);w||(w=u.querySelector(ed(x)),w||(i=g({src:i,async:!0,type:"module"},l),(l=Ti.get(x))&&py(i,l),w=u.createElement("script"),cn(w),fr(w,"link",i),u.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(x,w))}}function MC(i,l,u,h){var x=(x=Se.current)?Eh(x):null;if(!x)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(l=pc(u.href),u=gi(x).hoistableStyles,h=u.get(l),h||(h={type:"style",instance:null,count:0,state:null},u.set(l,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=pc(u.href);var w=gi(x).hoistableStyles,D=w.get(i);if(D||(x=x.ownerDocument||x,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(i,D),(w=x.querySelector(Zu(i)))&&!w._p&&(D.instance=w,D.state.loading=5),Ti.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Ti.set(i,u),w||B3(x,i,u,D.state))),l&&h===null)throw Error(r(528,""));return D}if(l&&h!==null)throw Error(r(529,""));return null;case"script":return l=u.async,u=u.src,typeof u=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=mc(u),u=gi(x).hoistableScripts,h=u.get(l),h||(h={type:"script",instance:null,count:0,state:null},u.set(l,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function pc(i){return'href="'+yi(i)+'"'}function Zu(i){return'link[rel="stylesheet"]['+i+"]"}function LC(i){return g({},i,{"data-precedence":i.precedence,precedence:null})}function B3(i,l,u,h){i.querySelector('link[rel="preload"][as="style"]['+l+"]")?h.loading=1:(l=i.createElement("link"),h.preload=l,l.addEventListener("load",function(){return h.loading|=1}),l.addEventListener("error",function(){return h.loading|=2}),fr(l,"link",u),cn(l),i.head.appendChild(l))}function mc(i){return'[src="'+yi(i)+'"]'}function ed(i){return"script[async]"+i}function IC(i,l,u){if(l.count++,l.instance===null)switch(l.type){case"style":var h=i.querySelector('style[data-href~="'+yi(u.href)+'"]');if(h)return l.instance=h,cn(h),h;var x=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(i.ownerDocument||i).createElement("style"),cn(h),fr(h,"style",x),Th(h,u.precedence,i),l.instance=h;case"stylesheet":x=pc(u.href);var w=i.querySelector(Zu(x));if(w)return l.state.loading|=4,l.instance=w,cn(w),w;h=LC(u),(x=Ti.get(x))&&hy(h,x),w=(i.ownerDocument||i).createElement("link"),cn(w);var D=w;return D._p=new Promise(function(P,q){D.onload=P,D.onerror=q}),fr(w,"link",h),l.state.loading|=4,Th(w,u.precedence,i),l.instance=w;case"script":return w=mc(u.src),(x=i.querySelector(ed(w)))?(l.instance=x,cn(x),x):(h=u,(x=Ti.get(w))&&(h=g({},u),py(h,x)),i=i.ownerDocument||i,x=i.createElement("script"),cn(x),fr(x,"link",h),i.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,Th(h,u.precedence,i));return l.instance}function Th(i,l,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=h.length?h[h.length-1]:null,w=x,D=0;D<h.length;D++){var P=h[D];if(P.dataset.precedence===l)w=P;else if(w!==x)break}w?w.parentNode.insertBefore(i,w.nextSibling):(l=u.nodeType===9?u.head:u,l.insertBefore(i,l.firstChild))}function hy(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.title==null&&(i.title=l.title)}function py(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.integrity==null&&(i.integrity=l.integrity)}var Rh=null;function zC(i,l,u){if(Rh===null){var h=new Map,x=Rh=new Map;x.set(u,h)}else x=Rh,h=x.get(u),h||(h=new Map,x.set(u,h));if(h.has(i))return h;for(h.set(i,null),u=u.getElementsByTagName(i),x=0;x<u.length;x++){var w=u[x];if(!(w[Zt]||w[Oe]||i==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var D=w.getAttribute(l)||"";D=i+D;var P=h.get(D);P?P.push(w):h.set(D,[w])}}return h}function $C(i,l,u){i=i.ownerDocument||i,i.head.insertBefore(u,l==="title"?i.querySelector("head > title"):null)}function V3(i,l,u){if(u===1||l.itemProp!=null)return!1;switch(i){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 i=l.disabled,typeof l.precedence=="string"&&i==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 UC(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function F3(i,l,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var x=pc(h.href),w=l.querySelector(Zu(x));if(w){l=w._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(i.count++,i=_h.bind(i),l.then(i,i)),u.state.loading|=4,u.instance=w,cn(w);return}w=l.ownerDocument||l,h=LC(h),(x=Ti.get(x))&&hy(h,x),w=w.createElement("link"),cn(w);var D=w;D._p=new Promise(function(P,q){D.onload=P,D.onerror=q}),fr(w,"link",h),u.instance=w}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(u,l),(l=u.state.preload)&&(u.state.loading&3)===0&&(i.count++,u=_h.bind(i),l.addEventListener("load",u),l.addEventListener("error",u))}}var my=0;function H3(i,l){return i.stylesheets&&i.count===0&&Dh(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var h=setTimeout(function(){if(i.stylesheets&&Dh(i,i.stylesheets),i.unsuspend){var w=i.unsuspend;i.unsuspend=null,w()}},6e4+l);0<i.imgBytes&&my===0&&(my=62500*C3());var x=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Dh(i,i.stylesheets),i.unsuspend)){var w=i.unsuspend;i.unsuspend=null,w()}},(i.imgBytes>my?50:800)+l);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(h),clearTimeout(x)}}:null}function _h(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Dh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Ah=null;function Dh(i,l){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Ah=new Map,l.forEach(q3,i),Ah=null,_h.call(i))}function q3(i,l){if(!(l.state.loading&4)){var u=Ah.get(i);if(u)var h=u.get(null);else{u=new Map,Ah.set(i,u);for(var x=i.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<x.length;w++){var D=x[w];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(u.set(D.dataset.precedence,D),h=D)}h&&u.set(null,h)}x=l.instance,D=x.getAttribute("data-precedence"),w=u.get(D)||h,w===h&&u.set(null,x),u.set(D,x),this.count++,h=_h.bind(this),x.addEventListener("load",h),x.addEventListener("error",h),w?w.parentNode.insertBefore(x,w.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(x,i.firstChild)),l.state.loading|=4}}var td={$$typeof:T,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function G3(i,l,u,h,x,w,D,P,q){this.tag=1,this.containerInfo=i,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=uo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=uo(0),this.hiddenUpdates=uo(null),this.identifierPrefix=h,this.onUncaughtError=x,this.onCaughtError=w,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function BC(i,l,u,h,x,w,D,P,q,te,fe,ve){return i=new G3(i,l,u,D,q,te,fe,ve,P),l=1,w===!0&&(l|=24),w=ri(3,null,null,l),i.current=w,w.stateNode=i,l=Wg(),l.refCount++,i.pooledCache=l,l.refCount++,w.memoizedState={element:h,isDehydrated:u,cache:l},Jg(w),i}function VC(i){return i?(i=Gl,i):Gl}function FC(i,l,u,h,x,w){x=VC(x),h.context===null?h.context=x:h.pendingContext=x,h=za(l),h.payload={element:u},w=w===void 0?null:w,w!==null&&(h.callback=w),u=$a(i,h,l),u!==null&&(qr(u,i,l),Nu(u,i,l))}function HC(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<l?u:l}}function gy(i,l){HC(i,l),(i=i.alternate)&&HC(i,l)}function qC(i){if(i.tag===13||i.tag===31){var l=Os(i,67108864);l!==null&&qr(l,i,67108864),gy(i,67108864)}}function GC(i){if(i.tag===13||i.tag===31){var l=li();l=ie(l);var u=Os(i,l);u!==null&&qr(u,i,l),gy(i,l)}}var kh=!0;function Q3(i,l,u,h){var x=O.T;O.T=null;var w=I.p;try{I.p=2,vy(i,l,u,h)}finally{I.p=w,O.T=x}}function W3(i,l,u,h){var x=O.T;O.T=null;var w=I.p;try{I.p=8,vy(i,l,u,h)}finally{I.p=w,O.T=x}}function vy(i,l,u,h){if(kh){var x=yy(h);if(x===null)ry(i,l,h,Ph,u),WC(i,h);else if(K3(x,i,l,u,h))h.stopPropagation();else if(WC(i,h),l&4&&-1<Y3.indexOf(i)){for(;x!==null;){var w=Ut(x);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var D=Jr(w.pendingLanes);if(D!==0){var P=w;for(P.pendingLanes|=2,P.entangledLanes|=2;D;){var q=1<<31-Tn(D);P.entanglements[1]|=q,D&=~q}mo(w),(Gt&6)===0&&(ph=pe()+500,Yu(0))}}break;case 31:case 13:P=Os(w,2),P!==null&&qr(P,w,2),gh(),gy(w,2)}if(w=yy(h),w===null&&ry(i,l,h,Ph,u),w===x)break;x=w}x!==null&&h.stopPropagation()}else ry(i,l,h,null,u)}}function yy(i){return i=bg(i),xy(i)}var Ph=null;function xy(i){if(Ph=null,i=It(i),i!==null){var l=s(i);if(l===null)i=null;else{var u=l.tag;if(u===13){if(i=c(l),i!==null)return i;i=null}else if(u===31){if(i=d(l),i!==null)return i;i=null}else if(u===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null)}}return Ph=i,null}function QC(i){switch(i){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(Ve()){case je:return 2;case ke:return 8;case At:case gn:return 32;case vn:return 268435456;default:return 32}default:return 32}}var by=!1,Ka=null,Xa=null,Ja=null,nd=new Map,rd=new Map,Za=[],Y3="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 WC(i,l){switch(i){case"focusin":case"focusout":Ka=null;break;case"dragenter":case"dragleave":Xa=null;break;case"mouseover":case"mouseout":Ja=null;break;case"pointerover":case"pointerout":nd.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":rd.delete(l.pointerId)}}function id(i,l,u,h,x,w){return i===null||i.nativeEvent!==w?(i={blockedOn:l,domEventName:u,eventSystemFlags:h,nativeEvent:w,targetContainers:[x]},l!==null&&(l=Ut(l),l!==null&&qC(l)),i):(i.eventSystemFlags|=h,l=i.targetContainers,x!==null&&l.indexOf(x)===-1&&l.push(x),i)}function K3(i,l,u,h,x){switch(l){case"focusin":return Ka=id(Ka,i,l,u,h,x),!0;case"dragenter":return Xa=id(Xa,i,l,u,h,x),!0;case"mouseover":return Ja=id(Ja,i,l,u,h,x),!0;case"pointerover":var w=x.pointerId;return nd.set(w,id(nd.get(w)||null,i,l,u,h,x)),!0;case"gotpointercapture":return w=x.pointerId,rd.set(w,id(rd.get(w)||null,i,l,u,h,x)),!0}return!1}function YC(i){var l=It(i.target);if(l!==null){var u=s(l);if(u!==null){if(l=u.tag,l===13){if(l=c(u),l!==null){i.blockedOn=l,We(i.priority,function(){GC(u)});return}}else if(l===31){if(l=d(u),l!==null){i.blockedOn=l,We(i.priority,function(){GC(u)});return}}else if(l===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Nh(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var u=yy(i.nativeEvent);if(u===null){u=i.nativeEvent;var h=new u.constructor(u.type,u);xg=h,u.target.dispatchEvent(h),xg=null}else return l=Ut(u),l!==null&&qC(l),i.blockedOn=u,!1;l.shift()}return!0}function KC(i,l,u){Nh(i)&&u.delete(l)}function X3(){by=!1,Ka!==null&&Nh(Ka)&&(Ka=null),Xa!==null&&Nh(Xa)&&(Xa=null),Ja!==null&&Nh(Ja)&&(Ja=null),nd.forEach(KC),rd.forEach(KC)}function Oh(i,l){i.blockedOn===l&&(i.blockedOn=null,by||(by=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,X3)))}var Mh=null;function XC(i){Mh!==i&&(Mh=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Mh===i&&(Mh=null);for(var l=0;l<i.length;l+=3){var u=i[l],h=i[l+1],x=i[l+2];if(typeof h!="function"){if(xy(h||u)===null)continue;break}var w=Ut(u);w!==null&&(i.splice(l,3),l-=3,yv(w,{pending:!0,data:x,method:u.method,action:h},h,x))}}))}function gc(i){function l(q){return Oh(q,i)}Ka!==null&&Oh(Ka,i),Xa!==null&&Oh(Xa,i),Ja!==null&&Oh(Ja,i),nd.forEach(l),rd.forEach(l);for(var u=0;u<Za.length;u++){var h=Za[u];h.blockedOn===i&&(h.blockedOn=null)}for(;0<Za.length&&(u=Za[0],u.blockedOn===null);)YC(u),u.blockedOn===null&&Za.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var x=u[h],w=u[h+1],D=x[ze]||null;if(typeof w=="function")D||XC(u);else if(D){var P=null;if(w&&w.hasAttribute("formAction")){if(x=w,D=w[ze]||null)P=D.formAction;else if(xy(x)!==null)continue}else P=D.action;typeof P=="function"?u[h+1]=P:(u.splice(h,3),h-=3),XC(u)}}}function JC(){function i(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(D){return x=D})},focusReset:"manual",scroll:"manual"})}function l(){x!==null&&(x(),x=null),h||setTimeout(u,20)}function u(){if(!h&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,x=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),x!==null&&(x(),x=null)}}}function Sy(i){this._internalRoot=i}Lh.prototype.render=Sy.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(r(409));var u=l.current,h=li();FC(u,h,i,l,null,null)},Lh.prototype.unmount=Sy.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;FC(i.current,2,null,i,null,null),gh(),l[Xe]=null}};function Lh(i){this._internalRoot=i}Lh.prototype.unstable_scheduleHydration=function(i){if(i){var l=De();i={blockedOn:null,target:i,priority:l};for(var u=0;u<Za.length&&l!==0&&l<Za[u].priority;u++);Za.splice(u,0,i),u===0&&YC(i)}};var ZC=t.version;if(ZC!=="19.2.1")throw Error(r(527,ZC,"19.2.1"));I.findDOMNode=function(i){var l=i._reactInternals;if(l===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=p(l),i=i!==null?m(i):null,i=i===null?null:i.stateNode,i};var J3={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ih=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ih.isDisabled&&Ih.supportsFiber)try{gr=Ih.inject(J3),Qt=Ih}catch{}}return dd.createRoot=function(i,l){if(!o(i))throw Error(r(299));var u=!1,h="",x=aj,w=sj,D=lj;return l!=null&&(l.unstable_strictMode===!0&&(u=!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&&(D=l.onRecoverableError)),l=BC(i,1,!1,null,null,u,h,null,x,w,D,JC),i[Xe]=l.current,ny(i),new Sy(l)},dd.hydrateRoot=function(i,l,u){if(!o(i))throw Error(r(299));var h=!1,x="",w=aj,D=sj,P=lj,q=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onUncaughtError!==void 0&&(w=u.onUncaughtError),u.onCaughtError!==void 0&&(D=u.onCaughtError),u.onRecoverableError!==void 0&&(P=u.onRecoverableError),u.formState!==void 0&&(q=u.formState)),l=BC(i,1,!0,l,u??null,h,x,q,w,D,P,JC),l.context=VC(null),u=l.current,h=li(),h=ie(h),x=za(h),x.callback=null,$a(u,x,h),u=h,l.current.lanes=u,Go(l,u),mo(l),i[Xe]=l.current,ny(i),new Lh(l)},dd.version="19.2.1",dd}var LR;function SZ(){if(LR)return sx.exports;LR=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(),sx.exports=bZ(),sx.exports}var wZ=SZ();var XP=e=>{throw TypeError(e)},jZ=(e,t,n)=>t.has(e)||XP("Cannot "+n),ux=(e,t,n)=>(jZ(e,t,"read from private field"),n?n.call(e):t.get(e)),CZ=(e,t,n)=>t.has(e)?XP("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),IR="popstate";function EZ(e={}){function t(r,o){let{pathname:s,search:c,hash:d}=r.location;return Ud("",{pathname:s,search:c,hash:d},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:Lo(o)}return RZ(t,n,null,e)}function bt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function zn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function TZ(){return Math.random().toString(36).substring(2,10)}function zR(e,t){return{usr:e.state,key:e.key,idx:t}}function Ud(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Da(t):t,state:n,key:t&&t.key||r||TZ()}}function Lo({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 Da(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 RZ(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:s=!1}=r,c=o.history,d="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(){d="POP";let C=m(),E=C==null?null:C-p;p=C,f&&f({action:d,location:j.location,delta:E})}function y(C,E){d="PUSH";let R=Ud(j.location,C,E);p=m()+1;let T=zR(R,p),_=j.createHref(R);try{c.pushState(T,"",_)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;o.location.assign(_)}s&&f&&f({action:d,location:j.location,delta:1})}function b(C,E){d="REPLACE";let R=Ud(j.location,C,E);p=m();let T=zR(R,p),_=j.createHref(R);c.replaceState(T,"",_),s&&f&&f({action:d,location:j.location,delta:0})}function S(C){return JP(C)}let j={get action(){return d},get location(){return e(o,c)},listen(C){if(f)throw new Error("A history only accepts one active listener");return o.addEventListener(IR,g),f=C,()=>{o.removeEventListener(IR,g),f=null}},createHref(C){return t(o,C)},createURL:S,encodeLocation(C){let E=S(C);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:y,replace:b,go(C){return c.go(C)}};return j}function JP(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:Lo(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var vd,$R=class{constructor(e){if(CZ(this,vd,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(ux(this,vd).has(e))return ux(this,vd).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){ux(this,vd).set(e,t)}};vd=new WeakMap;var _Z=new Set(["lazy","caseSensitive","path","id","index","children"]);function AZ(e){return _Z.has(e)}var DZ=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function kZ(e){return DZ.has(e)}function PZ(e){return e.index===!0}function Bd(e,t,n=[],r={},o=!1){return e.map((s,c)=>{let d=[...n,String(c)],f=typeof s.id=="string"?s.id:d.join("-");if(bt(s.index!==!0||!s.children,"Cannot specify children on an index route"),bt(o||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),PZ(s)){let p={...s,id:f};return r[f]=UR(p,t(p)),p}else{let p={...s,id:f,children:void 0};return r[f]=UR(p,t(p)),s.children&&(p.children=Bd(s.children,t,d,r,o)),p}})}function UR(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function ls(e,t,n="/"){return yd(e,t,n,!1)}function yd(e,t,n,r){let o=typeof t=="string"?Da(t):t,s=Mi(o.pathname||"/",n);if(s==null)return null;let c=ZP(e);OZ(c);let d=null;for(let f=0;d==null&&f<c.length;++f){let p=qZ(s);d=FZ(c[f],p,r)}return d}function NZ(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function ZP(e,t=[],n=[],r="",o=!1){let s=(c,d,f=o,p)=>{let m={relativePath:p===void 0?c.path||"":p,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&f)return;bt(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let g=Do([r,m.relativePath]),y=n.concat(m);c.children&&c.children.length>0&&(bt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),ZP(c.children,t,y,g,f)),!(c.path==null&&!c.index)&&t.push({path:g,score:BZ(g,c.index),routesMeta:y})};return e.forEach((c,d)=>{if(c.path===""||!c.path?.includes("?"))s(c,d);else for(let f of eN(c.path))s(c,d,!0,f)}),t}function eN(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return o?[s,""]:[s];let c=eN(r.join("/")),d=[];return d.push(...c.map(f=>f===""?s:[s,f].join("/"))),o&&d.push(...c),d.map(f=>e.startsWith("/")&&f===""?"/":f)}function OZ(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:VZ(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var MZ=/^:[\w-]+$/,LZ=3,IZ=2,zZ=1,$Z=10,UZ=-2,BR=e=>e==="*";function BZ(e,t){let n=e.split("/"),r=n.length;return n.some(BR)&&(r+=UZ),t&&(r+=IZ),n.filter(o=>!BR(o)).reduce((o,s)=>o+(MZ.test(s)?LZ:s===""?zZ:$Z),r)}function VZ(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function FZ(e,t,n=!1){let{routesMeta:r}=e,o={},s="/",c=[];for(let d=0;d<r.length;++d){let f=r[d],p=d===r.length-1,m=s==="/"?t:t.slice(s.length)||"/",g=Gp({path:f.relativePath,caseSensitive:f.caseSensitive,end:p},m),y=f.route;if(!g&&p&&n&&!r[r.length-1].route.index&&(g=Gp({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!g)return null;Object.assign(o,g.params),c.push({params:o,pathname:Do([s,g.pathname]),pathnameBase:YZ(Do([s,g.pathnameBase])),route:y}),g.pathnameBase!=="/"&&(s=Do([s,g.pathnameBase]))}return c}function Gp(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=HZ(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let s=o[0],c=s.replace(/(.)\/+$/,"$1"),d=o.slice(1);return{params:r.reduce((p,{paramName:m,isOptional:g},y)=>{if(m==="*"){let S=d[y]||"";c=s.slice(0,s.length-S.length).replace(/(.)\/+$/,"$1")}const b=d[y];return g&&!b?p[m]=void 0:p[m]=(b||"").replace(/%2F/g,"/"),p},{}),pathname:s,pathnameBase:c,pattern:e}}function HZ(e,t=!1,n=!0){zn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,f)=>(r.push({paramName:d,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function qZ(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return zn(!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 Mi(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 GZ({basename:e,pathname:t}){return t==="/"?e:Do([e,t])}var QZ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cg=e=>QZ.test(e);function WZ(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Da(e):e,s;if(n)if(cg(n))s=n;else{if(n.includes("//")){let c=n;n=n.replace(/\/\/+/g,"/"),zn(!1,`Pathnames cannot have embedded double slashes - normalizing ${c} -> ${n}`)}n.startsWith("/")?s=VR(n.substring(1),"/"):s=VR(n,t)}else s=t;return{pathname:s,search:KZ(r),hash:XZ(o)}}function VR(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function dx(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 tN(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function JS(e){let t=tN(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function ZS(e,t,n,r=!1){let o;typeof e=="string"?o=Da(e):(o={...e},bt(!o.pathname||!o.pathname.includes("?"),dx("?","pathname","search",o)),bt(!o.pathname||!o.pathname.includes("#"),dx("#","pathname","hash",o)),bt(!o.search||!o.search.includes("#"),dx("#","search","hash",o)));let s=e===""||o.pathname==="",c=s?"/":o.pathname,d;if(c==null)d=n;else{let g=t.length-1;if(!r&&c.startsWith("..")){let y=c.split("/");for(;y[0]==="..";)y.shift(),g-=1;o.pathname=y.join("/")}d=g>=0?t[g]:"/"}let f=WZ(o,d),p=c&&c!=="/"&&c.endsWith("/"),m=(s||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(p||m)&&(f.pathname+="/"),f}var Do=e=>e.join("/").replace(/\/\/+/g,"/"),YZ=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),KZ=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,XZ=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ug=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 Vd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function wf(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var fs=Symbol("Uninstrumented");function JZ(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:t.id,index:t.index,path:t.path,instrument(s){let c=Object.keys(n);for(let d of c)s[d]&&n[d].push(s[d])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let o=Pc(n.lazy,t.lazy,()=>{});o&&(r.lazy=o)}if(typeof t.lazy=="object"){let o=t.lazy;["middleware","loader","action"].forEach(s=>{let c=o[s],d=n[`lazy.${s}`];if(typeof c=="function"&&d.length>0){let f=Pc(d,c,()=>{});f&&(r.lazy=Object.assign(r.lazy||{},{[s]:f}))}})}return["loader","action"].forEach(o=>{let s=t[o];if(typeof s=="function"&&n[o].length>0){let c=s[fs]??s,d=Pc(n[o],c,(...f)=>FR(f[0]));d&&(d[fs]=c,r[o]=d)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(o=>{let s=o[fs]??o,c=Pc(n.middleware,s,(...d)=>FR(d[0]));return c?(c[fs]=s,c):o})),r}function ZZ(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(o){let s=Object.keys(o);for(let c of s)o[c]&&n[c].push(o[c])}})),n.navigate.length>0){let r=e.navigate[fs]??e.navigate,o=Pc(n.navigate,r,(...s)=>{let[c,d]=s;return{to:typeof c=="number"||typeof c=="string"?c:c?Lo(c):".",...HR(e,d??{})}});o&&(o[fs]=r,e.navigate=o)}if(n.fetch.length>0){let r=e.fetch[fs]??e.fetch,o=Pc(n.fetch,r,(...s)=>{let[c,,d,f]=s;return{href:d??".",fetcherKey:c,...HR(e,f??{})}});o&&(o[fs]=r,e.fetch=o)}return e}function Pc(e,t,n){return e.length===0?null:async(...r)=>{let o=await nN(e,n(...r),()=>t(...r),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function nN(e,t,n,r){let o=e[r],s;if(o){let c,d=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=nN(e,t,n,r-1),s=await c,bt(s,"Expected a result"),s.type==="error"&&s.value instanceof Error?{status:"error",error:s.value}:{status:"success",error:void 0});try{await o(d,t)}catch(f){console.error("An instrumentation function threw an error:",f)}c||await d(),await c}else try{s={type:"success",value:await n()}}catch(c){s={type:"error",value:c}}return s||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function FR(e){let{request:t,context:n,params:r,unstable_pattern:o}=e;return{request:eee(t),params:{...r},unstable_pattern:o,context:tee(n)}}function HR(e,t){return{currentUrl:Lo(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function eee(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function tee(e){if(ree(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var nee=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ree(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===nee}var rN=["POST","PUT","PATCH","DELETE"],iee=new Set(rN),oee=["GET",...rN],aee=new Set(oee),see=new Set([301,302,303,307,308]),lee=new Set([307,308]),fx={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},cee={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},fd={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},uee=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),iN="remix-router-transitions",oN=Symbol("ResetLoaderData");function dee(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||[],o=e.mapRouteProperties||uee,s=o;if(e.unstable_instrumentations){let V=e.unstable_instrumentations;s=X=>({...o(X),...JZ(V.map(ie=>ie.route).filter(Boolean),X)})}let c={},d=Bd(e.routes,s,void 0,c),f,p=e.basename||"/";p.startsWith("/")||(p=`/${p}`);let m=e.dataStrategy||gee,g={...e.future},y=null,b=new Set,S=null,j=null,C=null,E=e.hydrationData!=null,R=ls(d,e.history.location,p),T=!1,_=null,k;if(R==null&&!e.patchRoutesOnNavigation){let V=Di(404,{pathname:e.history.location.pathname}),{matches:X,route:ie}=Xh(d);k=!0,R=X,_={[ie.id]:V}}else if(R&&!e.hydrationData&&Vn(R,d,e.history.location.pathname).active&&(R=null),R)if(R.some(V=>V.route.lazy))k=!1;else if(!R.some(V=>e1(V.route)))k=!0;else{let V=e.hydrationData?e.hydrationData.loaderData:null,X=e.hydrationData?e.hydrationData.errors:null;if(X){let ie=R.findIndex(we=>X[we.route.id]!==void 0);k=R.slice(0,ie+1).every(we=>!rb(we.route,V,X))}else k=R.every(ie=>!rb(ie.route,V,X))}else{k=!1,R=[];let V=Vn(null,d,e.history.location.pathname);V.active&&V.matches&&(T=!0,R=V.matches)}let L,A={historyAction:e.history.action,location:e.history.location,matches:R,initialized:k,navigation:fx,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||_,fetchers:new Map,blockers:new Map},N="POP",z=null,B=!1,G,Y=!1,J=new Map,U=null,W=!1,O=!1,I=new Set,$=new Map,H=0,K=-1,M=new Map,F=new Set,ae=new Map,de=new Map,xe=new Set,Se=new Map,Ce,Ke=null;function Ae(){if(y=e.history.listen(({action:V,location:X,delta:ie})=>{if(Ce){Ce(),Ce=void 0;return}zn(Se.size===0||ie!=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 we=qo({currentLocation:A.location,nextLocation:X,historyAction:V});if(we&&ie!=null){let De=new Promise(We=>{Ce=We});e.history.go(ie*-1),zr(we,{state:"blocked",location:X,proceed(){zr(we,{state:"proceeding",proceed:void 0,reset:void 0,location:X}),De.then(()=>e.history.go(ie))},reset(){let We=new Map(A.blockers);We.set(we,fd),ot({blockers:We})}}),z?.resolve(),z=null;return}return wt(V,X)}),n){Pee(t,J);let V=()=>Nee(t,J);t.addEventListener("pagehide",V),U=()=>t.removeEventListener("pagehide",V)}return A.initialized||wt("POP",A.location,{initialHydration:!0}),L}function dt(){y&&y(),U&&U(),b.clear(),G&&G.abort(),A.fetchers.forEach((V,X)=>ln(X)),A.blockers.forEach((V,X)=>ka(X))}function Ct(V){return b.add(V),()=>b.delete(V)}function ot(V,X={}){V.matches&&(V.matches=V.matches.map(De=>{let We=c[De.route.id],qe=De.route;return qe.element!==We.element||qe.errorElement!==We.errorElement||qe.hydrateFallbackElement!==We.hydrateFallbackElement?{...De,route:We}:De})),A={...A,...V};let ie=[],we=[];A.fetchers.forEach((De,We)=>{De.state==="idle"&&(xe.has(We)?ie.push(We):we.push(We))}),xe.forEach(De=>{!A.fetchers.has(De)&&!$.has(De)&&ie.push(De)}),[...b].forEach(De=>De(A,{deletedFetchers:ie,newErrors:V.errors??null,viewTransitionOpts:X.viewTransitionOpts,flushSync:X.flushSync===!0})),ie.forEach(De=>ln(De)),we.forEach(De=>A.fetchers.delete(De))}function it(V,X,{flushSync:ie}={}){let we=A.actionData!=null&&A.navigation.formMethod!=null&&kr(A.navigation.formMethod)&&A.navigation.state==="loading"&&V.state?._isRedirect!==!0,De;X.actionData?Object.keys(X.actionData).length>0?De=X.actionData:De=null:we?De=A.actionData:De=null;let We=X.loaderData?e2(A.loaderData,X.loaderData,X.matches||[],X.errors):A.loaderData,qe=A.blockers;qe.size>0&&(qe=new Map(qe),qe.forEach((et,rt)=>qe.set(rt,fd)));let Oe=W?!1:As(V,X.matches||A.matches),ze=B===!0||A.navigation.formMethod!=null&&kr(A.navigation.formMethod)&&V.state?._isRedirect!==!0;f&&(d=f,f=void 0),W||N==="POP"||(N==="PUSH"?e.history.push(V,V.state):N==="REPLACE"&&e.history.replace(V,V.state));let Xe;if(N==="POP"){let et=J.get(A.location.pathname);et&&et.has(V.pathname)?Xe={currentLocation:A.location,nextLocation:V}:J.has(V.pathname)&&(Xe={currentLocation:V,nextLocation:A.location})}else if(Y){let et=J.get(A.location.pathname);et?et.add(V.pathname):(et=new Set([V.pathname]),J.set(A.location.pathname,et)),Xe={currentLocation:A.location,nextLocation:V}}ot({...X,actionData:De,loaderData:We,historyAction:N,location:V,initialized:!0,navigation:fx,revalidation:"idle",restoreScrollPosition:Oe,preventScrollReset:ze,blockers:qe},{viewTransitionOpts:Xe,flushSync:ie===!0}),N="POP",B=!1,Y=!1,W=!1,O=!1,z?.resolve(),z=null,Ke?.resolve(),Ke=null}async function pt(V,X){if(z?.resolve(),z=null,typeof V=="number"){z||(z=i2());let tt=z.promise;return e.history.go(V),tt}let ie=nb(A.location,A.matches,p,V,X?.fromRouteId,X?.relative),{path:we,submission:De,error:We}=qR(!1,ie,X),qe=A.location,Oe=Ud(A.location,we,X&&X.state);Oe={...Oe,...e.history.encodeLocation(Oe)};let ze=X&&X.replace!=null?X.replace:void 0,Xe="PUSH";ze===!0?Xe="REPLACE":ze===!1||De!=null&&kr(De.formMethod)&&De.formAction===A.location.pathname+A.location.search&&(Xe="REPLACE");let et=X&&"preventScrollReset"in X?X.preventScrollReset===!0:void 0,rt=(X&&X.flushSync)===!0,Tt=qo({currentLocation:qe,nextLocation:Oe,historyAction:Xe});if(Tt){zr(Tt,{state:"blocked",location:Oe,proceed(){zr(Tt,{state:"proceeding",proceed:void 0,reset:void 0,location:Oe}),pt(V,X)},reset(){let tt=new Map(A.blockers);tt.set(Tt,fd),ot({blockers:tt})}});return}await wt(Xe,Oe,{submission:De,pendingError:We,preventScrollReset:et,replace:X&&X.replace,enableViewTransition:X&&X.viewTransition,flushSync:rt})}function Et(){Ke||(Ke=i2()),ke(),ot({revalidation:"loading"});let V=Ke.promise;return A.navigation.state==="submitting"?V:A.navigation.state==="idle"?(wt(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),V):(wt(N||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:Y===!0}),V)}async function wt(V,X,ie){G&&G.abort(),G=null,N=V,W=(ie&&ie.startUninterruptedRevalidation)===!0,sr(A.location,A.matches),B=(ie&&ie.preventScrollReset)===!0,Y=(ie&&ie.enableViewTransition)===!0;let we=f||d,De=ie&&ie.overrideNavigation,We=ie?.initialHydration&&A.matches&&A.matches.length>0&&!T?A.matches:ls(we,X,p),qe=(ie&&ie.flushSync)===!0;if(We&&A.initialized&&!O&&Cee(A.location,X)&&!(ie&&ie.submission&&kr(ie.submission.formMethod))){it(X,{matches:We},{flushSync:qe});return}let Oe=Vn(We,we,X.pathname);if(Oe.active&&Oe.matches&&(We=Oe.matches),!We){let{error:Rn,notFoundMatches:It,route:Ut}=Bi(X.pathname);it(X,{matches:It,loaderData:{},errors:{[Ut.id]:Rn}},{flushSync:qe});return}G=new AbortController;let ze=kc(e.history,X,G.signal,ie&&ie.submission),Xe=e.getContext?await e.getContext():new $R,et;if(ie&&ie.pendingError)et=[cs(We).route.id,{type:"error",error:ie.pendingError}];else if(ie&&ie.submission&&kr(ie.submission.formMethod)){let Rn=await Te(ze,X,ie.submission,We,Xe,Oe.active,ie&&ie.initialHydration===!0,{replace:ie.replace,flushSync:qe});if(Rn.shortCircuited)return;if(Rn.pendingActionResult){let[It,Ut]=Rn.pendingActionResult;if(ui(Ut)&&Vd(Ut.error)&&Ut.error.status===404){G=null,it(X,{matches:Rn.matches,loaderData:{},errors:{[It]:Ut.error}});return}}We=Rn.matches||We,et=Rn.pendingActionResult,De=hx(X,ie.submission),qe=!1,Oe.active=!1,ze=kc(e.history,ze.url,ze.signal)}let{shortCircuited:rt,matches:Tt,loaderData:tt,errors:Zt}=await _e(ze,X,We,Xe,Oe.active,De,ie&&ie.submission,ie&&ie.fetcherSubmission,ie&&ie.replace,ie&&ie.initialHydration===!0,qe,et);rt||(G=null,it(X,{matches:Tt||We,...t2(et),loaderData:tt,errors:Zt}))}async function Te(V,X,ie,we,De,We,qe,Oe={}){ke();let ze=Dee(X,ie);if(ot({navigation:ze},{flushSync:Oe.flushSync===!0}),We){let rt=await uo(we,X.pathname,V.signal);if(rt.type==="aborted")return{shortCircuited:!0};if(rt.type==="error"){if(rt.partialMatches.length===0){let{matches:tt,route:Zt}=Xh(d);return{matches:tt,pendingActionResult:[Zt.id,{type:"error",error:rt.error}]}}let Tt=cs(rt.partialMatches).route.id;return{matches:rt.partialMatches,pendingActionResult:[Tt,{type:"error",error:rt.error}]}}else if(rt.matches)we=rt.matches;else{let{notFoundMatches:Tt,error:tt,route:Zt}=Bi(X.pathname);return{matches:Tt,pendingActionResult:[Zt.id,{type:"error",error:tt}]}}}let Xe,et=mp(we,X);if(!et.route.action&&!et.route.lazy)Xe={type:"error",error:Di(405,{method:V.method,pathname:X.pathname,routeId:et.route.id})};else{let rt=zc(s,c,V,we,et,qe?[]:r,De),Tt=await Ve(V,rt,De,null);if(Xe=Tt[et.route.id],!Xe){for(let tt of we)if(Tt[tt.route.id]){Xe=Tt[tt.route.id];break}}if(V.signal.aborted)return{shortCircuited:!0}}if(sl(Xe)){let rt;return Oe&&Oe.replace!=null?rt=Oe.replace:rt=XR(Xe.response.headers.get("Location"),new URL(V.url),p)===A.location.pathname+A.location.search,await pe(V,Xe,!0,{submission:ie,replace:rt}),{shortCircuited:!0}}if(ui(Xe)){let rt=cs(we,et.route.id);return(Oe&&Oe.replace)!==!0&&(N="PUSH"),{matches:we,pendingActionResult:[rt.route.id,Xe,et.route.id]}}return{matches:we,pendingActionResult:[et.route.id,Xe]}}async function _e(V,X,ie,we,De,We,qe,Oe,ze,Xe,et,rt){let Tt=We||hx(X,qe),tt=qe||Oe||r2(Tt),Zt=!W&&!Xe;if(De){if(Zt){let nr=Le(rt);ot({navigation:Tt,...nr!==void 0?{actionData:nr}:{}},{flushSync:et})}let Dt=await uo(ie,X.pathname,V.signal);if(Dt.type==="aborted")return{shortCircuited:!0};if(Dt.type==="error"){if(Dt.partialMatches.length===0){let{matches:Fi,route:vi}=Xh(d);return{matches:Fi,loaderData:{},errors:{[vi.id]:Dt.error}}}let nr=cs(Dt.partialMatches).route.id;return{matches:Dt.partialMatches,loaderData:{},errors:{[nr]:Dt.error}}}else if(Dt.matches)ie=Dt.matches;else{let{error:nr,notFoundMatches:Fi,route:vi}=Bi(X.pathname);return{matches:Fi,loaderData:{},errors:{[vi.id]:nr}}}}let Rn=f||d,{dsMatches:It,revalidatingFetchers:Ut}=GR(V,we,s,c,e.history,A,ie,tt,X,Xe?[]:r,Xe===!0,O,I,xe,ae,F,Rn,p,e.patchRoutesOnNavigation!=null,rt);if(K=++H,!e.dataStrategy&&!It.some(Dt=>Dt.shouldLoad)&&!It.some(Dt=>Dt.route.middleware&&Dt.route.middleware.length>0)&&Ut.length===0){let Dt=Tn();return it(X,{matches:ie,loaderData:{},errors:rt&&ui(rt[1])?{[rt[0]]:rt[1].error}:null,...t2(rt),...Dt?{fetchers:new Map(A.fetchers)}:{}},{flushSync:et}),{shortCircuited:!0}}if(Zt){let Dt={};if(!De){Dt.navigation=Tt;let nr=Le(rt);nr!==void 0&&(Dt.actionData=nr)}Ut.length>0&&(Dt.fetchers=Me(Ut)),ot(Dt,{flushSync:et})}Ut.forEach(Dt=>{Qt(Dt.key),Dt.controller&&$.set(Dt.key,Dt.controller)});let Zr=()=>Ut.forEach(Dt=>Qt(Dt.key));G&&G.signal.addEventListener("abort",Zr);let{loaderResults:gi,fetcherResults:cn}=await je(It,Ut,V,we);if(V.signal.aborted)return{shortCircuited:!0};G&&G.signal.removeEventListener("abort",Zr),Ut.forEach(Dt=>$.delete(Dt.key));let ei=Jh(gi);if(ei)return await pe(V,ei.result,!0,{replace:ze}),{shortCircuited:!0};if(ei=Jh(cn),ei)return F.add(ei.key),await pe(V,ei.result,!0,{replace:ze}),{shortCircuited:!0};let{loaderData:Ll,errors:ti}=ZR(A,ie,gi,rt,Ut,cn);Xe&&A.errors&&(ti={...A.errors,...ti});let $r=Tn(),Il=co(K),Ds=$r||Il||Ut.length>0;return{matches:ie,loaderData:Ll,errors:ti,...Ds?{fetchers:new Map(A.fetchers)}:{}}}function Le(V){if(V&&!ui(V[1]))return{[V[0]]:V[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function Me(V){return V.forEach(X=>{let ie=A.fetchers.get(X.key),we=hd(void 0,ie?ie.data:void 0);A.fetchers.set(X.key,we)}),new Map(A.fetchers)}async function lt(V,X,ie,we){Qt(V);let De=(we&&we.flushSync)===!0,We=f||d,qe=nb(A.location,A.matches,p,ie,X,we?.relative),Oe=ls(We,qe,p),ze=Vn(Oe,We,qe);if(ze.active&&ze.matches&&(Oe=ze.matches),!Oe){gn(V,X,Di(404,{pathname:qe}),{flushSync:De});return}let{path:Xe,submission:et,error:rt}=qR(!0,qe,we);if(rt){gn(V,X,rt,{flushSync:De});return}let Tt=e.getContext?await e.getContext():new $R,tt=(we&&we.preventScrollReset)===!0;if(et&&kr(et.formMethod)){await nt(V,X,Xe,Oe,Tt,ze.active,De,tt,et);return}ae.set(V,{routeId:X,path:Xe}),await ft(V,X,Xe,Oe,Tt,ze.active,De,tt,et)}async function nt(V,X,ie,we,De,We,qe,Oe,ze){ke(),ae.delete(V);let Xe=A.fetchers.get(V);At(V,kee(ze,Xe),{flushSync:qe});let et=new AbortController,rt=kc(e.history,ie,et.signal,ze);if(We){let Bt=await uo(we,new URL(rt.url).pathname,rt.signal,V);if(Bt.type==="aborted")return;if(Bt.type==="error"){gn(V,X,Bt.error,{flushSync:qe});return}else if(Bt.matches)we=Bt.matches;else{gn(V,X,Di(404,{pathname:ie}),{flushSync:qe});return}}let Tt=mp(we,ie);if(!Tt.route.action&&!Tt.route.lazy){let Bt=Di(405,{method:ze.formMethod,pathname:ie,routeId:X});gn(V,X,Bt,{flushSync:qe});return}$.set(V,et);let tt=H,Zt=zc(s,c,rt,we,Tt,r,De),Rn=await Ve(rt,Zt,De,V),It=Rn[Tt.route.id];if(!It){for(let Bt of Zt)if(Rn[Bt.route.id]){It=Rn[Bt.route.id];break}}if(rt.signal.aborted){$.get(V)===et&&$.delete(V);return}if(xe.has(V)){if(sl(It)||ui(It)){At(V,ha(void 0));return}}else{if(sl(It))if($.delete(V),K>tt){At(V,ha(void 0));return}else return F.add(V),At(V,hd(ze)),pe(rt,It,!1,{fetcherSubmission:ze,preventScrollReset:Oe});if(ui(It)){gn(V,X,It.error);return}}let Ut=A.navigation.location||A.location,Zr=kc(e.history,Ut,et.signal),gi=f||d,cn=A.navigation.state!=="idle"?ls(gi,A.navigation.location,p):A.matches;bt(cn,"Didn't find any matches after fetcher action");let ei=++H;M.set(V,ei);let Ll=hd(ze,It.data);A.fetchers.set(V,Ll);let{dsMatches:ti,revalidatingFetchers:$r}=GR(Zr,De,s,c,e.history,A,cn,ze,Ut,r,!1,O,I,xe,ae,F,gi,p,e.patchRoutesOnNavigation!=null,[Tt.route.id,It]);$r.filter(Bt=>Bt.key!==V).forEach(Bt=>{let lr=Bt.key,vu=A.fetchers.get(lr),pg=hd(void 0,vu?vu.data:void 0);A.fetchers.set(lr,pg),Qt(lr),Bt.controller&&$.set(lr,Bt.controller)}),ot({fetchers:new Map(A.fetchers)});let Il=()=>$r.forEach(Bt=>Qt(Bt.key));et.signal.addEventListener("abort",Il);let{loaderResults:Ds,fetcherResults:Dt}=await je(ti,$r,Zr,De);if(et.signal.aborted)return;if(et.signal.removeEventListener("abort",Il),M.delete(V),$.delete(V),$r.forEach(Bt=>$.delete(Bt.key)),A.fetchers.has(V)){let Bt=ha(It.data);A.fetchers.set(V,Bt)}let nr=Jh(Ds);if(nr)return pe(Zr,nr.result,!1,{preventScrollReset:Oe});if(nr=Jh(Dt),nr)return F.add(nr.key),pe(Zr,nr.result,!1,{preventScrollReset:Oe});let{loaderData:Fi,errors:vi}=ZR(A,cn,Ds,void 0,$r,Dt);co(ei),A.navigation.state==="loading"&&ei>K?(bt(N,"Expected pending action"),G&&G.abort(),it(A.navigation.location,{matches:cn,loaderData:Fi,errors:vi,fetchers:new Map(A.fetchers)})):(ot({errors:vi,loaderData:e2(A.loaderData,Fi,cn,vi),fetchers:new Map(A.fetchers)}),O=!1)}async function ft(V,X,ie,we,De,We,qe,Oe,ze){let Xe=A.fetchers.get(V);At(V,hd(ze,Xe?Xe.data:void 0),{flushSync:qe});let et=new AbortController,rt=kc(e.history,ie,et.signal);if(We){let Ut=await uo(we,new URL(rt.url).pathname,rt.signal,V);if(Ut.type==="aborted")return;if(Ut.type==="error"){gn(V,X,Ut.error,{flushSync:qe});return}else if(Ut.matches)we=Ut.matches;else{gn(V,X,Di(404,{pathname:ie}),{flushSync:qe});return}}let Tt=mp(we,ie);$.set(V,et);let tt=H,Zt=zc(s,c,rt,we,Tt,r,De),It=(await Ve(rt,Zt,De,V))[Tt.route.id];if($.get(V)===et&&$.delete(V),!rt.signal.aborted){if(xe.has(V)){At(V,ha(void 0));return}if(sl(It))if(K>tt){At(V,ha(void 0));return}else{F.add(V),await pe(rt,It,!1,{preventScrollReset:Oe});return}if(ui(It)){gn(V,X,It.error);return}At(V,ha(It.data))}}async function pe(V,X,ie,{submission:we,fetcherSubmission:De,preventScrollReset:We,replace:qe}={}){ie||(z?.resolve(),z=null),X.response.headers.has("X-Remix-Revalidate")&&(O=!0);let Oe=X.response.headers.get("Location");bt(Oe,"Expected a Location header on the redirect Response"),Oe=XR(Oe,new URL(V.url),p);let ze=Ud(A.location,Oe,{_isRedirect:!0});if(n){let Zt=!1;if(X.response.headers.has("X-Remix-Reload-Document"))Zt=!0;else if(cg(Oe)){const Rn=JP(Oe,!0);Zt=Rn.origin!==t.location.origin||Mi(Rn.pathname,p)==null}if(Zt){qe?t.location.replace(Oe):t.location.assign(Oe);return}}G=null;let Xe=qe===!0||X.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:et,formAction:rt,formEncType:Tt}=A.navigation;!we&&!De&&et&&rt&&Tt&&(we=r2(A.navigation));let tt=we||De;if(lee.has(X.response.status)&&tt&&kr(tt.formMethod))await wt(Xe,ze,{submission:{...tt,formAction:Oe},preventScrollReset:We||B,enableViewTransition:ie?Y:void 0});else{let Zt=hx(ze,we);await wt(Xe,ze,{overrideNavigation:Zt,fetcherSubmission:De,preventScrollReset:We||B,enableViewTransition:ie?Y:void 0})}}async function Ve(V,X,ie,we){let De,We={};try{De=await yee(m,V,X,we,ie,!1)}catch(qe){return X.filter(Oe=>Oe.shouldLoad).forEach(Oe=>{We[Oe.route.id]={type:"error",error:qe}}),We}if(V.signal.aborted)return We;for(let[qe,Oe]of Object.entries(De))if(_ee(Oe)){let ze=Oe.result;We[qe]={type:"redirect",response:wee(ze,V,qe,X,p)}}else We[qe]=await See(Oe);return We}async function je(V,X,ie,we){let De=Ve(ie,V,we,null),We=Promise.all(X.map(async ze=>{if(ze.matches&&ze.match&&ze.request&&ze.controller){let et=(await Ve(ze.request,ze.matches,we,ze.key))[ze.match.route.id];return{[ze.key]:et}}else return Promise.resolve({[ze.key]:{type:"error",error:Di(404,{pathname:ze.path})}})})),qe=await De,Oe=(await We).reduce((ze,Xe)=>Object.assign(ze,Xe),{});return{loaderResults:qe,fetcherResults:Oe}}function ke(){O=!0,ae.forEach((V,X)=>{$.has(X)&&I.add(X),Qt(X)})}function At(V,X,ie={}){A.fetchers.set(V,X),ot({fetchers:new Map(A.fetchers)},{flushSync:(ie&&ie.flushSync)===!0})}function gn(V,X,ie,we={}){let De=cs(A.matches,X);ln(V),ot({errors:{[De.route.id]:ie},fetchers:new Map(A.fetchers)},{flushSync:(we&&we.flushSync)===!0})}function vn(V){return de.set(V,(de.get(V)||0)+1),xe.has(V)&&xe.delete(V),A.fetchers.get(V)||cee}function Bn(V,X){Qt(V,X?.reason),At(V,ha(null))}function ln(V){let X=A.fetchers.get(V);$.has(V)&&!(X&&X.state==="loading"&&M.has(V))&&Qt(V),ae.delete(V),M.delete(V),F.delete(V),xe.delete(V),I.delete(V),A.fetchers.delete(V)}function gr(V){let X=(de.get(V)||0)-1;X<=0?(de.delete(V),xe.add(V)):de.set(V,X),ot({fetchers:new Map(A.fetchers)})}function Qt(V,X){let ie=$.get(V);ie&&(ie.abort(X),$.delete(V))}function ar(V){for(let X of V){let ie=vn(X),we=ha(ie.data);A.fetchers.set(X,we)}}function Tn(){let V=[],X=!1;for(let ie of F){let we=A.fetchers.get(ie);bt(we,`Expected fetcher: ${ie}`),we.state==="loading"&&(F.delete(ie),V.push(ie),X=!0)}return ar(V),X}function co(V){let X=[];for(let[ie,we]of M)if(we<V){let De=A.fetchers.get(ie);bt(De,`Expected fetcher: ${ie}`),De.state==="loading"&&(Qt(ie),M.delete(ie),X.push(ie))}return ar(X),X.length>0}function Ho(V,X){let ie=A.blockers.get(V)||fd;return Se.get(V)!==X&&Se.set(V,X),ie}function ka(V){A.blockers.delete(V),Se.delete(V)}function zr(V,X){let ie=A.blockers.get(V)||fd;bt(ie.state==="unblocked"&&X.state==="blocked"||ie.state==="blocked"&&X.state==="blocked"||ie.state==="blocked"&&X.state==="proceeding"||ie.state==="blocked"&&X.state==="unblocked"||ie.state==="proceeding"&&X.state==="unblocked",`Invalid blocker state transition: ${ie.state} -> ${X.state}`);let we=new Map(A.blockers);we.set(V,X),ot({blockers:we})}function qo({currentLocation:V,nextLocation:X,historyAction:ie}){if(Se.size===0)return;Se.size>1&&zn(!1,"A router only supports one blocker at a time");let we=Array.from(Se.entries()),[De,We]=we[we.length-1],qe=A.blockers.get(De);if(!(qe&&qe.state==="proceeding")&&We({currentLocation:V,nextLocation:X,historyAction:ie}))return De}function Bi(V){let X=Di(404,{pathname:V}),ie=f||d,{matches:we,route:De}=Xh(ie);return{notFoundMatches:we,route:De,error:X}}function Jr(V,X,ie){if(S=V,C=X,j=ie||null,!E&&A.navigation===fx){E=!0;let we=As(A.location,A.matches);we!=null&&ot({restoreScrollPosition:we})}return()=>{S=null,C=null,j=null}}function Vi(V,X){return j&&j(V,X.map(we=>NZ(we,A.loaderData)))||V.key}function sr(V,X){if(S&&C){let ie=Vi(V,X);S[ie]=C()}}function As(V,X){if(S){let ie=Vi(V,X),we=S[ie];if(typeof we=="number")return we}return null}function Vn(V,X,ie){if(e.patchRoutesOnNavigation)if(V){if(Object.keys(V[0].params).length>0)return{active:!0,matches:yd(X,ie,p,!0)}}else return{active:!0,matches:yd(X,ie,p,!0)||[]};return{active:!1,matches:null}}async function uo(V,X,ie,we){if(!e.patchRoutesOnNavigation)return{type:"success",matches:V};let De=V;for(;;){let We=f==null,qe=f||d,Oe=c;try{await e.patchRoutesOnNavigation({signal:ie,path:X,matches:De,fetcherKey:we,patch:(et,rt)=>{ie.aborted||QR(et,rt,qe,Oe,s,!1)}})}catch(et){return{type:"error",error:et,partialMatches:De}}finally{We&&!ie.aborted&&(d=[...d])}if(ie.aborted)return{type:"aborted"};let ze=ls(qe,X,p),Xe=null;if(ze){if(Object.keys(ze[0].params).length===0)return{type:"success",matches:ze};if(Xe=yd(qe,X,p,!0),!(Xe&&De.length<Xe.length&&Go(De,Xe.slice(0,De.length))))return{type:"success",matches:ze}}if(Xe||(Xe=yd(qe,X,p,!0)),!Xe||Go(De,Xe))return{type:"success",matches:null};De=Xe}}function Go(V,X){return V.length===X.length&&V.every((ie,we)=>ie.route.id===X[we].route.id)}function gu(V){c={},f=Bd(V,s,void 0,c)}function Ml(V,X,ie=!1){let we=f==null;QR(V,X,f||d,c,s,ie),we&&(d=[...d],ot({}))}return L={get basename(){return p},get future(){return g},get state(){return A},get routes(){return d},get window(){return t},initialize:Ae,subscribe:Ct,enableScrollRestoration:Jr,navigate:pt,fetch:lt,revalidate:Et,createHref:V=>e.history.createHref(V),encodeLocation:V=>e.history.encodeLocation(V),getFetcher:vn,resetFetcher:Bn,deleteFetcher:gr,dispose:dt,getBlocker:Ho,deleteBlocker:ka,patchRoutes:Ml,_internalFetchControllers:$,_internalSetRoutes:gu,_internalSetStateDoNotUseOrYouWillBreakYourApp(V){ot(V)}},e.unstable_instrumentations&&(L=ZZ(L,e.unstable_instrumentations.map(V=>V.router).filter(Boolean))),L}function fee(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function nb(e,t,n,r,o,s){let c,d;if(o){c=[];for(let p of t)if(c.push(p),p.route.id===o){d=p;break}}else c=t,d=t[t.length-1];let f=ZS(r||".",JS(c),Mi(e.pathname,n)||e.pathname,s==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&d){let p=t1(f.search);if(d.route.index&&!p)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!d.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=GZ({basename:n,pathname:f.pathname})),Lo(f)}function qR(e,t,n){if(!n||!fee(n))return{path:t};if(n.formMethod&&!Aee(n.formMethod))return{path:t,error:Di(405,{method:n.formMethod})};let r=()=>({path:t,error:Di(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),c=dN(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!kr(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}
|
|
243
|
+
`,""):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(!kr(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 d,f;if(n.formData)d=ob(n.formData),f=n.formData;else if(n.body instanceof FormData)d=ob(n.body),f=n.body;else if(n.body instanceof URLSearchParams)d=n.body,f=JR(d);else if(n.body==null)d=new URLSearchParams,f=new FormData;else try{d=new URLSearchParams(n.body),f=JR(d)}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(kr(p.formMethod))return{path:t,submission:p};let m=Da(t);return e&&m.search&&t1(m.search)&&d.append("index",""),m.search=`?${d}`,{path:Lo(m),submission:p}}function GR(e,t,n,r,o,s,c,d,f,p,m,g,y,b,S,j,C,E,R,T){let _=T?ui(T[1])?T[1].error:T[1].data:void 0,k=o.createURL(s.location),L=o.createURL(f),A;if(m&&s.errors){let U=Object.keys(s.errors)[0];A=c.findIndex(W=>W.route.id===U)}else if(T&&ui(T[1])){let U=T[0];A=c.findIndex(W=>W.route.id===U)-1}let N=T?T[1].statusCode:void 0,z=N&&N>=400,B={currentUrl:k,currentParams:s.matches[0]?.params||{},nextUrl:L,nextParams:c[0].params,...d,actionResult:_,actionStatus:N},G=wf(c),Y=c.map((U,W)=>{let{route:O}=U,I=null;if(A!=null&&W>A?I=!1:O.lazy?I=!0:e1(O)?m?I=rb(O,s.loaderData,s.errors):hee(s.loaderData,s.matches[W],U)&&(I=!0):I=!1,I!==null)return ib(n,r,e,G,U,p,t,I);let $=z?!1:g||k.pathname+k.search===L.pathname+L.search||k.search!==L.search||pee(s.matches[W],U),H={...B,defaultShouldRevalidate:$},K=Qp(U,H);return ib(n,r,e,G,U,p,t,K,H)}),J=[];return S.forEach((U,W)=>{if(m||!c.some(ae=>ae.route.id===U.routeId)||b.has(W))return;let O=s.fetchers.get(W),I=O&&O.state!=="idle"&&O.data===void 0,$=ls(C,U.path,E);if(!$){if(R&&I)return;J.push({key:W,routeId:U.routeId,path:U.path,matches:null,match:null,request:null,controller:null});return}if(j.has(W))return;let H=mp($,U.path),K=new AbortController,M=kc(o,U.path,K.signal),F=null;if(y.has(W))y.delete(W),F=zc(n,r,M,$,H,p,t);else if(I)g&&(F=zc(n,r,M,$,H,p,t));else{let ae={...B,defaultShouldRevalidate:z?!1:g};Qp(H,ae)&&(F=zc(n,r,M,$,H,p,t,ae))}F&&J.push({key:W,routeId:U.routeId,path:U.path,matches:F,match:H,request:M,controller:K})}),{dsMatches:Y,revalidatingFetchers:J}}function e1(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function rb(e,t,n){if(e.lazy)return!0;if(!e1(e))return!1;let r=t!=null&&e.id in t,o=n!=null&&n[e.id]!==void 0;return!r&&o?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!o}function hee(e,t,n){let r=!t||n.route.id!==t.route.id,o=!e.hasOwnProperty(n.route.id);return r||o}function pee(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Qp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function QR(e,t,n,r,o,s){let c;if(e){let p=r[e];bt(p,`No route found to patch children into: routeId = ${e}`),p.children||(p.children=[]),c=p.children}else c=n;let d=[],f=[];if(t.forEach(p=>{let m=c.find(g=>aN(p,g));m?f.push({existingRoute:m,newRoute:p}):d.push(p)}),d.length>0){let p=Bd(d,o,[e||"_","patch",String(c?.length||"0")],r);c.push(...p)}if(s&&f.length>0)for(let p=0;p<f.length;p++){let{existingRoute:m,newRoute:g}=f[p],y=m,[b]=Bd([g],o,[],{},!0);Object.assign(y,{element:b.element?b.element:y.element,errorElement:b.errorElement?b.errorElement:y.errorElement,hydrateFallbackElement:b.hydrateFallbackElement?b.hydrateFallbackElement:y.hydrateFallbackElement})}}function aN(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)=>t.children?.some(o=>aN(n,o))):!1}var WR=new WeakMap,sN=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let o=n[t.id];if(bt(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let s=o.lazy[e];if(!s)return;let c=WR.get(o);c||(c={},WR.set(o,c));let d=c[e];if(d)return d;let f=(async()=>{let p=AZ(e),g=o[e]!==void 0&&e!=="hasErrorBoundary";if(p)zn(!p,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(g)zn(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let y=await s();y!=null&&(Object.assign(o,{[e]:y}),Object.assign(o,r(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(y=>y===void 0)&&(o.lazy=void 0))})();return c[e]=f,f},YR=new WeakMap;function mee(e,t,n,r,o){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=YR.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=kZ(S),R=s[S]!==void 0&&S!=="hasErrorBoundary";C?zn(!C,"Route property "+S+" is not a supported property to be returned from a lazy route function. This property will be ignored."):R?zn(!R,`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 YR.set(s,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let c=Object.keys(e.lazy),d=[],f;for(let m of c){if(o&&o.includes(m))continue;let g=sN({key:m,route:e,manifest:n,mapRouteProperties:r});g&&(d.push(g),m===t&&(f=g))}let p=d.length>0?Promise.all(d).then(()=>{}):void 0;return p?.catch(()=>{}),f?.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:f}}async function KR(e){let t=e.matches.filter(o=>o.shouldLoad),n={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,s)=>{n[t[s].route.id]=o}),n}async function gee(e){return e.matches.some(t=>t.route.middleware)?lN(e,()=>KR(e)):KR(e)}function lN(e,t){return vee(e,t,r=>r,Tee,n);function n(r,o,s){if(s)return Promise.resolve(Object.assign(s.value,{[o]:{type:"error",result:r}}));{let{matches:c}=e,d=Math.min(Math.max(c.findIndex(p=>p.route.id===o),0),Math.max(c.findIndex(p=>p.shouldCallHandler()),0)),f=cs(c,c[d].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function vee(e,t,n,r,o){let{matches:s,request:c,params:d,context:f,unstable_pattern:p}=e,m=s.flatMap(y=>y.route.middleware?y.route.middleware.map(b=>[y.route.id,b]):[]);return await cN({request:c,params:d,context:f,unstable_pattern:p},m,t,n,r,o)}async function cN(e,t,n,r,o,s,c=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let f=t[c];if(!f)return await n();let[p,m]=f,g,y=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await cN(e,t,n,r,o,s,c+1)},g.value}catch(b){return g={value:await s(b,p,g)},g.value}};try{let b=await m(e,y),S=b!=null?r(b):void 0;return o(S)?S:g?S??g.value:(g={value:await y()},g.value)}catch(b){return await s(b,p,g)}}function uN(e,t,n,r,o){let s=sN({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=mee(r.route,kr(n.method)?"action":"loader",t,e,o);return{middleware:s,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function ib(e,t,n,r,o,s,c,d,f=null){let p=!1,m=uN(e,t,n,o,s);return{...o,_lazyPromises:m,shouldLoad:d,shouldRevalidateArgs:f,shouldCallHandler(g){return p=!0,f?typeof g=="boolean"?Qp(o,{...f,defaultShouldRevalidate:g}):Qp(o,f):d},resolve(g){let{lazy:y,loader:b,middleware:S}=o.route,j=p||d||g&&!kr(n.method)&&(y||b),C=S&&S.length>0&&!b&&!y;return j&&(kr(n.method)||!C)?xee({request:n,unstable_pattern:r,match:o,lazyHandlerPromise:m?.handler,lazyRoutePromise:m?.route,handlerOverride:g,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function zc(e,t,n,r,o,s,c,d=null){return r.map(f=>f.route.id!==o.route.id?{...f,shouldLoad:!1,shouldRevalidateArgs:d,shouldCallHandler:()=>!1,_lazyPromises:uN(e,t,n,f,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:ib(e,t,n,wf(r),f,s,c,!0,d))}async function yee(e,t,n,r,o,s){n.some(p=>p._lazyPromises?.middleware)&&await Promise.all(n.map(p=>p._lazyPromises?.middleware));let c={request:t,unstable_pattern:wf(n),params:n[0].params,context:o,matches:n},f=await e({...c,fetcherKey:r,runClientMiddleware:p=>{let m=c;return lN(m,()=>p({...m,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(p=>[p._lazyPromises?.handler,p._lazyPromises?.route]))}catch{}return f}async function xee({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:o,handlerOverride:s,scopedContext:c}){let d,f,p=kr(e.method),m=p?"action":"loader",g=y=>{let b,S=new Promise((E,R)=>b=R);f=()=>b(),e.signal.addEventListener("abort",f);let j=E=>typeof y!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${n.route.id}]`)):y({request:e,unstable_pattern:t,params:n.params,context:c},...E!==void 0?[E]:[]),C=(async()=>{try{return{type:"data",result:await(s?s(R=>j(R)):j())}}catch(E){return{type:"error",result:E}}})();return Promise.race([C,S])};try{let y=p?n.route.action:n.route.loader;if(r||o)if(y){let b,[S]=await Promise.all([g(y).catch(j=>{b=j}),r,o]);if(b!==void 0)throw b;d=S}else{await r;let b=p?n.route.action:n.route.loader;if(b)[d]=await Promise.all([g(b),o]);else if(m==="action"){let S=new URL(e.url),j=S.pathname+S.search;throw Di(405,{method:e.method,pathname:j,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(y)d=await g(y);else{let b=new URL(e.url),S=b.pathname+b.search;throw Di(404,{pathname:S})}}catch(y){return{type:"error",result:y}}finally{f&&e.signal.removeEventListener("abort",f)}return d}async function bee(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function See(e){let{result:t,type:n}=e;if(fN(t)){let r;try{r=await bee(t)}catch(o){return{type:"error",error:o}}return n==="error"?{type:"error",error:new ug(t.status,t.statusText,r),statusCode:t.status,headers:t.headers}:{type:"data",data:r,statusCode:t.status,headers:t.headers}}return n==="error"?n2(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:Eee(t),statusCode:Vd(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Vd(t)?t.status:void 0}:n2(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function wee(e,t,n,r,o){let s=e.headers.get("Location");if(bt(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!cg(s)){let c=r.slice(0,r.findIndex(d=>d.route.id===n)+1);s=nb(new URL(t.url),c,o,s),e.headers.set("Location",s)}return e}function XR(e,t,n){if(cg(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),s=Mi(o.pathname,n)!=null;if(o.origin===t.origin&&s)return o.pathname+o.search+o.hash}return e}function kc(e,t,n,r){let o=e.createURL(dN(t)).toString(),s={signal:n};if(r&&kr(r.formMethod)){let{formMethod:c,formEncType:d}=r;s.method=c.toUpperCase(),d==="application/json"?(s.headers=new Headers({"Content-Type":d}),s.body=JSON.stringify(r.json)):d==="text/plain"?s.body=r.text:d==="application/x-www-form-urlencoded"&&r.formData?s.body=ob(r.formData):s.body=r.formData}return new Request(o,s)}function ob(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function JR(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function jee(e,t,n,r=!1,o=!1){let s={},c=null,d,f=!1,p={},m=n&&ui(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(!sl(b),"Cannot handle redirect results in processLoaderData"),ui(b)){let S=b.error;if(m!==void 0&&(S=m,m=void 0),c=c||{},o)c[y]=S;else{let j=cs(e,y);c[j.route.id]==null&&(c[j.route.id]=S)}r||(s[y]=oN),f||(f=!0,d=Vd(b.error)?b.error.status:500),b.headers&&(p[y]=b.headers)}else s[y]=b.data,b.statusCode&&b.statusCode!==200&&!f&&(d=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:d||200,loaderHeaders:p}}function ZR(e,t,n,r,o,s){let{loaderData:c,errors:d}=jee(t,n,r);return o.filter(f=>!f.matches||f.matches.some(p=>p.shouldLoad)).forEach(f=>{let{key:p,match:m,controller:g}=f;if(g&&g.signal.aborted)return;let y=s[p];if(bt(y,"Did not find corresponding fetcher result"),ui(y)){let b=cs(e.matches,m?.route.id);d&&d[b.route.id]||(d={...d,[b.route.id]:y.error}),e.fetchers.delete(p)}else if(sl(y))bt(!1,"Unhandled fetcher revalidation redirect");else{let b=ha(y.data);e.fetchers.set(p,b)}}),{loaderData:c,errors:d}}function e2(e,t,n,r){let o=Object.entries(t).filter(([,s])=>s!==oN).reduce((s,[c,d])=>(s[c]=d,s),{});for(let s of n){let c=s.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&s.route.loader&&(o[c]=e[c]),r&&r.hasOwnProperty(c))break}return o}function t2(e){return e?ui(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function cs(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 Xh(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Di(e,{pathname:t,routeId:n,method:r,type:o,message:s}={}){let c="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&n?d=`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.`:o==="invalid-body"&&(d="Unable to encode submission body")):e===403?(c="Forbidden",d=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",d=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",r&&t&&n?d=`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&&(d=`Invalid request method "${r.toUpperCase()}"`)),new ug(e||500,c,new Error(d),!0)}function Jh(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(sl(o))return{key:r,result:o}}}function dN(e){let t=typeof e=="string"?Da(e):e;return Lo({...t,hash:""})}function Cee(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Eee(e){return new ug(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function Tee(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&Ree(n))}function Ree(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function _ee(e){return fN(e.result)&&see.has(e.result.status)}function ui(e){return e.type==="error"}function sl(e){return(e&&e.type)==="redirect"}function n2(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function fN(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Aee(e){return aee.has(e.toUpperCase())}function kr(e){return iee.has(e.toUpperCase())}function t1(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function mp(e,t){let n=typeof t=="string"?Da(t).search:t.search;if(e[e.length-1].route.index&&t1(n||""))return e[e.length-1];let r=tN(e);return r[r.length-1]}function r2(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:s,json:c}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:s,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:c,text:void 0}}}function hx(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 Dee(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 hd(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 kee(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 ha(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 Pee(e,t){try{let n=e.sessionStorage.getItem(iN);if(n){let r=JSON.parse(n);for(let[o,s]of Object.entries(r||{}))s&&Array.isArray(s)&&t.set(o,new Set(s||[]))}}catch{}}function Nee(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(iN,JSON.stringify(n))}catch(r){zn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function i2(){let e,t,n=new Promise((r,o)=>{e=async s=>{r(s);try{await n}catch{}},t=async s=>{o(s);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Nl=v.createContext(null);Nl.displayName="DataRouter";var jf=v.createContext(null);jf.displayName="DataRouterState";v.createContext(!1);var n1=v.createContext({isTransitioning:!1});n1.displayName="ViewTransition";var hN=v.createContext(new Map);hN.displayName="Fetchers";var Oee=v.createContext(null);Oee.displayName="Await";var so=v.createContext(null);so.displayName="Navigation";var Cf=v.createContext(null);Cf.displayName="Location";var lo=v.createContext({outlet:null,matches:[],isDataRoute:!1});lo.displayName="Route";var r1=v.createContext(null);r1.displayName="RouteError";function Mee(e,{relative:t}={}){bt(Ef(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=v.useContext(so),{hash:o,pathname:s,search:c}=Tf(e,{relative:t}),d=s;return n!=="/"&&(d=s==="/"?n:Do([n,s])),r.createHref({pathname:d,search:c,hash:o})}function Ef(){return v.useContext(Cf)!=null}function mi(){return bt(Ef(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Cf).location}var pN="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function mN(e){v.useContext(so).static||v.useLayoutEffect(e)}function Wn(){let{isDataRoute:e}=v.useContext(lo);return e?Kee():Lee()}function Lee(){bt(Ef(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(Nl),{basename:t,navigator:n}=v.useContext(so),{matches:r}=v.useContext(lo),{pathname:o}=mi(),s=JSON.stringify(JS(r)),c=v.useRef(!1);return mN(()=>{c.current=!0}),v.useCallback((f,p={})=>{if(zn(c.current,pN),!c.current)return;if(typeof f=="number"){n.go(f);return}let m=ZS(f,JSON.parse(s),o,p.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Do([t,m.pathname])),(p.replace?n.replace:n.push)(m,p.state,p)},[t,n,s,o,e])}var Iee=v.createContext(null);function zee(e){let t=v.useContext(lo).outlet;return v.useMemo(()=>t&&v.createElement(Iee.Provider,{value:e},t),[t,e])}function qt(){let{matches:e}=v.useContext(lo),t=e[e.length-1];return t?t.params:{}}function Tf(e,{relative:t}={}){let{matches:n}=v.useContext(lo),{pathname:r}=mi(),o=JSON.stringify(JS(n));return v.useMemo(()=>ZS(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function $ee(e,t){return gN(e,t)}function gN(e,t,n,r,o){bt(Ef(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=v.useContext(so),{matches:c}=v.useContext(lo),d=c[c.length-1],f=d?d.params:{},p=d?d.pathname:"/",m=d?d.pathnameBase:"/",g=d&&d.route;{let R=g&&g.path||"";vN(p,!g||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${R}">) 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.
|
|
244
|
+
|
|
245
|
+
Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let y=mi(),b;if(t){let R=typeof t=="string"?Da(t):t;bt(m==="/"||R.pathname?.startsWith(m),`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 "${m}" but pathname "${R.pathname}" was given in the \`location\` prop.`),b=R}else b=y;let S=b.pathname||"/",j=S;if(m!=="/"){let R=m.replace(/^\//,"").split("/");j="/"+S.replace(/^\//,"").split("/").slice(R.length).join("/")}let C=ls(e,{pathname:j});zn(g||C!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),zn(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.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 E=Hee(C&&C.map(R=>Object.assign({},R,{params:Object.assign({},f,R.params),pathname:Do([m,s.encodeLocation?s.encodeLocation(R.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?m:Do([m,s.encodeLocation?s.encodeLocation(R.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),c,n,r,o);return t&&E?v.createElement(Cf.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},E):E}function Uee(){let e=Yee(),t=Vd(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)",o={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:o},n):null,c)}var Bee=v.createElement(Uee,null),Vee=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){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?v.createElement(lo.Provider,{value:this.props.routeContext},v.createElement(r1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Fee({routeContext:e,match:t,children:n}){let r=v.useContext(Nl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(lo.Provider,{value:e},n)}function Hee(e,t=[],n=null,r=null,o=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 s=e,c=n?.errors;if(c!=null){let m=s.findIndex(g=>g.route.id&&c?.[g.route.id]!==void 0);bt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),s=s.slice(0,Math.min(s.length,m+1))}let d=!1,f=-1;if(n)for(let m=0;m<s.length;m++){let g=s[m];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=m),g.route.id){let{loaderData:y,errors:b}=n,S=g.route.loader&&!y.hasOwnProperty(g.route.id)&&(!b||b[g.route.id]===void 0);if(g.route.lazy||S){d=!0,f>=0?s=s.slice(0,f+1):s=[s[0]];break}}}let p=n&&r?(m,g)=>{r(m,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:wf(n.matches),errorInfo:g})}:void 0;return s.reduceRight((m,g,y)=>{let b,S=!1,j=null,C=null;n&&(b=c&&g.route.id?c[g.route.id]:void 0,j=g.route.errorElement||Bee,d&&(f<0&&y===0?(vN("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,C=null):f===y&&(S=!0,C=g.route.hydrateFallbackElement||null)));let E=t.concat(s.slice(0,y+1)),R=()=>{let T;return b?T=j:S?T=C:g.route.Component?T=v.createElement(g.route.Component,null):g.route.element?T=g.route.element:T=m,v.createElement(Fee,{match:g,routeContext:{outlet:m,matches:E,isDataRoute:n!=null},children:T})};return n&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?v.createElement(Vee,{location:n.location,revalidation:n.revalidation,component:j,error:b,children:R(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:p}):R()},null)}function i1(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function qee(e){let t=v.useContext(Nl);return bt(t,i1(e)),t}function Gee(e){let t=v.useContext(jf);return bt(t,i1(e)),t}function Qee(e){let t=v.useContext(lo);return bt(t,i1(e)),t}function o1(e){let t=Qee(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 Wee(){return o1("useRouteId")}function Yee(){let e=v.useContext(r1),t=Gee("useRouteError"),n=o1("useRouteError");return e!==void 0?e:t.errors?.[n]}function Kee(){let{router:e}=qee("useNavigate"),t=o1("useNavigate"),n=v.useRef(!1);return mN(()=>{n.current=!0}),v.useCallback(async(o,s={})=>{zn(n.current,pN),n.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...s}))},[e,t])}var o2={};function vN(e,t,n){!t&&!o2[e]&&(o2[e]=!0,zn(!1,n))}var a2={};function s2(e,t){!e&&!a2[t]&&(a2[t]=!0,console.warn(t))}var Xee="useOptimistic",l2=gb[Xee],Jee=()=>{};function Zee(e){return l2?l2(e):[e,Jee]}function ete(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&zn(!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&&zn(!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&&zn(!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 tte=["HydrateFallback","hydrateFallbackElement"],nte=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 rte({router:e,flushSync:t,unstable_onError:n,unstable_useTransitions:r}){let[o,s]=v.useState(e.state),[c,d]=Zee(o),[f,p]=v.useState(),[m,g]=v.useState({isTransitioning:!1}),[y,b]=v.useState(),[S,j]=v.useState(),[C,E]=v.useState(),R=v.useRef(new Map),T=v.useCallback((A,{deletedFetchers:N,newErrors:z,flushSync:B,viewTransitionOpts:G})=>{z&&n&&Object.values(z).forEach(J=>n(J,{location:A.location,params:A.matches[0]?.params??{},unstable_pattern:wf(A.matches)})),A.fetchers.forEach((J,U)=>{J.data!==void 0&&R.current.set(U,J.data)}),N.forEach(J=>R.current.delete(J)),s2(B===!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 Y=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(s2(G==null||Y,"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."),!G||!Y){t&&B?t(()=>s(A)):r===!1?s(A):v.startTransition(()=>{r===!0&&d(J=>c2(J,A)),s(A)});return}if(t&&B){t(()=>{S&&(y?.resolve(),S.skipTransition()),g({isTransitioning:!0,flushSync:!0,currentLocation:G.currentLocation,nextLocation:G.nextLocation})});let J=e.window.document.startViewTransition(()=>{t(()=>s(A))});J.finished.finally(()=>{t(()=>{b(void 0),j(void 0),p(void 0),g({isTransitioning:!1})})}),t(()=>j(J));return}S?(y?.resolve(),S.skipTransition(),E({state:A,currentLocation:G.currentLocation,nextLocation:G.nextLocation})):(p(A),g({isTransitioning:!0,flushSync:!1,currentLocation:G.currentLocation,nextLocation:G.nextLocation}))},[e.window,t,S,y,r,d,n]);v.useLayoutEffect(()=>e.subscribe(T),[e,T]),v.useEffect(()=>{m.isTransitioning&&!m.flushSync&&b(new nte)},[m]),v.useEffect(()=>{if(y&&f&&e.window){let A=f,N=y.promise,z=e.window.document.startViewTransition(async()=>{r===!1?s(A):v.startTransition(()=>{r===!0&&d(B=>c2(B,A)),s(A)}),await N});z.finished.finally(()=>{b(void 0),j(void 0),p(void 0),g({isTransitioning:!1})}),j(z)}},[f,y,e.window,r,d]),v.useEffect(()=>{y&&f&&c.location.key===f.location.key&&y.resolve()},[y,S,c.location,f]),v.useEffect(()=>{!m.isTransitioning&&C&&(p(C.state),g({isTransitioning:!0,flushSync:!1,currentLocation:C.currentLocation,nextLocation:C.nextLocation}),E(void 0))},[m.isTransitioning,C]);let _=v.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:A=>e.navigate(A),push:(A,N,z)=>e.navigate(A,{state:N,preventScrollReset:z?.preventScrollReset}),replace:(A,N,z)=>e.navigate(A,{replace:!0,state:N,preventScrollReset:z?.preventScrollReset})}),[e]),k=e.basename||"/",L=v.useMemo(()=>({router:e,navigator:_,static:!1,basename:k,unstable_onError:n}),[e,_,k,n]);return v.createElement(v.Fragment,null,v.createElement(Nl.Provider,{value:L},v.createElement(jf.Provider,{value:c},v.createElement(hN.Provider,{value:R.current},v.createElement(n1.Provider,{value:m},v.createElement(ate,{basename:k,location:c.location,navigationType:c.historyAction,navigator:_,unstable_useTransitions:r===!0},v.createElement(ite,{routes:e.routes,future:e.future,state:c,unstable_onError:n})))))),null)}function c2(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var ite=v.memo(ote);function ote({routes:e,future:t,state:n,unstable_onError:r}){return gN(e,void 0,n,r,t)}function a1(e){return zee(e.context)}function Ue(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 ate({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:s=!1,unstable_useTransitions:c}){bt(!Ef(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:d,navigator:o,static:s,unstable_useTransitions:c,future:{}}),[d,o,s,c]);typeof n=="string"&&(n=Da(n));let{pathname:p="/",search:m="",hash:g="",state:y=null,key:b="default"}=n,S=v.useMemo(()=>{let j=Mi(p,d);return j==null?null:{location:{pathname:j,search:m,hash:g,state:y,key:b},navigationType:r}},[d,p,m,g,y,b,r]);return zn(S!=null,`<Router basename="${d}"> is not able to match the URL "${p}${m}${g}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:v.createElement(so.Provider,{value:f},v.createElement(Cf.Provider,{children:t,value:S}))}function ste({children:e,location:t}){return $ee(ab(e),t)}function ab(e,t=[]){let n=[];return v.Children.forEach(e,(r,o)=>{if(!v.isValidElement(r))return;let s=[...t,o];if(r.type===v.Fragment){n.push.apply(n,ab(r.props.children,s));return}bt(r.type===Ue,`[${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,middleware:r.props.middleware,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=ab(r.props.children,s)),n.push(c)}),n}var gp="get",vp="application/x-www-form-urlencoded";function dg(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function lte(e){return dg(e)&&e.tagName.toLowerCase()==="button"}function cte(e){return dg(e)&&e.tagName.toLowerCase()==="form"}function ute(e){return dg(e)&&e.tagName.toLowerCase()==="input"}function dte(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function fte(e,t){return e.button===0&&(!t||t==="_self")&&!dte(e)}function sb(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(o=>[n,o]):[[n,r]])},[]))}function hte(e,t){let n=sb(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(s=>{n.append(o,s)})}),n}var Zh=null;function pte(){if(Zh===null)try{new FormData(document.createElement("form"),0),Zh=!1}catch{Zh=!0}return Zh}var mte=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function px(e){return e!=null&&!mte.has(e)?(zn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${vp}"`),null):e}function gte(e,t){let n,r,o,s,c;if(cte(e)){let d=e.getAttribute("action");r=d?Mi(d,t):null,n=e.getAttribute("method")||gp,o=px(e.getAttribute("enctype"))||vp,s=new FormData(e)}else if(lte(e)||ute(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||d.getAttribute("action");if(r=f?Mi(f,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||gp,o=px(e.getAttribute("formenctype"))||px(d.getAttribute("enctype"))||vp,s=new FormData(d,e),!pte()){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(dg(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=gp,r=null,o=vp,c=e}return s&&o==="text/plain"&&(c=s,s=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:s,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function s1(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function vte(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&Mi(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function yte(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 xte(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 bte(e,t,n){let r=await Promise.all(e.map(async o=>{let s=t.routes[o.route.id];if(s){let c=await yte(s,n);return c.links?c.links():[]}return[]}));return Cte(r.flat(1).filter(xte).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function u2(e,t,n,r,o,s){let c=(f,p)=>n[p]?f.route.id!==n[p].route.id:!0,d=(f,p)=>n[p].pathname!==f.pathname||n[p].route.path?.endsWith("*")&&n[p].params["*"]!==f.params["*"];return s==="assets"?t.filter((f,p)=>c(f,p)||d(f,p)):s==="data"?t.filter((f,p)=>{let m=r.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(c(f,p)||d(f,p))return!0;if(f.route.shouldRevalidate){let g=f.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function Ste(e,t,{includeHydrateFallback:n}={}){return wte(e.map(r=>{let o=t.routes[r.route.id];if(!o)return[];let s=[o.module];return o.clientActionModule&&(s=s.concat(o.clientActionModule)),o.clientLoaderModule&&(s=s.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(s=s.concat(o.hydrateFallbackModule)),o.imports&&(s=s.concat(o.imports)),s}).flat(1))}function wte(e){return[...new Set(e)]}function jte(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Cte(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let s=JSON.stringify(jte(o));return n.has(s)||(n.add(s),r.push({key:s,link:o})),r},[])}function yN(){let e=v.useContext(Nl);return s1(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Ete(){let e=v.useContext(jf);return s1(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var l1=v.createContext(void 0);l1.displayName="FrameworkContext";function xN(){let e=v.useContext(l1);return s1(e,"You must render this element inside a <HydratedRouter> element"),e}function Tte(e,t){let n=v.useContext(l1),[r,o]=v.useState(!1),[s,c]=v.useState(!1),{onFocus:d,onBlur:f,onMouseEnter:p,onMouseLeave:m,onTouchStart:g}=t,y=v.useRef(null);v.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=E=>{E.forEach(R=>{c(R.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=()=>{o(!0)},S=()=>{o(!1),c(!1)};return n?e!=="intent"?[s,y,{}]:[s,y,{onFocus:pd(d,b),onBlur:pd(f,S),onMouseEnter:pd(p,b),onMouseLeave:pd(m,S),onTouchStart:pd(g,b)}]:[!1,y,{}]}function pd(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Rte({page:e,...t}){let{router:n}=yN(),r=v.useMemo(()=>ls(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(Ate,{page:e,matches:r,...t}):null}function _te(e){let{manifest:t,routeModules:n}=xN(),[r,o]=v.useState([]);return v.useEffect(()=>{let s=!1;return bte(e,t,n).then(c=>{s||o(c)}),()=>{s=!0}},[e,t,n]),r}function Ate({page:e,matches:t,...n}){let r=mi(),{manifest:o,routeModules:s}=xN(),{basename:c}=yN(),{loaderData:d,matches:f}=Ete(),p=v.useMemo(()=>u2(e,t,f,o,r,"data"),[e,t,f,o,r]),m=v.useMemo(()=>u2(e,t,f,o,r,"assets"),[e,t,f,o,r]),g=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let S=new Set,j=!1;if(t.forEach(E=>{let R=o.routes[E.route.id];!R||!R.hasLoader||(!p.some(T=>T.route.id===E.route.id)&&E.route.id in d&&s[E.route.id]?.shouldRevalidate||R.hasClientLoader?j=!0:S.add(E.route.id))}),S.size===0)return[];let C=vte(e,c,"data");return j&&S.size>0&&C.searchParams.set("_routes",t.filter(E=>S.has(E.route.id)).map(E=>E.route.id).join(",")),[C.pathname+C.search]},[c,d,r,o,p,t,e,s]),y=v.useMemo(()=>Ste(m,o),[m,o]),b=_te(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,nonce:n.nonce,...j})))}function Dte(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var bN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{bN&&(window.__reactRouterVersion="7.10.1")}catch{}function kte(e,t){return dee({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:EZ({window:t?.window}),hydrationData:Pte(),routes:e,mapRouteProperties:ete,hydrationRouteProperties:tte,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function Pte(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Nte(e.errors)}),e}function Nte(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new ug(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let s=window[o.__subType];if(typeof s=="function")try{let c=new s(o.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let s=new Error(o.message);s.stack="",n[r]=s}}else n[r]=o;return n}var SN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wN=v.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:s,replace:c,state:d,target:f,to:p,preventScrollReset:m,viewTransition:g,...y},b){let{basename:S,unstable_useTransitions:j}=v.useContext(so),C=typeof p=="string"&&SN.test(p),E,R=!1;if(typeof p=="string"&&C&&(E=p,bN))try{let B=new URL(window.location.href),G=p.startsWith("//")?new URL(B.protocol+p):new URL(p),Y=Mi(G.pathname,S);G.origin===B.origin&&Y!=null?p=Y+G.search+G.hash:R=!0}catch{zn(!1,`<Link to="${p}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let T=Mee(p,{relative:o}),[_,k,L]=Tte(r,y),A=Ite(p,{replace:c,state:d,target:f,preventScrollReset:m,relative:o,viewTransition:g,unstable_useTransitions:j});function N(B){t&&t(B),B.defaultPrevented||A(B)}let z=v.createElement("a",{...y,...L,href:E||T,onClick:R||s?t:N,ref:Dte(b,k),target:f,"data-discover":!C&&n==="render"?"true":void 0});return _&&!C?v.createElement(v.Fragment,null,z,v.createElement(Rte,{page:T})):z});wN.displayName="Link";var Ote=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:s,to:c,viewTransition:d,children:f,...p},m){let g=Tf(c,{relative:p.relative}),y=mi(),b=v.useContext(jf),{navigator:S,basename:j}=v.useContext(so),C=b!=null&&Vte(g)&&d===!0,E=S.encodeLocation?S.encodeLocation(g).pathname:g.pathname,R=y.pathname,T=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(R=R.toLowerCase(),T=T?T.toLowerCase():null,E=E.toLowerCase()),T&&j&&(T=Mi(T,j)||T);const _=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let k=R===E||!o&&R.startsWith(E)&&R.charAt(_)==="/",L=T!=null&&(T===E||!o&&T.startsWith(E)&&T.charAt(E.length)==="/"),A={isActive:k,isPending:L,isTransitioning:C},N=k?t:void 0,z;typeof r=="function"?z=r(A):z=[r,k?"active":null,L?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let B=typeof s=="function"?s(A):s;return v.createElement(wN,{...p,"aria-current":N,className:z,ref:m,style:B,to:c,viewTransition:d},typeof f=="function"?f(A):f)});Ote.displayName="NavLink";var Mte=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:s,method:c=gp,action:d,onSubmit:f,relative:p,preventScrollReset:m,viewTransition:g,...y},b)=>{let{unstable_useTransitions:S}=v.useContext(so),j=Ute(),C=Bte(d,{relative:p}),E=c.toLowerCase()==="get"?"get":"post",R=typeof d=="string"&&SN.test(d),T=_=>{if(f&&f(_),_.defaultPrevented)return;_.preventDefault();let k=_.nativeEvent.submitter,L=k?.getAttribute("formmethod")||c,A=()=>j(k||_.currentTarget,{fetcherKey:t,method:L,navigate:n,replace:o,state:s,relative:p,preventScrollReset:m,viewTransition:g});S&&n!==!1?v.startTransition(()=>A()):A()};return v.createElement("form",{ref:b,method:E,action:C,onSubmit:r?f:T,...y,"data-discover":!R&&e==="render"?"true":void 0})});Mte.displayName="Form";function Lte(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jN(e){let t=v.useContext(Nl);return bt(t,Lte(e)),t}function Ite(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:s,viewTransition:c,unstable_useTransitions:d}={}){let f=Wn(),p=mi(),m=Tf(e,{relative:s});return v.useCallback(g=>{if(fte(g,t)){g.preventDefault();let y=n!==void 0?n:Lo(p)===Lo(m),b=()=>f(e,{replace:y,state:r,preventScrollReset:o,relative:s,viewTransition:c});d?v.startTransition(()=>b()):b()}},[p,f,m,n,r,t,e,o,s,c,d])}function c1(e){zn(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(sb(e)),n=v.useRef(!1),r=mi(),o=v.useMemo(()=>hte(r.search,n.current?null:t.current),[r.search]),s=Wn(),c=v.useCallback((d,f)=>{const p=sb(typeof d=="function"?d(new URLSearchParams(o)):d);n.current=!0,s("?"+p,f)},[s,o]);return[o,c]}var zte=0,$te=()=>`__${String(++zte)}__`;function Ute(){let{router:e}=jN("useSubmit"),{basename:t}=v.useContext(so),n=Wee(),r=e.fetch,o=e.navigate;return v.useCallback(async(s,c={})=>{let{action:d,method:f,encType:p,formData:m,body:g}=gte(s,t);if(c.navigate===!1){let y=c.fetcherKey||$te();await r(y,n,c.action||d,{preventScrollReset:c.preventScrollReset,formData:m,body:g,formMethod:c.method||f,formEncType:c.encType||p,flushSync:c.flushSync})}else await o(c.action||d,{preventScrollReset:c.preventScrollReset,formData:m,body:g,formMethod:c.method||f,formEncType:c.encType||p,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[r,o,t,n])}function Bte(e,{relative:t}={}){let{basename:n}=v.useContext(so),r=v.useContext(lo);bt(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),s={...Tf(e||".",{relative:t})},c=mi();if(e==null){s.search=c.search;let d=new URLSearchParams(s.search),f=d.getAll("index");if(f.some(m=>m==="")){d.delete("index"),f.filter(g=>g).forEach(g=>d.append("index",g));let m=d.toString();s.search=m?`?${m}`:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:Do([n,s.pathname])),Lo(s)}function Vte(e,{relative:t}={}){let n=v.useContext(n1);bt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=jN("useViewTransitionState"),o=Tf(e,{relative:t});if(!n.isTransitioning)return!1;let s=Mi(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=Mi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Gp(o.pathname,c)!=null||Gp(o.pathname,s)!=null}function u1(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function Fte(e){if(e.resourceType==="Specimen")return e;if(e.resourceType==="Observation")return e.specimen;if(e.resourceType==="DiagnosticReport"||e.resourceType==="ServiceRequest")return e.specimen?.[0]}function Rs(e){return hl(e.getActiveLogin()?.project)}function fg(e){const t=Re(),n=Rs(t),r=Wn(),[o,s]=v.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:he.EQUALS,value:"Project/"+n},{code:"profile-type",operator:he.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return a.jsx(mu,{search:o,onClick:c=>r(`/admin/members/${c.resource.id}`)?.catch(console.error),onChange:c=>s(c.definition),hideFilters:!0,hideToolbar:!0})}function Hte(){return a.jsxs(a.Fragment,{children:[a.jsx($e,{children:"Bots"}),a.jsx(fg,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(yt,{to:"/admin/bots/new",children:"Create new bot"})})]})}function qte(){return a.jsxs(a.Fragment,{children:[a.jsx($e,{children:"Clients"}),a.jsx(fg,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(yt,{to:"/admin/clients/new",children:"Create new client"})})]})}function hg(e){return a.jsx(kl,{resourceType:"AccessPolicy",name:e.name,defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{Vo(t)?e.onChange(Yt(t)):e.onChange(void 0)}})}function Gte(){const e=Re(),t=Rs(e),[n,r]=v.useState(""),[o,s]=v.useState(""),[c,d]=v.useState(),[f,p]=v.useState(),[m,g]=v.useState(void 0);return a.jsxs(a.Fragment,{children:[a.jsx($e,{children:"Create new Bot"}),a.jsxs(ht,{onSubmit:()=>{const y={name:n,description:o,accessPolicy:c};e.post("admin/projects/"+t+"/bot",y).then(b=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),g(b),Ne({color:"green",message:"Bot created"})}).catch(b=>{Ne({color:"red",message:Qe(b),autoClose:!1}),p(Xt(b))})},children:[!m&&a.jsxs(Be,{children:[a.jsx(zt,{title:"Name",htmlFor:"name",outcome:f,children:a.jsx(He,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:y=>r(y.currentTarget.value),error:Lt(f,"name")})}),a.jsx(zt,{title:"Description",htmlFor:"description",outcome:f,children:a.jsx(He,{id:"description",name:"description",onChange:y=>s(y.currentTarget.value),error:Lt(f,"description")})}),a.jsx(zt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:a.jsx(hg,{name:"accessPolicy",onChange:d})}),a.jsx(ye,{justify:"flex-end",children:a.jsx(Pe,{type:"submit",children:"Create Bot"})})]}),m&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(Ee,{children:"Bot created"}),a.jsxs(Pr,{children:[a.jsx(Pr.Item,{children:a.jsx(yt,{to:m,children:"Go to new bot"})}),a.jsx(Pr.Item,{children:a.jsx(yt,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function Qte(){const e=Re(),t=Rs(e),[n,r]=v.useState(""),[o,s]=v.useState(""),[c,d]=v.useState(""),[f,p]=v.useState(),[m,g]=v.useState(),[y,b]=v.useState(void 0);return a.jsxs(a.Fragment,{children:[a.jsx($e,{children:"Create new Client"}),a.jsxs(ht,{onSubmit:()=>{const S={name:n,description:o,redirectUri:c,accessPolicy:f};e.post("admin/projects/"+t+"/client",S).then(j=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),b(j),Ne({color:"green",message:"Client created"})}).catch(j=>{Ne({color:"red",message:Qe(j),autoClose:!1}),g(Xt(j))})},children:[!y&&a.jsxs(Be,{children:[a.jsx(zt,{title:"Name",htmlFor:"name",outcome:m,children:a.jsx(He,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:S=>r(S.currentTarget.value),error:Lt(m,"name")})}),a.jsx(zt,{title:"Description",htmlFor:"description",outcome:m,children:a.jsx(He,{id:"description",name:"description",onChange:S=>s(S.currentTarget.value),error:Lt(m,"description")})}),a.jsx(zt,{title:"Redirect URI",htmlFor:"redirectUri",outcome:m,children:a.jsx(He,{id:"redirectUri",name:"redirectUri",onChange:S=>d(S.currentTarget.value),error:Lt(m,"redirectUri")})}),a.jsx(zt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:m,children:a.jsx(hg,{name:"accessPolicy",onChange:p})}),a.jsx(ye,{justify:"flex-end",children:a.jsx(Pe,{type:"submit",children:"Create Client"})})]}),y&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(Ee,{children:"Client created"}),a.jsxs(Pr,{children:[a.jsx(Pr.Item,{children:a.jsx(yt,{to:y,children:"Go to new client"})}),a.jsx(Pr.Item,{children:a.jsx(yt,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function d1(e,t,n,r){const o=Date.now().toString();Ne({id:o,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=>{let d="Done";return c.resourceType==="AsyncJob"?d=a.jsx(yt,{to:c,children:"View AsyncJob"}):c.resourceType==="OperationOutcome"&&c.issue?.[0]?.details?.text&&(d=a.jsx(Ee,{children:c.issue[0].details.text})),ki.update({id:o,color:"green",title:t,message:d,icon:a.jsx(Fo,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c}).catch(c=>{throw ki.update({id:o,color:"red",title:t,message:Qe(c),icon:a.jsx(vl,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c})}function _c(e,t,n,r){d1(e,t,n,r).catch(()=>{})}const Wte=8;function Yte({pillInputProps:e,inputProps:t,data:n,onChange:r}){const o=Tl({onDropdownClose:()=>o.resetSelectedOption(),onDropdownOpen:()=>o.updateSelectedOptionIndex("active")}),[s,c]=v.useState(""),[d,f]=v.useState([]),p=S=>{const j=d.includes(S)?d.filter(C=>C!==S):[...d,S];f(j),r&&r(j)},m=S=>f(j=>j.filter(C=>C!==S)),g=v.useMemo(()=>d.map(S=>a.jsx(ya,{withRemoveButton:!0,onRemove:()=>m(S),children:S},S)),[d]),y=v.useMemo(()=>{const S=s.trim().toLowerCase();return n.filter(j=>j.toLowerCase().includes(S))},[n,s]),b=v.useMemo(()=>{const S=new Array(Math.min(y.length,Wte));for(let j=0;j<S.length;j++){const C=y[j];S[j]=a.jsx(Ye.Option,{value:C,active:d.includes(C),children:a.jsxs(ye,{gap:"sm",children:[d.includes(C)?a.jsx(Zd,{size:12}):null,a.jsx("span",{children:C})]})},C)}return S},[y,d]);return a.jsxs(Ye,{store:o,onOptionSubmit:p,withinPortal:!1,children:[a.jsx(Ye.DropdownTarget,{children:a.jsx(ms,{onClick:()=>o.openDropdown(),...e,children:a.jsxs(ya.Group,{children:[g,a.jsx(Ye.EventsTarget,{children:a.jsx(ms.Field,{onFocus:()=>o.openDropdown(),onBlur:()=>{o.closeDropdown(),c("")},value:s,onChange:S=>{o.updateSelectedOptionIndex(),c(S.currentTarget.value)},onKeyDown:S=>{S.key==="Backspace"&&s.length===0&&d.length>0&&(S.preventDefault(),m(d[d.length-1]))},...t})})]})})}),a.jsx(Ye.Dropdown,{children:a.jsx(Ye.Options,{children:b.length>0?b:a.jsx(Ye.Empty,{children:"Nothing found..."})})})]})}function Kte({defaultGinPendingListLimit:e,availableTables:t,onResponse:n}){const r=Re(),[o,s]=v.useState(!1),[c,d]=v.useState([]),[f,p]=v.useState("unspecified"),[m,g]=v.useState("unspecified"),[y,b]=v.useState(void 0),S=()=>{const j={tableName:c};f==="reset"?j.fastUpdateAction="reset":f==="on"?(j.fastUpdateAction="set",j.fastUpdateValue=!0):f==="off"&&(j.fastUpdateAction="set",j.fastUpdateValue=!1),m==="reset"?j.ginPendingListLimitAction="reset":m==="set"&&(j.ginPendingListLimitAction="set",j.ginPendingListLimitValue=y),s(!0),d1(r,"Configure GIN Indexes","fhir/R4/$db-configure-indexes",j).then(C=>{n(C)}).catch(()=>{}).finally(()=>{s(!1)})};return a.jsx(ht,{onSubmit:S,children:a.jsxs(Be,{gap:"sm",maw:"800",children:[a.jsx(Yd,{label:"Table(s)",children:a.jsx(Yte,{data:t,onChange:j=>d(j),inputProps:{name:"tables",placeholder:"e.g. Observation"}})}),a.jsx(yr.Group,{name:"fastUpdate",label:"fastupdate",value:f,onChange:j=>p(j),children:a.jsxs(ye,{h:"36",children:[a.jsx(yr,{size:"sm",value:"unspecified",label:"unspecified"}),a.jsx(yr,{size:"sm",value:"reset",label:"reset to default (on)"}),a.jsx(yr,{size:"sm",value:"off",label:"off"}),a.jsx(yr,{size:"sm",value:"on",label:"on"})]})}),a.jsx(yr.Group,{name:"ginPendingListLimit",label:"gin_pending_list_limit",value:m,onChange:j=>{g(j),j!=="set"&&b(void 0)},children:a.jsxs(ye,{h:"36",children:[a.jsx(yr,{size:"sm",value:"unspecified",label:"unspecified"}),a.jsx(yr,{size:"sm",value:"reset",label:`reset to default (${e}kB)`}),a.jsxs(ye,{children:[a.jsx(yr,{size:"sm",value:"set",label:"Set to (kB)"}),a.jsx(Hc,{title:"gin_pending_list_limit_value",name:"gin_pending_list_limit_value",value:(m==="set"?y:"")||"",disabled:m!=="set",required:m==="set",size:"sm",w:"100",min:64,max:2147483647,onChange:j=>{b(typeof j=="number"?j:void 0)}})]})]})}),a.jsx(ye,{justify:"center",children:a.jsx(Tr,{size:"sm",loading:o,children:"Update"})})]})})}const Xte=8;function Jte({inputProps:e,data:t,onChange:n}){const r=Tl({onDropdownClose:()=>r.resetSelectedOption()}),[o,s]=v.useState(null),[c,d]=v.useState(""),f=v.useMemo(()=>t.filter(m=>m.toLowerCase().includes(c.toLowerCase().trim())),[t,c]),p=v.useMemo(()=>{const m=new Array(Math.min(f.length,Xte));for(let g=0;g<m.length;g++){const y=f[g];m[g]=a.jsx(Ye.Option,{value:y,children:y},y)}return m},[f]);return a.jsxs(Ye,{store:r,withinPortal:!1,onOptionSubmit:m=>{n&&n(m),s(m),d(m),r.closeDropdown()},children:[a.jsx(Ye.Target,{children:a.jsx(Ir,{rightSection:a.jsx(Ye.Chevron,{}),value:c,onChange:m=>{r.openDropdown(),r.updateSelectedOptionIndex(),d(m.currentTarget.value)},onClick:()=>r.openDropdown(),onFocus:()=>r.openDropdown(),onBlur:()=>{r.closeDropdown(),d(o||"")},rightSectionPointerEvents:"none",...e})}),a.jsx(Ye.Dropdown,{children:a.jsx(Ye.Options,{children:p.length>0?p:a.jsx(Ye.Empty,{children:"Nothing found"})})})]})}function Zte(e){let t=[];for(const n of e)t.push(n),t.push(n+"_History"),t.push(n+"_References");return t.push("Address"),t.push("ContactPoint"),t.push("HumanName"),t.push("Coding"),t.push("Coding_Property"),t.push("DatabaseMigration"),t=Qc(t),t}function CN(e){return typeof e=="string"?e.length>50?e.substring(0,50)+"...":e:typeof e=="boolean"?e.toString().toLocaleUpperCase():e}function ene(){const e=Re(),[t,{open:n,close:r}]=Zc(!1),[o,s]=v.useState(""),[c,d]=v.useState(),[f,p]=v.useState(void 0),[m,g]=v.useState(0),[y,b]=v.useState(!1),[S,j]=v.useState(void 0),[C,E]=v.useState([]),[R,T]=v.useState(0);v.useEffect(()=>{async function A(){return(await e.valueSetExpand({url:"https://medplum.com/fhir/ValueSet/resource-types",count:200})).expansion?.contains?.map(z=>z.code).filter(z=>z!==void 0)??[]}A().then(N=>{E(Zte(N))}).catch(console.error)},[e]),v.useEffect(()=>{b(!0),e.get("fhir/R4/$db-indexes?tableName="+encodeURIComponent(f??""),{cache:"no-cache"}).then(A=>{const N=A.parameter?.find(B=>B.name==="defaultGinPendingListLimit")?.valueInteger??0;g(N);const z=A.parameter?.filter(B=>B.name==="index");j(z??[])}).finally(()=>{b(!1)}).catch(A=>{Ne({color:"red",message:A.message})})},[e,f,R]);const _=A=>{s("Configure results"),d(a.jsx("pre",{children:JSON.stringify(A,null,2)})),n(),T(N=>(N+1)%100)},k={onClick:A=>{s("Details"),d(a.jsx("pre",{children:A})),n()}};let L;return y?L="Loading...":f?S?.length===0&&(L="No GIN indexes on this table"):L="Select a table",a.jsxs(a.Fragment,{children:[a.jsxs(Be,{gap:"sm",children:[a.jsx("h2",{children:"Configure GIN indexes"}),a.jsx(ye,{children:a.jsx(Kte,{defaultGinPendingListLimit:m,availableTables:C,onResponse:_})}),a.jsx("h2",{children:"GIN index stats"}),a.jsxs(ye,{children:[a.jsx(Jte,{data:C,inputProps:{placeholder:"Table name",inputSize:"50"},onChange:A=>{p(A)}}),a.jsx(Pe,{loading:y,onClick:()=>T(A=>(A+1)%100),disabled:!f,children:"Refresh"})]}),a.jsx(ue.ScrollContainer,{minWidth:500,children:a.jsxs(ue,{striped:!0,highlightOnHover:!0,children:[a.jsx(ue.Thead,{children:a.jsxs(ue.Tr,{children:[a.jsx(ue.Th,{children:"Schema"}),a.jsx(ue.Th,{children:"Table"}),a.jsx(ue.Th,{children:"Index"}),a.jsx(ue.Th,{children:"fastupdate"}),a.jsx(ue.Th,{children:"gin_pending_list_limit"}),a.jsx(ue.Th,{children:"options"})]})}),a.jsxs(ue.Tbody,{children:[L&&a.jsx(ue.Tr,{children:a.jsx(ue.Td,{colSpan:16,children:L})}),!L&&S?.map(A=>{const N=A.part??[],z=N.find(B=>B.name==="indexName")?.valueString;if(!z)throw new Error("Index missing name",{cause:A});return a.jsxs(ue.Tr,{children:[a.jsx(ue.Td,{children:N.find(B=>B.name==="schemaName")?.valueString}),a.jsx(ue.Td,{children:N.find(B=>B.name==="tableName")?.valueString}),a.jsx(ue.Td,{children:z}),a.jsx(mx,{value:N.find(B=>B.name==="fastUpdate")?.valueBoolean,defaultValue:a.jsxs(Ee,{span:!0,c:"dimmed",fs:"italic",children:["default (",CN(!0),")"]}),...k}),a.jsx(mx,{value:N.find(B=>B.name==="ginPendingListLimit")?.valueInteger,defaultValue:a.jsxs(Ee,{span:!0,c:"dimmed",fs:"italic",children:["default (",m,")"]}),...k}),a.jsx(mx,{value:N.find(B=>B.name==="indexOptions")?.valueString,defaultValue:a.jsx(Ee,{span:!0,c:"dimmed",fs:"italic",children:"NULL"}),...k})]},z)})]})]})})]}),a.jsx(Un,{opened:t,onClose:r,title:o,centered:!0,size:"auto",children:c})]})}function mx({value:e,onClick:t,defaultValue:n}){return a.jsx(ue.Td,{style:{cursor:"pointer"},onClick:()=>t?.(e),children:e===void 0?n:CN(e)})}function tne(){const e=Re(),t=["GIN Indexes"],[n,r]=v.useState(t[0]);function o(s){s||(s=t[0]),r(s)}return!e.isLoading()&&!e.isSuperAdmin()?a.jsx(Rr,{outcome:uf}):a.jsx(hu,{maw:"100%",children:a.jsxs(Dl,{children:[a.jsx($e,{order:1,children:"Database Tools"}),a.jsxs(Wt,{value:n,onChange:o,children:[a.jsx(Wt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:t.map(s=>a.jsx(Wt.Tab,{value:s,children:s},s))}),a.jsx(Wt.Panel,{value:"GIN Indexes",pt:"md",children:a.jsx(ene,{})})]})]})})}function nne(e){return a.jsx(kl,{resourceType:"UserConfiguration",name:e.name,defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{Vo(t)?e.onChange(Yt(t)):e.onChange(void 0)}})}function rne(){const{membershipId:e}=qt(),t=Re(),n=Rs(t),r=Wn(),o=t.get(`admin/projects/${n}/members/${e}`).read(),[s,c]=v.useState(o.accessPolicy),[d,f]=v.useState(o.userConfiguration),[p,m]=v.useState(o.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(Xt(C)))}return a.jsxs(a.Fragment,{children:[a.jsx($e,{children:"Edit membership"}),a.jsx("h3",{children:a.jsx(Ic,{value:o.profile,link:!0})}),a.jsxs(ht,{onSubmit:()=>{const C={...o,accessPolicy:s,userConfiguration:d,admin:p};t.post(`admin/projects/${n}/members/${e}`,C).then(()=>S(!0)).catch(E=>y(Xt(E)))},children:[!b&&a.jsxs(Be,{children:[a.jsx(zt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:g,children:a.jsx(hg,{name:"accessPolicy",defaultValue:s,onChange:c})}),a.jsx(zt,{title:"User Configuration",htmlFor:"userConfiguration",outcome:g,children:a.jsx(nne,{name:"userConfiguration",defaultValue:d,onChange:f})}),a.jsx(zt,{title:"Admin",htmlFor:"admin",outcome:g,children:a.jsx(Ln,{id:"admin",name:"admin",defaultChecked:p,onChange:C=>m(C.currentTarget.checked)})}),a.jsxs(ye,{justify:"flex-end",mt:"xl",children:[a.jsx(Pe,{type:"submit",children:"Save"}),a.jsx(Pe,{type:"button",color:"red",variant:"outline",onClick:j,children:"Remove user"})]})]}),b&&a.jsxs("div",{"data-testid":"success",children:[a.jsx("p",{children:"User updated"}),a.jsx("pre",{children:JSON.stringify(g,void 0,2)}),a.jsxs("p",{children:["Click ",a.jsx(yt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function ine(){const e=Re(),[t,n]=v.useState(e.getProject()),[r,o]=v.useState(),[s,c]=v.useState(),[d,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",mfaRequired:y.mfaRequired==="on"};return e.invite(t?.id,b).then(S=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),Im(S)?c(S):m(S),f(b.sendEmail??!1),Ne({color:"green",message:"Invite success"})}).catch(S=>{Ne({color:"red",message:Qe(S),autoClose:!1}),c(Xt(S))})},[e,t,r]);return a.jsxs(ht,{onSubmit:g,children:[!p&&!s&&a.jsxs(Be,{children:[a.jsx($e,{children:"Invite new member"}),e.isSuperAdmin()&&a.jsx(zt,{title:"Project",htmlFor:"project",outcome:s,children:a.jsx(kl,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),a.jsx(hn,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:Lt(s,"resourceType")}),a.jsx(He,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:Lt(s,"firstName")}),a.jsx(He,{name:"lastName",label:"Last Name",required:!0,error:Lt(s,"lastName")}),a.jsx(He,{name:"email",type:"email",label:"Email",required:!0,error:Lt(s,"email")}),a.jsx(zt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:s,children:a.jsx(hg,{name:"accessPolicy",onChange:o})}),a.jsx(Ln,{name:"sendEmail",label:"Send email",defaultChecked:!0}),a.jsx(Ln,{name:"isAdmin",label:"Admin"}),a.jsx(Ln,{name:"isProjectScoped",label:"Project scoped"}),a.jsx(Ln,{name:"mfaRequired",label:"MFA required"}),a.jsx(ye,{justify:"flex-end",children:a.jsx(Tr,{children:"Invite"})})]}),s&&a.jsxs("div",{"data-testid":"success",children:[a.jsx("p",{children:"User created, email couldn't be sent"}),a.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),a.jsxs("p",{children:["Click ",a.jsx(yt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),p&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(Ee,{children:"User created"}),d&&a.jsx(Ee,{children:"Email sent"}),a.jsxs(Pr,{children:[a.jsx(Pr.Item,{children:a.jsx(yt,{to:p,children:"Go to new membership"})}),a.jsx(Pr.Item,{children:a.jsx(yt,{to:p.profile,children:"Go to new profile"})}),a.jsx(Pr.Item,{children:a.jsx(yt,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function one(){return a.jsxs(a.Fragment,{children:[a.jsx($e,{children:"Patients"}),a.jsx(fg,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(yt,{to:"/admin/invite",children:"Invite new patient"})})]})}function ane(){const e=Re();if(!e.isLoading()&&!e.isProjectAdmin())return a.jsx(Rr,{outcome:uf});function t(n){e.post("admin/projects/setpassword",n).then(()=>Ne({color:"green",message:"Done"})).catch(r=>Ne({color:"red",message:Qe(r),autoClose:!1}))}return a.jsxs(ut,{width:600,children:[a.jsx($e,{order:1,children:"Project Admin"}),a.jsx(An,{my:"lg"}),a.jsx($e,{order:2,children:"Force Set Password"}),a.jsx(Ee,{children:"Sets the password for the specified user in this project."}),a.jsx(Ee,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),a.jsx(ht,{onSubmit:t,children:a.jsxs(Be,{children:[a.jsx(He,{name:"email",label:"Email",required:!0}),a.jsx(Ji,{name:"password",label:"Password",required:!0}),a.jsx(Pe,{type:"submit",children:"Force Set Password"})]})})]})}function d2(){const e=Re(),t=Rs(e),n=e.get(`admin/projects/${t}`).read();return a.jsxs(a.Fragment,{children:[a.jsx($e,{children:"Details"}),a.jsxs(xf,{children:[a.jsx(Mr,{term:"ID",children:n.project.id}),a.jsx(Mr,{term:"Name",children:n.project.name})]})]})}const sne=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function lne(){const e=Re(),t=Rs(e),n=v.useMemo(()=>e.get("admin/projects/"+t).read(),[e,t]);return a.jsxs(a.Fragment,{children:[a.jsxs(Nr,{children:[a.jsx(vt,{children:a.jsxs(vt.Entry,{children:[a.jsx(vt.Key,{children:"Project"}),a.jsx(vt.Value,{children:n.project.name})]})}),a.jsx(Yr,{children:a.jsx(YS,{baseUrl:"/admin",tabs:sne})})]}),a.jsx(ut,{children:a.jsx(a1,{})})]})}function cne(){const e=Re(),t=Rs(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=v.useState(!1),[s,c]=v.useState();return v.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),v.useEffect(()=>{n&&c(hi(n.project.secret||[]))},[e,n]),!r||!s?a.jsx("div",{children:"Loading..."}):a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:d=>{d.preventDefault(),e.post(`admin/projects/${t}/secrets`,s).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>Ne({color:"green",message:"Saved"})).catch(console.log)},children:[a.jsx($e,{children:"Project Secrets"}),a.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),a.jsx(bf,{property:Es("Project","secret"),name:"secret",path:"Project.secret",defaultValue:s,onChange:c,outcome:void 0}),a.jsx(Pe,{type:"submit",children:"Save"})]})}function une(){const e=Re(),t=Rs(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=v.useState(!1),[s,c]=v.useState();return v.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),v.useEffect(()=>{n&&c(hi(n.project.site||[]))},[e,n]),!r||!s?a.jsx("div",{children:"Loading..."}):a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:d=>{d.preventDefault(),e.post(`admin/projects/${t}/sites`,s).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>Ne({color:"green",message:"Saved"})).catch(f=>{const p=Xt(f);Ne({color:"red",message:`Error ${p.issue?.[0].details?.text} ${p.issue?.[0].expression?.[0]}`,autoClose:!1})})},children:[a.jsx($e,{children:"Project Sites"}),a.jsx("p",{children:"Use project sites configure your project on a separate domain."}),a.jsx(bf,{property:Es("Project","site"),name:"site",path:"Project.site",defaultValue:s,onChange:c,outcome:void 0}),a.jsx(Pe,{type:"submit",children:"Save"})]})}const EN="System AsyncJob",TN="Post-deploy Migrations",ep=[TN,EN];function dne(){const e=Re(),[t,n]=v.useState(ep[0]);function r(o){o||=ep[0],ep.includes(o)&&n(o)}return!e.isLoading()&&!e.isSuperAdmin()?a.jsx(Rr,{outcome:uf}):a.jsx(hu,{miw:"1600",maw:"2000",children:a.jsxs(Dl,{children:[a.jsx($e,{order:1,children:"AsyncJob Dashboard"}),a.jsxs(Wt,{keepMounted:!1,value:t,onChange:r,children:[a.jsx(Wt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:ep.map(o=>a.jsx(Wt.Tab,{value:o,children:o},o))}),a.jsx(Wt.Panel,{value:EN,pt:"md",children:a.jsx(hne,{})}),a.jsx(Wt.Panel,{value:TN,pt:"md",children:a.jsx(mne,{})})]})]})})}const fne={resourceType:"AsyncJob",fields:["id","_lastUpdated","request","status","type"],filters:[{code:"_project",operator:he.MISSING,value:"true"}],sortRules:[{code:"_lastUpdated",descending:!0}]};function hne(){const e=Wn(),[t]=v.useState(fne);return a.jsxs(Be,{children:[a.jsx(yt,{to:`/${t.resourceType}/${ds(t)}`,children:"Show in search page"}),a.jsx(mu,{checkboxesEnabled:!1,search:t,onClick:n=>e(f2(n.resource))?.catch(console.error),onAuxClick:n=>window.open(f2(n.resource),"_blank")})]})}const pne={resourceType:"AsyncJob",fields:["id","_lastUpdated","request","status","type"],filters:[{code:"_project",operator:he.MISSING,value:"true"},{code:"type",operator:he.EQUALS,value:"data-migration"}],count:1e3,sortRules:[{code:"_lastUpdated",descending:!0}]};function mne(){const e=Re(),[t,n]=v.useState(),[r,o]=v.useState(),[s,c]=v.useState([]),[d,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((E,R)=>R-E),n(C)}).catch(C=>{Ne({color:"red",message:Qe(C),autoClose:!1})}).finally(()=>m(C=>C.filter(E=>E!==j)))},[e,d]),v.useEffect(()=>{const j="jobs";m(C=>C.includes(j)?C:[...C,j]),e.requestSchema("AsyncJob").then(()=>e.search("AsyncJob",ds({...pne,total:"accurate",fields:void 0}),{cache:"no-cache"}).then(C=>{o(C.entry?.map(E=>E.resource))})).catch(C=>{o(void 0),Ne({color:"red",message:Qe(C),autoClose:!1})}).finally(()=>m(C=>C.filter(E=>E!==j)))},[e,d]);function g(){f(j=>j+1)}function y(j){d1(e,"Run pending post-deploy migration","admin/super/migrate",{dataVersion:j}).finally(()=>{g()}).catch(()=>{}),g()}const b=p.length>0;function S(j,{isLoading:C}){return a.jsxs("div",{style:{position:"relative"},children:[a.jsx(vm,{visible:C}),a.jsxs(ue,{children:[a.jsx(ue.Thead,{children:a.jsxs(ue.Tr,{children:[a.jsx(ue.Th,{children:"Version"}),a.jsx(ue.Th,{children:"Action"}),a.jsx(ue.Th,{children:"Status"}),a.jsx(ue.Th,{children:"AsyncJob"}),a.jsx(ue.Th,{children:"Last Updated"}),a.jsx(ue.Th,{children:"Request Time"}),a.jsx(ue.Th,{children:"Duration"}),a.jsx(ue.Th,{children:"Attempts"})]})}),a.jsx(ue.Tbody,{children:j()})]})]})}return a.jsxs(a.Fragment,{children:[a.jsx(Pe,{size:"xs",mb:"xs",variant:"subtle",leftSection:a.jsx(Hk,{size:14}),onClick:g,loading:b,children:"Refresh"}),S(()=>{if(!b){if(!t)return a.jsx(ue.Tr,{children:a.jsx(ue.Td,{colSpan:6,children:"Failed to load migration info"})});if(!r)return a.jsx(ue.Tr,{children:a.jsx(ue.Td,{colSpan:6,children:"Failed to load async jobs"})})}return!t||!r?null:t.postDeployMigrations?.map(j=>{const{status:C,asyncJob:E,asyncJobs:R}=gne(j,r??[],t?.pendingPostDeployMigration),T=s.includes(j),_=j===t?.pendingPostDeployMigration&&(!E||E?.status==="error"),k=[a.jsxs(ue.Tr,{children:[a.jsx(ue.Td,{children:j}),a.jsx(ue.Td,{children:_&&a.jsx(Pe,{color:"green",size:"xs",onClick:()=>y(j),children:"Start"})}),a.jsx(ue.Td,{children:C}),a.jsx(ue.Td,{children:E&&a.jsx(yt,{to:`/AsyncJob/${E?.id}`,children:E?.id})}),a.jsx(ue.Td,{children:E?.meta?.lastUpdated}),a.jsx(ue.Td,{children:E?.requestTime}),a.jsx(ue.Td,{children:h2(E)}),a.jsx(ue.Td,{display:"flex",children:a.jsxs(ye,{gap:"xs",children:[R.length?R.length:"",T&&R.length>1&&a.jsx(Pe,{leftSection:a.jsx(tG,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(L=>L.includes(j)?L.filter(A=>A!==j):L),children:"Hide all"}),!T&&R.length>1&&a.jsx(Pe,{leftSection:a.jsx(Fk,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(L=>L.includes(j)?L:[...L,j]),children:"Show all"})]})})]},j)];return T&&k.push(...R.filter(L=>L.id!==E?.id).map(L=>a.jsxs(ue.Tr,{bg:"gray.1",children:[a.jsx(ue.Td,{children:j}),a.jsx(ue.Td,{}),a.jsx(ue.Td,{children:L.status}),a.jsx(ue.Td,{children:a.jsx(yt,{to:`/AsyncJob/${L.id}`,children:L.id})}),a.jsx(ue.Td,{children:L.meta?.lastUpdated}),a.jsx(ue.Td,{children:L.requestTime}),a.jsx(ue.Td,{children:h2(L)}),a.jsx(ue.Td,{})]},L.id))),k})},{isLoading:b})]})}function gne(e,t,n){const r=t.filter(c=>c.dataVersion===e),o=r.find(c=>c.status==="completed")??r[0];let s;return n===0?s=o?.status??"completed":e>n?s=o?.status??"pending":e===n?s=o?.status??"next":s=o?.status??"completed",{status:s,asyncJob:o,asyncJobs:r}}function f2(e){return`/${e.resourceType}/${e.id}`}function h2(e){const t=e?.requestTime,n=e?.transactionTime??e?.meta?.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 vne(){const e=Re(),[t,{open:n,close:r}]=Zc(!1),[o,s]=v.useState(""),[c,d]=v.useState();if(!e.isLoading()&&!e.isSuperAdmin())return a.jsx(Rr,{outcome:uf});function f(){_c(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function p(){_c(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function m(){_c(e,"Rebuilding Value Sets","admin/super/valuesets")}function g(_){_c(e,"Reindexing Resources","admin/super/reindex",_)}function y(){_c(e,"Reload Cron Resources","admin/super/reloadcron")}function b(_){e.post("admin/super/removebotidjobsfromqueue",_).then(()=>Ne({color:"green",message:"Done"})).catch(k=>Ne({color:"red",message:Qe(k),autoClose:!1}))}function S(_){e.post("admin/super/purge",{..._,before:$S(_.before)}).then(()=>Ne({color:"green",message:"Done"})).catch(k=>Ne({color:"red",message:Qe(k),autoClose:!1}))}function j(_){e.post("admin/super/setpassword",_).then(()=>Ne({color:"green",message:"Done"})).catch(k=>Ne({color:"red",message:Qe(k),autoClose:!1}))}function C(_){e.post("fhir/R4/$db-stats",_.tableNames?{resourceType:"Parameters",parameter:[{name:"tableNames",valueString:_.tableNames}]}:void 0).then(k=>{s("Database Stats"),d(a.jsx("pre",{children:k.parameter?.find(L=>L.name==="tableString")?.valueString})),n()}).catch(k=>Ne({color:"red",message:Qe(k),autoClose:!1}))}function E(){e.post("fhir/R4/$db-invalid-indexes").then(_=>{s("Database Invalid Indexes"),d(a.jsx("pre",{children:_.parameter?.filter(k=>k.name==="invalidIndex").map(k=>k.valueString).join(`
|
|
246
|
+
`)})),n()}).catch(_=>Ne({color:"red",message:Qe(_),autoClose:!1}))}function R(){e.post("fhir/R4/$db-schema-diff").then(_=>{s("Schema Diff"),d(a.jsx("pre",{children:_.parameter?.find(k=>k.name==="migrationString")?.valueString})),n()}).catch(_=>Ne({color:"red",message:Qe(_),autoClose:!1}))}function T(){_c(e,"Reconcile Schema Diff","admin/super/reconcile-db-schema-drift")}return a.jsxs(ut,{width:600,children:[a.jsx($e,{order:1,children:"Super Admin"}),a.jsx(An,{my:"lg"}),a.jsx($e,{order:2,children:"Structure Definitions"}),a.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."}),a.jsx(ht,{children:a.jsx(Pe,{onClick:f,children:"Rebuild StructureDefinitions"})}),a.jsx(An,{my:"lg"}),a.jsx($e,{order:2,children:"Search Parameters"}),a.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."}),a.jsx(ht,{children:a.jsx(Pe,{onClick:p,children:"Rebuild SearchParameters"})}),a.jsx(An,{my:"lg"}),a.jsx($e,{order:2,children:"Value Sets"}),a.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."}),a.jsx(ht,{children:a.jsx(Pe,{onClick:m,children:"Rebuild ValueSets"})}),a.jsx(An,{my:"lg"}),a.jsx($e,{order:2,children:"Reindex Resources"}),a.jsx("p",{children:"When Medplum changes how resources are indexed, the system may require a reindex for old resources to be indexed properly."}),a.jsx(ht,{onSubmit:g,children:a.jsxs(Be,{children:[a.jsx(zt,{title:"Resource Type",htmlFor:"resourceType",children:a.jsx(He,{id:"resourceType",name:"resourceType",placeholder:"Reindex Resource Type"})}),a.jsx(zt,{title:"Search Filter",htmlFor:"filter",children:a.jsx(He,{id:"filter",name:"filter",placeholder:"e.g. name=Sam&birthdate=lt2000-01-01"})}),a.jsx(zt,{title:"Max Resource Version",htmlFor:"maxResourceVersion",children:a.jsx(yne,{})}),a.jsx(Pe,{type:"submit",children:"Reindex"})]})}),a.jsx(An,{my:"lg"}),a.jsx($e,{order:2,children:"Purge Resources"}),a.jsx("p",{children:"As system generated resources accumulate, the system may require a purge to remove old resources."}),a.jsx(ht,{onSubmit:S,children:a.jsxs(Be,{children:[a.jsx(zt,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:a.jsx(hn,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),a.jsx(zt,{title:"Purge Before",htmlFor:"before",children:a.jsx(Ao,{name:"before",placeholder:"Before Date"})}),a.jsx(Pe,{type:"submit",children:"Purge"})]})}),a.jsx(An,{my:"lg"}),a.jsx($e,{order:2,children:"Remove Bot ID Jobs from Queue"}),a.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),a.jsx(ht,{onSubmit:b,children:a.jsxs(Be,{children:[a.jsx(zt,{title:"Bot ID",children:a.jsx(He,{name:"botId",placeholder:"Bot Id"})}),a.jsx(Pe,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),a.jsx(An,{my:"lg"}),a.jsx($e,{order:2,children:"Force Set Password"}),a.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.'}),a.jsx(ht,{onSubmit:j,children:a.jsxs(Be,{children:[a.jsx(He,{name:"email",label:"Email",required:!0}),a.jsx(Ji,{name:"password",label:"Password",required:!0}),a.jsx(He,{name:"projectId",label:"Project ID"}),a.jsx(Pe,{type:"submit",children:"Force Set Password"})]})}),a.jsx(An,{my:"lg"}),a.jsx($e,{order:2,children:"Database Stats"}),a.jsx("p",{children:"Query current table statistics from the database."}),a.jsx(ht,{onSubmit:C,children:a.jsxs(Be,{children:[a.jsx(zt,{title:"Table Names (comma-delimited)",htmlFor:"tableNames",children:a.jsx(He,{id:"tableNames",name:"tableNames",placeholder:"Observation,Observation_History"})}),a.jsx(Pe,{type:"submit",children:"Get Database Stats"})]})}),a.jsx(An,{my:"lg"}),a.jsx($e,{order:2,children:"Database Invalid Indexes"}),a.jsx("p",{children:"Query invalid indexes from the database."}),a.jsx(ht,{onSubmit:E,children:a.jsx(Be,{children:a.jsx(Pe,{type:"submit",children:"Get Database Invalid Indexes"})})}),a.jsx(An,{my:"lg"}),a.jsx($e,{order:2,children:"Database Schema Drift"}),a.jsx("p",{children:"Show the schema migration needed to match the expected database schema."}),a.jsxs(wr,{children:[a.jsx(wr.Col,{span:6,children:a.jsx(ht,{onSubmit:R,children:a.jsx(Be,{children:a.jsx(Pe,{type:"submit",children:"Get Schema Drift"})})})}),a.jsx(wr.Col,{span:6,children:a.jsx(ht,{onSubmit:T,children:a.jsx(Be,{children:a.jsx(Pe,{type:"submit",children:"Reconcile Schema Drift"})})})})]}),a.jsx(An,{my:"lg"}),a.jsx($e,{order:2,children:"Reload Cron Resources"}),a.jsx("p",{children:"Obliterates the cron queue and rebuilds all the cron job schedulers for cron resources (eg. cron bots)."}),a.jsx(ht,{onSubmit:y,children:a.jsx(Be,{children:a.jsx(Pe,{type:"submit",children:"Reload Cron Resources"})})}),a.jsx(An,{my:"lg"}),a.jsx($e,{order:2,children:"Database Explain Search"}),a.jsx("p",{children:"Runs an EXPLAIN query on the database to show the query plan for a search."}),a.jsx(xne,{setModalTitle:s,setModalContent:d,openModal:n}),a.jsx(Un,{opened:t,onClose:r,title:o,centered:!0,size:"auto",children:c})]})}function yne(){const[e,t]=v.useState("outdated");return a.jsxs(a.Fragment,{children:[a.jsx(hn,{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"&&a.jsx(Hc,{required:!0,name:"maxResourceVersion",placeholder:"Max Resource Version",min:0})]})}function xne({setModalTitle:e,setModalContent:t,openModal:n}){const r=Re(),[o,s]=v.useState(),[c,d]=v.useState(),[f,p]=v.useState(),[m,g]=v.useState(),y=v.useMemo(()=>{if(o?.reference)return{"_has:ProjectMembership:profile:project":o.reference}},[o]);v.useEffect(()=>{if(g(void 0),!c?.reference&&!o?.reference){p(void 0);return}r.searchResources("ProjectMembership",{profile:c?.reference,project:o?.reference,_count:20}).then(j=>{p(j),j.length===1&&g(Yt(j[0]))}).catch(j=>{console.error(j),Ne({color:"red",message:Qe(j),autoClose:!1})})},[r,c,o]);const b=v.useMemo(()=>{const j={};return c?.reference&&(j.profile=c?.reference),o?.reference&&(j.project=o?.reference),j},[c,o]);function S(j){if(!j.query){Ne({color:"red",message:"Query is required",autoClose:!1});return}const C=j.onBehalfOfProjectMembership;delete j.onBehalfOfProjectMembership;const E={query:j.query,analyze:j.analyze==="on",format:"text"},R={};C&&(R["x-medplum-on-behalf-of"]=C),r.post("fhir/R4/$explain",E,void 0,{headers:R}).then(T=>{e("Database Explain");const _=T.parameter?.find(N=>N.name==="explain")?.valueString,k=T.parameter?.find(N=>N.name==="query")?.valueString,L=T.parameter?.find(N=>N.name==="parameters")?.valueString,A=[k,L,`
|
|
247
|
+
`,_].join(`
|
|
248
|
+
`);t(a.jsx(ef,{block:!0,maw:"100%",children:A})),n()}).catch(T=>{Ne({color:"red",message:Qe(T),autoClose:!1})})}return!r.isLoading()&&!r.isSuperAdmin()?a.jsx(Rr,{outcome:uf}):a.jsx(ht,{onSubmit:S,children:a.jsxs(Be,{children:[a.jsx(He,{name:"query",label:"Search",required:!0,placeholder:"Observation?code=85354-9&_sort=-date&_count=5"}),a.jsx(Ln,{name:"analyze",label:"Analyze"}),a.jsx(Yd,{label:"On Behalf Of",children:a.jsxs(Be,{gap:"sm",children:[a.jsx(ps,{required:!0,placeholder:"Project",targetTypes:["Project"],name:"onBehalfOfProject",onChange:s}),a.jsx(ps,{required:!0,placeholder:"Practitioner or Patient",name:"onBehalfOfProfile",targetTypes:["Practitioner","Patient"],onChange:d,searchCriteria:y}),f?.length!==1&&a.jsx(ps,{required:!0,placeholder:"ProjectMembership",name:"onBehalfOfProjectMembership",targetTypes:["ProjectMembership"],onChange:g,searchCriteria:b}),f?.length===1&&a.jsxs(a.Fragment,{children:[a.jsx("input",{type:"hidden",name:"onBehalfOfProjectMembership",value:Mt(f[0])}),a.jsx($p,{value:Yt(f[0])})]}),!m&&a.jsx(Ee,{fs:"italic",children:"On Behalf Of not set. Running as super admin"})]})}),a.jsx(Pe,{type:"submit",children:"Explain Search"})]})})}function bne(){return a.jsxs(a.Fragment,{children:[a.jsx($e,{children:"Users"}),a.jsx(fg,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(yt,{to:"/admin/invite",children:"Invite new user"})})]})}const Sne=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 Xc(e,t,n){const r=wne(e),{webkitRelativePath:o}=e,s=typeof t=="string"?t:typeof o=="string"&&o.length>0?o:`./${e.name}`;return typeof r.path!="string"&&p2(r,"path",s),p2(r,"relativePath",s),r}function wne(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),o=Sne.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}function p2(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const jne=[".DS_Store","Thumbs.db"];function Cne(e){return wl(this,void 0,void 0,function*(){return Wp(e)&&Ene(e.dataTransfer)?Ane(e.dataTransfer,e.type):Tne(e)?Rne(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?_ne(e):[]})}function Ene(e){return Wp(e)}function Tne(e){return Wp(e)&&Wp(e.target)}function Wp(e){return typeof e=="object"&&e!==null}function Rne(e){return lb(e.target.files).map(t=>Xc(t))}function _ne(e){return wl(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Xc(n))})}function Ane(e,t){return wl(this,void 0,void 0,function*(){if(e.items){const n=lb(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(Dne));return m2(RN(r))}return m2(lb(e.files).map(n=>Xc(n)))})}function m2(e){return e.filter(t=>jne.indexOf(t.name)===-1)}function lb(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 Dne(e){if(typeof e.webkitGetAsEntry!="function")return g2(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?_N(t):g2(e,t)}function RN(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?RN(n):[n]],[])}function g2(e,t){return wl(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const s=yield e.getAsFileSystemHandle();if(s===null)throw new Error(`${e} is not a File`);if(s!==void 0){const c=yield s.getFile();return c.handle=s,Xc(c)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return Xc(r,(n=t?.fullPath)!==null&&n!==void 0?n:void 0)})}function kne(e){return wl(this,void 0,void 0,function*(){return e.isDirectory?_N(e):Pne(e)})}function _N(e){const t=e.createReader();return new Promise((n,r)=>{const o=[];function s(){t.readEntries(c=>wl(this,void 0,void 0,function*(){if(c.length){const d=Promise.all(c.map(kne));o.push(d),s()}else try{const d=yield Promise.all(o);n(d)}catch(d){r(d)}}),c=>{r(c)})}s()})}function Pne(e){return wl(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const o=Xc(r,e.fullPath);t(o)},r=>{n(r)})})})}var tp={},v2;function Nne(){return v2||(v2=1,tp.__esModule=!0,tp.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return n.some(function(c){var d=c.trim().toLowerCase();return d.charAt(0)==="."?r.toLowerCase().endsWith(d):d.endsWith("/*")?s===d.replace(/\/.*$/,""):o===d})}return!0}),tp}var One=Nne();const gx=Xp(One);function y2(e){return Ine(e)||Lne(e)||DN(e)||Mne()}function Mne(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
249
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lne(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ine(e){if(Array.isArray(e))return cb(e)}function x2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function b2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?x2(Object(n),!0).forEach(function(r){AN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AN(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fd(e,t){return Une(e)||$ne(e,t)||DN(e,t)||zne()}function zne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
250
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DN(e,t){if(e){if(typeof e=="string")return cb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cb(e,t)}}function cb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $ne(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,c,d;try{for(n=n.call(e);!(o=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));o=!0);}catch(f){s=!0,d=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw d}}return r}}function Une(e){if(Array.isArray(e))return e}var Bne=typeof gx=="function"?gx:gx.default,Vne="file-invalid-type",Fne="file-too-large",Hne="file-too-small",qne="too-many-files",Gne=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:Vne,message:"File type must be ".concat(r)}},S2=function(t){return{code:Fne,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},w2=function(t){return{code:Hne,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},Qne={code:qne,message:"Too many files"};function kN(e,t){var n=e.type==="application/x-moz-file"||Bne(e,t);return[n,n?null:Gne(t)]}function PN(e,t,n){if(el(e.size))if(el(t)&&el(n)){if(e.size>n)return[!1,S2(n)];if(e.size<t)return[!1,w2(t)]}else{if(el(t)&&e.size<t)return[!1,w2(t)];if(el(n)&&e.size>n)return[!1,S2(n)]}return[!0,null]}function el(e){return e!=null}function Wne(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,c=e.maxFiles,d=e.validator;return!s&&t.length>1||s&&c>=1&&t.length>c?!1:t.every(function(f){var p=kN(f,n),m=Fd(p,1),g=m[0],y=PN(f,r,o),b=Fd(y,1),S=b[0],j=d?d(f):null;return g&&S&&!j})}function Yp(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function np(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function j2(e){e.preventDefault()}function Yne(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Kne(e){return e.indexOf("Edge/")!==-1}function Xne(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Yne(e)||Kne(e)}function vo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),c=1;c<o;c++)s[c-1]=arguments[c];return t.some(function(d){return!Yp(r)&&d&&d.apply(void 0,[r].concat(s)),Yp(r)})}}function Jne(){return"showOpenFilePicker"in window}function Zne(e){if(el(e)){var t=Object.entries(e).filter(function(n){var r=Fd(n,2),o=r[0],s=r[1],c=!0;return NN(o)||(console.warn('Skipped "'.concat(o,'" 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.')),c=!1),(!Array.isArray(s)||!s.every(ON))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),c=!1),c}).reduce(function(n,r){var o=Fd(r,2),s=o[0],c=o[1];return b2(b2({},n),{},AN({},s,c))},{});return[{description:"Files",accept:t}]}return e}function ere(e){if(el(e))return Object.entries(e).reduce(function(t,n){var r=Fd(n,2),o=r[0],s=r[1];return[].concat(y2(t),[o],y2(s))},[]).filter(function(t){return NN(t)||ON(t)}).join(",")}function tre(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function nre(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function NN(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function ON(e){return/^.*\.[\w]+$/.test(e)}var rre=["children"],ire=["open"],ore=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],are=["refKey","onChange","onClick"];function sre(e){return ure(e)||cre(e)||MN(e)||lre()}function lre(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
251
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ure(e){if(Array.isArray(e))return ub(e)}function vx(e,t){return hre(e)||fre(e,t)||MN(e,t)||dre()}function dre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
252
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MN(e,t){if(e){if(typeof e=="string")return ub(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ub(e,t)}}function ub(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fre(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,c,d;try{for(n=n.call(e);!(o=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));o=!0);}catch(f){s=!0,d=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw d}}return r}}function hre(e){if(Array.isArray(e))return e}function C2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function kn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?C2(Object(n),!0).forEach(function(r){db(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function db(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kp(e,t){if(e==null)return{};var n=pre(e,t),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function pre(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var f1=v.forwardRef(function(e,t){var n=e.children,r=Kp(e,rre),o=IN(r),s=o.open,c=Kp(o,ire);return v.useImperativeHandle(t,function(){return{open:s}},[s]),Pn.createElement(v.Fragment,null,n(kn(kn({},c),{},{open:s})))});f1.displayName="Dropzone";var LN={disabled:!1,getFilesFromEvent:Cne,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};f1.defaultProps=LN;f1.propTypes={children:dn.func,accept:dn.objectOf(dn.arrayOf(dn.string)),multiple:dn.bool,preventDropOnDocument:dn.bool,noClick:dn.bool,noKeyboard:dn.bool,noDrag:dn.bool,noDragEventsBubbling:dn.bool,minSize:dn.number,maxSize:dn.number,maxFiles:dn.number,disabled:dn.bool,getFilesFromEvent:dn.func,onFileDialogCancel:dn.func,onFileDialogOpen:dn.func,useFsAccessApi:dn.bool,autoFocus:dn.bool,onDragEnter:dn.func,onDragLeave:dn.func,onDragOver:dn.func,onDrop:dn.func,onDropAccepted:dn.func,onDropRejected:dn.func,onError:dn.func,validator:dn.func};var fb={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function IN(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=kn(kn({},LN),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,c=t.minSize,d=t.multiple,f=t.maxFiles,p=t.onDragEnter,m=t.onDragLeave,g=t.onDragOver,y=t.onDrop,b=t.onDropAccepted,S=t.onDropRejected,j=t.onFileDialogCancel,C=t.onFileDialogOpen,E=t.useFsAccessApi,R=t.autoFocus,T=t.preventDropOnDocument,_=t.noClick,k=t.noKeyboard,L=t.noDrag,A=t.noDragEventsBubbling,N=t.onError,z=t.validator,B=v.useMemo(function(){return ere(n)},[n]),G=v.useMemo(function(){return Zne(n)},[n]),Y=v.useMemo(function(){return typeof C=="function"?C:E2},[C]),J=v.useMemo(function(){return typeof j=="function"?j:E2},[j]),U=v.useRef(null),W=v.useRef(null),O=v.useReducer(mre,fb),I=vx(O,2),$=I[0],H=I[1],K=$.isFocused,M=$.isFileDialogActive,F=v.useRef(typeof window<"u"&&window.isSecureContext&&E&&Jne()),ae=function(){!F.current&&M&&setTimeout(function(){if(W.current){var Ve=W.current.files;Ve.length||(H({type:"closeDialog"}),J())}},300)};v.useEffect(function(){return window.addEventListener("focus",ae,!1),function(){window.removeEventListener("focus",ae,!1)}},[W,M,J,F]);var de=v.useRef([]),xe=function(Ve){U.current&&U.current.contains(Ve.target)||(Ve.preventDefault(),de.current=[])};v.useEffect(function(){return T&&(document.addEventListener("dragover",j2,!1),document.addEventListener("drop",xe,!1)),function(){T&&(document.removeEventListener("dragover",j2),document.removeEventListener("drop",xe))}},[U,T]),v.useEffect(function(){return!r&&R&&U.current&&U.current.focus(),function(){}},[U,R,r]);var Se=v.useCallback(function(pe){N?N(pe):console.error(pe)},[N]),Ce=v.useCallback(function(pe){pe.preventDefault(),pe.persist(),Me(pe),de.current=[].concat(sre(de.current),[pe.target]),np(pe)&&Promise.resolve(o(pe)).then(function(Ve){if(!(Yp(pe)&&!A)){var je=Ve.length,ke=je>0&&Wne({files:Ve,accept:B,minSize:c,maxSize:s,multiple:d,maxFiles:f,validator:z}),At=je>0&&!ke;H({isDragAccept:ke,isDragReject:At,isDragActive:!0,type:"setDraggedFiles"}),p&&p(pe)}}).catch(function(Ve){return Se(Ve)})},[o,p,Se,A,B,c,s,d,f,z]),Ke=v.useCallback(function(pe){pe.preventDefault(),pe.persist(),Me(pe);var Ve=np(pe);if(Ve&&pe.dataTransfer)try{pe.dataTransfer.dropEffect="copy"}catch{}return Ve&&g&&g(pe),!1},[g,A]),Ae=v.useCallback(function(pe){pe.preventDefault(),pe.persist(),Me(pe);var Ve=de.current.filter(function(ke){return U.current&&U.current.contains(ke)}),je=Ve.indexOf(pe.target);je!==-1&&Ve.splice(je,1),de.current=Ve,!(Ve.length>0)&&(H({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),np(pe)&&m&&m(pe))},[U,m,A]),dt=v.useCallback(function(pe,Ve){var je=[],ke=[];pe.forEach(function(At){var gn=kN(At,B),vn=vx(gn,2),Bn=vn[0],ln=vn[1],gr=PN(At,c,s),Qt=vx(gr,2),ar=Qt[0],Tn=Qt[1],co=z?z(At):null;if(Bn&&ar&&!co)je.push(At);else{var Ho=[ln,Tn];co&&(Ho=Ho.concat(co)),ke.push({file:At,errors:Ho.filter(function(ka){return ka})})}}),(!d&&je.length>1||d&&f>=1&&je.length>f)&&(je.forEach(function(At){ke.push({file:At,errors:[Qne]})}),je.splice(0)),H({acceptedFiles:je,fileRejections:ke,isDragReject:ke.length>0,type:"setFiles"}),y&&y(je,ke,Ve),ke.length>0&&S&&S(ke,Ve),je.length>0&&b&&b(je,Ve)},[H,d,B,c,s,f,y,b,S,z]),Ct=v.useCallback(function(pe){pe.preventDefault(),pe.persist(),Me(pe),de.current=[],np(pe)&&Promise.resolve(o(pe)).then(function(Ve){Yp(pe)&&!A||dt(Ve,pe)}).catch(function(Ve){return Se(Ve)}),H({type:"reset"})},[o,dt,Se,A]),ot=v.useCallback(function(){if(F.current){H({type:"openDialog"}),Y();var pe={multiple:d,types:G};window.showOpenFilePicker(pe).then(function(Ve){return o(Ve)}).then(function(Ve){dt(Ve,null),H({type:"closeDialog"})}).catch(function(Ve){tre(Ve)?(J(Ve),H({type:"closeDialog"})):nre(Ve)?(F.current=!1,W.current?(W.current.value=null,W.current.click()):Se(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):Se(Ve)});return}W.current&&(H({type:"openDialog"}),Y(),W.current.value=null,W.current.click())},[H,Y,J,E,dt,Se,G,d]),it=v.useCallback(function(pe){!U.current||!U.current.isEqualNode(pe.target)||(pe.key===" "||pe.key==="Enter"||pe.keyCode===32||pe.keyCode===13)&&(pe.preventDefault(),ot())},[U,ot]),pt=v.useCallback(function(){H({type:"focus"})},[]),Et=v.useCallback(function(){H({type:"blur"})},[]),wt=v.useCallback(function(){_||(Xne()?setTimeout(ot,0):ot())},[_,ot]),Te=function(Ve){return r?null:Ve},_e=function(Ve){return k?null:Te(Ve)},Le=function(Ve){return L?null:Te(Ve)},Me=function(Ve){A&&Ve.stopPropagation()},lt=v.useMemo(function(){return function(){var pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ve=pe.refKey,je=Ve===void 0?"ref":Ve,ke=pe.role,At=pe.onKeyDown,gn=pe.onFocus,vn=pe.onBlur,Bn=pe.onClick,ln=pe.onDragEnter,gr=pe.onDragOver,Qt=pe.onDragLeave,ar=pe.onDrop,Tn=Kp(pe,ore);return kn(kn(db({onKeyDown:_e(vo(At,it)),onFocus:_e(vo(gn,pt)),onBlur:_e(vo(vn,Et)),onClick:Te(vo(Bn,wt)),onDragEnter:Le(vo(ln,Ce)),onDragOver:Le(vo(gr,Ke)),onDragLeave:Le(vo(Qt,Ae)),onDrop:Le(vo(ar,Ct)),role:typeof ke=="string"&&ke!==""?ke:"presentation"},je,U),!r&&!k?{tabIndex:0}:{}),Tn)}},[U,it,pt,Et,wt,Ce,Ke,Ae,Ct,k,L,r]),nt=v.useCallback(function(pe){pe.stopPropagation()},[]),ft=v.useMemo(function(){return function(){var pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ve=pe.refKey,je=Ve===void 0?"ref":Ve,ke=pe.onChange,At=pe.onClick,gn=Kp(pe,are),vn=db({accept:B,multiple:d,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:Te(vo(ke,Ct)),onClick:Te(vo(At,nt)),tabIndex:-1},je,W);return kn(kn({},vn),gn)}},[W,n,d,Ct,r]);return kn(kn({},$),{},{isFocused:K&&!r,getRootProps:lt,getInputProps:ft,rootRef:U,inputRef:W,open:Te(ot)})}function mre(e,t){switch(t.type){case"focus":return kn(kn({},e),{},{isFocused:!0});case"blur":return kn(kn({},e),{},{isFocused:!1});case"openDialog":return kn(kn({},fb),{},{isFileDialogActive:!0});case"closeDialog":return kn(kn({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return kn(kn({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return kn(kn({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return kn({},fb);default:return e}}function E2(){}const[gre,vre]=Er("Dropzone component was not found in tree");function h1(e){const t=n=>{const{children:r,...o}=oe(`Dropzone${dE(e)}`,{},n),s=vre(),c=Io(r)?r:a.jsx("span",{children:r});return s[e]?v.cloneElement(c,o):null};return t.displayName=`@mantine/dropzone/${dE(e)}`,t}const yre=h1("accept"),xre=h1("reject"),bre=h1("idle");var Hd={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const Sre={multiple:!0,maxSize:1/0,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},wre=(e,{radius:t,variant:n,acceptColor:r,rejectColor:o})=>{const s=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),c=e.variantColorResolver({color:o||"red",theme:e,variant:n});return{root:{"--dropzone-radius":Ht(t),"--dropzone-accept-color":s.color,"--dropzone-accept-bg":s.background,"--dropzone-reject-color":c.color,"--dropzone-reject-bg":c.background}}},_s=ge((e,t)=>{const n=oe("Dropzone",Sre,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,radius:p,disabled:m,loading:g,multiple:y,maxSize:b,accept:S,children:j,onDropAny:C,onDrop:E,onReject:R,openRef:T,name:_,maxFiles:k,autoFocus:L,activateOnClick:A,activateOnDrag:N,dragEventsBubbling:z,activateOnKeyboard:B,onDragEnter:G,onDragLeave:Y,onDragOver:J,onFileDialogCancel:U,onFileDialogOpen:W,preventDropOnDocument:O,useFsAccessApi:I,getFilesFromEvent:$,validator:H,rejectColor:K,acceptColor:M,enablePointerEvents:F,loaderProps:ae,inputProps:de,mod:xe,attributes:Se,...Ce}=n,Ke=Ie({name:"Dropzone",classes:Hd,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:Se,vars:f,varsResolver:wre}),{getRootProps:Ae,getInputProps:dt,isDragAccept:Ct,isDragReject:ot,isDragActive:it,open:pt}=IN({onDrop:C,onDropAccepted:E,onDropRejected:R,disabled:m||g,accept:Array.isArray(S)?S.reduce((_e,Le)=>({..._e,[Le]:[]}),{}):S,multiple:y,maxSize:b,maxFiles:k,autoFocus:L,noClick:!A,noDrag:!N,noDragEventsBubbling:!z,noKeyboard:!B,onDragEnter:G,onDragLeave:Y,onDragOver:J,onFileDialogCancel:U,onFileDialogOpen:W,preventDropOnDocument:O,useFsAccessApi:I,validator:H,...$?{getFilesFromEvent:$}:null});Cd(T,pt);const Et=it&&Ct,wt=it&&ot,Te=!Et&&!wt;return a.jsx(gre,{value:{accept:Et,reject:wt,idle:Te},children:a.jsxs(ce,{...Ae(),...Ke("root",{focusable:!0}),...Ce,mod:[{accept:Et,reject:wt,idle:Te,disabled:m,loading:g,"activate-on-click":A},xe],children:[a.jsx(vm,{visible:g,overlayProps:{radius:p},unstyled:d,loaderProps:ae}),a.jsx("input",{...dt(de),name:_}),a.jsx("div",{...Ke("inner"),ref:t,"data-enable-pointer-events":F||void 0,children:j})]})})});_s.classes=Hd;_s.displayName="@mantine/dropzone/Dropzone";_s.Accept=yre;_s.Idle=bre;_s.Reject=xre;const jre={maxSize:1/0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Lr("max"),withinPortal:!0},p1=ge((e,t)=>{const n=oe("DropzoneFullScreen",jre,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,active:p,onDrop:m,onReject:g,zIndex:y,withinPortal:b,portalProps:S,attributes:j,...C}=n,E=Ie({name:"DropzoneFullScreen",classes:Hd,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:j,rootSelector:"fullScreen"}),{resolvedClassNames:R,resolvedStyles:T}=jl({classNames:r,styles:c,props:n}),[_,k]=v.useState(0),[L,{open:A,close:N}]=Zc(!1),z=G=>{G.dataTransfer?.types.includes("Files")&&(k(Y=>Y+1),A())},B=()=>{k(G=>G-1)};return v.useEffect(()=>{_===0&&N()},[_]),v.useEffect(()=>{if(p)return document.addEventListener("dragenter",z,!1),document.addEventListener("dragleave",B,!1),()=>{document.removeEventListener("dragenter",z,!1),document.removeEventListener("dragleave",B,!1)}},[p]),a.jsx(va,{...S,withinPortal:b,children:a.jsx(ce,{ref:t,...E("fullScreen",{style:{opacity:L?1:0,pointerEvents:L?"all":"none",zIndex:y}}),children:a.jsx(_s,{activateOnClick:!1,...C,classNames:R,styles:T,unstyled:d,className:Hd.dropzone,onDrop:G=>{m?.(G),N(),k(0)},onReject:G=>{g?.(G),N(),k(0)}})})})});p1.classes=Hd;p1.displayName="@mantine/dropzone/DropzoneFullScreen";_s.FullScreen=p1;const rp=_s,Cre='{"resourceType": "Bundle"}';function yx({id:e,title:t,message:n,color:r,icon:o,withCloseButton:s=!1,method:c="show",loading:d}){ki[c]({id:e,loading:d,title:t,message:n,color:r,icon:o,withCloseButton:s,autoClose:!1})}function Ere(){const e=En(),t=Re(),[n,r]=v.useState({}),o=v.useCallback(async(d,f)=>{const p="batch-upload";yx({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(d);m.type!=="batch"&&m.type!=="transaction"&&(m=xk(m));const g=await t.executeBatch(m);r(y=>({...y,[f]:g})),yx({id:p,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:a.jsx(Fo,{size:"1rem"}),withCloseButton:!0})}catch(m){yx({id:p,title:"Batch Upload Failed",color:"red",message:Qe(m),method:"update",icon:a.jsx(vl,{size:"1rem"}),withCloseButton:!0})}},[t]),s=v.useCallback(async d=>{for(const f of d){const p=new FileReader;p.onload=m=>o(m.target?.result,f.name),p.readAsText(f)}},[o]),c=v.useCallback(async d=>{await o(d.input,"JSON Data")},[o]);return a.jsxs(ut,{children:[a.jsx($e,{children:"Batch Create"}),a.jsxs(Ee,{children:["Use this page to create, read, or update multiple resources. For more details, see"," ",a.jsx(Nt,{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(n).length===0&&a.jsxs(a.Fragment,{children:[a.jsx("h3",{children:"Input"}),a.jsxs(Wt,{defaultValue:"upload",children:[a.jsxs(Wt.List,{children:[a.jsx(Wt.Tab,{value:"upload",children:"File Upload"}),a.jsx(Wt.Tab,{value:"json",children:"JSON"})]}),a.jsx(Wt.Panel,{value:"upload",pt:"xs",children:a.jsx(rp,{onDrop:s,accept:["application/json"],children:a.jsxs(ye,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[a.jsx(rp.Accept,{children:a.jsx(rR,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),a.jsx(rp.Reject,{children:a.jsx(vl,{size:50,stroke:1.5,color:e.colors.red[5]})}),a.jsx(rp.Idle,{children:a.jsx(rR,{size:50,stroke:1.5})}),a.jsxs("div",{children:[a.jsx(Ee,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),a.jsx(Ee,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),a.jsx(Wt.Panel,{value:"json",pt:"xs",children:a.jsxs(ht,{onSubmit:c,children:[a.jsx(au,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:Cre,deserialize:JSON.parse}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Pe,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&a.jsxs(a.Fragment,{children:[a.jsx("h3",{children:"Output"}),a.jsxs(Wt,{defaultValue:Object.keys(n)[0],children:[a.jsx(Wt.List,{children:Object.keys(n).map(d=>a.jsx(Wt.Tab,{value:d,children:d},d))}),Object.keys(n).map(d=>a.jsx(Wt.Panel,{value:d,children:a.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[d],void 0,2)})},d))]}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Pe,{onClick:()=>r({}),children:"Start over"})})]})]})}function Tre(){const{resourceType:e}=qt(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(o=>!!o),[r]=Yc("Questionnaire",`subject-type=${e}`);return r?r.length===0?a.jsxs(ut,{children:[a.jsxs($e,{children:["No apps for ",e]}),a.jsx(yt,{to:`/${e}`,children:"Return to search page"})]}):a.jsx(ut,{children:a.jsx("div",{children:r.map(o=>a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(yt,{to:`/forms/${o.id}?subject=`+n.map(s=>`${e}/${s}`).join(","),children:o.name})}),a.jsx("p",{children:o.description})]},o.id))})}):a.jsx(Oi,{})}function Rre(){const e=Re(),[t,n]=v.useState(),[r,o]=v.useState(!1);return a.jsx(ut,{width:450,children:a.jsxs(ht,{onSubmit:s=>{n(void 0),e.post("auth/changepassword",s).then(()=>o(!0)).catch(c=>n(Xt(c)))},children:[a.jsxs(hr,{style:{flexDirection:"column"},children:[a.jsx(Ui,{size:32}),a.jsx($e,{children:"Change password"})]}),!r&&a.jsxs(Be,{gap:"xl",mt:"xl",children:[a.jsx(Ji,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:Lt(t,"oldPassword")}),a.jsx(Ji,{name:"newPassword",label:"New password",required:!0,error:Lt(t,"newPassword")}),a.jsx(Ji,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Lt(t,"confirmPassword")}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Pe,{type:"submit",children:"Change password"})})]}),r&&a.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const _re=["Form","JSON","Profiles"];function Are(){const{resourceType:e}=qt();return a.jsxs(a.Fragment,{children:[a.jsxs(Nr,{children:[a.jsxs(Ee,{p:"md",fw:500,children:["New ",e]}),a.jsx(Yr,{children:a.jsx(YS,{baseUrl:`/${e}/new`,tabs:_re})})]}),a.jsx(a1,{})]})}function Dre(){return a.jsx(ut,{children:a.jsxs(Be,{children:[a.jsx($e,{order:1,children:"Unexpected Error"}),a.jsx(Ee,{children:"We're sorry, something went wrong."}),a.jsxs(Ee,{children:["Please contact ",a.jsx(Nt,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}function zN(e){const t=Jt(e.resource);if(!t)return null;const n=[{key:"Type",value:a.jsx(yt,{to:`/${t.resourceType}`,children:t.resourceType})}];function r(c,d){c&&d&&n.push({key:c,value:d})}function o(c){c&&r(c.system,c.value)}function s(c,d){Array.isArray(d)?d.forEach(f=>s(c,f)):typeof d=="string"?r(c,d):d&&(Array.isArray(d.coding)?r(c,d.coding.map(f=>f.display||f.code).join(", ")):r(c,d.text))}if("name"in t){const c=ba(t);c!==Mt(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(o):o(t.identifier)),n.length===1&&n.push({key:"ID",value:t.id}),a.jsx(vt,{children:n.map((c,d)=>a.jsxs(vt.Entry,{children:[a.jsx(vt.Key,{children:c.key}),a.jsx(vt.Value,{children:c.value})]},`${c.key}-${d}`))})}function kre(){const{id:e}=qt(),t=mi(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=Re(),[s,c]=v.useState(!0),[d,f]=v.useState(),[p,m]=v.useState(),[g,y]=v.useState(),[b,S]=v.useState(),[j,C]=v.useState();if(v.useEffect(()=>{const T={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const _=r.split(",").filter(k=>!!k);_.length===1&&T.entry.push({request:{method:"GET",url:_[0]}}),m(_)}o.executeBatch(T).then(_=>{_.entry?.[0]?.response?.status!=="200"?S(_.entry?.[0]?.response?.outcome):(f(_.entry[0]?.resource),y(_.entry[1]?.resource)),c(!1)}).catch(_=>{S(_),c(!1)})},[o,e,r]),b)return a.jsx(ut,{children:a.jsx("pre",{"data-testid":"error",children:JSON.stringify(b,void 0,2)})});if(j)return a.jsxs(ut,{children:[a.jsx($e,{children:d?.title}),a.jsx("p",{children:"Your response has been recorded."}),a.jsxs("ul",{children:[j.length===1&&a.jsx("li",{children:a.jsx(yt,{to:j[0],children:"Review your answers"})}),j.length>1&&a.jsxs("li",{children:["Review your answers:",a.jsx("ul",{children:j.map(T=>a.jsx("li",{children:a.jsx(yt,{to:T,children:Mt(T)})},T.id))})]}),g&&a.jsx("li",{children:a.jsxs(yt,{to:g,children:["Back to ",ba(g)]})}),a.jsx("li",{children:a.jsx(yt,{to:"/",children:"Go back home"})})]})]});if(s||!d)return a.jsx(Oi,{});const E=g&&u1(g);return a.jsxs(a.Fragment,{children:[a.jsxs(Nr,{shadow:"xs",radius:0,children:[E&&a.jsx($P,{patient:E}),g&&g.resourceType!=="Patient"&&a.jsx(zN,{resource:g}),a.jsx(ce,{px:"xl",py:"md",children:a.jsxs(Ee,{children:[ba(d),p&&p.length>1&&a.jsxs(a.Fragment,{children:[" (for ",p.length," resources)"]})]})})]}),a.jsx(ut,{children:a.jsx(YP,{questionnaire:d,subject:g&&Yt(g),onSubmit:R})})]});async function R(T){const _=[];if(!p||p.length===0)_.push(await o.createResource(T));else for(const k of p)_.push(await o.createResource({...T,subject:{reference:k}}));C(_)}}const Pre="_paper_unw9o_1",Nre={paper:Pre},Ore={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function $N(e,t){const n=e.resourceType||Mre(t),r=e.fields??Lre(n),o=e.filters??(e.resourceType?void 0:Ire(n)),s=e.sortRules??zre(n),c=e.offset??0,d=e.count??Vm;return{...e,resourceType:n,fields:r,filters:o,sortRules:s,offset:c,count:d}}function Mre(e){return localStorage.getItem("defaultResourceType")??e?.option?.find(t=>t.id==="defaultResourceType")?.valueString??"Patient"}function Lre(e){const t=m1(e);if(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 Ire(e){return m1(e)?.filters}function zre(e){const t=m1(e);return t?.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function m1(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function $re(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function Ure(e,t){const n={...e,count:1e3,offset:0},r=$N(n,t.getUserConfiguration()),o=await t.search(r.resourceType,ds({...r,total:"accurate",fields:void 0}));return xk(o)}function T2(){const e=Re(),t=Wn(),n=mi(),[r,o]=v.useState();return v.useEffect(()=>{const s=pk(n.pathname+n.search),c=$N(s,e.getUserConfiguration());n.pathname===`/${c.resourceType}`&&n.search===ds(c)?($re(c),o(c)):t(`/${c.resourceType}${ds(c)}`)?.catch(console.error)},[e,t,n]),!r?.resourceType||!r.fields||r.fields.length===0?a.jsx(Oi,{}):a.jsx(Nr,{shadow:"xs",m:"md",p:"xs",className:Nre.paper,children:a.jsx(mu,{checkboxesEnabled:!0,search:r,onClick:s=>t(`/${s.resource.resourceType}/${s.resource.id}`)?.catch(console.error),onAuxClick:s=>window.open(`/${s.resource.resourceType}/${s.resource.id}`,"_blank"),onChange:s=>{t(`/${r.resourceType}${ds(s.definition)}`)?.catch(console.error)},onNew:()=>{t(Ore[r.resourceType]??`/${r.resourceType}/new`)?.catch(console.error)},onExportCsv:()=>{const s=e.fhirUrl(r.resourceType,"$csv")+ds(r);e.download(s).then(c=>{window.open(window.URL.createObjectURL(c),"_blank")}).catch(c=>Ne({color:"red",message:Qe(c),autoClose:!1}))},onExportTransactionBundle:async()=>{Ure(r,e).then(s=>Gk(JSON.stringify(s,void 0,2))).catch(s=>Ne({color:"red",message:Qe(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(()=>o({...r})).catch(c=>Ne({color:"red",message:Qe(c),autoClose:!1})))},onBulk:s=>{t(`/bulk/${r.resourceType}?ids=${s.join(",")}`)?.catch(console.error)}})})}function Bre(){const[e]=Yc("ObservationDefinition","_count=100");return e?a.jsxs(ue,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Code"}),a.jsx("th",{children:"Method"}),a.jsx("th",{children:"Unit"}),a.jsx("th",{children:"Precision"}),a.jsx("th",{children:"Ranges"})]})}),a.jsx("tbody",{children:e.map(t=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(_o,{value:t.category?.[0]})}),a.jsx("td",{children:a.jsx(_o,{value:t.code})}),a.jsx("td",{children:a.jsx(_o,{value:t.method})}),a.jsx("td",{children:t.quantitativeDetails?.unit?.text}),a.jsx("td",{children:t.quantitativeDetails?.decimalPrecision}),a.jsx("td",{children:a.jsx(hb,{ranges:t.qualifiedInterval})})]},t.id))})]}):a.jsx(Oi,{})}function hb(e){const{ranges:t}=e;if(!t)return null;const n=R2(t.map(o=>o.gender));if(n.length>1)return Qc(n),a.jsx(a.Fragment,{children:n.map(o=>a.jsxs(v.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:Qn(o)})}),a.jsx(hb,{ranges:e.ranges?.filter(s=>s.gender===o)})]},o))});const r=R2(t.map(o=>o.age&&Md(o.age)));return r.length>1?(Qc(r),a.jsx(a.Fragment,{children:r.map(o=>a.jsxs(v.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:Qn(o)})}),a.jsx(hb,{ranges:e.ranges?.filter(s=>Md(s.age)===o)})]},o))})):a.jsx(a.Fragment,{children:t.map(o=>a.jsx("table",{children:a.jsx("tbody",{children:a.jsxs("tr",{children:[a.jsx("td",{children:o.condition}),a.jsx("td",{children:a.jsx(zS,{value:o.range})})]})})},`range-${o.condition}`))})}function R2(e){return[...new Set(e.filter(t=>!!t))]}function Vre(){const[e]=Yc("ActivityDefinition","_count=100"),[t]=Yc("ObservationDefinition","_count=100");return!e||!t?a.jsx(Oi,{}):a.jsxs(ue,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Assay"}),e.map(n=>a.jsx("th",{children:n.name},n.id))]})}),a.jsx("tbody",{children:t.map(n=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(_o,{value:n.category?.[0]})}),a.jsx("td",{children:a.jsx(_o,{value:n.code})}),e.map(r=>a.jsx("td",{children:r.observationResultRequirement?.find(o=>o.reference?.includes(n.id))?"✅":""},r.id))]},n.id))})]})}function Fre(){const e=Re(),[t,n]=v.useState(),[r,o]=v.useState(void 0),[s,c]=v.useState(!1),d=v.useCallback(()=>{e.get("auth/mfa/status",{cache:"no-cache"}).then(m=>{n(m.enrollQrCode),o(m.enrolled)}).catch(m=>Ne({color:"red",message:Qe(m),autoClose:!1}))},[e]);v.useEffect(()=>{d()},[d]);const f=v.useCallback(m=>{e.post("auth/mfa/enroll",m).then(()=>{o(!0),Ne({color:"green",message:"Success"})}).catch(g=>Ne({color:"red",message:Qe(g),autoClose:!1}))},[e]),p=v.useCallback(async m=>e.post("auth/mfa/disable",{token:m.token}),[e]);return r===void 0?null:r?a.jsxs(ut,{children:[a.jsx(Un,{title:"Disable MFA",opened:s,onClose:()=>c(!1),children:a.jsx(zp,{title:"Disable MFA",buttonText:"Submit code",onSubmit:async m=>{await p(m),c(!1),o(!1),Ne({id:"mfa-disabled",color:"green",title:"Success",message:"MFA disabled",icon:a.jsx(lq,{})}),d()}})}),a.jsxs(ye,{children:[a.jsx($e,{children:"MFA is enabled"}),a.jsx(Pe,{onClick:()=>c(!0),children:"Disable MFA"})]})]}):a.jsx(ut,{width:400,children:a.jsx(zp,{title:"Multi Factor Auth Setup",buttonText:"Enroll",qrCodeUrl:t,onSubmit:f})})}const Hre={},pb={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__",awsTextractEnabled:Hre?.MEDPLUM_AWS_TEXTRACT_ENABLED};function Rf(){return pb}function UN(){return BN("registerEnabled")}function qre(){return BN("awsTextractEnabled")}function BN(e){try{return pb[e]!==!1&&pb[e]!=="false"}catch{return!0}}function Gre(){const e=Wn(),[t]=c1(),n=Re(),r=t.get("scope")||"openid",[o,s]=v.useState(),[c,d]=v.useState(!0),f=t.get("client_id"),p=t.get("login");if(v.useEffect(()=>{if(!f||f==="medplum-cli")return;async function g(){try{const y=await n.get(`/auth/clientinfo/${f}`);s(y)}catch(y){Ne({id:"clientinfofail",title:"Failed to retrieve client information.",color:"red",message:Qe(y),withCloseButton:!0})}finally{d(!1)}}g().catch(console.error)},[n,f]),!f)return null;function m(g){const y=new URL(t.get("redirect_uri"));for(const b of["scope","state","nonce"])t.has(b)&&y.searchParams.set(b,t.get(b));y.searchParams.set("code",g),Zn.assign(y.toString())}return a.jsx(fP,{onCode:m,onForgotPassword:()=>e("/resetpassword")?.catch(console.error),onRegister:()=>e("/register")?.catch(console.error),googleClientId:Rf().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&&a.jsxs(a.Fragment,{children:[o?.logo?.url?a.jsx("img",{src:o?.logo?.url,alt:"Welcome Logo",height:60,style:{width:"auto"}}):a.jsx(Ui,{size:32}),a.jsx($e,{children:o?.welcomeString??"Sign in to Medplum"})]})})}function Qre(){const e=Re(),t=Wn(),n=Rf();return v.useEffect(()=>{e.getProfile()&&t("/signin?project=new")?.catch(console.error)},[e,t]),UN()?a.jsxs(mW,{type:"project",projectId:"new",onSuccess:()=>{window.location.href="/"},googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[a.jsx(Ui,{size:32}),a.jsx($e,{children:"Create a new account"})]}):a.jsx(ut,{width:450,children:a.jsx(Uo,{icon:a.jsx(Ts,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function Wre(){const e=Wn(),t=Re(),[n,r]=v.useState(),[o,s]=v.useState(!1),c=Rf().recaptchaSiteKey;return v.useEffect(()=>{uP(c)},[c]),a.jsx(ut,{width:450,children:a.jsxs(ht,{onSubmit:async d=>{let f="";f=await dP(c),t.post("auth/resetpassword",{...d,recaptchaToken:f}).then(()=>s(!0)).catch(p=>r(Xt(p)))},children:[a.jsxs(Be,{gap:"lg",mb:"xl",align:"center",children:[a.jsx(Ui,{size:32}),a.jsx($e,{children:"Password Reset"})]}),a.jsxs(Be,{gap:"xl",children:[a.jsx(Rr,{issues:pu(n,void 0)}),!o&&a.jsxs(a.Fragment,{children:[a.jsx(He,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:Lt(n,"email")}),a.jsxs(ye,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[a.jsx(Nt,{component:"button",type:"button",color:"dimmed",onClick:()=>e("/register")?.catch(console.error),size:"xs",children:"Register"}),a.jsx(Pe,{type:"submit",children:"Reset password"})]})]}),o&&a.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function Yre(e){const t=Re(),[n,r]=v.useState(),[o,s]=v.useState();return o?a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"Request group created successfully."}),a.jsxs("ul",{children:[a.jsxs("li",{children:["Go to the"," ",a.jsx(yt,{to:o,suffix:"checklist",children:"Request Group"})]}),a.jsxs("li",{children:["Back to the ",a.jsx(yt,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):a.jsx(ht,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueString:n?.reference}]}).then(s).catch(console.log)},children:a.jsxs(Be,{children:[a.jsxs($e,{children:['Start "',e.planDefinition.title,'"']}),a.jsxs(Ee,{children:["Use the ",a.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),a.jsx(Ee,{children:"The following tasks will be created:"}),a.jsx("ul",{children:e.planDefinition.action?.map((c,d)=>a.jsxs("li",{children:[c.definitionCanonical?.startsWith("Questionnaire/")&&"Questionnaire request: ",c.title&&a.jsx(a.Fragment,{children:c.title}),c.code&&a.jsx(_o,{value:c.code[0]})]},`action-${d}`))}),a.jsx(zt,{title:"Subject",children:a.jsx(ps,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(Pe,{type:"submit",children:"Go"})})]})})}function Kre(){const{resourceType:e,id:t}=qt(),n=Jt({reference:e+"/"+t});return n?a.jsx(ut,{children:a.jsx(Yre,{planDefinition:n})}):null}function Xre(){const{resourceType:e,id:t}=qt(),n=Jt({reference:e+"/"+t}),[r,o]=Yc("Questionnaire","subject-type="+e),[s,c]=Yc("ClientApplication",{_count:1e3});if(!n||o||c)return a.jsx(Oi,{});const d=s?.filter(m=>Jre(e)&&!!m.launchUri);if((!r||r.length===0)&&(!d||d.length===0))return a.jsxs(ut,{children:[a.jsx($e,{children:"Apps"}),a.jsxs("p",{children:["No apps found. Contact your administrator or ",a.jsx("a",{href:"mailto:support@medplum.com",children:"Medplum Support"})," to add automation here."]})]});let f,p;return n.resourceType==="Patient"?f=Yt(n):n.resourceType==="Encounter"&&(f=n.subject,p=Yt(n)),a.jsxs(ut,{children:[r?.map(m=>a.jsxs("div",{children:[a.jsx($e,{order:3,children:a.jsx(yt,{to:`/forms/${m.id}?subject=${Mt(n)}`,children:m.title||m.name})}),a.jsx(Ee,{children:m.description})]},m.id)),d?.map(m=>a.jsxs("div",{children:[a.jsx($e,{order:3,children:a.jsx(vZ,{client:m,patient:f,encounter:p,children:m.name})}),a.jsx(Ee,{children:m.description})]},m.id))]})}function Jre(e){return e==="Patient"||e==="Encounter"}function Zre(){const{resourceType:e,id:t}=qt(),n=Wn(),[r,o]=v.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:he.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return a.jsx(ut,{children:a.jsx(mu,{search:r,onClick:s=>n(`/${s.resource.resourceType}/${s.resource.id}`)?.catch(console.error),onChange:s=>o(s.definition),hideFilters:!0})})}function eie(){const e=Re(),{resourceType:t,id:n}=qt(),r=e.readHistory(t,n).read();return a.jsx(tf,{maw:1200,children:a.jsx(Dl,{children:a.jsx(aZ,{history:r})})})}const tie="_hl7Input_k5xm3_1",nie={hl7Input:tie};function rie(e){return a.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 iie(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),a.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=>{Sd(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const oie=`{
|
|
253
|
+
"resourceType": "Patient",
|
|
254
|
+
"name": [
|
|
255
|
+
{
|
|
256
|
+
"given": [
|
|
257
|
+
"Alice"
|
|
258
|
+
],
|
|
259
|
+
"family": "Smith"
|
|
260
|
+
}
|
|
261
|
+
]
|
|
262
|
+
}`,aie="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 sie(){const e=Re(),{id:t}=qt(),[n,r]=v.useState(),[o,s]=v.useState(),[c,d]=v.useState(),[f,p]=v.useState(oie),[m,g]=v.useState(aie),[y,b]=v.useState(rn.FHIR_JSON),S=v.useRef(null),j=v.useRef(null),[C,E]=v.useState(!1);v.useEffect(()=>{e.readResource("Bot",t).then(async N=>{r(N),s(N.runtimeVersion==="vmcontext"?"commonjs":"esnext"),d(await lie(e,N))}).catch(N=>Ne({color:"red",message:Qe(N),autoClose:!1}))},[e,t]);const R=v.useCallback(async()=>Sd(S.current,{command:"getValue"}),[]),T=v.useCallback(async()=>Sd(S.current,{command:"getOutput"}),[]),_=v.useCallback(async()=>y===rn.FHIR_JSON?JSON.parse(f):m,[y,f,m]),k=v.useCallback(async N=>{N.preventDefault(),N.stopPropagation(),E(!0);try{const z=await R(),B=await T(),G=await e.createAttachment({data:z,filename:"index.ts",contentType:rn.TYPESCRIPT}),Y=await e.createAttachment({data:B,filename:o==="commonjs"?"index.cjs":"index.mjs",contentType:rn.JAVASCRIPT}),J=[{op:"add",path:"/sourceCode",value:G},{op:"add",path:"/executableCode",value:Y}];await e.patchResource("Bot",t,J),Ne({color:"green",message:"Saved"})}catch(z){Ne({color:"red",message:Qe(z),autoClose:!1})}finally{E(!1)}},[e,t,o,R,T]),L=v.useCallback(async N=>{N.preventDefault(),N.stopPropagation(),E(!0);try{await e.post(e.fhirUrl("Bot",t,"$deploy")),Ne({color:"green",message:"Deployed"})}catch(z){Ne({color:"red",message:Qe(z),autoClose:!1})}finally{E(!1)}},[e,t]),A=v.useCallback(async N=>{N.preventDefault(),N.stopPropagation(),E(!0);try{const z=await _(),B=await e.post(e.fhirUrl("Bot",t,"$execute"),z,y);await Sd(j.current,{command:"setValue",value:B}),Ne({color:"green",message:"Success"})}catch(z){Ne({color:"red",message:Qe(z),autoClose:!1})}finally{E(!1)}},[e,t,_,y]);return!n||c===void 0?null:a.jsxs(wr,{m:0,gutter:0,style:{overflow:"hidden"},children:[a.jsx(wr.Col,{span:8,children:a.jsxs(Nr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[a.jsx(iie,{iframeRef:S,language:"typescript",module:o,testId:"code-frame",defaultValue:c,minHeight:"528px"}),a.jsxs(ye,{justify:"flex-end",gap:"xs",children:[a.jsx(Pe,{type:"button",onClick:k,loading:C,leftSection:a.jsx(bq,{size:"1rem"}),children:"Save"}),a.jsx(Pe,{type:"button",onClick:L,loading:C,leftSection:a.jsx(ES,{size:"1rem"}),children:"Deploy"}),a.jsx(Pe,{type:"button",onClick:A,loading:C,leftSection:a.jsx(cG,{size:"1rem"}),children:"Execute"})]})]})}),a.jsxs(wr.Col,{span:4,children:[a.jsxs(Nr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[a.jsx(hn,{data:[{label:"FHIR",value:rn.FHIR_JSON},{label:"HL7",value:rn.HL7_V2}],onChange:N=>b(N.currentTarget.value)}),y===rn.FHIR_JSON?a.jsx(au,{value:f,onChange:N=>p(N),autosize:!0,minRows:15}):a.jsx("textarea",{className:nie.hl7Input,value:m,onChange:N=>g(N.currentTarget.value),rows:15})]}),a.jsx(Nr,{m:2,p:"xs",shadow:"md",children:a.jsx(rie,{iframeRef:j,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function lie(e,t){if(t.sourceCode?.url){const n=t.sourceCode.url?.split("/")?.find(aS);return(await e.download(e.fhirUrl("Binary",n))).text()}return t.code??""}function Ol(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function cie(){const e=Re(),{resourceType:t,id:n}=qt(),r={reference:t+"/"+n},o=v.useCallback(s=>{e.updateResource(Ol(s)).then(()=>{Ne({color:"green",message:"Success"})}).catch(c=>{Ne({color:"red",message:Qe(c),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return a.jsx(ut,{children:a.jsx(UX,{value:r,onSubmit:o})});case"Questionnaire":return a.jsx(ut,{children:a.jsx(pJ,{questionnaire:r,onSubmit:o})});default:return null}}function uie(){const{resourceType:e,id:t}=qt(),n=Jt({reference:e+"/"+t}),r=Wn();return n?a.jsx(ut,{children:a.jsx(VJ,{value:n,onStart:(o,s)=>r(`/forms/${hl(s)}`)?.catch(console.error),onEdit:(o,s,c)=>r(`/${c.reference}}`)?.catch(console.error)})}):null}function die(){const e=Re(),{resourceType:t,id:n}=qt(),r=Wn();return a.jsxs(ut,{children:[a.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),a.jsx(Pe,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>r(`/${t}`)?.catch(console.error)).catch(o=>Ne({color:"red",message:Qe(o),autoClose:!1}))},children:"Delete"})]})}const fie="_selectProfileBtn_tbaz6_1",hie="_chevron_tbaz6_13",_2={selectProfileBtn:fie,chevron:hie};function pie(){const{resourceType:e,id:t}=qt(),n=Jt({reference:e+"/"+t}),[r,o]=v.useState(),s=Tl({onDropdownClose:()=>s.resetSelectedOption()}),c=v.useMemo(()=>{if(Nn(n?.meta?.profile))return[a.jsx(Ye.Option,{value:"",children:"None"},""),...n.meta.profile.map(f=>a.jsx(Ye.Option,{value:f,children:f},f))]},[n?.meta?.profile]);if(v.useEffect(()=>{n?.meta?.profile?.length===1&&o(n.meta.profile[0])},[n?.meta?.profile]),!n)return null;let d;return Nn(c)&&(d=a.jsx(ye,{justify:"flex-end",children:a.jsxs(Be,{align:"flex-end",gap:"xs",children:[a.jsxs(Ye,{store:s,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:f=>{o(f),s.closeDropdown()},children:[a.jsx(Ye.Target,{children:a.jsx(In,{onClick:()=>s.toggleDropdown(),children:a.jsxs(ef,{fw:"bold",fs:"sm",className:_2.selectProfileBtn,children:[a.jsx("span",{children:"Pick profile"}),a.jsx(CS,{stroke:1.5,className:_2.chevron})]})})}),a.jsx(Ye.Dropdown,{w:"max-content",children:a.jsx(Ye.Options,{children:c})})]}),a.jsx(ce,{children:r?a.jsxs(a.Fragment,{children:[a.jsx(Ee,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),a.jsx(Ee,{span:!0,size:"sm",children:r||"Nothing selected"})]}):a.jsx(Ee,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),a.jsx(ut,{children:a.jsxs(Be,{gap:"xl",children:[d,a.jsx(qS,{value:n,profileUrl:r})]})})}function mie(){const e=Re(),{resourceType:t,id:n}=qt(),[r,o]=v.useState(),[s,c]=v.useState(),d=Wn(),[f,p]=v.useState();v.useEffect(()=>{e.readResource(t,n).then(b=>{o(hi(b)),c(hi(b))}).catch(b=>{p(Xt(b)),Ne({color:"red",message:Qe(b),autoClose:!1})})},[e,t,n]);const m=v.useCallback(b=>{p(void 0),e.updateResource(Ol(b)).then(()=>{d(`/${t}/${n}/details`)?.catch(console.error),Ne({id:"succes",color:"green",message:"Success"})}).catch(S=>{p(Xt(S)),Ne({color:"red",message:Qe(S),autoClose:!1})})},[e,t,n,d]),g=v.useCallback(b=>{p(void 0);const S=AP.createPatch(r,b);e.patchResource(t,n,S).then(()=>{d(`/${t}/${n}/details`)?.catch(console.error),Ne({id:"succes",color:"green",message:"Success"})}).catch(j=>{p(Xt(j)),Ne({color:"red",message:Qe(j),autoClose:!1})})},[e,t,n,r,d]),y=v.useCallback(()=>d(`/${t}/${n}/delete`)?.catch(console.error),[d,t,n]);return s?a.jsx(ut,{children:a.jsx(qp,{defaultValue:s,onSubmit:m,onPatch:g,onDelete:y,outcome:f})}):null}function gie(){const{resourceType:e,id:t}=qt(),n=Jt({reference:e+"/"+t});return n?a.jsx(ut,{maw:700,children:n.resourceType==="Patient"?a.jsx(OX,{patient:n}):a.jsx(Uo,{icon:a.jsx(Ts,{size:16}),title:"Unsupported export type",color:"red",children:"This page is only supported for Patient resources"})}):null}function VN({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,o=Re(),[s,c]=v.useState();return v.useEffect(()=>{o.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(d=>{c(d.filter(KW))}).catch(console.error)},[o,n,r]),a.jsx(Wt,{value:t?.url,onChange:d=>{const f=s?.find(p=>p.url===d);f&&n(f)},children:a.jsx(Wt.List,{children:s?.map(d=>{const f=e.meta?.profile?.includes(d.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 a.jsx(Wt.Tab,{value:d.url,title:p,rightSection:f&&a.jsx(Z0,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:a.jsx(UG,{size:"90%"})}),children:d.title||d.name},d.url)})})})}function FN(e,t){const n=Re(),r=Wn();return{defaultValue:{resourceType:e},handleSubmit:c=>{t&&t(void 0),n.createResource(c).then(d=>r("/"+d.resourceType+"/"+d.id)).catch(d=>{t&&t(Xt(d)),Ne({color:"red",message:Qe(d),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function xx(){const{resourceType:e}=qt(),t=mi(),[n,r]=v.useState(),{defaultValue:o,handleSubmit:s}=FN(e,r),[c,d]=v.useState(),f=t.pathname.toLowerCase().endsWith("profiles"),p=v.useCallback(m=>{const g=Ol(m);c&&ak(g,c.url),s(g)},[c,s]);return f?a.jsx(ut,{children:a.jsxs(Be,{children:[a.jsx(VN,{resource:o,currentProfile:c,onChange:d}),c?a.jsx(qp,{defaultValue:o,onSubmit:p,outcome:n,profileUrl:c.url},c.url):a.jsx(Ee,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):a.jsx(ut,{children:a.jsx(qp,{defaultValue:o,onSubmit:s,outcome:n})})}function A2(){const e=Re(),{resourceType:t,id:n}=qt(),r=e.readHistory(t,n).read();return a.jsx(ut,{children:a.jsx(hZ,{history:r})})}function vie(){const{resourceType:e}=qt(),[t,n]=v.useState(),{defaultValue:r,handleSubmit:o}=FN(e,n),s=v.useCallback(c=>{o(JSON.parse(c["new-resource"]))},[o]);return a.jsxs(ut,{children:[t&&a.jsx(Rr,{outcome:t}),a.jsxs(ht,{onSubmit:s,children:[a.jsx(au,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:io(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Pe,{type:"submit",children:"OK"})})]})]})}function yie(){const e=Re(),{resourceType:t,id:n}=qt(),r=Jt({reference:t+"/"+n}),o=Wn(),[s,c]=v.useState(),d=v.useCallback(f=>{e.updateResource(Ol(JSON.parse(f.resource))).then(()=>{c(void 0),o(`/${t}/${n}/details`)?.catch(console.error),Ne({color:"green",message:"Success"})}).catch(p=>{Ne({color:"red",message:Qe(p),autoClose:!1})})},[e,t,n,o]);return r?a.jsxs(ut,{children:[s&&a.jsx(Rr,{outcome:s}),a.jsxs(ht,{onSubmit:d,children:[a.jsx(au,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:io(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Pe,{type:"submit",children:"OK"})})]})]}):null}function xie(e){const{resourceType:t,id:n}=e;return a.jsxs(ut,{children:[a.jsxs(Uo,{icon:a.jsx(Ts,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",a.jsx("br",{}),a.jsx(Nt,{href:`/forms/${n}`,children:`/forms/${n}`})]}),a.jsx(YP,{questionnaire:{reference:t+"/"+n},onSubmit:()=>alert("You submitted the preview")})]})}const bie="_propertyTable_1xts4_1",Sie="_propertiesTitle_1xts4_17",HN={propertyTable:bie,propertiesTitle:Sie};function wie(e){return e.valueCode||e.valueString||(e.valueBoolean===void 0?void 0:String(e.valueBoolean))||(e.valueInteger===void 0?void 0:String(e.valueInteger))||(e.valueDecimal===void 0?void 0:String(e.valueDecimal))||e.valueDate||e.valueDateTime||"N/A"}function jie(e){const{properties:t}=e,n=t.map(r=>{let o="",s="",c="";return r.part?.forEach(d=>{d.name==="code"?o=d.valueCode||"":d.name==="description"?s=d.valueString||"":d.name==="value"&&(c=wie(d))}),{code:o,description:s,value:c}});return a.jsxs(ue,{className:HN.propertyTable,children:[a.jsx(ue.Thead,{children:a.jsxs(ue.Tr,{children:[a.jsx(ue.Th,{children:"Code"}),a.jsx(ue.Th,{children:"Description"}),a.jsx(ue.Th,{children:"Value"})]})}),a.jsx(ue.Tbody,{children:n.map((r,o)=>a.jsxs(ue.Tr,{children:[a.jsx(ue.Td,{children:r.code}),a.jsx(ue.Td,{children:r.description}),a.jsx(ue.Td,{children:r.value})]},`property-${o}`))})]})}function Cie(e){const{valueSet:t}=e,n=Re(),r=t.url,[o,s]=v.useState(),[c,d]=v.useState(),[f,p]=v.useState(!1),[m,g]=v.useState(),y=v.useCallback(async j=>{if(s(j),d(void 0),g(void 0),!j?.code||!j?.system){p(!1);return}p(!0);try{const C=new URLSearchParams({system:j.system,code:j.code}),E=n.fhirUrl("CodeSystem","$lookup")+"?"+C.toString(),R=await n.get(E);d(R)}catch(C){g(C instanceof Error?C:new Error(String(C)))}finally{p(!1)}},[n]),b=v.useMemo(()=>c?.parameter?.filter(j=>j.name==="property"&&j.part)??[],[c]),S=b.length>0;return a.jsx(ut,{children:a.jsxs(Be,{gap:"xl",children:[a.jsx(vf,{binding:r,placeholder:"Select a value from the ValueSet",onChange:j=>y(j[0]),defaultValue:o,maxValues:1}),o?a.jsxs(Be,{gap:"md",children:[a.jsxs(xf,{children:[a.jsx(Mr,{term:"Code",children:o.code}),o.system&&a.jsx(Mr,{term:"System",children:o.system}),o.display&&a.jsx(Mr,{term:"Display",children:o.display})]}),f&&a.jsxs(ye,{gap:"xs",children:[a.jsx(jr,{size:"sm"}),a.jsx(Ee,{size:"sm",c:"dimmed",children:"Loading properties..."})]}),!f&&m&&a.jsxs(Uo,{icon:a.jsx(Ts,{size:16}),title:"Lookup Failed",color:"red",children:["Failed to retrieve code information: ",Qe(m)]}),!f&&!m&&S&&a.jsx(DS,{children:a.jsxs(Be,{gap:"xs",mt:"lg",children:[a.jsx(Ee,{fw:500,size:"sm",c:"dimmed",className:HN.propertiesTitle,children:"Properties"}),a.jsx(jie,{properties:b})]})})]}):null]})})}function Eie(){const{resourceType:e,id:t}=qt(),n=Jt({reference:e+"/"+t});return n?n.resourceType==="Questionnaire"?a.jsx(xie,{resourceType:e,id:t}):n.resourceType==="ValueSet"?a.jsx(Cie,{valueSet:n}):null:null}function Tie(){const e=Re(),{resourceType:t,id:n}=qt(),[r,o]=v.useState(),[s,c]=v.useState();return v.useEffect(()=>{e.readResource(t,n).then(d=>o(hi(d))).catch(d=>{Ne({color:"red",message:Qe(d)})})},[e,t,n]),r?a.jsxs(ut,{children:[a.jsxs($e,{order:2,children:["Available ",t," profiles"]}),a.jsx(Be,{children:a.jsxs(a.Fragment,{children:[a.jsx(VN,{resource:r,currentProfile:s,onChange:c}),s?a.jsx(Rie,{profile:s,resource:r,onResourceUpdated:d=>o(d)},s.url):a.jsx(Ee,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const Rie=({profile:e,resource:t,onResourceUpdated:n})=>{const r=Re(),[o,s]=v.useState(),[c,d]=v.useState(()=>t.meta?.profile?.includes(e.url)),f=v.useCallback(p=>{s(void 0);const m=Ol(p);c?ak(m,e.url):xB(m,e.url),r.updateResource(m).then(g=>{n(g),Ne({color:"green",message:"Success"})}).catch(g=>{s(Xt(g)),Ne({color:"red",message:Qe(g),autoClose:!1})})},[r,e.url,n,c]);return a.jsxs(Be,{children:[a.jsx(af,{size:"md",checked:c,label:`Conform resource to ${e.title}`,onChange:p=>d(p.currentTarget.checked),"data-testid":"profile-toggle"}),c?a.jsx(qp,{profileUrl:e.url,defaultValue:t,onSubmit:f,outcome:o}):a.jsx("form",{noValidate:!0,onSubmit:p=>{p.preventDefault(),f(t)},children:a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(Pe,{type:"submit",children:"OK"})})})]})},qN={"Create Only":"create","Update Only":"update","Delete Only":"delete","All Interactions":void 0},_ie=Object.keys(qN);function Aie(){const e=Re(),{id:t}=qt(),n=Jt({reference:`Questionnaire/${t}`}),[r,o]=v.useState(),[s,c]=v.useState("create"),[d,f]=v.useState(0),p=e.searchResources("Subscription","status=active&_count=100").read().filter(g=>Die(g,n));function m(){r&&n&&e.createResource({resourceType:"Subscription",status:"active",reason:`Connect bot ${r.name} to questionnaire responses`,criteria:`QuestionnaireResponse?questionnaire=${n.url?`${n.url},${Mt(n)}`:Mt(n)}`,channel:{type:"rest-hook",endpoint:Mt(r)},...s?{extension:[{url:"https://medplum.com/fhir/StructureDefinition/subscription-supported-interaction",valueCode:s}]}:void 0}).then(()=>{o(void 0),f(Date.now()),e.invalidateSearches("Subscription"),Ne({color:"green",message:"Success"})}).catch(g=>Ne({color:"red",message:Qe(g),autoClose:!1}))}return a.jsxs(ut,{children:[a.jsx($e,{children:"Bots"}),a.jsxs(Be,{children:[p.length===0&&a.jsx("p",{children:"No bots found."}),p.map(g=>a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(Pl,{value:{reference:g.channel?.endpoint},link:!0})}),a.jsxs("p",{children:["Criteria: ",g.criteria]})]},g.id))]}),a.jsx(An,{}),a.jsxs(Be,{mt:10,children:[a.jsx(Wd,{size:"lg",htmlFor:"bot",children:"Connect to bot"}),a.jsxs(ye,{children:[a.jsx(kl,{name:"bot",resourceType:"Bot",onChange:g=>o(g)}),a.jsx(Pe,{onClick:m,children:"Connect"})]}),a.jsx(ye,{children:a.jsx(hn,{name:"subscription-trigger-event",defaultValue:"Create Only",label:"Subscription Trigger Event",data:_ie,onChange:g=>c(qN[g.target.value])})})]}),a.jsx("div",{style:{display:"none"},children:d})]})}function Die(e,t){if(!t)return!1;const n=e.criteria||"",r=e.channel?.endpoint||"";return n.startsWith("QuestionnaireResponse?")&&r.startsWith("Bot/")&&(n.includes(Mt(t))||(t.url?n.includes(t.url):!1))}function kie(){const{id:e}=qt(),t=Wn(),r=Re().readReference({reference:`Questionnaire/${e}`}).read(),[o,s]=v.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:he.EQUALS,value:r.url?`${r.url},Questionnaire/${e}`:`Questionnaire/${e}`}],fields:["id","_lastUpdated"]});return a.jsx(ut,{children:a.jsx(mu,{search:o,onClick:c=>t(`/${c.resource.resourceType}/${c.resource.id}`)?.catch(console.error),onChange:c=>s(c.definition),hideFilters:!0,hideToolbar:!0})})}function Pie(){const e=Re(),{resourceType:t,id:n}=qt(),r=Jt({reference:t+"/"+n}),o=v.useCallback(s=>{e.updateResource(Ol(s)).then(()=>{Ne({color:"green",message:"Success"})}).catch(c=>{Ne({color:"red",message:Qe(c),autoClose:!1})})},[e]);return r?a.jsx(ut,{children:a.jsx(OJ,{onSubmit:o,definition:r})}):null}function Nie(){const{resourceType:e,id:t}=qt(),n=Jt({reference:e+"/"+t});return n?a.jsx(ut,{children:e==="MeasureReport"?a.jsx(PX,{measureReport:n}):a.jsx(HS,{value:n})}):null}const Oie="_container_1ue98_1",Mie="_entry_1ue98_14",Lie="_active_1ue98_21",bx={container:Oie,entry:Mie,active:Lie};function Iie(e){const t=Re(),n=Jt(e.value),[r,o]=v.useState();return v.useEffect(()=>{if(!n)return;const s=u1(n);if(!s)return;const c="reference"in s?s.reference:Mt(s);t.search("ServiceRequest","subject="+c).then(d=>{const p=(d.entry??[]).map(m=>m.resource);DP(p),p.reverse(),o(p)}).catch(d=>Ne({color:"red",message:Qe(d),autoClose:!1}))},[t,n]),r?a.jsx("div",{"data-testid":"quick-service-requests",className:bx.container,children:r.map(s=>a.jsxs("div",{className:$t(bx.entry,{[bx.active]:s.id===n?.id}),children:[a.jsx("p",{children:a.jsx(yt,{to:s,children:zie(s)})}),s.category?.[0]?.text&&a.jsx("p",{children:s.category[0]?.text}),s.code?.coding?.[0]?.code&&a.jsx("p",{children:s.code.coding[0]?.code}),a.jsx("p",{children:$ie(s)})]},s.id))}):null}function zie(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function $ie(e){return e.authoredOn?e.authoredOn.substring(0,10):e.meta?.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const Uie="_container_1l2dh_1",Bie={container:Uie};function Vie(e){const t=Jt(e.valueSet);if(!t)return null;const n=[""],r=t.compose?.include?.[0]?.concept?.map(o=>o.code);return r&&n.push(...r),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),a.jsx("div",{className:Bie.container,children:a.jsx(hn,{defaultValue:e.defaultValue,onChange:o=>e.onChange(o.currentTarget.value),data:n})})}function Fie(e){const t=Jt(e.specimen);return t?a.jsxs(vt,{children:[a.jsxs(vt.Entry,{children:[a.jsx(vt.Key,{children:"Type"}),a.jsx(vt.Value,{children:"Specimen"})]}),a.jsxs(vt.Entry,{children:[a.jsx(vt.Key,{children:"Collected"}),a.jsx(vt.Value,{children:Cr(t.collection?.collectedDateTime)})]}),a.jsxs(vt.Entry,{children:[a.jsx(vt.Key,{children:"Specimen Age"}),a.jsx(vt.Value,{children:Hie(t)})]}),t.collection?.collectedDateTime&&t.receivedTime?a.jsxs(vt.Entry,{children:[a.jsx(vt.Key,{children:"Specimen Stability"}),a.jsx(vt.Value,{children:qie(t)})]}):a.jsx(a.Fragment,{})]}):null}function Hie(e){const t=e.collection?.collectedDateTime;if(!t)return;const n=new Date(t);return GN(QN(n,new Date))}function qie(e){if(!e.collection?.collectedDateTime||!e.receivedTime)return;const t=new Date(e.collection.collectedDateTime),n=new Date(e.receivedTime);return GN(QN(t,n))}function GN(e){return e.toString().padStart(3,"0")+"D"}function QN(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function Gie(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==="ValueSet"&&t.push("Preview"),(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 Qie(){const e=Re(),{resourceType:t,id:n}=qt(),r={reference:t+"/"+n},[o,s]=v.useState(),c=Jt(r,s),d=Gie(t);async function f(){const j=(await e.readHistory(t,n)).entry?.find(C=>!!C.resource)?.resource;j?p(j):Ne({color:"red",message:"No history to restore",autoClose:!1})}function p(S){e.updateResource(Ol(S)).then(()=>{s(void 0),Ne({color:"green",message:"Success"})}).catch(j=>{Ne({color:"red",message:Qe(j),autoClose:!1})})}if(o)return D8(o)?a.jsxs(ut,{children:[a.jsx($e,{children:"Deleted"}),a.jsx("p",{children:"The resource was deleted."}),a.jsx(Pe,{color:"red",onClick:f,children:"Restore"})]}):a.jsx(Rr,{outcome:o});function m(S){const j=c,C=j.orderDetail||[];C.length===0&&C.push({}),C[0].text!==S&&(C[0].text=S,p({...j,orderDetail:C}))}const g=c&&u1(c),y=c&&Fte(c),b=e.getUserConfiguration()?.option?.find(S=>S.id==="statusValueSet")?.valueString;return a.jsxs(a.Fragment,{children:[c?.resourceType==="ServiceRequest"&&b&&a.jsx(Vie,{valueSet:{reference:b},defaultValue:c.orderDetail?.[0]?.text,onChange:m},Mt(c)+"-"+c.orderDetail?.[0]?.text),c&&a.jsx(Iie,{value:c}),c&&a.jsxs(Nr,{children:[g&&a.jsx($P,{patient:g}),y&&a.jsx(Fie,{specimen:y}),t!=="Patient"&&a.jsx(zN,{resource:r}),a.jsx(Yr,{children:a.jsx(YS,{baseUrl:`/${t}/${n}`,tabs:d})})]}),a.jsx(a1,{})]})}function ip(){const e=Wn(),{resourceType:t,id:n,versionId:r,tab:o}=qt(),s=Re(),[c,d]=v.useState(!0),[f,p]=v.useState(),[m,g]=v.useState();if(v.useEffect(()=>{g(void 0),d(!0),s.readHistory(t,n).then(T=>p(T)).then(()=>d(!1)).catch(T=>{g(T),d(!1)})},[s,t,n]),c)return a.jsx(Oi,{});const y=f?.entry??[],b=y.findIndex(T=>T.resource?.meta?.versionId===r);if(b===-1)return a.jsxs(ut,{children:[a.jsx($e,{children:"Version not found"}),a.jsx(yt,{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",E=o||C,R=y.length-b;return a.jsx(tf,{maw:1200,children:a.jsx(Dl,{children:a.jsxs(Be,{gap:"lg",children:[m&&a.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)}),a.jsxs(Mm,{cols:2,mb:"lg",children:[a.jsx($i,{total:y.length,value:R,getControlProps:MP,onChange:T=>e(`/${t}/${n}/_history/${y[y.length-T]?.resource?.meta?.versionId}/${E}`)?.catch(console.error)}),a.jsx(ye,{justify:"right",children:a.jsx(qc,{data:[{value:"diff",label:"Diff"},{value:"raw",label:"Raw"}],value:E,onChange:T=>e(`/${t}/${n}/_history/${r}/${T||C}`)?.catch(console.error)})})]}),a.jsx(ce,{mb:"lg",children:a.jsxs(xf,{compact:!0,children:[a.jsx(Mr,{term:"Version ID",children:S.meta?.versionId}),a.jsx(Mr,{term:"Author",children:a.jsx(Ic,{value:S.meta?.author,link:!0},S.meta?.author?.reference)}),a.jsx(Mr,{term:"Date/Time",children:Cr(S.meta?.lastUpdated)})]})}),E==="diff"&&a.jsx(cZ,{original:j??{resourceType:t,id:n},revised:S}),E==="raw"&&a.jsx("pre",{style:{fontSize:"9pt"},children:JSON.stringify(S,void 0,2)})]})})})}function Wie(){const{resourceType:e,id:t}=qt(),n=Wn(),[r,o]=v.useState({resourceType:"Subscription",filters:[{code:"url",operator:he.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return a.jsx(ut,{children:a.jsx(mu,{search:r,onClick:s=>n(`/${s.resource.resourceType}/${s.resource.id}`)?.catch(console.error),onChange:s=>o(s.definition),hideFilters:!0})})}function Yie(e){const t=Re(),{resource:n,opened:r,onClose:o}=e,[s,c]=v.useState(!1),[d,f]=v.useState(),[p,m]=v.useState(!1),g=v.useCallback(async()=>{if(n?.id)try{await t.post(t.fhirUrl(n.resourceType,n.id,"$resend"),{subscription:s&&d?Mt(d):void 0,verbose:p}),Ne({color:"green",message:"Done"}),o()}catch(y){Ne({color:"red",message:Qe(y),autoClose:!1})}},[t,n,o,s,d,p]);return a.jsx(Un,{opened:r,onClose:o,title:"Resend Subscriptions",children:a.jsx(ht,{onSubmit:g,children:a.jsxs(Be,{children:[a.jsx(Ln,{label:"Choose subscription (all subscriptions by default)",onChange:y=>c(y.currentTarget.checked)}),s&&a.jsx(kl,{name:"subscription",resourceType:"Subscription",placeholder:"Subscription",onChange:f}),a.jsx(Ln,{label:"Verbose mode",onChange:y=>m(y.currentTarget.checked)}),a.jsx(ye,{justify:"flex-end",children:a.jsx(Pe,{type:"submit",children:"Resend"})})]})})})}function D2(){const e=Re(),t=du(),{resourceType:n,id:r}=qt(),o={reference:n+"/"+r},[s,c]=v.useState(),d=Zc(!1);function f(R,T){return e.updateResource({...R,priority:T})}function p(R,T){f(R,"stat").then(T).catch(console.error)}function m(R,T){f(R,"routine").then(T).catch(console.error)}function g(R){t(`/${R.resourceType}/${R.id}`)}function y(R){t(`/${R.resourceType}/${R.id}/edit`)}function b(R){t(`/${R.resourceType}/${R.id}/delete`)}function S(R){c(R),d[1].open()}function j(R){t(`/${R.resourceType}/${R.id}/_history/${R.meta?.versionId}`)}function C(R,T){const _="aws-textract";Ne({id:_,title:"AWS Textract in Progress",message:"Extracting text... This may take a moment...",loading:!0,autoClose:!1}),e.post(e.fhirUrl(R.resourceType,R.id,"$aws-textract"),{}).then(()=>{T(),nl({id:_,title:"AWS Textract Successful",message:"Text successfully extracted.",color:"green",icon:a.jsx(Fo,{size:"1rem"}),loading:!1,withCloseButton:!0})}).catch(k=>nl({id:_,title:"AWS Textract Error",color:"red",message:Qe(k),icon:a.jsx(vl,{size:"1rem"}),loading:!1,withCloseButton:!0}))}function E(R){const{primaryResource:T,currentResource:_,reloadTimeline:k}=R,L=_.resourceType===T.resourceType&&_.id===T.id,A=_.resourceType==="Communication"&&_.priority!=="stat",N=_.resourceType==="Communication"&&_.priority==="stat",z=L,B=!L,G=!L,Y=!L,J=e.getProjectMembership()?.admin,U=J,W=qre()&&(_.resourceType==="DocumentReference"||_.resourceType==="Media");return a.jsxs(be.Dropdown,{children:[a.jsx(be.Label,{children:"Resource"}),A&&a.jsx(be.Item,{leftSection:a.jsx(oG,{size:14}),onClick:()=>p(_,k),"aria-label":`Pin ${Mt(_)}`,children:"Pin"}),N&&a.jsx(be.Item,{leftSection:a.jsx(sG,{size:14}),onClick:()=>m(_,k),"aria-label":`Unpin ${Mt(_)}`,children:"Unpin"}),B&&a.jsx(be.Item,{leftSection:a.jsx(nR,{size:14}),onClick:()=>g(_),"aria-label":`Details ${Mt(_)}`,children:"Details"}),z&&a.jsx(be.Item,{leftSection:a.jsx(nR,{size:14}),onClick:()=>j(_),"aria-label":`Details ${Mt(_)}`,children:"Details"}),G&&a.jsx(be.Item,{leftSection:a.jsx(Uk,{size:14}),onClick:()=>y(_),"aria-label":`Edit ${Mt(_)}`,children:"Edit"}),J&&a.jsxs(a.Fragment,{children:[a.jsx(be.Divider,{}),a.jsx(be.Label,{children:"Admin"}),U&&a.jsx(be.Item,{leftSection:a.jsx(mG,{size:14}),onClick:()=>S(_),"aria-label":`Resend Subscriptions ${Mt(_)}`,children:"Resend Subscriptions"})]}),W&&a.jsxs(a.Fragment,{children:[a.jsx(be.Divider,{}),a.jsx(be.Label,{children:"AWS AI"}),a.jsx(be.Item,{leftSection:a.jsx(NG,{size:14}),onClick:()=>C(_,k),"aria-label":`AWS Textract ${Mt(_)}`,children:"AWS Textract"})]}),Y&&a.jsxs(a.Fragment,{children:[a.jsx(be.Divider,{}),a.jsx(be.Label,{children:"Danger zone"}),a.jsx(be.Item,{color:"red",leftSection:a.jsx(Wm,{size:14}),onClick:()=>b(_),"aria-label":`Delete ${Mt(_)}`,children:"Delete"})]})]})}return a.jsxs(a.Fragment,{children:[n==="Encounter"&&a.jsx(SK,{encounter:o,getMenu:E}),n==="Patient"&&a.jsx(IX,{patient:o,getMenu:E}),n==="ServiceRequest"&&a.jsx(gZ,{serviceRequest:o,getMenu:E}),n!=="Encounter"&&n!=="Patient"&&n!=="ServiceRequest"&&a.jsx(bK,{resource:o,getMenu:E}),a.jsx(Yie,{resource:s,opened:d[0],onClose:d[1].close},`resend-subscriptions-${s?.id}`)]})}function Kie(e){const{opened:t,close:n,version:r,loadingStatus:o,handleStatus:s,handleUpgrade:c}=e,[d,f]=v.useState(),[p,m]=v.useState(!1);return v.useEffect(()=>{t&&(d||JF("app-tools-page").then(f).catch(console.error),s())},[t,d,s]),d&&r&&!o?r==="unknown"?a.jsx("p",{children:"Unable to determine the current version of the agent. Check the network connectivity of the agent."}):r.startsWith(d)?a.jsxs("p",{children:["This agent is already on the latest version (",d,")."]}):a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:["Are you sure you want to upgrade this agent from version ",r," to version ",d,"?"]}),a.jsxs(ye,{children:[a.jsx(Pe,{onClick:()=>{c(p),n()},"aria-label":"Confirm upgrade",children:"Confirm Upgrade"}),a.jsx(Ln,{label:"Force",onChange:g=>m(g.currentTarget.checked)})]})]}):a.jsx(Oi,{})}function Xie(){const e=Re(),{id:t}=qt(),n=v.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,o]=v.useState(!1),[s,c]=v.useState(!1),[d,f]=v.useState(!1),[p,m]=v.useState(!1),[g,y]=v.useState(),[b,S]=v.useState(),[j,C]=v.useState(),[E,R]=v.useState(),[T,_]=v.useState(!1),[k,L]=v.useState(!1),[A,N]=v.useState(),[z,{open:B,close:G}]=Zc(!1);v.useEffect(()=>{if(r||s||d||T){L(!0);return}L(!1)},[r,s,d,T]);const Y=v.useCallback(()=>{o(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(H=>{y(H.parameter?.find(K=>K.name==="status")?.valueCode),S(H.parameter?.find(K=>K.name==="version")?.valueString),C(H.parameter?.find(K=>K.name==="lastUpdated")?.valueInstant)}).catch(H=>$(Qe(H))).finally(()=>o(!1))},[e,t]),J=v.useCallback(H=>{const K=H.host,M=H.pingCount||1;K&&(_(!0),e.pushToAgent(n,K,`PING ${M}`,rn.PING,!0).then(F=>R(F)).catch(F=>$(Qe(F))).finally(()=>_(!1)))},[e,n]),U=v.useCallback(()=>{c(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(H=>{I("Agent config reloaded successfully.")}).catch(H=>$(Qe(H))).finally(()=>c(!1))},[e,t]),W=v.useCallback(H=>{f(!0);const K=e.fhirUrl("Agent",t,"$upgrade");K.searchParams.set("force",String(H)),e.get(K,{cache:"reload"}).then(M=>{I("Agent upgraded successfully.")}).catch(M=>$(Qe(M))).finally(()=>f(!1))},[e,t]),O=v.useCallback(H=>{m(!0);const K=H.logLimit||20;e.get(e.fhirUrl("Agent",t,`$fetch-logs${K!==void 0?`?limit=${K}`:""}`),{cache:"reload"}).then(M=>{const F=M?.parameter?.find(ae=>ae.name==="logs");F&&N(F?.valueString)}).catch(M=>$(Qe(M))).finally(()=>m(!1))},[e,t]);function I(H){Ne({color:"green",title:"Success",icon:a.jsx(Fo,{size:"1rem"}),message:H})}function $(H){Ne({color:"red",title:"Error",message:H,autoClose:!1})}return a.jsxs(ut,{children:[a.jsx(Un,{opened:z,onClose:G,title:"Upgrade Agent",centered:!0,children:a.jsx(Kie,{opened:z,close:G,version:b,loadingStatus:r,handleStatus:Y,handleUpgrade:W})}),a.jsx($e,{order:1,children:"Agent Tools"}),a.jsxs("div",{style:{marginBottom:10},children:["Agent: ",a.jsx(Pl,{value:n,link:!0})]}),a.jsx(An,{my:"lg"}),a.jsx($e,{order:2,children:"Agent Status"}),a.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."}),a.jsx(Pe,{onClick:Y,loading:r,disabled:k&&!r,children:"Get Status"}),!r&&g&&a.jsx(ue,{children:a.jsxs(ue.Tbody,{children:[a.jsxs(ue.Tr,{children:[a.jsx(ue.Td,{children:"Status"}),a.jsx(ue.Td,{children:a.jsx(rg,{status:g})})]}),a.jsxs(ue.Tr,{children:[a.jsx(ue.Td,{children:"Version"}),a.jsx(ue.Td,{children:b})]}),a.jsxs(ue.Tr,{children:[a.jsx(ue.Td,{children:"Last Updated"}),a.jsx(ue.Td,{children:Cr(j,void 0,{timeZoneName:"longOffset"})})]})]})}),a.jsx(An,{my:"lg"}),a.jsx($e,{order:2,children:"Reload Config"}),a.jsx("p",{children:"Reload the configuration of this agent, syncing it with the current version of the Agent resource on the Medplum server."}),a.jsx(Pe,{onClick:U,loading:s,disabled:k&&!s,"aria-label":"Reload config",children:"Reload Config"}),a.jsx(An,{my:"lg"}),a.jsx($e,{order:2,children:"Upgrade Agent"}),a.jsx("p",{children:"Upgrade the version of this agent, to either the latest (default) or a specified version."}),a.jsx(Pe,{onClick:B,loading:d,disabled:k&&!d,"aria-label":"Upgrade agent",children:"Upgrade"}),a.jsx(An,{my:"lg"}),a.jsxs(ht,{onSubmit:O,children:[a.jsx($e,{order:2,children:"Fetch Logs"}),a.jsx("p",{children:"Fetch logs from the agent."}),A?.length?a.jsx(ef,{block:!0,mb:15,children:A}):null,a.jsxs(ye,{children:[a.jsx(Hc,{w:100,id:"logLimit",name:"logLimit",placeholder:"20",label:"Log Limit"}),a.jsx(Pe,{mt:22,loading:p,disabled:k&&!p,"aria-label":"Fetch logs",type:"submit",children:"Fetch Logs"})]})]}),a.jsx(An,{my:"lg"}),a.jsx($e,{order:2,children:"Ping from Agent"}),a.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."}),a.jsx(ht,{onSubmit:J,children:a.jsxs(ye,{children:[a.jsx(He,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:a.jsx(Dn,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:T,disabled:k&&!T,children:a.jsx(xG,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),a.jsx(Hc,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!T&&E&&a.jsxs(a.Fragment,{children:[a.jsx($e,{order:5,mt:"sm",mb:0,children:"Last Ping"}),a.jsx("pre",{children:E})]})]})}function Jie(){const e=Wn(),t=Re(),[n,r]=v.useState();v.useEffect(()=>{t.get("auth/me",{cache:"no-cache"}).then(r).catch(s=>Ne({color:"red",message:Qe(s),autoClose:!1}))},[t]);function o(s){t.post("auth/revoke",{loginId:s}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>Ne({color:"green",message:"Login revoked"})).catch(c=>Ne({color:"red",message:Qe(c),autoClose:!1}))}return n?a.jsxs(a.Fragment,{children:[a.jsxs(ut,{children:[a.jsx($e,{children:"Security"}),a.jsxs(xf,{children:[a.jsx(Mr,{term:"ID",children:a.jsx(Nt,{href:`/${Mt(n.profile)}`,children:n.profile.id})}),a.jsx(Mr,{term:"Resource Type",children:n.profile.resourceType}),a.jsx(Mr,{term:"Name",children:Cs(n.profile.name?.[0])})]})]}),a.jsxs(ut,{children:[a.jsx($e,{children:"Sessions"}),a.jsxs(ue,{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"OS"}),a.jsx("th",{children:"Browser"}),a.jsx("th",{children:"IP Address"}),a.jsx("th",{children:"Auth Method"}),a.jsx("th",{children:"Last Updated"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:n.security.sessions.map(s=>a.jsxs("tr",{children:[a.jsx("td",{children:s.os}),a.jsx("td",{children:s.browser}),a.jsx("td",{children:s.remoteAddress}),a.jsx("td",{children:s.authMethod}),a.jsx("td",{children:Cr(s.lastUpdated)}),a.jsx("td",{children:a.jsx(Nt,{href:"#",onClick:()=>o(s.id),children:"Revoke"})})]},s.id))})]})]}),a.jsxs(ut,{children:[a.jsx($e,{children:"Password"}),a.jsx(Pe,{onClick:()=>e("/changepassword")?.catch(console.error),children:"Change password"})]}),a.jsxs(ut,{children:[a.jsx($e,{children:"Multi Factor Auth"}),a.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&a.jsx(Pe,{onClick:()=>e("/mfa")?.catch(console.error),children:"Enroll"})]})]}):null}function Zie(){const{id:e,secret:t}=qt(),n=Re(),[r,o]=v.useState(),[s,c]=v.useState(!1),d=pu(r,void 0);return a.jsxs(ut,{width:450,children:[a.jsx(Rr,{issues:d}),a.jsxs(ht,{onSubmit:f=>{if(f.password!==f.confirmPassword){o(To("Passwords do not match","confirmPassword"));return}o(void 0);const p={id:e,secret:t,password:f.password};n.post("auth/setpassword",p).then(()=>c(!0)).catch(m=>o(Xt(m)))},children:[a.jsxs(hr,{style:{flexDirection:"column"},children:[a.jsx(Ui,{size:32}),a.jsx($e,{children:"Set password"})]}),!s&&a.jsxs(Be,{children:[a.jsx(Ji,{name:"password",label:"New password",required:!0,error:Lt(r,"password")}),a.jsx(Ji,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Lt(r,"confirmPassword")}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(Pe,{type:"submit",children:"Set password"})})]}),s&&a.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",a.jsx(yt,{to:"/signin",children:"sign in"}),"."]})]})]})}function eoe(){const e=hf(),t=Wn(),[n]=c1(),r=Rf(),o=v.useCallback(()=>{const s=n.get("next");t(s?.startsWith("/")?s:"/")?.catch(console.error)},[n,t]);return v.useEffect(()=>{e&&n.has("next")&&o()},[e,n,o]),a.jsxs(fP,{onSuccess:()=>o(),onForgotPassword:()=>t("/resetpassword")?.catch(console.error),onRegister:UN()?()=>t("/register")?.catch(console.error):void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[a.jsx(Ui,{size:32}),a.jsxs($e,{children:["Sign in to ",Qk()]}),n.get("project")==="new"&&a.jsx("div",{children:"Sign in again to create a new project"})]})}function toe(){const e=Wn(),t=mi(),[n,r]=v.useState(),[o,s]=v.useState(),[c,d]=v.useState();return v.useEffect(()=>{const f=Object.fromEntries(new URLSearchParams(t.search).entries());r(f.resourceType),s(f.query),d(JSON.parse(f.fields))},[t]),!n||!o||!c?null:a.jsx(yX,{resourceType:n,checkboxesEnabled:!0,query:o,fields:c,onClick:f=>e(`/${n}/${f.resource.id}`)?.catch(console.error),onAuxClick:f=>window.open(`/${n}/${f.resource.id}`,"_blank"),onBulk:f=>{e(`/bulk/${n}?ids=${f.join(",")}`)?.catch(console.error)}})}function noe(){const{id:e,secret:t}=qt(),n=Re(),[r,o]=v.useState(),[s,c]=v.useState(!1),d=pu(r,void 0);return a.jsxs(ut,{width:450,children:[a.jsx(Rr,{issues:d}),a.jsxs(ht,{onSubmit:()=>{o(void 0);const f={id:e,secret:t};n.post("auth/verifyemail",f).then(()=>c(!0)).catch(p=>o(Xt(p)))},children:[a.jsxs(hr,{style:{flexDirection:"column"},children:[a.jsx(Ui,{size:32}),a.jsx($e,{children:"Email address verification required"})]}),!s&&a.jsxs(Be,{children:[a.jsx("p",{children:"In order to sign in, click the button below to verify your ability to receive email at the address this link was sent to."}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(Pe,{type:"submit",children:"Verify email"})})]}),s&&a.jsxs("div",{"data-testid":"success",children:["Email verified. You can now ",a.jsx(yt,{to:"/signin",children:"sign in"}),"."]})]})]})}function roe(){return a.jsx(ste,{children:a.jsxs(Ue,{errorElement:a.jsx(Dre,{}),children:[a.jsx(Ue,{path:"/signin",element:a.jsx(eoe,{})}),a.jsx(Ue,{path:"/oauth",element:a.jsx(Gre,{})}),a.jsx(Ue,{path:"/resetpassword",element:a.jsx(Wre,{})}),a.jsx(Ue,{path:"/setpassword/:id/:secret",element:a.jsx(Zie,{})}),a.jsx(Ue,{path:"/verifyemail/:id/:secret",element:a.jsx(noe,{})}),a.jsx(Ue,{path:"/register",element:a.jsx(Qre,{})}),a.jsx(Ue,{path:"/changepassword",element:a.jsx(Rre,{})}),a.jsx(Ue,{path:"/security",element:a.jsx(Jie,{})}),a.jsx(Ue,{path:"/mfa",element:a.jsx(Fre,{})}),a.jsx(Ue,{path:"/batch",element:a.jsx(Ere,{})}),a.jsx(Ue,{path:"/bulk/:resourceType",element:a.jsx(Tre,{})}),a.jsx(Ue,{path:"/smart",element:a.jsx(toe,{})}),a.jsx(Ue,{path:"/forms/:id",element:a.jsx(kre,{})}),a.jsx(Ue,{path:"/admin/super",element:a.jsx(vne,{})}),a.jsx(Ue,{path:"/admin/super/asyncjob",element:a.jsx(dne,{})}),a.jsx(Ue,{path:"/admin/super/db",element:a.jsx(tne,{})}),a.jsx(Ue,{path:"/admin/config",element:a.jsx(ane,{})}),a.jsxs(Ue,{path:"/admin",element:a.jsx(lne,{}),children:[a.jsx(Ue,{path:"patients",element:a.jsx(one,{})}),a.jsx(Ue,{path:"bots/new",element:a.jsx(Gte,{})}),a.jsx(Ue,{path:"bots",element:a.jsx(Hte,{})}),a.jsx(Ue,{path:"clients/new",element:a.jsx(Qte,{})}),a.jsx(Ue,{path:"clients",element:a.jsx(qte,{})}),a.jsx(Ue,{path:"details",element:a.jsx(d2,{})}),a.jsx(Ue,{path:"invite",element:a.jsx(ine,{})}),a.jsx(Ue,{path:"users",element:a.jsx(bne,{})}),a.jsx(Ue,{path:"project",element:a.jsx(d2,{})}),a.jsx(Ue,{path:"secrets",element:a.jsx(cne,{})}),a.jsx(Ue,{path:"sites",element:a.jsx(une,{})}),a.jsx(Ue,{path:"members/:membershipId",element:a.jsx(rne,{})})]}),a.jsx(Ue,{path:"/lab/assays",element:a.jsx(Bre,{})}),a.jsx(Ue,{path:"/lab/panels",element:a.jsx(Vre,{})}),a.jsxs(Ue,{path:"/:resourceType/new",element:a.jsx(Are,{}),children:[a.jsx(Ue,{index:!0,element:a.jsx(xx,{})}),a.jsx(Ue,{path:"form",element:a.jsx(xx,{})}),a.jsx(Ue,{path:"json",element:a.jsx(vie,{})}),a.jsx(Ue,{path:"profiles",element:a.jsx(xx,{})})]}),a.jsxs(Ue,{path:"/:resourceType/:id",element:a.jsx(Qie,{}),children:[a.jsx(Ue,{index:!0,element:a.jsx(D2,{})}),a.jsx(Ue,{path:"apply",element:a.jsx(Kre,{})}),a.jsx(Ue,{path:"apps",element:a.jsx(Xre,{})}),a.jsx(Ue,{path:"event",element:a.jsx(Zre,{})}),a.jsx(Ue,{path:"blame",element:a.jsx(eie,{})}),a.jsx(Ue,{path:"bots",element:a.jsx(Aie,{})}),a.jsx(Ue,{path:"builder",element:a.jsx(cie,{})}),a.jsx(Ue,{path:"checklist",element:a.jsx(uie,{})}),a.jsx(Ue,{path:"delete",element:a.jsx(die,{})}),a.jsx(Ue,{path:"details",element:a.jsx(pie,{})}),a.jsx(Ue,{path:"edit",element:a.jsx(mie,{})}),a.jsx(Ue,{path:"editor",element:a.jsx(sie,{})}),a.jsxs(Ue,{path:"history",children:[a.jsx(Ue,{index:!0,element:a.jsx(A2,{})}),a.jsx(Ue,{path:":versionId/:tab",element:a.jsx(ip,{})}),a.jsx(Ue,{path:":versionId",element:a.jsx(ip,{})})]}),a.jsxs(Ue,{path:"_history",children:[a.jsx(Ue,{index:!0,element:a.jsx(A2,{})}),a.jsx(Ue,{path:":versionId/:tab",element:a.jsx(ip,{})}),a.jsx(Ue,{path:":versionId",element:a.jsx(ip,{})})]}),a.jsx(Ue,{path:"json",element:a.jsx(yie,{})}),a.jsx(Ue,{path:"preview",element:a.jsx(Eie,{})}),a.jsx(Ue,{path:"responses",element:a.jsx(kie,{})}),a.jsx(Ue,{path:"report",element:a.jsx(Nie,{})}),a.jsx(Ue,{path:"ranges",element:a.jsx(Pie,{})}),a.jsx(Ue,{path:"subscriptions",element:a.jsx(Wie,{})}),a.jsx(Ue,{path:"timeline",element:a.jsx(D2,{})}),a.jsx(Ue,{path:"tools",element:a.jsx(Xie,{})}),a.jsx(Ue,{path:"profiles",element:a.jsx(Tie,{})}),a.jsx(Ue,{path:"export",element:a.jsx(gie,{})})]}),a.jsx(Ue,{path:"/:resourceType",element:a.jsx(T2,{})}),a.jsx(Ue,{path:"/",element:a.jsx(T2,{})})]})})}function ioe(){const e=Re(),t=e.getUserConfiguration(),n=mi(),[r]=c1();return e.isLoading()?a.jsx(Oi,{}):a.jsx(tW,{logo:a.jsx(Ui,{size:24}),pathname:n.pathname,searchParams:r,version:wk,menus:ooe(t),displayAddBookmark:!!t?.id,children:a.jsx(v.Suspense,{fallback:a.jsx(Oi,{}),children:a.jsx(roe,{})})})}function ooe(e){const t=e?.menu?.map(n=>({title:n.title,links:n.link?.map(r=>({label:r.name,href:r.target,icon:aoe(r.target)}))||[]}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:a.jsx(qq,{})}]}),t}const k2={Patient:RG,Practitioner:zq,Organization:tq,ServiceRequest:fG,DiagnosticReport:vG,Questionnaire:Lq,admin:YH,AccessPolicy:Fq,Subscription:IG,batch:rG,Observation:Zq};function aoe(e){if(e.includes("admin/super/db"))return a.jsx(yq,{});try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in k2){const n=k2[t];return a.jsx(n,{})}}catch{}return a.jsx(Lm,{w:20})}async function soe(){const e=Rf(),t=new jk({baseUrl:e.baseUrl,clientId:e.clientId,storagePrefix:"@medplum:",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=kte([{path:"*",element:a.jsx(ioe,{})}]),o=c=>r.navigate(c);wZ.createRoot(document.getElementById("root")).render(a.jsx(v.StrictMode,{children:a.jsx(ZF,{medplum:t,navigate:o,children:a.jsxs(e_,{theme:n,children:[a.jsx(Ra,{position:"bottom-right"}),a.jsx(rte,{router:r})]})})}))}soe().catch(console.error);
|
|
263
|
+
//# sourceMappingURL=index-8KRX5leM.js.map
|