@medplum/app 5.0.13 → 5.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
function x3(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 om(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _y={exports:{}},dd={};var sE;function b3(){if(sE)return dd;sE=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 u in o)u!=="key"&&(s[u]=o[u])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:c,ref:o!==void 0?o:null,props:s}}return dd.Fragment=t,dd.jsx=n,dd.jsxs=n,dd}var lE;function S3(){return lE||(lE=1,_y.exports=b3()),_y.exports}var a=S3(),Ro=function(){return Ro=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},Ro.apply(this,arguments)};function V2(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 Al(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 u(m){try{h(r.next(m))}catch(g){c(g)}}function f(m){try{h(r.throw(m))}catch(g){c(g)}}function h(m){m.done?s(m.value):o(m.value).then(u,f)}h((r=r.apply(e,t||[])).next())})}function w3(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 Dy={exports:{}},gt={};var cE;function j3(){if(cE)return gt;cE=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"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function x(O){return O===null||typeof O!="object"?null:(O=y&&O[y]||O["@@iterator"],typeof O=="function"?O:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,C={};function T(O,F,se){this.props=O,this.context=F,this.refs=C,this.updater=se||S}T.prototype.isReactComponent={},T.prototype.setState=function(O,F){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,F,"setState")},T.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function R(){}R.prototype=T.prototype;function E(O,F,se){this.props=O,this.context=F,this.refs=C,this.updater=se||S}var _=E.prototype=new R;_.constructor=E,j(_,T.prototype),_.isPureReactComponent=!0;var k=Array.isArray;function I(){}var D={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function $(O,F,se){var de=se.ref;return{$$typeof:e,type:O,key:F,ref:de!==void 0?de:null,props:se}}function B(O,F){return $(O.type,F,O.props)}function W(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function Y(O){var F={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(se){return F[se]})}var Z=/\/+/g;function U(O,F){return typeof O=="object"&&O!==null&&O.key!=null?Y(""+O.key):F.toString(36)}function G(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(I,I):(O.status="pending",O.then(function(F){O.status==="pending"&&(O.status="fulfilled",O.value=F)},function(F){O.status==="pending"&&(O.status="rejected",O.reason=F)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function M(O,F,se,de,ye){var je=typeof O;(je==="undefined"||je==="boolean")&&(O=null);var Ee=!1;if(O===null)Ee=!0;else switch(je){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(O.$$typeof){case e:case t:Ee=!0;break;case m:return Ee=O._init,M(Ee(O._payload),F,se,de,ye)}}if(Ee)return ye=ye(O),Ee=de===""?"."+U(O,0):de,k(ye)?(se="",Ee!=null&&(se=Ee.replace(Z,"$&/")+"/"),M(ye,F,se,"",function(dt){return dt})):ye!=null&&(W(ye)&&(ye=B(ye,se+(ye.key==null||O&&O.key===ye.key?"":(""+ye.key).replace(Z,"$&/")+"/")+Ee)),F.push(ye)),1;Ee=0;var Ke=de===""?".":de+":";if(k(O))for(var De=0;De<O.length;De++)de=O[De],je=Ke+U(de,De),Ee+=M(de,F,se,je,ye);else if(De=x(O),typeof De=="function")for(O=De.call(O),De=0;!(de=O.next()).done;)de=de.value,je=Ke+U(de,De++),Ee+=M(de,F,se,je,ye);else if(je==="object"){if(typeof O.then=="function")return M(G(O),F,se,de,ye);throw F=String(O),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function L(O,F,se){if(O==null)return O;var de=[],ye=0;return M(O,de,"","",function(je){return F.call(se,je,ye++)}),de}function z(O){if(O._status===-1){var F=O._result;F=F(),F.then(function(se){(O._status===0||O._status===-1)&&(O._status=1,O._result=se)},function(se){(O._status===0||O._status===-1)&&(O._status=2,O._result=se)}),O._status===-1&&(O._status=0,O._result=F)}if(O._status===1)return O._result.default;throw O._result}var V=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},K={map:L,forEach:function(O,F,se){L(O,function(){F.apply(this,arguments)},se)},count:function(O){var F=0;return L(O,function(){F++}),F},toArray:function(O){return L(O,function(F){return F})||[]},only:function(O){if(!W(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return gt.Activity=g,gt.Children=K,gt.Component=T,gt.Fragment=n,gt.Profiler=o,gt.PureComponent=E,gt.StrictMode=r,gt.Suspense=f,gt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,gt.__COMPILER_RUNTIME={__proto__:null,c:function(O){return D.H.useMemoCache(O)}},gt.cache=function(O){return function(){return O.apply(null,arguments)}},gt.cacheSignal=function(){return null},gt.cloneElement=function(O,F,se){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var de=j({},O.props),ye=O.key;if(F!=null)for(je in F.key!==void 0&&(ye=""+F.key),F)!P.call(F,je)||je==="key"||je==="__self"||je==="__source"||je==="ref"&&F.ref===void 0||(de[je]=F[je]);var je=arguments.length-2;if(je===1)de.children=se;else if(1<je){for(var Ee=Array(je),Ke=0;Ke<je;Ke++)Ee[Ke]=arguments[Ke+2];de.children=Ee}return $(O.type,ye,de)},gt.createContext=function(O){return O={$$typeof:c,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:s,_context:O},O},gt.createElement=function(O,F,se){var de,ye={},je=null;if(F!=null)for(de in F.key!==void 0&&(je=""+F.key),F)P.call(F,de)&&de!=="key"&&de!=="__self"&&de!=="__source"&&(ye[de]=F[de]);var Ee=arguments.length-2;if(Ee===1)ye.children=se;else if(1<Ee){for(var Ke=Array(Ee),De=0;De<Ee;De++)Ke[De]=arguments[De+2];ye.children=Ke}if(O&&O.defaultProps)for(de in Ee=O.defaultProps,Ee)ye[de]===void 0&&(ye[de]=Ee[de]);return $(O,je,ye)},gt.createRef=function(){return{current:null}},gt.forwardRef=function(O){return{$$typeof:u,render:O}},gt.isValidElement=W,gt.lazy=function(O){return{$$typeof:m,_payload:{_status:-1,_result:O},_init:z}},gt.memo=function(O,F){return{$$typeof:h,type:O,compare:F===void 0?null:F}},gt.startTransition=function(O){var F=D.T,se={};D.T=se;try{var de=O(),ye=D.S;ye!==null&&ye(se,de),typeof de=="object"&&de!==null&&typeof de.then=="function"&&de.then(I,V)}catch(je){V(je)}finally{F!==null&&se.types!==null&&(F.types=se.types),D.T=F}},gt.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},gt.use=function(O){return D.H.use(O)},gt.useActionState=function(O,F,se){return D.H.useActionState(O,F,se)},gt.useCallback=function(O,F){return D.H.useCallback(O,F)},gt.useContext=function(O){return D.H.useContext(O)},gt.useDebugValue=function(){},gt.useDeferredValue=function(O,F){return D.H.useDeferredValue(O,F)},gt.useEffect=function(O,F){return D.H.useEffect(O,F)},gt.useEffectEvent=function(O){return D.H.useEffectEvent(O)},gt.useId=function(){return D.H.useId()},gt.useImperativeHandle=function(O,F,se){return D.H.useImperativeHandle(O,F,se)},gt.useInsertionEffect=function(O,F){return D.H.useInsertionEffect(O,F)},gt.useLayoutEffect=function(O,F){return D.H.useLayoutEffect(O,F)},gt.useMemo=function(O,F){return D.H.useMemo(O,F)},gt.useOptimistic=function(O,F){return D.H.useOptimistic(O,F)},gt.useReducer=function(O,F,se){return D.H.useReducer(O,F,se)},gt.useRef=function(O){return D.H.useRef(O)},gt.useState=function(O){return D.H.useState(O)},gt.useSyncExternalStore=function(O,F,se){return D.H.useSyncExternalStore(O,F,se)},gt.useTransition=function(){return D.H.useTransition()},gt.version="19.2.3",gt}var uE;function wb(){return uE||(uE=1,Dy.exports=j3()),Dy.exports}var v=wb();const Mn=om(v),jb=x3({__proto__:null,default:Mn},[v]);var mp="right-scroll-bar-position",gp="width-before-scroll-bar",C3="with-scroll-bars-hidden",E3="--removed-body-scroll-bar-size";function Ay(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function T3(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 R3=typeof window<"u"?v.useLayoutEffect:v.useEffect,dE=new WeakMap;function _3(e,t){var n=T3(null,function(r){return e.forEach(function(o){return Ay(o,r)})});return R3(function(){var r=dE.get(n);if(r){var o=new Set(r),s=new Set(e),c=n.current;o.forEach(function(u){s.has(u)||Ay(u,null)}),s.forEach(function(u){o.has(u)||Ay(u,c)})}dE.set(n,e)},[e]),n}function D3(e){return e}function A3(e,t){t===void 0&&(t=D3);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(u){return u!==c})}},assignSyncMedium:function(s){for(r=!0;n.length;){var c=n;n=[],c.forEach(s)}n={push:function(u){return s(u)},filter:function(){return n}}},assignMedium:function(s){r=!0;var c=[];if(n.length){var u=n;n=[],u.forEach(s),c=n}var f=function(){var m=c;c=[],m.forEach(s)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(m){c.push(m),h()},filter:function(m){return c=c.filter(m),n}}}};return o}function k3(e){e===void 0&&(e={});var t=A3(null);return t.options=Ro({async:!0,ssr:!1},e),t}var F2=function(e){var t=e.sideCar,n=V2(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,Ro({},n))};F2.isSideCarExport=!0;function P3(e,t){return e.useMedium(t),F2}var H2=k3(),ky=function(){},am=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:ky,onWheelCapture:ky,onTouchMoveCapture:ky}),o=r[0],s=r[1],c=e.forwardProps,u=e.children,f=e.className,h=e.removeScrollBar,m=e.enabled,g=e.shards,y=e.sideCar,x=e.noRelative,S=e.noIsolation,j=e.inert,C=e.allowPinchZoom,T=e.as,R=T===void 0?"div":T,E=e.gapMode,_=V2(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=y,I=_3([n,t]),D=Ro(Ro({},_),o);return v.createElement(v.Fragment,null,m&&v.createElement(k,{sideCar:H2,removeScrollBar:h,shards:g,noRelative:x,noIsolation:S,inert:j,setCallbacks:s,allowPinchZoom:!!C,lockRef:n,gapMode:E}),c?v.cloneElement(v.Children.only(u),Ro(Ro({},D),{ref:I})):v.createElement(R,Ro({},D,{className:f,ref:I}),u))});am.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};am.classNames={fullWidth:gp,zeroRight:mp};var N3=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function O3(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=N3();return t&&e.setAttribute("nonce",t),e}function M3(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function L3(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var I3=function(){var e=0,t=null;return{add:function(n){e==0&&(t=O3())&&(M3(t,n),L3(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},z3=function(){var e=I3();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},q2=function(){var e=z3(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},$3={left:0,top:0,right:0,gap:0},Py=function(e){return parseInt(e||"",10)||0},U3=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[Py(n),Py(r),Py(o)]},B3=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return $3;var t=U3(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])}},V3=q2(),Bc="data-scroll-locked",F3=function(e,t,n,r){var o=e.left,s=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
2
|
-
.`.concat(C3,` {
|
|
3
|
-
overflow: hidden `).concat(r,`;
|
|
4
|
-
padding-right: `).concat(u,"px ").concat(r,`;
|
|
5
|
-
}
|
|
6
|
-
body[`).concat(Bc,`] {
|
|
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(u,"px ").concat(r,`;
|
|
16
|
-
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.`).concat(mp,` {
|
|
20
|
-
right: `).concat(u,"px ").concat(r,`;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.`).concat(gp,` {
|
|
24
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.`).concat(mp," .").concat(mp,` {
|
|
28
|
-
right: 0 `).concat(r,`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.`).concat(gp," .").concat(gp,` {
|
|
32
|
-
margin-right: 0 `).concat(r,`;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
body[`).concat(Bc,`] {
|
|
36
|
-
`).concat(E3,": ").concat(u,`px;
|
|
37
|
-
}
|
|
38
|
-
`)},fE=function(){var e=parseInt(document.body.getAttribute(Bc)||"0",10);return isFinite(e)?e:0},H3=function(){v.useEffect(function(){return document.body.setAttribute(Bc,(fE()+1).toString()),function(){var e=fE()-1;e<=0?document.body.removeAttribute(Bc):document.body.setAttribute(Bc,e.toString())}},[])},q3=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;H3();var s=v.useMemo(function(){return B3(o)},[o]);return v.createElement(V3,{styles:F3(s,!t,o,n?"":"!important")})},_x=!1;if(typeof window<"u")try{var Yh=Object.defineProperty({},"passive",{get:function(){return _x=!0,!0}});window.addEventListener("test",Yh,Yh),window.removeEventListener("test",Yh,Yh)}catch{_x=!1}var Cc=_x?{passive:!1}:!1,G3=function(e){return e.tagName==="TEXTAREA"},G2=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!G3(e)&&n[t]==="visible")},W3=function(e){return G2(e,"overflowY")},Q3=function(e){return G2(e,"overflowX")},hE=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=W2(e,r);if(o){var s=Q2(e,r),c=s[1],u=s[2];if(c>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Y3=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},K3=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},W2=function(e,t){return e==="v"?W3(t):Q3(t)},Q2=function(e,t){return e==="v"?Y3(t):K3(t)},X3=function(e,t){return e==="h"&&t==="rtl"?-1:1},J3=function(e,t,n,r,o){var s=X3(e,window.getComputedStyle(t).direction),c=s*r,u=n.target,f=t.contains(u),h=!1,m=c>0,g=0,y=0;do{if(!u)break;var x=Q2(e,u),S=x[0],j=x[1],C=x[2],T=j-C-s*S;(S||T)&&W2(e,u)&&(g+=T,y+=S);var R=u.parentNode;u=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(m&&Math.abs(g)<1||!m&&Math.abs(y)<1)&&(h=!0),h},Kh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},pE=function(e){return[e.deltaX,e.deltaY]},mE=function(e){return e&&"current"in e?e.current:e},Z3=function(e,t){return e[0]===t[0]&&e[1]===t[1]},eM=function(e){return`
|
|
39
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
40
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
41
|
-
`)},tM=0,Ec=[];function nM(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),o=v.useState(tM++)[0],s=v.useState(q2)[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=w3([e.lockRef.current],(e.shards||[]).map(mE),!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 u=v.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var T=Kh(j),R=n.current,E="deltaX"in j?j.deltaX:R[0]-T[0],_="deltaY"in j?j.deltaY:R[1]-T[1],k,I=j.target,D=Math.abs(E)>Math.abs(_)?"h":"v";if("touches"in j&&D==="h"&&I.type==="range")return!1;var P=window.getSelection(),$=P&&P.anchorNode,B=$?$===I||$.contains(I):!1;if(B)return!1;var W=hE(D,I);if(!W)return!0;if(W?k=D:(k=D==="v"?"h":"v",W=hE(D,I)),!W)return!1;if(!r.current&&"changedTouches"in j&&(E||_)&&(r.current=k),!k)return!0;var Y=r.current||k;return J3(Y,C,j,Y==="h"?E:_)},[]),f=v.useCallback(function(j){var C=j;if(!(!Ec.length||Ec[Ec.length-1]!==s)){var T="deltaY"in C?pE(C):Kh(C),R=t.current.filter(function(k){return k.name===C.type&&(k.target===C.target||C.target===k.shadowParent)&&Z3(k.delta,T)})[0];if(R&&R.should){C.cancelable&&C.preventDefault();return}if(!R){var E=(c.current.shards||[]).map(mE).filter(Boolean).filter(function(k){return k.contains(C.target)}),_=E.length>0?u(C,E[0]):!c.current.noIsolation;_&&C.cancelable&&C.preventDefault()}}},[]),h=v.useCallback(function(j,C,T,R){var E={name:j,delta:C,target:T,should:R,shadowParent:rM(T)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(_){return _!==E})},1)},[]),m=v.useCallback(function(j){n.current=Kh(j),r.current=void 0},[]),g=v.useCallback(function(j){h(j.type,pE(j),j.target,u(j,e.lockRef.current))},[]),y=v.useCallback(function(j){h(j.type,Kh(j),j.target,u(j,e.lockRef.current))},[]);v.useEffect(function(){return Ec.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",f,Cc),document.addEventListener("touchmove",f,Cc),document.addEventListener("touchstart",m,Cc),function(){Ec=Ec.filter(function(j){return j!==s}),document.removeEventListener("wheel",f,Cc),document.removeEventListener("touchmove",f,Cc),document.removeEventListener("touchstart",m,Cc)}},[]);var x=e.removeScrollBar,S=e.inert;return v.createElement(v.Fragment,null,S?v.createElement(s,{styles:eM(o)}):null,x?v.createElement(q3,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function rM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const iM=P3(H2,nM);var yl=v.forwardRef(function(e,t){return v.createElement(am,Ro({},e,{ref:t,sideCar:iM}))});yl.classNames=am.classNames;function un(e){return Object.keys(e)}function Ny(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Cb(e,t){const n={...e},r=t;return Ny(e)&&Ny(t)&&Object.keys(t).forEach(o=>{Ny(r[o])&&o in e?n[o]=Cb(n[o],r[o]):n[o]=r[o]}),n}function oM(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function aM(e){return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:e.match(/^calc\((.*?)\)$/)?.[1].split("*")[0].trim()}function Rd(e){const t=aM(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 gE(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function Y2(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?gE(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?gE(s):s}}return r}return n}const ce=Y2("rem",{shouldScale:!0}),_p=Y2("em");function Es(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function K2(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 sm(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==v.Fragment:!1}function Ar(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 Ho(e=null){const t=v.createContext(e);return[({children:o,value:s})=>a.jsx(t.Provider,{value:s,children:o}),()=>v.useContext(t)]}function vE(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function Dp(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function sM(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 lM(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 cM(e,t,n){return Dp(e,n)===Dp(t,n)}function Eb({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:o=!1,dir:s="rtl",orientation:c}){return u=>{n?.(u);const f=Array.from(Dp(u.currentTarget,e)?.querySelectorAll(t)||[]).filter(S=>cM(u.currentTarget,S,e)),h=f.findIndex(S=>u.currentTarget===S),m=lM(h,f,r),g=sM(h,f,r),y=s==="rtl"?g:m,x=s==="rtl"?m:g;switch(u.key){case"ArrowRight":{c==="horizontal"&&(u.stopPropagation(),u.preventDefault(),f[y].focus(),o&&f[y].click());break}case"ArrowLeft":{c==="horizontal"&&(u.stopPropagation(),u.preventDefault(),f[x].focus(),o&&f[x].click());break}case"ArrowUp":{c==="vertical"&&(u.stopPropagation(),u.preventDefault(),f[g].focus(),o&&f[g].click());break}case"ArrowDown":{c==="vertical"&&(u.stopPropagation(),u.preventDefault(),f[m].focus(),o&&f[m].click());break}case"Home":{u.stopPropagation(),u.preventDefault(),!f[0].disabled&&f[0].focus();break}case"End":{u.stopPropagation(),u.preventDefault();const S=f.length-1;!f[S].disabled&&f[S].focus();break}}}}const uM={app:100,modal:200,popover:300,overlay:400,max:9999};function zr(e){return uM[e]}const Ap=()=>{};function dM(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||Ap:n=>{n.key==="Escape"&&(e(n),t.onTrigger?.())}}function ot(e,t="size",n=!0){if(e!==void 0)return K2(e)?n?ce(e):e:`var(--${t}-${e})`}function Gn(e){return ot(e,"mantine-spacing")}function Vt(e){return e===void 0?"var(--mantine-radius-default)":ot(e,"mantine-radius")}function Wn(e){return ot(e,"mantine-font-size")}function X2(e){return ot(e,"mantine-line-height",!1)}function Tb(e){if(e)return ot(e,"mantine-shadow",!1)}function lr(e,t){return n=>{e?.(n),t?.(n)}}function Rb(e,t){return e in t?Rd(t[e]):Rd(e)}function _d(e,t){const n=e.map(r=>({value:r,px:Rb(r,t)}));return n.sort((r,o)=>r.px-o.px),n}function no(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function fM(e,t,n){return n?Array.from(Dp(n,t)?.querySelectorAll(e)||[]).findIndex(r=>r===n):null}function jd(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 kp(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function hM(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 yE(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function ol(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>((...n)=>t.current?.(...n)),[])}function Xd(e,t){const{delay:n,flushOnUnmount:r,leading:o}=typeof t=="number"?{delay:t,flushOnUnmount:!1,leading:!1}:t,s=ol(e),c=v.useRef(0),u=v.useMemo(()=>{const f=Object.assign((...h)=>{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(...h);const S=()=>{g()},j=()=>{c.current!==0&&(g(),s(...h))},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(...h))},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(...h))},x=()=>{g()};f.flush=y,f.cancel=x,c.current=window.setTimeout(y,n)},{flush:()=>{},cancel:()=>{},_isFirstCall:!0});return f},[s,n,o]);return v.useEffect(()=>()=>{r?u.flush():u.cancel()},[u,r]),u}const pM=["mousedown","touchstart"];function mM(e,t,n){const r=v.useRef(null),o=t||pM;return v.useEffect(()=>{const s=c=>{const{target:u}=c??{};if(Array.isArray(n)){const f=!document.body.contains(u)&&u?.tagName!=="HTML";n.every(m=>!!m&&!c.composedPath().includes(m))&&!f&&e(c)}else r.current&&!r.current.contains(u)&&e(c)};return o.forEach(c=>document.addEventListener(c,s)),()=>{o.forEach(c=>document.removeEventListener(c,s))}},[r,e,n]),r}function J2(e={timeout:2e3}){const[t,n]=v.useState(null),[r,o]=v.useState(!1),[s,c]=v.useState(null),u=m=>{window.clearTimeout(s),c(window.setTimeout(()=>o(!1),e.timeout)),o(m)};return{copy:m=>{"clipboard"in navigator?navigator.clipboard.writeText(m).then(()=>u(!0)).catch(g=>n(g)):n(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{o(!1),n(null),window.clearTimeout(s)},error:t,copied:r}}function gM(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function vM(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function Z2(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=v.useState(n?t:vM(e));return v.useEffect(()=>{try{const s=window.matchMedia(e);return o(s.matches),gM(s,c=>o(c.matches))}catch{return}},[e]),r||!1}function yM(e,t){return Z2("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const kl=typeof document<"u"?v.useLayoutEffect:v.useEffect;function xl(e,t){const n=v.useRef(!1);v.useEffect(()=>()=>{n.current=!1},[]),v.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function e_({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 xl(()=>{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 xM=/input|select|textarea|button|object/,t_="a, input, select, textarea, button, object, [tabindex]";function bM(e){return e.style.display==="none"}function SM(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(bM(n))return!1;n=n.parentNode}return!0}function n_(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function Dx(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(n_(e));return(xM.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&SM(e)}function r_(e){const t=n_(e);return(Number.isNaN(t)||t>=0)&&Dx(e)}function wM(e){return Array.from(e.querySelectorAll(t_)).filter(r_)}function jM(e,t){const n=wM(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 CM(e=!0){const t=v.useRef(null),n=o=>{let s=o.querySelector("[data-autofocus]");if(!s){const c=Array.from(o.querySelectorAll(t_));s=c.find(r_)||c.find(Dx)||null,!s&&Dx(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&&jM(t.current,s)};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e]),r}const EM=e=>(e+1)%1e6;function TM(){const[,e]=v.useReducer(EM,0);return e}const RM=Mn.useId||(()=>{});function _M(){const e=RM();return e?`mantine-${e.replace(/:/g,"")}`:""}function ur(e){const t=_M(),[n,r]=v.useState(t);return kl(()=>{r(kp())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function i_(e,t,n){v.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function Dd(e,t){if(typeof e=="function")return e(t);typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function DM(...e){const t=new Map;return n=>{if(e.forEach(r=>{const o=Dd(r,n);o&&t.set(r,o)}),t.size>0)return()=>{e.forEach(r=>{const o=t.get(r);o&&typeof o=="function"?o():Dd(r,null)}),t.clear()}}}function Vn(...e){return v.useCallback(DM(...e),e)}function ir({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,s]=v.useState(t!==void 0?t:n),c=(u,...f)=>{s(u),r?.(u,...f)};return e!==void 0?[e,r,!0]:[o,c,!1]}function ss(e,t){const n=t-e+1;return Array.from({length:n},(r,o)=>o+e)}const Xh="dots";function AM({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:o=1,onChange:s}){const c=Math.max(Math.trunc(e),0),[u,f]=ir({value:r,onChange:s,defaultValue:o,finalValue:o}),h=j=>{j<=0?f(1):j>c?f(c):f(j)},m=()=>h(u+1),g=()=>h(u-1),y=()=>h(1),x=()=>h(c);return{range:v.useMemo(()=>{if(t*2+3+n*2>=c)return ss(1,c);const C=Math.max(u-t,n),T=Math.min(u+t,c-n),R=C>n+2,E=T<c-(n+1);if(!R&&E){const _=t*2+n+2;return[...ss(1,_),Xh,...ss(c-(n-1),c)]}if(R&&!E){const _=n+1+2*t;return[...ss(1,n),Xh,...ss(c-_,c)]}return[...ss(1,n),Xh,...ss(C,T),Xh,...ss(c-n+1,c)]},[c,t,u]),active:u,setPage:h,next:m,previous:g,first:y,last:x}}function _b(e,t){return Z2("(prefers-reduced-motion: reduce)",e,t)}function kM(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(!hM(e[n],t[n]))return!1;return!0}function PM(e){const t=v.useRef([]),n=v.useRef(0);return kM(t.current,e)||(t.current=e,n.current+=1),[n.current]}function NM(e,t){v.useEffect(e,PM(t))}const OM={" ":"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 Jh(e){const t=e.replace("Key","").toLowerCase();return OM[e]||t}function MM(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 LM(e,t,n){const{alt:r,ctrl:o,meta:s,mod:c,shift:u,key:f}=e,{altKey:h,ctrlKey:m,metaKey:g,shiftKey:y,key:x,code:S}=t;if(r!==h)return!1;if(c){if(!m&&!g)return!1}else if(o!==m||s!==g)return!1;return u!==y?!1:!!(f&&(n?Jh(S)===Jh(f):Jh(x??S)===Jh(f)))}function IM(e,t){return n=>LM(MM(e),n,t)}function zM(e,t,n=!1){return e.target instanceof HTMLElement?(n||!e.target.isContentEditable)&&!t.includes(e.target.tagName):!0}function $M(e,t=["INPUT","TEXTAREA","SELECT"],n=!1){v.useEffect(()=>{const r=o=>{e.forEach(([s,c,u={preventDefault:!0,usePhysicalKeys:!1}])=>{IM(s,u.usePhysicalKeys)(o)&&zM(o,t,n)&&(u.preventDefault&&o.preventDefault(),c(o))})};return document.documentElement.addEventListener("keydown",r),()=>document.documentElement.removeEventListener("keydown",r)},[e])}function Pl(e=!1,t={}){const[n,r]=v.useState(e),o=v.useCallback(()=>{r(u=>u||(t.onOpen?.(),!0))},[t.onOpen]),s=v.useCallback(()=>{r(u=>u&&(t.onClose?.(),!1))},[t.onClose]),c=v.useCallback(()=>{n?s():o()},[s,o,n]);return[n,{open:o,close:s,toggle:c}]}function UM(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 BM(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 VM(){const[e,t]=v.useState(!1);return v.useEffect(()=>t(!0),[]),e}var FM={};function o_(){return typeof process<"u"&&FM?"production":"development"}function lm(e){const t=Mn.version;return typeof Mn.version!="string"||t.startsWith("18.")?e?.ref:e?.props?.ref}function vp(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=vp(e,s.shadowRoot);if(c)return c}}return null}function ds(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 u=ds(e,c.shadowRoot);n.push(...u)}}return n}function ls(e){if(!e)return document;const t=e.getRootNode();return t instanceof ShadowRoot||t instanceof Document?t:document}function Nl(e){const t=v.Children.toArray(e);return t.length!==1||!sm(t[0])?null:t[0]}function a_(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=a_(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Bt(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=a_(e))&&(r&&(r+=" "),r+=t);return r}const HM={};function qM(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,o])=>{t[r]?t[r]=Bt(t[r],o):t[r]=o})}),t}function Jd({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||HM);return qM(s)}function Ad({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 Db=v.createContext(null);function Ta(){const e=v.useContext(Db);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function GM(){return Ta().cssVariablesResolver}function WM(){return Ta().classNamesPrefix}function cm(){return Ta().getStyleNonce}function QM(){return Ta().withStaticClasses}function YM(){return Ta().headless}function KM(){return Ta().stylesTransform?.sx}function XM(){return Ta().stylesTransform?.styles}function um(){return Ta().env||"default"}function JM(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function ZM(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 e5(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 t5(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,u=(1-Math.abs(2*s-1))*o,f=r/60,h=u*(1-Math.abs(f%2-1)),m=s-u/2;let g,y,x;return f>=0&&f<1?(g=u,y=h,x=0):f>=1&&f<2?(g=h,y=u,x=0):f>=2&&f<3?(g=0,y=u,x=h):f>=3&&f<4?(g=0,y=h,x=u):f>=4&&f<5?(g=h,y=0,x=u):(g=u,y=0,x=h),{r:Math.round((g+m)*255),g:Math.round((y+m)*255),b:Math.round((x+m)*255),a:c||1}}function Ab(e){return JM(e)?ZM(e):e.startsWith("rgb")?e5(e):e.startsWith("hsl")?t5(e):{r:0,g:0,b:0,a:1}}function Zh(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:o,a:s}=Ab(e),c=1-t,u=f=>Math.round(f*c);return`rgba(${u(n)}, ${u(r)}, ${u(o)}, ${s})`}function kd(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function Oy(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function n5(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function r5(e){if(e.startsWith("oklch("))return(n5(e)||0)/100;const{r:t,g:n,b:r}=Ab(e),o=t/255,s=n/255,c=r/255,u=Oy(o),f=Oy(s),h=Oy(c);return .2126*u+.7152*f+.0722*h}function fd(e,t=.179){return e.startsWith("var(")?!1:r5(e)>t}function Xr({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:fd(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:fd(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:fd(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 u=s!==void 0?t.colors[r][s]:t.colors[r][kd(t,n||"light")];return{color:r,value:u,shade:s,isThemeColor:c,isLight:fd(u,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${s}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:c,isLight:fd(e,t.luminanceThreshold),shade:s,variable:void 0}}function Kt(e,t){const n=Xr({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function Ax(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 ki(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}=Ab(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const Tc=ki,i5=({color:e,theme:t,variant:n,gradient:r,autoContrast:o})=>{const s=Xr({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 u=c&&s.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return s.isThemeColor?s.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:u,border:`${ce(1)} solid transparent`}:{background:`var(--mantine-color-${s.color}-${s.shade})`,hover:`var(--mantine-color-${s.color}-${s.shade===9?8:s.shade+1})`,color:u,border:`${ce(1)} solid transparent`}:{background:e,hover:Zh(e,.1),color:u,border:`${ce(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:`${ce(1)} solid transparent`};const u=t.colors[s.color][s.shade];return{background:ki(u,.1),hover:ki(u,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${ce(1)} solid transparent`}}return{background:ki(e,.1),hover:ki(e,.12),color:e,border:`${ce(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:`${ce(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:ki(t.colors[s.color][s.shade],.05),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${ce(1)} solid var(--mantine-color-${s.color}-${s.shade})`}:{background:"transparent",hover:ki(e,.05),color:e,border:`${ce(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:`${ce(1)} solid transparent`};const u=t.colors[s.color][s.shade];return{background:"transparent",hover:ki(u,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${ce(1)} solid transparent`}}return{background:"transparent",hover:ki(e,.12),color:e,border:`${ce(1)} solid transparent`}}return n==="transparent"?s.isThemeColor?s.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${ce(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${ce(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${ce(1)} solid transparent`}:n==="white"?s.isThemeColor?s.shade===void 0?{background:"var(--mantine-color-white)",hover:Zh(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${ce(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Zh(t.white,.01),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${ce(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Zh(t.white,.01),color:e,border:`${ce(1)} solid transparent`}:n==="gradient"?{background:Ax(r,t),hover:Ax(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:`${ce(1)} solid var(--mantine-color-default-border)`}:{}},o5={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"]},xE="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",kb={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:o5,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:i5,autoContrast:!1,luminanceThreshold:.3,fontFamily:xE,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:xE,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:ce(34),lineHeight:"1.3"},h2:{fontSize:ce(26),lineHeight:"1.35"},h3:{fontSize:ce(22),lineHeight:"1.4"},h4:{fontSize:ce(18),lineHeight:"1.45"},h5:{fontSize:ce(16),lineHeight:"1.5"},h6:{fontSize:ce(14),lineHeight:"1.5"}}},fontSizes:{xs:ce(12),sm:ce(14),md:ce(16),lg:ce(18),xl:ce(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:ce(2),sm:ce(4),md:ce(8),lg:ce(16),xl:ce(32)},spacing:{xs:ce(10),sm:ce(12),md:ce(16),lg:ce(20),xl:ce(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${ce(1)} ${ce(3)} rgba(0, 0, 0, 0.05), 0 ${ce(1)} ${ce(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${ce(1)} ${ce(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${ce(10)} ${ce(15)} ${ce(-5)}, rgba(0, 0, 0, 0.04) 0 ${ce(7)} ${ce(7)} ${ce(-5)}`,md:`0 ${ce(1)} ${ce(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${ce(20)} ${ce(25)} ${ce(-5)}, rgba(0, 0, 0, 0.04) 0 ${ce(10)} ${ce(10)} ${ce(-5)}`,lg:`0 ${ce(1)} ${ce(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${ce(28)} ${ce(23)} ${ce(-7)}, rgba(0, 0, 0, 0.04) 0 ${ce(12)} ${ce(12)} ${ce(-7)}`,xl:`0 ${ce(1)} ${ce(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${ce(36)} ${ce(28)} ${ce(-7)}, rgba(0, 0, 0, 0.04) 0 ${ce(17)} ${ce(17)} ${ce(-7)}`},other:{},components:{}};function bE(e){return e==="auto"||e==="dark"||e==="light"}function a5({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 bE(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&&bE(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const s5="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",SE="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function My(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function wE(e){if(!(e.primaryColor in e.colors))throw new Error(s5);if(typeof e.primaryShade=="object"&&(!My(e.primaryShade.dark)||!My(e.primaryShade.light)))throw new Error(SE);if(typeof e.primaryShade=="number"&&!My(e.primaryShade))throw new Error(SE)}function l5(e,t){if(!t)return wE(e),e;const n=Cb(e,t);return t.fontFamily&&!t.headings?.fontFamily&&(n.headings.fontFamily=t.fontFamily),wE(n),n}const Pb=v.createContext(null),c5=()=>v.useContext(Pb)||kb;function _n(){const e=v.useContext(Pb);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 s_({theme:e,children:t,inherit:n=!0}){const r=c5(),o=v.useMemo(()=>l5(n?r:kb,e),[e,r,n]);return a.jsx(Pb.Provider,{value:o,children:t})}s_.displayName="@mantine/core/MantineThemeProvider";function u5(){const e=_n(),t=cm(),n=un(e.breakpoints).reduce((r,o)=>{const s=e.breakpoints[o].includes("px"),c=Rd(e.breakpoints[o]),u=s?`${c-.1}px`:_p(c-.1),f=s?`${c}px`:_p(c);return`${r}@media (max-width: ${u}) {.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 Ly(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function l_(e,t){const n=t?[t]:[":root",":host"],r=Ly(e.variables),o=r?`${n.join(", ")}{${r}}`:"",s=Ly(e.dark),c=Ly(e.light),u=m=>n.map(g=>g===":host"?`${g}([data-mantine-color-scheme="${m}"])`:`${g}[data-mantine-color-scheme="${m}"]`).join(", "),f=s?`${u("dark")}{${s}}`:"",h=c?`${u("light")}{${c}}`:"";return`${o}
|
|
42
|
-
|
|
43
|
-
${f}
|
|
44
|
-
|
|
45
|
-
${h}`}function Ra({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&Xr({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function jE(e,t){return Ra({color:e.colors[e.primaryColor][kd(e,t)],theme:e,autoContrast:null})}function ep({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:o=!0}){if(!e.colors[t])return{};if(n==="light"){const u=kd(e,"light"),f={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${u})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${u===9?8:u+1})`,[`--mantine-color-${r}-light`]:Tc(e.colors[t][u],.1),[`--mantine-color-${r}-light-hover`]:Tc(e.colors[t][u],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${u})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${u})`,[`--mantine-color-${r}-outline-hover`]:Tc(e.colors[t][u],.05)};return o?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...f}:f}const s=kd(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`]:Tc(e.colors[t][Math.max(0,s-2)],.15),[`--mantine-color-${r}-light-hover`]:Tc(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`]:Tc(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 d5(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function Rc(e,t,n){un(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const c_=e=>{const t=kd(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:ce(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":jE(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":jE(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)"}};Rc(r.variables,e.breakpoints,"breakpoint"),Rc(r.variables,e.spacing,"spacing"),Rc(r.variables,e.fontSizes,"font-size"),Rc(r.variables,e.lineHeights,"line-height"),Rc(r.variables,e.shadows,"shadow"),Rc(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((s,c)=>{r.variables[`--mantine-primary-color-${c}`]=`var(--mantine-color-${e.primaryColor}-${c})`}),un(e.colors).forEach(s=>{const c=e.colors[s];if(d5(c)){Object.assign(r.light,ep({theme:e,name:c.name,color:c.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,ep({theme:e,name:c.name,color:c.dark,colorScheme:"dark",withColorValues:!0}));return}c.forEach((u,f)=>{r.variables[`--mantine-color-${s}-${f}`]=u}),Object.assign(r.light,ep({theme:e,color:s,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,ep({theme:e,color:s,colorScheme:"dark",withColorValues:!1}))});const o=e.headings.sizes;return un(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 f5({theme:e,generator:t}){const n=c_(e),r=t?.(e);return r?Cb(n,r):n}const Iy=c_(kb);function h5(e){const t={variables:{},light:{},dark:{}};return un(e.variables).forEach(n=>{Iy.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),un(e.light).forEach(n=>{Iy.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),un(e.dark).forEach(n=>{Iy.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function p5(e){return l_({variables:{},dark:{"--mantine-color-scheme":"dark"},light:{"--mantine-color-scheme":"light"}},e)}function u_({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=_n(),r=cm(),o=GM(),s=f5({theme:n,generator:o}),c=(e===void 0||e===":root"||e===":host")&&t,u=c?h5(s):s,f=l_(u,e);return f?a.jsx("style",{"data-mantine-styles":!0,nonce:r?.(),dangerouslySetInnerHTML:{__html:`${f}${c?"":p5(e)}`}}):null}u_.displayName="@mantine/CssVariables";function _c(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 m5({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const o=v.useRef(null),[s,c]=v.useState(()=>e.get(t)),u=r||s,f=v.useCallback(m=>{r||(_c(m,n),c(m),e.set(m))},[e.set,u,r]),h=v.useCallback(()=>{c(t),_c(t,n),e.clear()},[e.clear,t]);return v.useEffect(()=>(e.subscribe(f),e.unsubscribe),[e.subscribe,e.unsubscribe]),kl(()=>{_c(e.get(t),n)},[]),v.useEffect(()=>{if(r)return _c(r,n),()=>{};r===void 0&&_c(s,n),typeof window<"u"&&"matchMedia"in window&&(o.current=window.matchMedia("(prefers-color-scheme: dark)"));const m=g=>{s==="auto"&&_c(g.matches?"dark":"light",n)};return o.current?.addEventListener("change",m),()=>o.current?.removeEventListener("change",m)},[s,r]),{colorScheme:u,setColorScheme:f,clearColorScheme:h}}function g5({respectReducedMotion:e,getRootElement:t}){kl(()=>{e&&t()?.setAttribute("data-respect-reduced-motion","true")},[e])}function d_({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:o=!0,deduplicateCssVariables:s=!0,withCssVariables:c=!0,cssVariablesSelector:u,classNamesPrefix:f="mantine",colorSchemeManager:h=a5(),defaultColorScheme:m="light",getRootElement:g=()=>document.documentElement,cssVariablesResolver:y,forceColorScheme:x,stylesTransform:S,env:j}){const{colorScheme:C,setColorScheme:T,clearColorScheme:R}=m5({defaultColorScheme:m,forceColorScheme:x,manager:h,getRootElement:g});return g5({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:g}),a.jsx(Db.Provider,{value:{colorScheme:C,setColorScheme:T,clearColorScheme:R,getRootElement:g,classNamesPrefix:f,getStyleNonce:n,cssVariablesResolver:y,cssVariablesSelector:u??":root",withStaticClasses:r,stylesTransform:S,env:j},children:a.jsxs(s_,{theme:e,children:[c&&a.jsx(u_,{cssVariablesSelector:u,deduplicateCssVariables:s}),o&&a.jsx(u5,{}),t]})})}d_.displayName="@mantine/core/MantineProvider";function Ol({classNames:e,styles:t,props:n,stylesCtx:r}){const o=_n();return{resolvedClassNames:Jd({theme:o,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:Ad({theme:o,styles:t,props:n,stylesCtx:r||void 0})}}const v5={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function y5({theme:e,options:t,unstyled:n}){return Bt(t?.focusable&&!n&&(e.focusClassName||v5[e.focusRing]),t?.active&&!n&&e.activeClassName)}function x5({selector:e,stylesCtx:t,options:n,props:r,theme:o}){return Jd({theme:o,classNames:n?.classNames,props:n?.props||r,stylesCtx:t})[e]}function CE({selector:e,stylesCtx:t,theme:n,classNames:r,props:o}){return Jd({theme:n,classNames:r,props:o,stylesCtx:t})[e]}function b5({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function S5({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function w5({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(o=>`${t}-${o}-${n}`)}function j5({themeName:e,theme:t,selector:n,props:r,stylesCtx:o}){return e.map(s=>Jd({theme:t,classNames:t.components[s]?.classNames,props:r,stylesCtx:o})?.[n])}function C5({options:e,classes:t,selector:n,unstyled:r}){return e?.variant&&!r?t[`${n}--${e.variant}`]:void 0}function E5({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:o,classNames:s,classes:c,unstyled:u,className:f,rootSelector:h,props:m,stylesCtx:g,withStaticClasses:y,headless:x,transformedStyles:S}){return Bt(y5({theme:e,options:t,unstyled:u||x}),j5({theme:e,themeName:n,selector:r,props:m,stylesCtx:g}),C5({options:t,classes:c,selector:r,unstyled:u}),CE({selector:r,stylesCtx:g,theme:e,classNames:s,props:m}),CE({selector:r,stylesCtx:g,theme:e,classNames:S,props:m}),x5({selector:r,stylesCtx:g,options:t,props:m,theme:e}),b5({rootSelector:h,selector:r,className:f}),S5({selector:r,classes:c,unstyled:u||x}),y&&!x&&w5({themeName:n,classNamesPrefix:o,selector:r,withStaticClass:t?.withStaticClass}),t?.className)}function T5({theme:e,themeName:t,props:n,stylesCtx:r,selector:o}){return t.map(s=>Ad({theme:e,styles:e.components[s]?.styles,props:n,stylesCtx:r})[o]).reduce((s,c)=>({...s,...c}),{})}function kx({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...kx({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function R5(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...Es(n[r])}}),t),{})}function _5({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:o,selector:s,themeName:c,headless:u}){return R5([u?{}: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:u,style:f,vars:h,varsResolver:m,headless:g,withStylesTransform:y}){return{...!y&&T5({theme:e,themeName:t,props:o,stylesCtx:s,selector:n}),...!y&&Ad({theme:e,styles:u,props:o,stylesCtx:s})[n],...!y&&Ad({theme:e,styles:r?.styles,props:r?.props||o,stylesCtx:s})[n],..._5({theme:e,props:o,stylesCtx:s,vars:h,varsResolver:m,selector:n,themeName:t,headless:g}),...c===n?kx({style:f,theme:e}):null,...kx({style:r?.style,theme:e})}}function A5({props:e,stylesCtx:t,themeName:n}){const r=_n(),o=XM()?.();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 $e({name:e,classes:t,props:n,stylesCtx:r,className:o,style:s,rootSelector:c="root",unstyled:u,classNames:f,styles:h,vars:m,varsResolver:g,attributes:y}){const x=_n(),S=WM(),j=QM(),C=YM(),T=(Array.isArray(e)?e:[e]).filter(_=>_),{withStylesTransform:R,getTransformedStyles:E}=A5({props:n,stylesCtx:r,themeName:T});return(_,k)=>({className:E5({theme:x,options:k,themeName:T,selector:_,classNamesPrefix:S,classNames:f,classes:t,unstyled:u,className:o,rootSelector:c,props:n,stylesCtx:r,withStaticClasses:j,headless:C,transformedStyles:E([k?.styles,h])}),style:D5({theme:x,themeName:T,selector:_,options:k,props:n,stylesCtx:r,rootSelector:c,styles:h,style:s,vars:m,varsResolver:g,headless:C,withStylesTransform:R}),...y?.[_]})}function Ml(e,t){return typeof e=="boolean"?e:t.autoContrast}function EE(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 k5({keepTransitions:e}={}){const t=v.useRef(Ap),n=v.useRef(-1),r=v.useContext(Db),o=cm(),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?()=>{}:EE(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},u=()=>{r.clearColorScheme(),t.current=e?()=>{}:EE(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},f=yM("light",{getInitialValueInEffect:!1}),h=r.colorScheme==="auto"?f:r.colorScheme,m=v.useCallback(()=>c(h==="light"?"dark":"light"),[c,h]);return v.useEffect(()=>()=>{t.current?.(),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:c,clearColorScheme:u,toggleColorScheme:m}}function oe(e,t,n){const r=_n(),o=r.components[e]?.defaultProps,s=typeof o=="function"?o(r):o;return{...t,...s,...Es(n)}}function zy(e){return un(e).reduce((t,n)=>e[n]!==void 0?`${t}${oM(n)}:${e[n]};`:t,"").trim()}function P5({selector:e,styles:t,media:n,container:r}){const o=t?zy(t):"",s=Array.isArray(n)?n.map(u=>`@media${u.query}{${e}{${zy(u.styles)}}}`):[],c=Array.isArray(r)?r.map(u=>`@container ${u.query}{${e}{${zy(u.styles)}}}`):[];return`${o?`${e}{${o}}`:""}${s.join("")}${c.join("")}`.trim()}function Ll(e){const t=cm();return a.jsx("style",{"data-mantine-styles":"inline",nonce:t?.(),dangerouslySetInnerHTML:{__html:P5(e)}})}function _a(e){const{m:t,mx:n,my:r,mt:o,mb:s,ml:c,mr:u,me:f,ms:h,p:m,px:g,py:y,pt:x,pb:S,pl:j,pr:C,pe:T,ps:R,bd:E,bdrs:_,bg:k,c:I,opacity:D,ff:P,fz:$,fw:B,lts:W,ta:Y,lh:Z,fs:U,tt:G,td:M,w:L,miw:z,maw:V,h:K,mih:O,mah:F,bgsz:se,bgp:de,bgr:ye,bga:je,pos:Ee,top:Ke,left:De,bottom:dt,right:Ct,inset:rt,display:nt,flex:mt,hiddenFrom:Tt,visibleFrom:wt,lightHidden:Te,darkHidden:Pe,sx:Ne,...Ie}=e;return{styleProps:Es({m:t,mx:n,my:r,mt:o,mb:s,ml:c,mr:u,me:f,ms:h,p:m,px:g,py:y,pt:x,pb:S,pl:j,pr:C,pe:T,ps:R,bd:E,bg:k,c:I,opacity:D,ff:P,fz:$,fw:B,lts:W,ta:Y,lh:Z,fs:U,tt:G,td:M,w:L,miw:z,maw:V,h:K,mih:O,mah:F,bgsz:se,bgp:de,bgr:ye,bga:je,pos:Ee,top:Ke,left:De,bottom:dt,right:Ct,inset:rt,display:nt,flex:mt,bdrs:_,hiddenFrom:Tt,visibleFrom:wt,lightHidden:Te,darkHidden:Pe,sx:Ne}),rest:Ie}}const N5={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 Nb(e,t){const n=Xr({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 O5(e,t){const n=Xr({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:Nb(e,t)}function M5(e,t){if(typeof e=="number")return ce(e);if(typeof e=="string"){const[n,r,...o]=e.split(" ").filter(c=>c.trim()!=="");let s=`${ce(n)}`;return r&&(s+=` ${r}`),o.length>0&&(s+=` ${Nb(o.join(" "),t)}`),s.trim()}return e}const TE={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 L5(e){return typeof e=="string"&&e in TE?TE[e]:e}const I5=["h1","h2","h3","h4","h5","h6"];function z5(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&I5.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?ce(e):e}function $5(e){return e}const U5=["h1","h2","h3","h4","h5","h6"];function B5(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&U5.includes(e)?`var(--mantine-${e}-line-height)`:e}function V5(e,t){return typeof e=="string"&&e in t.radius?`var(--mantine-radius-${e})`:typeof e=="number"||typeof e=="string"?ce(e):e}function F5(e){return typeof e=="number"?ce(e):e}function H5(e,t){if(typeof e=="number")return ce(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return ce(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const $y={color:Nb,textColor:O5,fontSize:z5,spacing:H5,radius:V5,identity:$5,size:F5,lineHeight:B5,fontFamily:L5,border:M5};function RE(e){return e.replace("(min-width: ","").replace("em)","")}function q5({media:e,...t}){const r=Object.keys(e).sort((o,s)=>Number(RE(o))-Number(RE(s))).map(o=>({query:o,styles:e[o]}));return{...t,media:r}}function G5(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function W5(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function Q5(e){return typeof e=="object"&&e!==null?un(e).filter(t=>t!=="base"):[]}function Y5(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function f_({styleProps:e,data:t,theme:n}){return q5(un(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],u=W5(e[o]);if(!G5(e[o]))return c.forEach(h=>{r.inlineStyles[h]=$y[s.type](u,n)}),r;r.hasResponsiveStyles=!0;const f=Q5(e[o]);return c.forEach(h=>{u!=null&&(r.styles[h]=$y[s.type](u,n)),f.forEach(m=>{const g=`(min-width: ${n.breakpoints[m]})`;r.media[g]={...r.media[g],[h]:$y[s.type](Y5(e[o],m),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function Zd(){return`__m__-${v.useId().replace(/[:«»]/g,"")}`}function h_(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...h_(r,t)}),{}):typeof e=="function"?e(t):e??{}}function p_(e){return e.startsWith("data-")?e:`data-${e}`}function K5(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[p_(n)]=e[n]),t},{})}function m_(e){return e?typeof e=="string"?{[p_(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...m_(n)}),{}):K5(e):null}function Px(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Px(r,t)}),{}):typeof e=="function"?e(t):e??{}}function X5({theme:e,style:t,vars:n,styleProps:r}){const o=Px(t,e),s=Px(n,e);return{...o,...s,...r}}const g_=v.forwardRef(({component:e,style:t,__vars:n,className:r,variant:o,mod:s,size:c,hiddenFrom:u,visibleFrom:f,lightHidden:h,darkHidden:m,renderRoot:g,__size:y,...x},S)=>{const j=_n(),C=e||"div",{styleProps:T,rest:R}=_a(x),_=KM()?.()?.(T.sx),k=Zd(),I=f_({styleProps:T,theme:j,data:N5}),D={ref:S,style:X5({theme:j,style:t,vars:n,styleProps:I.inlineStyles}),className:Bt(r,_,{[k]:I.hasResponsiveStyles,"mantine-light-hidden":h,"mantine-dark-hidden":m,[`mantine-hidden-from-${u}`]:u,[`mantine-visible-from-${f}`]:f}),"data-variant":o,"data-size":K2(c)?void 0:c||void 0,size:y,...m_(s),...R};return a.jsxs(a.Fragment,{children:[I.hasResponsiveStyles&&a.jsx(Ll,{selector:`.${k}`,styles:I.styles,media:I.media}),typeof g=="function"?g(D):a.jsx(C,{...D})]})});g_.displayName="@mantine/core/Box";const le=g_;function v_(e){return e}function J5(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=v_,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 ar(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=v_,t}const Z5=v.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function Ts(){return v.useContext(Z5)}var Uy={exports:{}},wr={};var _E;function e9(){if(_E)return wr;_E=1;var e=wb();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function s(f,h,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:f,containerInfo:h,implementation:m}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return wr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,wr.createPortal=function(f,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return s(f,h,null,m)},wr.flushSync=function(f){var h=c.T,m=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=h,r.p=m,r.d.f()}},wr.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},wr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},wr.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var m=h.as,g=u(m,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,x=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:x}):m==="script"&&r.d.X(f,{crossOrigin:g,integrity:y,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},wr.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=u(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},wr.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,g=u(m,h.crossOrigin);r.d.L(f,m,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},wr.preloadModule=function(f,h){if(typeof f=="string")if(h){var m=u(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},wr.requestFormReset=function(f){r.d.r(f)},wr.unstable_batchedUpdates=function(f,h){return f(h)},wr.useFormState=function(f,h,m){return c.H.useFormState(f,h,m)},wr.useFormStatus=function(){return c.H.useHostTransitionStatus()},wr.version="19.2.3",wr}var DE;function y_(){if(DE)return Uy.exports;DE=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(),Uy.exports=e9(),Uy.exports}var Ob=y_();const xd=om(Ob);function dm(){return typeof window<"u"}function au(e){return x_(e)?(e.nodeName||"").toLowerCase():"#document"}function Kr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qo(e){var t;return(t=(x_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function x_(e){return dm()?e instanceof Node||e instanceof Kr(e).Node:!1}function Cn(e){return dm()?e instanceof Element||e instanceof Kr(e).Element:!1}function fi(e){return dm()?e instanceof HTMLElement||e instanceof Kr(e).HTMLElement:!1}function Nx(e){return!dm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Kr(e).ShadowRoot}const t9=new Set(["inline","contents"]);function ef(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Mi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!t9.has(o)}const n9=new Set(["table","td","th"]);function r9(e){return n9.has(au(e))}const i9=[":popover-open",":modal"];function fm(e){return i9.some(t=>{try{return e.matches(t)}catch{return!1}})}const o9=["transform","translate","scale","rotate","perspective"],a9=["transform","translate","scale","rotate","perspective","filter"],s9=["paint","layout","strict","content"];function Mb(e){const t=hm(),n=Cn(e)?Mi(e):e;return o9.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)||a9.some(r=>(n.willChange||"").includes(r))||s9.some(r=>(n.contain||"").includes(r))}function l9(e){let t=Sa(e);for(;fi(t)&&!xa(t);){if(Mb(t))return t;if(fm(t))return null;t=Sa(t)}return null}function hm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const c9=new Set(["html","body","#document"]);function xa(e){return c9.has(au(e))}function Mi(e){return Kr(e).getComputedStyle(e)}function pm(e){return Cn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Sa(e){if(au(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Nx(e)&&e.host||qo(e);return Nx(t)?t.host:t}function b_(e){const t=Sa(e);return xa(t)?e.ownerDocument?e.ownerDocument.body:e.body:fi(t)&&ef(t)?t:b_(t)}function ba(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=b_(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),c=Kr(o);if(s){const u=Ox(c);return t.concat(c,c.visualViewport||[],ef(o)?o:[],u&&n?ba(u):[])}return t.concat(o,ba(o,[],n))}function Ox(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const u9=["top","right","bottom","left"],ao=Math.min,Tr=Math.max,Pp=Math.round,tp=Math.floor,ko=e=>({x:e,y:e}),d9={left:"right",right:"left",bottom:"top",top:"bottom"},f9={start:"end",end:"start"};function Mx(e,t,n){return Tr(e,ao(t,n))}function zo(e,t){return typeof e=="function"?e(t):e}function so(e){return e.split("-")[0]}function su(e){return e.split("-")[1]}function Lb(e){return e==="x"?"y":"x"}function Ib(e){return e==="y"?"height":"width"}const h9=new Set(["top","bottom"]);function ro(e){return h9.has(so(e))?"y":"x"}function zb(e){return Lb(ro(e))}function p9(e,t,n){n===void 0&&(n=!1);const r=su(e),o=zb(e),s=Ib(o);let c=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=Np(c)),[c,Np(c)]}function m9(e){const t=Np(e);return[Lx(e),t,Lx(t)]}function Lx(e){return e.replace(/start|end/g,t=>f9[t])}const AE=["left","right"],kE=["right","left"],g9=["top","bottom"],v9=["bottom","top"];function y9(e,t,n){switch(e){case"top":case"bottom":return n?t?kE:AE:t?AE:kE;case"left":case"right":return t?g9:v9;default:return[]}}function x9(e,t,n,r){const o=su(e);let s=y9(so(e),n==="start",r);return o&&(s=s.map(c=>c+"-"+o),t&&(s=s.concat(s.map(Lx)))),s}function Np(e){return e.replace(/left|right|bottom|top/g,t=>d9[t])}function b9(e){return{top:0,right:0,bottom:0,left:0,...e}}function $b(e){return typeof e!="number"?b9(e):{top:e,right:e,bottom:e,left:e}}function Wc(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 S9(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function w9(){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 j9(){return/apple/i.test(navigator.vendor)}function C9(){return S9().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function E9(){return w9().includes("jsdom/")}const PE="data-floating-ui-focusable",T9="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function NE(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 Pd(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Nx(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Lc(e){return"composedPath"in e?e.composedPath()[0]:e.target}function By(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 R9(e){return e.matches("html,body")}function cl(e){return e?.ownerDocument||document}function _9(e){return fi(e)&&e.matches(T9)}function D9(e){if(!e||E9())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function A9(e){return e?e.hasAttribute(PE)?e:e.querySelector("["+PE+"]")||e:null}function yp(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,...yp(e,o.id,n)])}function k9(e){return"nativeEvent"in e}function Ix(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}var P9=typeof document<"u",N9=function(){},Po=P9?v.useLayoutEffect:N9;const O9={...jb};function np(e){const t=v.useRef(e);return Po(()=>{t.current=e}),t}const M9=O9.useInsertionEffect,L9=M9||(e=>e());function _o(e){const t=v.useRef(()=>{});return L9(()=>{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 OE(e,t,n){let{reference:r,floating:o}=e;const s=ro(t),c=zb(t),u=Ib(c),f=so(t),h=s==="y",m=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,y=r[u]/2-o[u]/2;let x;switch(f){case"top":x={x:m,y:r.y-o.height};break;case"bottom":x={x:m,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:g};break;case"left":x={x:r.x-o.width,y:g};break;default:x={x:r.x,y:r.y}}switch(su(t)){case"start":x[c]-=y*(n&&h?-1:1);break;case"end":x[c]+=y*(n&&h?-1:1);break}return x}const I9=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:c}=n,u=s.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let h=await c.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:g}=OE(h,r,f),y=r,x={},S=0;for(let j=0;j<u.length;j++){const{name:C,fn:T}=u[j],{x:R,y:E,data:_,reset:k}=await T({x:m,y:g,initialPlacement:r,placement:y,strategy:o,middlewareData:x,rects:h,platform:c,elements:{reference:e,floating:t}});m=R??m,g=E??g,x={...x,[C]:{...x[C],..._}},k&&S<=50&&(S++,typeof k=="object"&&(k.placement&&(y=k.placement),k.rects&&(h=k.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:o}):k.rects),{x:m,y:g}=OE(h,y,f)),j=-1)}return{x:m,y:g,placement:y,strategy:o,middlewareData:x}};async function Nd(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:c,elements:u,strategy:f}=e,{boundary:h="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:y=!1,padding:x=0}=zo(t,e),S=$b(x),C=u[y?g==="floating"?"reference":"floating":g],T=Wc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(C)))==null||n?C:C.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(u.floating)),boundary:h,rootBoundary:m,strategy:f})),R=g==="floating"?{x:r,y:o,width:c.floating.width,height:c.floating.height}:c.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u.floating)),_=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},k=Wc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:R,offsetParent:E,strategy:f}):R);return{top:(T.top-k.top+S.top)/_.y,bottom:(k.bottom-T.bottom+S.bottom)/_.y,left:(T.left-k.left+S.left)/_.x,right:(k.right-T.right+S.right)/_.x}}const z9=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:c,elements:u,middlewareData:f}=t,{element:h,padding:m=0}=zo(e,t)||{};if(h==null)return{};const g=$b(m),y={x:n,y:r},x=zb(o),S=Ib(x),j=await c.getDimensions(h),C=x==="y",T=C?"top":"left",R=C?"bottom":"right",E=C?"clientHeight":"clientWidth",_=s.reference[S]+s.reference[x]-y[x]-s.floating[S],k=y[x]-s.reference[x],I=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h));let D=I?I[E]:0;(!D||!await(c.isElement==null?void 0:c.isElement(I)))&&(D=u.floating[E]||s.floating[S]);const P=_/2-k/2,$=D/2-j[S]/2-1,B=ao(g[T],$),W=ao(g[R],$),Y=B,Z=D-j[S]-W,U=D/2-j[S]/2+P,G=Mx(Y,U,Z),M=!f.arrow&&su(o)!=null&&U!==G&&s.reference[S]/2-(U<Y?B:W)-j[S]/2<0,L=M?U<Y?U-Y:U-Z:0;return{[x]:y[x]+L,data:{[x]:G,centerOffset:U-G-L,...M&&{alignmentOffset:L}},reset:M}}}),$9=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:u,platform:f,elements:h}=t,{mainAxis:m=!0,crossAxis:g=!0,fallbackPlacements:y,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:j=!0,...C}=zo(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const T=so(o),R=ro(u),E=so(u)===u,_=await(f.isRTL==null?void 0:f.isRTL(h.floating)),k=y||(E||!j?[Np(u)]:m9(u)),I=S!=="none";!y&&I&&k.push(...x9(u,j,S,_));const D=[u,...k],P=await Nd(t,C),$=[];let B=((r=s.flip)==null?void 0:r.overflows)||[];if(m&&$.push(P[T]),g){const U=p9(o,c,_);$.push(P[U[0]],P[U[1]])}if(B=[...B,{placement:o,overflows:$}],!$.every(U=>U<=0)){var W,Y;const U=(((W=s.flip)==null?void 0:W.index)||0)+1,G=D[U];if(G&&(!(g==="alignment"?R!==ro(G):!1)||B.every(z=>ro(z.placement)===R?z.overflows[0]>0:!0)))return{data:{index:U,overflows:B},reset:{placement:G}};let M=(Y=B.filter(L=>L.overflows[0]<=0).sort((L,z)=>L.overflows[1]-z.overflows[1])[0])==null?void 0:Y.placement;if(!M)switch(x){case"bestFit":{var Z;const L=(Z=B.filter(z=>{if(I){const V=ro(z.placement);return V===R||V==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(V=>V>0).reduce((V,K)=>V+K,0)]).sort((z,V)=>z[1]-V[1])[0])==null?void 0:Z[0];L&&(M=L);break}case"initialPlacement":M=u;break}if(o!==M)return{reset:{placement:M}}}return{}}}};function ME(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function LE(e){return u9.some(t=>e[t]>=0)}const U9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=zo(e,t);switch(r){case"referenceHidden":{const s=await Nd(t,{...o,elementContext:"reference"}),c=ME(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:LE(c)}}}case"escaped":{const s=await Nd(t,{...o,altBoundary:!0}),c=ME(s,n.floating);return{data:{escapedOffsets:c,escaped:LE(c)}}}default:return{}}}}};function S_(e){const t=ao(...e.map(s=>s.left)),n=ao(...e.map(s=>s.top)),r=Tr(...e.map(s=>s.right)),o=Tr(...e.map(s=>s.bottom));return{x:t,y:n,width:r-t,height:o-n}}function B9(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=>Wc(S_(o)))}const V9=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:u=2,x:f,y:h}=zo(e,t),m=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),g=B9(m),y=Wc(S_(m)),x=$b(u);function S(){if(g.length===2&&g[0].left>g[1].right&&f!=null&&h!=null)return g.find(C=>f>C.left-x.left&&f<C.right+x.right&&h>C.top-x.top&&h<C.bottom+x.bottom)||y;if(g.length>=2){if(ro(n)==="y"){const B=g[0],W=g[g.length-1],Y=so(n)==="top",Z=B.top,U=W.bottom,G=Y?B.left:W.left,M=Y?B.right:W.right,L=M-G,z=U-Z;return{top:Z,bottom:U,left:G,right:M,width:L,height:z,x:G,y:Z}}const C=so(n)==="left",T=Tr(...g.map(B=>B.right)),R=ao(...g.map(B=>B.left)),E=g.filter(B=>C?B.left===R:B.right===T),_=E[0].top,k=E[E.length-1].bottom,I=R,D=T,P=D-I,$=k-_;return{top:_,bottom:k,left:I,right:D,width:P,height:$,x:I,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}}:{}}}},w_=new Set(["left","top"]);async function F9(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),c=so(n),u=su(n),f=ro(n)==="y",h=w_.has(c)?-1:1,m=s&&f?-1:1,g=zo(t,e);let{mainAxis:y,crossAxis:x,alignmentAxis:S}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof S=="number"&&(x=u==="end"?S*-1:S),f?{x:x*m,y:y*h}:{x:y*h,y:x*m}}const H9=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:u}=t,f=await F9(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:o+f.x,y:s+f.y,data:{...f,placement:c}}}}},q9=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:u={fn:C=>{let{x:T,y:R}=C;return{x:T,y:R}}},...f}=zo(e,t),h={x:n,y:r},m=await Nd(t,f),g=ro(so(o)),y=Lb(g);let x=h[y],S=h[g];if(s){const C=y==="y"?"top":"left",T=y==="y"?"bottom":"right",R=x+m[C],E=x-m[T];x=Mx(R,x,E)}if(c){const C=g==="y"?"top":"left",T=g==="y"?"bottom":"right",R=S+m[C],E=S-m[T];S=Mx(R,S,E)}const j=u.fn({...t,[y]:x,[g]:S});return{...j,data:{x:j.x-n,y:j.y-r,enabled:{[y]:s,[g]:c}}}}}},G9=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:c}=t,{offset:u=0,mainAxis:f=!0,crossAxis:h=!0}=zo(e,t),m={x:n,y:r},g=ro(o),y=Lb(g);let x=m[y],S=m[g];const j=zo(u,t),C=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(f){const E=y==="y"?"height":"width",_=s.reference[y]-s.floating[E]+C.mainAxis,k=s.reference[y]+s.reference[E]-C.mainAxis;x<_?x=_:x>k&&(x=k)}if(h){var T,R;const E=y==="y"?"width":"height",_=w_.has(so(o)),k=s.reference[g]-s.floating[E]+(_&&((T=c.offset)==null?void 0:T[g])||0)+(_?0:C.crossAxis),I=s.reference[g]+s.reference[E]+(_?0:((R=c.offset)==null?void 0:R[g])||0)-(_?C.crossAxis:0);S<k?S=k:S>I&&(S=I)}return{[y]:x,[g]:S}}}},W9=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:u}=t,{apply:f=()=>{},...h}=zo(e,t),m=await Nd(t,h),g=so(o),y=su(o),x=ro(o)==="y",{width:S,height:j}=s.floating;let C,T;g==="top"||g==="bottom"?(C=g,T=y===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(T=g,C=y==="end"?"top":"bottom");const R=j-m.top-m.bottom,E=S-m.left-m.right,_=ao(j-m[C],R),k=ao(S-m[T],E),I=!t.middlewareData.shift;let D=_,P=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(D=R),I&&!y){const B=Tr(m.left,0),W=Tr(m.right,0),Y=Tr(m.top,0),Z=Tr(m.bottom,0);x?P=S-2*(B!==0||W!==0?B+W:Tr(m.left,m.right)):D=j-2*(Y!==0||Z!==0?Y+Z:Tr(m.top,m.bottom))}await f({...t,availableWidth:P,availableHeight:D});const $=await c.getDimensions(u.floating);return S!==$.width||j!==$.height?{reset:{rects:!0}}:{}}}};function j_(e){const t=Mi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=fi(e),s=o?e.offsetWidth:n,c=o?e.offsetHeight:r,u=Pp(n)!==s||Pp(r)!==c;return u&&(n=s,r=c),{width:n,height:r,$:u}}function Ub(e){return Cn(e)?e:e.contextElement}function Vc(e){const t=Ub(e);if(!fi(t))return ko(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=j_(t);let c=(s?Pp(n.width):n.width)/r,u=(s?Pp(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const Q9=ko(0);function C_(e){const t=Kr(e);return!hm()||!t.visualViewport?Q9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Y9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Kr(e)?!1:t}function bl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Ub(e);let c=ko(1);t&&(r?Cn(r)&&(c=Vc(r)):c=Vc(e));const u=Y9(s,n,r)?C_(s):ko(0);let f=(o.left+u.x)/c.x,h=(o.top+u.y)/c.y,m=o.width/c.x,g=o.height/c.y;if(s){const y=Kr(s),x=r&&Cn(r)?Kr(r):r;let S=y,j=Ox(S);for(;j&&r&&x!==S;){const C=Vc(j),T=j.getBoundingClientRect(),R=Mi(j),E=T.left+(j.clientLeft+parseFloat(R.paddingLeft))*C.x,_=T.top+(j.clientTop+parseFloat(R.paddingTop))*C.y;f*=C.x,h*=C.y,m*=C.x,g*=C.y,f+=E,h+=_,S=Kr(j),j=Ox(S)}}return Wc({width:m,height:g,x:f,y:h})}function mm(e,t){const n=pm(e).scrollLeft;return t?t.left+n:bl(qo(e)).left+n}function E_(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-mm(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function K9(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",c=qo(r),u=t?fm(t.floating):!1;if(r===c||u&&s)return n;let f={scrollLeft:0,scrollTop:0},h=ko(1);const m=ko(0),g=fi(r);if((g||!g&&!s)&&((au(r)!=="body"||ef(c))&&(f=pm(r)),fi(r))){const x=bl(r);h=Vc(r),m.x=x.x+r.clientLeft,m.y=x.y+r.clientTop}const y=c&&!g&&!s?E_(c,f):ko(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+m.x+y.x,y:n.y*h.y-f.scrollTop*h.y+m.y+y.y}}function X9(e){return Array.from(e.getClientRects())}function J9(e){const t=qo(e),n=pm(e),r=e.ownerDocument.body,o=Tr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Tr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+mm(e);const u=-n.scrollTop;return Mi(r).direction==="rtl"&&(c+=Tr(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:c,y:u}}const IE=25;function Z9(e,t){const n=Kr(e),r=qo(e),o=n.visualViewport;let s=r.clientWidth,c=r.clientHeight,u=0,f=0;if(o){s=o.width,c=o.height;const m=hm();(!m||m&&t==="fixed")&&(u=o.offsetLeft,f=o.offsetTop)}const h=mm(r);if(h<=0){const m=r.ownerDocument,g=m.body,y=getComputedStyle(g),x=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,S=Math.abs(r.clientWidth-g.clientWidth-x);S<=IE&&(s-=S)}else h<=IE&&(s+=h);return{width:s,height:c,x:u,y:f}}const eL=new Set(["absolute","fixed"]);function tL(e,t){const n=bl(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=fi(e)?Vc(e):ko(1),c=e.clientWidth*s.x,u=e.clientHeight*s.y,f=o*s.x,h=r*s.y;return{width:c,height:u,x:f,y:h}}function zE(e,t,n){let r;if(t==="viewport")r=Z9(e,n);else if(t==="document")r=J9(qo(e));else if(Cn(t))r=tL(t,n);else{const o=C_(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Wc(r)}function T_(e,t){const n=Sa(e);return n===t||!Cn(n)||xa(n)?!1:Mi(n).position==="fixed"||T_(n,t)}function nL(e,t){const n=t.get(e);if(n)return n;let r=ba(e,[],!1).filter(u=>Cn(u)&&au(u)!=="body"),o=null;const s=Mi(e).position==="fixed";let c=s?Sa(e):e;for(;Cn(c)&&!xa(c);){const u=Mi(c),f=Mb(c);!f&&u.position==="fixed"&&(o=null),(s?!f&&!o:!f&&u.position==="static"&&!!o&&eL.has(o.position)||ef(c)&&!f&&T_(e,c))?r=r.filter(m=>m!==c):o=u,c=Sa(c)}return t.set(e,r),r}function rL(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const c=[...n==="clippingAncestors"?fm(t)?[]:nL(t,this._c):[].concat(n),r],u=c[0],f=c.reduce((h,m)=>{const g=zE(t,m,o);return h.top=Tr(g.top,h.top),h.right=ao(g.right,h.right),h.bottom=ao(g.bottom,h.bottom),h.left=Tr(g.left,h.left),h},zE(t,u,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function iL(e){const{width:t,height:n}=j_(e);return{width:t,height:n}}function oL(e,t,n){const r=fi(t),o=qo(t),s=n==="fixed",c=bl(e,!0,s,t);let u={scrollLeft:0,scrollTop:0};const f=ko(0);function h(){f.x=mm(o)}if(r||!r&&!s)if((au(t)!=="body"||ef(o))&&(u=pm(t)),r){const x=bl(t,!0,s,t);f.x=x.x+t.clientLeft,f.y=x.y+t.clientTop}else o&&h();s&&!r&&o&&h();const m=o&&!r&&!s?E_(o,u):ko(0),g=c.left+u.scrollLeft-f.x-m.x,y=c.top+u.scrollTop-f.y-m.y;return{x:g,y,width:c.width,height:c.height}}function Vy(e){return Mi(e).position==="static"}function $E(e,t){if(!fi(e)||Mi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return qo(e)===n&&(n=n.ownerDocument.body),n}function R_(e,t){const n=Kr(e);if(fm(e))return n;if(!fi(e)){let o=Sa(e);for(;o&&!xa(o);){if(Cn(o)&&!Vy(o))return o;o=Sa(o)}return n}let r=$E(e,t);for(;r&&r9(r)&&Vy(r);)r=$E(r,t);return r&&xa(r)&&Vy(r)&&!Mb(r)?n:r||l9(e)||n}const aL=async function(e){const t=this.getOffsetParent||R_,n=this.getDimensions,r=await n(e.floating);return{reference:oL(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sL(e){return Mi(e).direction==="rtl"}const lL={convertOffsetParentRelativeRectToViewportRelativeRect:K9,getDocumentElement:qo,getClippingRect:rL,getOffsetParent:R_,getElementRects:aL,getClientRects:X9,getDimensions:iL,getScale:Vc,isElement:Cn,isRTL:sL};function __(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cL(e,t){let n=null,r;const o=qo(e);function s(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function c(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),s();const h=e.getBoundingClientRect(),{left:m,top:g,width:y,height:x}=h;if(u||t(),!y||!x)return;const S=tp(g),j=tp(o.clientWidth-(m+y)),C=tp(o.clientHeight-(g+x)),T=tp(m),E={rootMargin:-S+"px "+-j+"px "+-C+"px "+-T+"px",threshold:Tr(0,ao(1,f))||1};let _=!0;function k(I){const D=I[0].intersectionRatio;if(D!==f){if(!_)return c();D?c(!1,D):r=setTimeout(()=>{c(!1,1e-7)},1e3)}D===1&&!__(h,e.getBoundingClientRect())&&c(),_=!1}try{n=new IntersectionObserver(k,{...E,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,E)}n.observe(e)}return c(!0),s}function zx(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,h=Ub(e),m=o||s?[...h?ba(h):[],...ba(t)]:[];m.forEach(T=>{o&&T.addEventListener("scroll",n,{passive:!0}),s&&T.addEventListener("resize",n)});const g=h&&u?cL(h,n):null;let y=-1,x=null;c&&(x=new ResizeObserver(T=>{let[R]=T;R&&R.target===h&&x&&(x.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var E;(E=x)==null||E.observe(t)})),n()}),h&&!f&&x.observe(h),x.observe(t));let S,j=f?bl(e):null;f&&C();function C(){const T=bl(e);j&&!__(j,T)&&n(),j=T,S=requestAnimationFrame(C)}return n(),()=>{var T;m.forEach(R=>{o&&R.removeEventListener("scroll",n),s&&R.removeEventListener("resize",n)}),g?.(),(T=x)==null||T.disconnect(),x=null,f&&cancelAnimationFrame(S)}}const uL=H9,dL=q9,fL=$9,hL=W9,pL=U9,UE=z9,mL=V9,gL=G9,vL=(e,t,n)=>{const r=new Map,o={platform:lL,...n},s={...o.platform,_c:r};return I9(e,t,{...o,platform:s})};var yL=typeof document<"u",xL=function(){},xp=yL?v.useLayoutEffect:xL;function Op(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(!Op(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)&&!Op(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function D_(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function BE(e,t){const n=D_(e);return Math.round(t*n)/n}function Fy(e){const t=v.useRef(e);return xp(()=>{t.current=e}),t}function bL(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:c}={},transform:u=!0,whileElementsMounted:f,open:h}=e,[m,g]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,x]=v.useState(r);Op(y,r)||x(r);const[S,j]=v.useState(null),[C,T]=v.useState(null),R=v.useCallback(z=>{z!==I.current&&(I.current=z,j(z))},[]),E=v.useCallback(z=>{z!==D.current&&(D.current=z,T(z))},[]),_=s||S,k=c||C,I=v.useRef(null),D=v.useRef(null),P=v.useRef(m),$=f!=null,B=Fy(f),W=Fy(o),Y=Fy(h),Z=v.useCallback(()=>{if(!I.current||!D.current)return;const z={placement:t,strategy:n,middleware:y};W.current&&(z.platform=W.current),vL(I.current,D.current,z).then(V=>{const K={...V,isPositioned:Y.current!==!1};U.current&&!Op(P.current,K)&&(P.current=K,Ob.flushSync(()=>{g(K)}))})},[y,t,n,W,Y]);xp(()=>{h===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,g(z=>({...z,isPositioned:!1})))},[h]);const U=v.useRef(!1);xp(()=>(U.current=!0,()=>{U.current=!1}),[]),xp(()=>{if(_&&(I.current=_),k&&(D.current=k),_&&k){if(B.current)return B.current(_,k,Z);Z()}},[_,k,Z,B,$]);const G=v.useMemo(()=>({reference:I,floating:D,setReference:R,setFloating:E}),[R,E]),M=v.useMemo(()=>({reference:_,floating:k}),[_,k]),L=v.useMemo(()=>{const z={position:n,left:0,top:0};if(!M.floating)return z;const V=BE(M.floating,m.x),K=BE(M.floating,m.y);return u?{...z,transform:"translate("+V+"px, "+K+"px)",...D_(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:K}},[n,u,M.floating,m.x,m.y]);return v.useMemo(()=>({...m,update:Z,refs:G,elements:M,floatingStyles:L}),[m,Z,G,M,L])}const SL=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?UE({element:r.current,padding:o}).fn(n):{}:r?UE({element:r,padding:o}).fn(n):{}}}},A_=(e,t)=>({...uL(e),options:[e,t]}),Bb=(e,t)=>({...dL(e),options:[e,t]}),VE=(e,t)=>({...gL(e),options:[e,t]}),Mp=(e,t)=>({...fL(e),options:[e,t]}),wL=(e,t)=>({...hL(e),options:[e,t]}),jL=(e,t)=>({...pL(e),options:[e,t]}),Cd=(e,t)=>({...mL(e),options:[e,t]}),k_=(e,t)=>({...SL(e),options:[e,t]});function P_(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,u=c(r);return typeof u=="function"?u:()=>{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 CL="data-floating-ui-focusable",FE="active",HE="selected",EL={...jb};let qE=!1,TL=0;const GE=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+TL++;function RL(){const[e,t]=v.useState(()=>qE?GE():void 0);return Po(()=>{e==null&&t(GE())},[]),v.useEffect(()=>{qE=!0},[]),e}const _L=EL.useId,N_=_L||RL;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 AL=v.createContext(null),kL=v.createContext(null),Vb=()=>{var e;return((e=v.useContext(AL))==null?void 0:e.id)||null},Fb=()=>v.useContext(kL);function Hb(e){return"data-floating-ui-"+e}function Ai(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const WE=Hb("safe-polygon");function bp(e,t,n){if(n&&!Ix(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 Hy(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:u=!0,delay:f=0,handleClose:h=null,mouseOnly:m=!1,restMs:g=0,move:y=!0}=t,x=Fb(),S=Vb(),j=np(h),C=np(f),T=np(n),R=np(g),E=v.useRef(),_=v.useRef(-1),k=v.useRef(),I=v.useRef(-1),D=v.useRef(!0),P=v.useRef(!1),$=v.useRef(()=>{}),B=v.useRef(!1),W=_o(()=>{var L;const z=(L=o.current.openEvent)==null?void 0:L.type;return z?.includes("mouse")&&z!=="mousedown"});v.useEffect(()=>{if(!u)return;function L(z){let{open:V}=z;V||(Ai(_),Ai(I),D.current=!0,B.current=!1)}return s.on("openchange",L),()=>{s.off("openchange",L)}},[u,s]),v.useEffect(()=>{if(!u||!j.current||!n)return;function L(V){W()&&r(!1,V,"hover")}const z=cl(c.floating).documentElement;return z.addEventListener("mouseleave",L),()=>{z.removeEventListener("mouseleave",L)}},[c.floating,n,r,u,j,W]);const Y=v.useCallback(function(L,z,V){z===void 0&&(z=!0),V===void 0&&(V="hover");const K=bp(C.current,"close",E.current);K&&!k.current?(Ai(_),_.current=window.setTimeout(()=>r(!1,L,V),K)):z&&(Ai(_),r(!1,L,V))},[C,r]),Z=_o(()=>{$.current(),k.current=void 0}),U=_o(()=>{if(P.current){const L=cl(c.floating).body;L.style.pointerEvents="",L.removeAttribute(WE),P.current=!1}}),G=_o(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);v.useEffect(()=>{if(!u)return;function L(F){if(Ai(_),D.current=!1,m&&!Ix(E.current)||Hy(R.current)>0&&!bp(C.current,"open"))return;const se=bp(C.current,"open",E.current);se?_.current=window.setTimeout(()=>{T.current||r(!0,F,"hover")},se):n||r(!0,F,"hover")}function z(F){if(G()){U();return}$.current();const se=cl(c.floating);if(Ai(I),B.current=!1,j.current&&o.current.floatingContext){n||Ai(_),k.current=j.current({...o.current.floatingContext,tree:x,x:F.clientX,y:F.clientY,onClose(){U(),Z(),G()||Y(F,!0,"safe-polygon")}});const ye=k.current;se.addEventListener("mousemove",ye),$.current=()=>{se.removeEventListener("mousemove",ye)};return}(E.current!=="touch"||!Pd(c.floating,F.relatedTarget))&&Y(F)}function V(F){G()||o.current.floatingContext&&(j.current==null||j.current({...o.current.floatingContext,tree:x,x:F.clientX,y:F.clientY,onClose(){U(),Z(),G()||Y(F)}})(F))}function K(){Ai(_)}function O(F){G()||Y(F,!1)}if(Cn(c.domReference)){const F=c.domReference,se=c.floating;return n&&F.addEventListener("mouseleave",V),y&&F.addEventListener("mousemove",L,{once:!0}),F.addEventListener("mouseenter",L),F.addEventListener("mouseleave",z),se&&(se.addEventListener("mouseleave",V),se.addEventListener("mouseenter",K),se.addEventListener("mouseleave",O)),()=>{n&&F.removeEventListener("mouseleave",V),y&&F.removeEventListener("mousemove",L),F.removeEventListener("mouseenter",L),F.removeEventListener("mouseleave",z),se&&(se.removeEventListener("mouseleave",V),se.removeEventListener("mouseenter",K),se.removeEventListener("mouseleave",O))}}},[c,u,e,m,y,Y,Z,U,r,n,T,x,C,j,o,G,R]),Po(()=>{var L;if(u&&n&&(L=j.current)!=null&&(L=L.__options)!=null&&L.blockPointerEvents&&W()){P.current=!0;const V=c.floating;if(Cn(c.domReference)&&V){var z;const K=cl(c.floating).body;K.setAttribute(WE,"");const O=c.domReference,F=x==null||(z=x.nodesRef.current.find(se=>se.id===S))==null||(z=z.context)==null?void 0:z.elements.floating;return F&&(F.style.pointerEvents=""),K.style.pointerEvents="none",O.style.pointerEvents="auto",V.style.pointerEvents="auto",()=>{K.style.pointerEvents="",O.style.pointerEvents="",V.style.pointerEvents=""}}}},[u,n,S,c,x,j,W]),Po(()=>{n||(E.current=void 0,B.current=!1,Z(),U())},[n,Z,U]),v.useEffect(()=>()=>{Z(),Ai(_),Ai(I),U()},[u,c.domReference,Z,U]);const M=v.useMemo(()=>{function L(z){E.current=z.pointerType}return{onPointerDown:L,onPointerEnter:L,onMouseMove(z){const{nativeEvent:V}=z;function K(){!D.current&&!T.current&&r(!0,V,"hover")}m&&!Ix(E.current)||n||Hy(R.current)===0||B.current&&z.movementX**2+z.movementY**2<2||(Ai(I),E.current==="touch"?K():(B.current=!0,I.current=window.setTimeout(K,Hy(R.current))))}}},[m,r,n,T,R]);return v.useMemo(()=>u?{reference:M}:{},[u,M])}const $x=()=>{},O_=v.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:$x,setState:$x,isInstantPhase:!1}),NL=()=>v.useContext(O_);function OL(e){const{children:t,delay:n,timeoutMs:r=0}=e,[o,s]=v.useReducer((f,h)=>({...f,...h}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=v.useRef(null),u=v.useCallback(f=>{s({currentId:f})},[]);return Po(()=>{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(O_.Provider,{value:v.useMemo(()=>({...o,setState:s,setCurrentId:u}),[o,u]),children:t})}function ML(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:s,enabled:c=!0}=t,u=s??o,f=NL(),{currentId:h,setCurrentId:m,initialDelay:g,setState:y,timeoutMs:x}=f;return Po(()=>{c&&h&&(y({delay:{open:1,close:bp(g,"close")}}),h!==u&&r(!1))},[c,u,r,y,h,g]),Po(()=>{function S(){r(!1),y({delay:g,currentId:null})}if(c&&h&&!n&&h===u){if(x){const j=window.setTimeout(S,x);return()=>{clearTimeout(j)}}S()}},[c,n,y,h,u,r,g,x]),Po(()=>{c&&(m===$x||!n||m(u))},[c,n,m,u]),f}const LL={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},IL={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},QE=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 zL(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:c=!0,escapeKey:u=!0,outsidePress:f=!0,outsidePressEvent:h="pointerdown",referencePress:m=!1,referencePressEvent:g="pointerdown",ancestorScroll:y=!1,bubbles:x,capture:S}=t,j=Fb(),C=_o(typeof f=="function"?f:()=>!1),T=typeof f=="function"?C:f,R=v.useRef(!1),{escapeKey:E,outsidePress:_}=QE(x),{escapeKey:k,outsidePress:I}=QE(S),D=v.useRef(!1),P=_o(U=>{var G;if(!n||!c||!u||U.key!=="Escape"||D.current)return;const M=(G=s.current.floatingContext)==null?void 0:G.nodeId,L=j?yp(j.nodesRef.current,M):[];if(!E&&(U.stopPropagation(),L.length>0)){let z=!0;if(L.forEach(V=>{var K;if((K=V.context)!=null&&K.open&&!V.context.dataRef.current.__escapeKeyBubbles){z=!1;return}}),!z)return}r(!1,k9(U)?U.nativeEvent:U,"escape-key")}),$=_o(U=>{var G;const M=()=>{var L;P(U),(L=Lc(U))==null||L.removeEventListener("keydown",M)};(G=Lc(U))==null||G.addEventListener("keydown",M)}),B=_o(U=>{var G;const M=s.current.insideReactTree;s.current.insideReactTree=!1;const L=R.current;if(R.current=!1,h==="click"&&L||M||typeof T=="function"&&!T(U))return;const z=Lc(U),V="["+Hb("inert")+"]",K=cl(o.floating).querySelectorAll(V);let O=Cn(z)?z:null;for(;O&&!xa(O);){const ye=Sa(O);if(xa(ye)||!Cn(ye))break;O=ye}if(K.length&&Cn(z)&&!R9(z)&&!Pd(z,o.floating)&&Array.from(K).every(ye=>!Pd(O,ye)))return;if(fi(z)&&Z){const ye=xa(z),je=Mi(z),Ee=/auto|scroll/,Ke=ye||Ee.test(je.overflowX),De=ye||Ee.test(je.overflowY),dt=Ke&&z.clientWidth>0&&z.scrollWidth>z.clientWidth,Ct=De&&z.clientHeight>0&&z.scrollHeight>z.clientHeight,rt=je.direction==="rtl",nt=Ct&&(rt?U.offsetX<=z.offsetWidth-z.clientWidth:U.offsetX>z.clientWidth),mt=dt&&U.offsetY>z.clientHeight;if(nt||mt)return}const F=(G=s.current.floatingContext)==null?void 0:G.nodeId,se=j&&yp(j.nodesRef.current,F).some(ye=>{var je;return By(U,(je=ye.context)==null?void 0:je.elements.floating)});if(By(U,o.floating)||By(U,o.domReference)||se)return;const de=j?yp(j.nodesRef.current,F):[];if(de.length>0){let ye=!0;if(de.forEach(je=>{var Ee;if((Ee=je.context)!=null&&Ee.open&&!je.context.dataRef.current.__outsidePressBubbles){ye=!1;return}}),!ye)return}r(!1,U,"outside-press")}),W=_o(U=>{var G;const M=()=>{var L;B(U),(L=Lc(U))==null||L.removeEventListener(h,M)};(G=Lc(U))==null||G.addEventListener(h,M)});v.useEffect(()=>{if(!n||!c)return;s.current.__escapeKeyBubbles=E,s.current.__outsidePressBubbles=_;let U=-1;function G(K){r(!1,K,"ancestor-scroll")}function M(){window.clearTimeout(U),D.current=!0}function L(){U=window.setTimeout(()=>{D.current=!1},hm()?5:0)}const z=cl(o.floating);u&&(z.addEventListener("keydown",k?$:P,k),z.addEventListener("compositionstart",M),z.addEventListener("compositionend",L)),T&&z.addEventListener(h,I?W:B,I);let V=[];return y&&(Cn(o.domReference)&&(V=ba(o.domReference)),Cn(o.floating)&&(V=V.concat(ba(o.floating))),!Cn(o.reference)&&o.reference&&o.reference.contextElement&&(V=V.concat(ba(o.reference.contextElement)))),V=V.filter(K=>{var O;return K!==((O=z.defaultView)==null?void 0:O.visualViewport)}),V.forEach(K=>{K.addEventListener("scroll",G,{passive:!0})}),()=>{u&&(z.removeEventListener("keydown",k?$:P,k),z.removeEventListener("compositionstart",M),z.removeEventListener("compositionend",L)),T&&z.removeEventListener(h,I?W:B,I),V.forEach(K=>{K.removeEventListener("scroll",G)}),window.clearTimeout(U)}},[s,o,u,T,h,n,r,y,c,E,_,P,k,$,B,I,W]),v.useEffect(()=>{s.current.insideReactTree=!1},[s,T,h]);const Y=v.useMemo(()=>({onKeyDown:P,...m&&{[LL[g]]:U=>{r(!1,U.nativeEvent,"reference-press")},...g!=="click"&&{onClick(U){r(!1,U.nativeEvent,"reference-press")}}}}),[P,r,m,g]),Z=v.useMemo(()=>({onKeyDown:P,onMouseDown(){R.current=!0},onMouseUp(){R.current=!0},[IL[h]]:()=>{s.current.insideReactTree=!0}}),[P,h,s]);return v.useMemo(()=>c?{reference:Y,floating:Z}:{},[c,Y,Z])}function $L(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=N_(),s=v.useRef({}),[c]=v.useState(()=>DL()),u=Vb()!=null,[f,h]=v.useState(r.reference),m=_o((x,S,j)=>{s.current.openEvent=x?S:void 0,c.emit("openchange",{open:x,event:S,reason:j,nested:u}),n?.(x,S,j)}),g=v.useMemo(()=>({setPositionReference:h}),[]),y=v.useMemo(()=>({reference:f||r.reference||null,floating:r.floating||null,domReference:r.reference}),[f,r.reference,r.floating]);return v.useMemo(()=>({dataRef:s,open:t,onOpenChange:m,elements:y,events:c,floatingId:o,refs:g}),[t,m,y,c,o,g])}function qb(e){e===void 0&&(e={});const{nodeId:t}=e,n=$L({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,c]=v.useState(null),[u,f]=v.useState(null),m=o?.domReference||s,g=v.useRef(null),y=Fb();Po(()=>{m&&(g.current=m)},[m]);const x=bL({...e,elements:{...o,...u&&{reference:u}}}),S=v.useCallback(E=>{const _=Cn(E)?{getBoundingClientRect:()=>E.getBoundingClientRect(),getClientRects:()=>E.getClientRects(),contextElement:E}:E;f(_),x.refs.setReference(_)},[x.refs]),j=v.useCallback(E=>{(Cn(E)||E===null)&&(g.current=E,c(E)),(Cn(x.refs.reference.current)||x.refs.reference.current===null||E!==null&&!Cn(E))&&x.refs.setReference(E)},[x.refs]),C=v.useMemo(()=>({...x.refs,setReference:j,setPositionReference:S,domReference:g}),[x.refs,j,S]),T=v.useMemo(()=>({...x.elements,domReference:m}),[x.elements,m]),R=v.useMemo(()=>({...x,...r,refs:C,elements:T,nodeId:t}),[x,C,T,t,r]);return Po(()=>{r.dataRef.current.floatingContext=R;const E=y?.nodesRef.current.find(_=>_.id===t);E&&(E.context=R)}),v.useMemo(()=>({...x,context:R,refs:C,elements:T}),[x,C,T,R])}function qy(){return C9()&&j9()}function UL(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:c}=e,{enabled:u=!0,visibleOnly:f=!0}=t,h=v.useRef(!1),m=v.useRef(-1),g=v.useRef(!0);v.useEffect(()=>{if(!u)return;const x=Kr(c.domReference);function S(){!n&&fi(c.domReference)&&c.domReference===NE(cl(c.domReference))&&(h.current=!0)}function j(){g.current=!0}function C(){g.current=!1}return x.addEventListener("blur",S),qy()&&(x.addEventListener("keydown",j,!0),x.addEventListener("pointerdown",C,!0)),()=>{x.removeEventListener("blur",S),qy()&&(x.removeEventListener("keydown",j,!0),x.removeEventListener("pointerdown",C,!0))}},[c.domReference,n,u]),v.useEffect(()=>{if(!u)return;function x(S){let{reason:j}=S;(j==="reference-press"||j==="escape-key")&&(h.current=!0)}return o.on("openchange",x),()=>{o.off("openchange",x)}},[o,u]),v.useEffect(()=>()=>{Ai(m)},[]);const y=v.useMemo(()=>({onMouseLeave(){h.current=!1},onFocus(x){if(h.current)return;const S=Lc(x.nativeEvent);if(f&&Cn(S)){if(qy()&&!x.relatedTarget){if(!g.current&&!_9(S))return}else if(!D9(S))return}r(!0,x.nativeEvent,"focus")},onBlur(x){h.current=!1;const S=x.relatedTarget,j=x.nativeEvent,C=Cn(S)&&S.hasAttribute(Hb("focus-guard"))&&S.getAttribute("data-type")==="outside";m.current=window.setTimeout(()=>{var T;const R=NE(c.domReference?c.domReference.ownerDocument:document);!S&&R===c.domReference||Pd((T=s.current.floatingContext)==null?void 0:T.refs.floating.current,R)||Pd(c.domReference,R)||C||r(!1,j,"focus")})}}),[s,c.domReference,r,f]);return v.useMemo(()=>u?{reference:y}:{},[u,y])}function Gy(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[FE]:c,[HE]:u,...f}=e;s=f}return{...n==="floating"&&{tabIndex:-1,[CL]:""},...s,...t.map(c=>{const u=c?c[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((c,u)=>(u&&Object.entries(u).forEach(f=>{let[h,m]=f;if(!(o&&[FE,HE].includes(h)))if(h.indexOf("on")===0){if(r.has(h)||r.set(h,[]),typeof m=="function"){var g;(g=r.get(h))==null||g.push(m),c[h]=function(){for(var y,x=arguments.length,S=new Array(x),j=0;j<x;j++)S[j]=arguments[j];return(y=r.get(h))==null?void 0:y.map(C=>C(...S)).find(C=>C!==void 0)}}}else c[h]=m}),c),{})}}function BL(e){e===void 0&&(e=[]);const t=e.map(u=>u?.reference),n=e.map(u=>u?.floating),r=e.map(u=>u?.item),o=v.useCallback(u=>Gy(u,e,"reference"),t),s=v.useCallback(u=>Gy(u,e,"floating"),n),c=v.useCallback(u=>Gy(u,e,"item"),r);return v.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:c}),[o,s,c])}const VL=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function FL(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:s,floatingId:c}=e,{enabled:u=!0,role:f="dialog"}=t,h=N_(),m=((n=s.domReference)==null?void 0:n.id)||h,g=v.useMemo(()=>{var R;return((R=A9(s.floating))==null?void 0:R.id)||c},[s.floating,c]),y=(r=VL.get(f))!=null?r:f,S=Vb()!=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]),T=v.useCallback(R=>{let{active:E,selected:_}=R;const k={role:"option",...E&&{id:g+"-fui-option"}};switch(f){case"select":case"combobox":return{...k,"aria-selected":_}}return{}},[g,f]);return v.useMemo(()=>u?{reference:j,floating:C,item:T}:{},[u,j,C,T])}var Gb={root:"m_d57069b5",content:"m_b1336c6",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const[HL,zi]=Ar("ScrollArea.Root component was not found in tree");function Qc(e,t){const n=ol(t);kl(()=>{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 qL=v.forwardRef((e,t)=>{const{style:n,...r}=e,o=zi(),[s,c]=v.useState(0),[u,f]=v.useState(0),h=!!(s&&u);return Qc(o.scrollbarX,()=>{const m=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(m),f(m)}),Qc(o.scrollbarY,()=>{const m=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(m),c(m)}),h?a.jsx("div",{...r,ref:t,style:{...n,width:s,height:u}}):null}),GL=v.forwardRef((e,t)=>{const n=zi(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?a.jsx(qL,{...e,ref:t}):null}),WL={scrollHideDelay:1e3,type:"hover"},M_=v.forwardRef((e,t)=>{const{type:n,scrollHideDelay:r,scrollbars:o,getStyles:s,...c}=oe("ScrollAreaRoot",WL,e),[u,f]=v.useState(null),[h,m]=v.useState(null),[g,y]=v.useState(null),[x,S]=v.useState(null),[j,C]=v.useState(null),[T,R]=v.useState(0),[E,_]=v.useState(0),[k,I]=v.useState(!1),[D,P]=v.useState(!1),$=Vn(t,B=>f(B));return a.jsx(HL,{value:{type:n,scrollHideDelay:r,scrollArea:u,viewport:h,onViewportChange:m,content:g,onContentChange:y,scrollbarX:x,onScrollbarXChange:S,scrollbarXEnabled:k,onScrollbarXEnabledChange:I,scrollbarY:j,onScrollbarYChange:C,scrollbarYEnabled:D,onScrollbarYEnabledChange:P,onCornerWidthChange:R,onCornerHeightChange:_,getStyles:s},children:a.jsx(le,{...c,ref:$,__vars:{"--sa-corner-width":o!=="xy"?"0px":`${T}px`,"--sa-corner-height":o!=="xy"?"0px":`${E}px`}})})});M_.displayName="@mantine/core/ScrollAreaRoot";function L_(e,t){const n=e/t;return Number.isNaN(n)?0:n}function gm(e){const t=L_(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function I_(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 QL(e,[t,n]){return Math.min(n,Math.max(t,e))}function YE(e,t,n="ltr"){const r=gm(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,c=t.content-t.viewport,u=s-r,f=n==="ltr"?[0,c]:[c*-1,0],h=QL(e,f);return I_([0,c],[0,u])(h)}function YL(e,t,n,r="ltr"){const o=gm(n),s=o/2,c=t||s,u=o-c,f=n.scrollbar.paddingStart+c,h=n.scrollbar.size-n.scrollbar.paddingEnd-u,m=n.content-n.viewport,g=r==="ltr"?[0,m]:[m*-1,0];return I_([f,h],g)(e)}function z_(e,t){return e>0&&e<t}function vs(e){return e?parseInt(e,10):0}function gl(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e?.(r),(n===!1||!r.defaultPrevented)&&t?.(r)}}const[KL,$_]=Ar("ScrollAreaScrollbar was not found in tree"),U_=v.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:f,onWheelScroll:h,onResize:m,...g}=e,y=zi(),[x,S]=v.useState(null),j=Vn(t,P=>S(P)),C=v.useRef(null),T=v.useRef(""),{viewport:R}=y,E=n.content-n.viewport,_=ol(h),k=ol(u),I=Xd(m,10),D=P=>{if(C.current){const $=P.clientX-C.current.left,B=P.clientY-C.current.top;f({x:$,y:B})}};return v.useEffect(()=>{const P=$=>{const B=$.target;x?.contains(B)&&_($,E)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[R,x,E,_]),v.useEffect(k,[n,k]),Qc(x,I),Qc(y.content,I),a.jsx(KL,{value:{scrollbar:x,hasThumb:r,onThumbChange:ol(o),onThumbPointerUp:ol(s),onThumbPositionChange:k,onThumbPointerDown:ol(c)},children:a.jsx("div",{...g,ref:j,"data-mantine-scrollbar":!0,style:{position:"absolute",...g.style},onPointerDown:gl(e.onPointerDown,P=>{P.preventDefault(),P.button===0&&(P.target.setPointerCapture(P.pointerId),C.current=x.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",D(P))}),onPointerMove:gl(e.onPointerMove,D),onPointerUp:gl(e.onPointerUp,P=>{const $=P.target;$.hasPointerCapture(P.pointerId)&&(P.preventDefault(),$.releasePointerCapture(P.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=T.current,C.current=null}})})}),B_=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...s}=e,c=zi(),[u,f]=v.useState(),h=v.useRef(null),m=Vn(t,h,c.onScrollbarXChange);return v.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),a.jsx(U_,{"data-orientation":"horizontal",...s,ref:m,sizes:n,style:{...o,"--sa-thumb-width":`${gm(n)}px`},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,y)=>{if(c.viewport){const x=c.viewport.scrollLeft+g.deltaX;e.onWheelScroll(x),z_(x,y)&&g.preventDefault()}},onResize:()=>{h.current&&c.viewport&&u&&r({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:vs(u.paddingLeft),paddingEnd:vs(u.paddingRight)}})}})});B_.displayName="@mantine/core/ScrollAreaScrollbarX";const V_=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...s}=e,c=zi(),[u,f]=v.useState(),h=v.useRef(null),m=Vn(t,h,c.onScrollbarYChange);return v.useEffect(()=>{h.current&&f(window.getComputedStyle(h.current))},[]),a.jsx(U_,{...s,"data-orientation":"vertical",ref:m,sizes:n,style:{"--sa-thumb-height":`${gm(n)}px`,...o},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,y)=>{if(c.viewport){const x=c.viewport.scrollTop+g.deltaY;e.onWheelScroll(x),z_(x,y)&&g.preventDefault()}},onResize:()=>{h.current&&c.viewport&&u&&r({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:vs(u.paddingTop),paddingEnd:vs(u.paddingBottom)}})}})});V_.displayName="@mantine/core/ScrollAreaScrollbarY";const vm=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:o}=Ts(),s=zi(),c=v.useRef(null),u=v.useRef(0),[f,h]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=L_(f.viewport,f.content),g={...r,sizes:f,onSizesChange:h,hasThumb:m>0&&m<1,onThumbChange:x=>{c.current=x},onThumbPointerUp:()=>{u.current=0},onThumbPointerDown:x=>{u.current=x}},y=(x,S)=>YL(x,u.current,f,S);return n==="horizontal"?a.jsx(B_,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&c.current){const x=s.viewport.scrollLeft,S=YE(x,f,o);c.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:x=>{s.viewport&&(s.viewport.scrollLeft=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollLeft=y(x,o))}}):n==="vertical"?a.jsx(V_,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&c.current){const x=s.viewport.scrollTop,S=YE(x,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:x=>{s.viewport&&(s.viewport.scrollTop=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollTop=y(x))}}):null});vm.displayName="@mantine/core/ScrollAreaScrollbarVisible";const Wb=v.forwardRef((e,t)=>{const n=zi(),{forceMount:r,...o}=e,[s,c]=v.useState(!1),u=e.orientation==="horizontal",f=Xd(()=>{if(n.viewport){const h=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;c(u?h:m)}},10);return Qc(n.viewport,f),Qc(n.content,f),r||s?a.jsx(vm,{"data-state":s?"visible":"hidden",...o,ref:t}):null});Wb.displayName="@mantine/core/ScrollAreaScrollbarAuto";const F_=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=zi(),[s,c]=v.useState(!1);return v.useEffect(()=>{const{scrollArea:u}=o;let f=0;if(u){const h=()=>{window.clearTimeout(f),c(!0)},m=()=>{f=window.setTimeout(()=>c(!1),o.scrollHideDelay)};return u.addEventListener("pointerenter",h),u.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",h),u.removeEventListener("pointerleave",m)}}},[o.scrollArea,o.scrollHideDelay]),n||s?a.jsx(Wb,{"data-state":s?"visible":"hidden",...r,ref:t}):null});F_.displayName="@mantine/core/ScrollAreaScrollbarHover";const XL=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=zi(),s=e.orientation==="horizontal",[c,u]=v.useState("hidden"),f=Xd(()=>u("idle"),100);return v.useEffect(()=>{if(c==="idle"){const h=window.setTimeout(()=>u("hidden"),o.scrollHideDelay);return()=>window.clearTimeout(h)}},[c,o.scrollHideDelay]),v.useEffect(()=>{const{viewport:h}=o,m=s?"scrollLeft":"scrollTop";if(h){let g=h[m];const y=()=>{const x=h[m];g!==x&&(u("scrolling"),f()),g=x};return h.addEventListener("scroll",y),()=>h.removeEventListener("scroll",y)}},[o.viewport,s,f]),n||c!=="hidden"?a.jsx(vm,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:gl(e.onPointerEnter,()=>u("interacting")),onPointerLeave:gl(e.onPointerLeave,()=>u("idle"))}):null}),Ux=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=zi(),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:c}=o,u=e.orientation==="horizontal";return v.useEffect(()=>(u?s(!0):c(!0),()=>{u?s(!1):c(!1)}),[u,s,c]),o.type==="hover"?a.jsx(F_,{...r,ref:t,forceMount:n}):o.type==="scroll"?a.jsx(XL,{...r,ref:t,forceMount:n}):o.type==="auto"?a.jsx(Wb,{...r,ref:t,forceMount:n}):o.type==="always"?a.jsx(vm,{...r,ref:t}):null});Ux.displayName="@mantine/core/ScrollAreaScrollbar";function JL(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,u=n.top!==s.top;(c||u)&&t(),n=s,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)}const H_=v.forwardRef((e,t)=>{const{style:n,...r}=e,o=zi(),s=$_(),{onThumbPositionChange:c}=s,u=Vn(t,m=>s.onThumbChange(m)),f=v.useRef(void 0),h=Xd(()=>{f.current&&(f.current(),f.current=void 0)},100);return v.useEffect(()=>{const{viewport:m}=o;if(m){const g=()=>{if(h(),!f.current){const y=JL(m,c);f.current=y,c()}};return c(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[o.viewport,h,c]),a.jsx("div",{"data-state":s.hasThumb?"visible":"hidden",...r,ref:u,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:gl(e.onPointerDownCapture,m=>{const y=m.target.getBoundingClientRect(),x=m.clientX-y.left,S=m.clientY-y.top;s.onThumbPointerDown({x,y:S})}),onPointerUp:gl(e.onPointerUp,s.onThumbPointerUp)})});H_.displayName="@mantine/core/ScrollAreaThumb";const Bx=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=$_();return n||o.hasThumb?a.jsx(H_,{ref:t,...r}):null});Bx.displayName="@mantine/core/ScrollAreaThumb";const q_=v.forwardRef(({children:e,style:t,onWheel:n,...r},o)=>{const s=zi(),c=Vn(o,s.onViewportChange),u=f=>{if(n?.(f),s.scrollbarXEnabled&&s.viewport&&f.shiftKey){const{scrollTop:h,scrollHeight:m,clientHeight:g,scrollWidth:y,clientWidth:x}=s.viewport,S=h<1,j=h>=m-g-1;y>x&&(S||j)&&f.stopPropagation()}};return a.jsx(le,{...r,ref:c,onWheel:u,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...t},children:a.jsx("div",{...s.getStyles("content"),ref:s.onContentChange,children:e})})});q_.displayName="@mantine/core/ScrollAreaViewport";const G_={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},ZL=(e,{scrollbarSize:t,overscrollBehavior:n,scrollbars:r})=>{let o=n;return n&&r&&(r==="x"?o=`${n} auto`:r==="y"&&(o=`auto ${n}`)),{root:{"--scrollarea-scrollbar-size":ce(t),"--scrollarea-over-scroll-behavior":o}}},Jr=ge((e,t)=>{const n=oe("ScrollArea",G_,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,scrollbarSize:f,vars:h,type:m,scrollHideDelay:g,viewportProps:y,viewportRef:x,onScrollPositionChange:S,children:j,offsetScrollbars:C,scrollbars:T,onBottomReached:R,onTopReached:E,overscrollBehavior:_,attributes:k,...I}=n,[D,P]=v.useState(!1),[$,B]=v.useState(!1),[W,Y]=v.useState(!1),Z=$e({name:"ScrollArea",props:n,classes:Gb,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:k,vars:h,varsResolver:ZL}),U=v.useRef(null),G=P_([x,U]);return v.useEffect(()=>{if(!U.current||C!=="present")return;const M=U.current,L=new ResizeObserver(()=>{const{scrollHeight:z,clientHeight:V,scrollWidth:K,clientWidth:O}=M;B(z>V),Y(K>O)});return L.observe(M),()=>L.disconnect()},[U,C]),a.jsxs(M_,{getStyles:Z,type:m==="never"?"always":m,scrollHideDelay:g,ref:t,scrollbars:T,...Z("root"),...I,children:[a.jsx(q_,{...y,...Z("viewport",{style:y?.style}),ref:G,"data-offset-scrollbars":C===!0?"xy":C||void 0,"data-scrollbars":T||void 0,"data-horizontal-hidden":C==="present"&&!W?"true":void 0,"data-vertical-hidden":C==="present"&&!$?"true":void 0,onScroll:M=>{y?.onScroll?.(M),S?.({x:M.currentTarget.scrollLeft,y:M.currentTarget.scrollTop});const{scrollTop:L,scrollHeight:z,clientHeight:V}=M.currentTarget;L-(z-V)>=-.8&&R?.(),L===0&&E?.()},children:j}),(T==="xy"||T==="x")&&a.jsx(Ux,{...Z("scrollbar"),orientation:"horizontal","data-hidden":m==="never"||C==="present"&&!W?!0:void 0,forceMount:!0,onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1),children:a.jsx(Bx,{...Z("thumb")})}),(T==="xy"||T==="y")&&a.jsx(Ux,{...Z("scrollbar"),orientation:"vertical","data-hidden":m==="never"||C==="present"&&!$?!0:void 0,forceMount:!0,onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1),children:a.jsx(Bx,{...Z("thumb")})}),a.jsx(GL,{...Z("corner"),"data-hovered":D||void 0,"data-hidden":m==="never"||void 0})]})});Jr.displayName="@mantine/core/ScrollArea";const ym=ge((e,t)=>{const{children:n,classNames:r,styles:o,scrollbarSize:s,scrollHideDelay:c,type:u,dir:f,offsetScrollbars:h,overscrollBehavior:m,viewportRef:g,onScrollPositionChange:y,unstyled:x,variant:S,viewportProps:j,scrollbars:C,style:T,vars:R,onBottomReached:E,onTopReached:_,onOverflowChange:k,...I}=oe("ScrollAreaAutosize",G_,e),D=v.useRef(null),P=P_([g,D]),[$,B]=v.useState(!1),W=v.useRef(!1);return v.useEffect(()=>{if(!k)return;const Y=D.current;if(!Y)return;const Z=()=>{const G=Y.scrollHeight>Y.clientHeight;G!==$&&(W.current?k?.(G):(W.current=!0,G&&k?.(!0)),B(G))};Z();const U=new ResizeObserver(Z);return U.observe(Y),()=>U.disconnect()},[k,$]),a.jsx(le,{...I,ref:t,style:[{display:"flex",overflow:"hidden"},T],children:a.jsx(le,{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden",...C==="y"&&{minWidth:0},...C==="x"&&{minHeight:0},...C==="xy"&&{minWidth:0,minHeight:0},...C===!1&&{minWidth:0,minHeight:0}},children:a.jsx(Jr,{classNames:r,styles:o,scrollHideDelay:c,scrollbarSize:s,type:u,dir:f,offsetScrollbars:h,overscrollBehavior:m,viewportRef:P,onScrollPositionChange:y,unstyled:x,variant:S,viewportProps:j,vars:R,scrollbars:C,onBottomReached:E,onTopReached:_,"data-autosize":"true",children:n})})})});Jr.classes=Gb;ym.displayName="@mantine/core/ScrollAreaAutosize";ym.classes=Gb;Jr.Autosize=ym;var W_={root:"m_87cf2631"};const eI={__staticSelector:"UnstyledButton"},Pn=ar((e,t)=>{const n=oe("UnstyledButton",eI,e),{className:r,component:o="button",__staticSelector:s,unstyled:c,classNames:u,styles:f,style:h,attributes:m,...g}=n,y=$e({name:s,props:n,classes:W_,className:r,style:h,classNames:u,styles:f,unstyled:c,attributes:m});return a.jsx(le,{...y("root",{focusable:!0}),component:o,ref:t,type:o==="button"?"button":void 0,...g})});Pn.classes=W_;Pn.displayName="@mantine/core/UnstyledButton";var Q_={root:"m_515a97f8"};const Qb=ge((e,t)=>{const n=oe("VisuallyHidden",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,attributes:h,...m}=n,g=$e({name:"VisuallyHidden",classes:Q_,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:h});return a.jsx(le,{component:"span",ref:t,...g("root"),...m})});Qb.classes=Q_;Qb.displayName="@mantine/core/VisuallyHidden";var Y_={root:"m_1b7284a3"};const tI=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:Vt(t),"--paper-shadow":Tb(n)}}),Mr=ar((e,t)=>{const n=oe("Paper",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,withBorder:f,vars:h,radius:m,shadow:g,variant:y,mod:x,attributes:S,...j}=n,C=$e({name:"Paper",props:n,classes:Y_,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:S,vars:h,varsResolver:tI});return a.jsx(le,{ref:t,mod:[{"data-with-border":f},x],...C("root"),variant:y,...j})});Mr.classes=Y_;Mr.displayName="@mantine/core/Paper";function KE(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function XE(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 nI={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function rI({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:s,arrowY:c,dir:u}){const[f,h="center"]=e.split("-"),m={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[nI[f]]:r},g=-t/2;return f==="left"?{...m,...KE(h,c,n,o),right:g,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:f==="right"?{...m,...KE(h,c,n,o),left:g,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:f==="top"?{...m,...XE(h,s,n,o,u),bottom:g,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:f==="bottom"?{...m,...XE(h,s,n,o,u),top:g,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const Lp=v.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,visible:s,arrowX:c,arrowY:u,style:f,...h},m)=>{const{dir:g}=Ts();return s?a.jsx("div",{...h,ref:m,style:{...f,...rI({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,dir:g,arrowX:c,arrowY:u})}}):null});Lp.displayName="@mantine/core/FloatingArrow";function K_(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 X_={root:"m_9814e45f"};const iI={zIndex:zr("modal")},oI=(e,{gradient:t,color:n,backgroundOpacity:r,blur:o,radius:s,zIndex:c})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&ki(n||"#000",r??.6)||void 0,"--overlay-filter":o?`blur(${ce(o)})`:void 0,"--overlay-radius":s===void 0?void 0:Vt(s),"--overlay-z-index":c?.toString()}}),Yc=ar((e,t)=>{const n=oe("Overlay",iI,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,fixed:h,center:m,children:g,radius:y,zIndex:x,gradient:S,blur:j,color:C,backgroundOpacity:T,mod:R,attributes:E,..._}=n,k=$e({name:"Overlay",props:n,classes:X_,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:E,vars:f,varsResolver:oI});return a.jsx(le,{ref:t,...k("root"),mod:[{center:m,fixed:h},R],..._,children:g})});Yc.classes=X_;Yc.displayName="@mantine/core/Overlay";function Wy(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 aI({target:e,reuseTargetNode:t,...n}){if(e)return typeof e=="string"?document.querySelector(e)||Wy(n):e;if(t){const r=document.querySelector("[data-mantine-shared-portal-node]");if(r)return r;const o=Wy(n);return o.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(o),o}return Wy(n)}const sI={reuseTargetNode:!0},J_=ge((e,t)=>{const{children:n,target:r,reuseTargetNode:o,...s}=oe("Portal",sI,e),[c,u]=v.useState(!1),f=v.useRef(null);return kl(()=>(u(!0),f.current=aI({target:r,reuseTargetNode:o,...s}),Dd(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:Ob.createPortal(a.jsx(a.Fragment,{children:n}),f.current)});J_.displayName="@mantine/core/Portal";const wa=ge(({withinPortal:e=!0,children:t,...n},r)=>um()==="test"||!e?a.jsx(a.Fragment,{children:t}):a.jsx(J_,{ref:r,...n,children:t}));wa.displayName="@mantine/core/OptionalPortal";const hd=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),rp={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:{...hd("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...hd("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...hd("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...hd("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...hd("top"),common:{transformOrigin:"top right"}}},JE={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function lI({transition:e,state:t,duration:n,timingFunction:r}){const o={WebkitBackfaceVisibility:"hidden",transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in rp?{transitionProperty:rp[e].transitionProperty,...o,...rp[e].common,...rp[e][JE[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[JE[t]]}}function cI({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:s,onEntered:c,onExited:u,enterDelay:f,exitDelay:h}){const m=_n(),g=_b(),y=m.respectReducedMotion?g:!1,[x,S]=v.useState(y?0:e),[j,C]=v.useState(r?"entered":"exited"),T=v.useRef(-1),R=v.useRef(-1),E=v.useRef(-1);function _(){window.clearTimeout(T.current),window.clearTimeout(R.current),cancelAnimationFrame(E.current)}const k=D=>{_();const P=D?o:s,$=D?c:u,B=y?0:D?e:t;S(B),B===0?(typeof P=="function"&&P(),typeof $=="function"&&$(),C(D?"entered":"exited")):E.current=requestAnimationFrame(()=>{xd.flushSync(()=>{C(D?"pre-entering":"pre-exiting")}),E.current=requestAnimationFrame(()=>{typeof P=="function"&&P(),C(D?"entering":"exiting"),T.current=window.setTimeout(()=>{typeof $=="function"&&$(),C(D?"entered":"exited")},B)})})},I=D=>{if(_(),typeof(D?f:h)!="number"){k(D);return}R.current=window.setTimeout(()=>{k(D)},D?f:h)};return xl(()=>{I(r)},[r]),v.useEffect(()=>()=>{_()},[]),{transitionDuration:x,transitionStatus:j,transitionTimingFunction:n||"ease"}}function lo({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:o,children:s,timingFunction:c="ease",onExit:u,onEntered:f,onEnter:h,onExited:m,enterDelay:g,exitDelay:y}){const x=um(),{transitionDuration:S,transitionStatus:j,transitionTimingFunction:C}=cI({mounted:o,exitDuration:r,duration:n,timingFunction:c,onExit:u,onEntered:f,onEnter:h,onExited:m,enterDelay:g,exitDelay:y});return S===0||x==="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(lI({transition:t,duration:S,state:j,timingFunction:C}))})}lo.displayName="@mantine/core/Transition";const[uI,Z_]=Ar("Popover component was not found in the tree");var eD={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};function xm({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const o=CM(t),s=Vn(o,r),c=Nl(e);return c?v.cloneElement(c,{[n]:s}):e}function tD(e){return a.jsx(Qb,{tabIndex:-1,"data-autofocus":!0,...e})}xm.displayName="@mantine/core/FocusTrap";tD.displayName="@mantine/core/FocusTrapInitialFocus";xm.InitialFocus=tD;const Yb=ge((e,t)=>{const n=oe("PopoverDropdown",null,e),{className:r,style:o,vars:s,children:c,onKeyDownCapture:u,variant:f,classNames:h,styles:m,...g}=n,y=Z_(),x=e_({opened:y.opened,shouldReturnFocus:y.returnFocus}),S=y.withRoles?{"aria-labelledby":y.getTargetId(),id:y.getDropdownId(),role:"dialog",tabIndex:-1}:{},j=Vn(t,y.floating);return y.disabled?null:a.jsx(wa,{...y.portalProps,withinPortal:y.withinPortal,children:a.jsx(lo,{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(xm,{active:y.trapFocus&&y.opened,innerRef:j,children:a.jsxs(le,{...S,...g,variant:f,onKeyDownCapture:dM(()=>{y.onClose?.(),y.onDismiss?.()},{active:y.closeOnEscape,onTrigger:x,onKeyDown:u}),"data-position":y.placement,"data-fixed":y.floatingStrategy==="fixed"||void 0,...y.getStyles("dropdown",{className:r,props:n,classNames:h,styles:m,style:[{...C,zIndex:y.zIndex,top:y.y??0,left:y.x??0,width:y.width==="target"?void 0:ce(y.width),...y.referenceHidden?{display:"none"}:null},y.resolvedStyles.dropdown,m?.dropdown,o]}),children:[c,a.jsx(Lp,{ref:y.arrowRef,arrowX:y.arrowX,arrowY:y.arrowY,visible:y.withArrow,position:y.placement,arrowSize:y.arrowSize,arrowRadius:y.arrowRadius,arrowOffset:y.arrowOffset,arrowPosition:y.arrowPosition,...y.getStyles("arrow",{props:n,classNames:h,styles:m})})]})})})})});Yb.classes=eD;Yb.displayName="@mantine/core/PopoverDropdown";const dI={refProp:"ref",popupType:"dialog"},nD=ge((e,t)=>{const{children:n,refProp:r,popupType:o,...s}=oe("PopoverTarget",dI,e),c=Nl(n);if(!c)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 u=s,f=Z_(),h=Vn(f.reference,lm(c),t),m=f.withRoles?{"aria-haspopup":o,"aria-expanded":f.opened,"aria-controls":f.opened?f.getDropdownId():void 0,id:f.getTargetId()}:{},g=c.props;return v.cloneElement(c,{...u,...m,...f.targetProps,className:Bt(f.targetProps.className,u.className,g.className),[r]:h,...f.controlled?null:{onClick:()=>{f.onToggle(),g.onClick?.()}}})});nD.displayName="@mantine/core/PopoverTarget";function fI(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 hI(e,t,n){const r=fI(e.middlewares),o=[A_(e.offset),jL()];return e.dropdownVisible&&n!=="test"&&e.preventPositionChangeWhenVisible&&(r.flip=!1),r.flip&&o.push(typeof r.flip=="boolean"?Mp():Mp(r.flip)),r.shift&&o.push(Bb(typeof r.shift=="boolean"?{limiter:VE(),padding:5}:{limiter:VE(),padding:5,...r.shift})),r.inline&&o.push(typeof r.inline=="boolean"?Cd():Cd(r.inline)),o.push(k_({element:e.arrowRef,padding:e.arrowOffset})),(r.size||e.width==="target")&&o.push(wL({...typeof r.size=="boolean"?{}:r.size,apply({rects:s,availableWidth:c,availableHeight:u,...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:u,...f}):Object.assign(m,{maxWidth:`${c}px`,maxHeight:`${u}px`})),e.width==="target"&&Object.assign(m,{width:`${s.reference.width}px`})}})),o}function pI(e){const t=um(),[n,r]=ir({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)},u=qb({strategy:e.strategy,placement:e.preventPositionChangeWhenVisible?e.positionRef.current:e.position,middleware:hI(e,()=>u,t),whileElementsMounted:e.keepMounted?void 0:zx});return v.useEffect(()=>{if(!(!u.refs.reference.current||!u.refs.floating.current)&&n)return zx(u.refs.reference.current,u.refs.floating.current,u.update)},[n,u.update]),xl(()=>{e.onPositionChange?.(u.placement),e.positionRef.current=u.placement},[u.placement,e.preventPositionChangeWhenVisible]),xl(()=>{n!==o.current&&(n?e.onOpen?.():e.onClose?.()),o.current=n},[n,e.onClose,e.onOpen]),kl(()=>{let f=-1;return n&&(f=window.setTimeout(()=>e.setDropdownVisible(!0),4)),()=>{window.clearTimeout(f)}},[n,e.position]),{floating:u,controlled:typeof e.opened=="boolean",opened:n,onClose:s,onToggle:c}}const mI={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:zr("popover"),__staticSelector:"Popover",width:"max-content"},gI=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:Vt(t),"--popover-shadow":Tb(n)}});function Zr(e){const t=oe("Popover",mI,e),{children:n,position:r,offset:o,onPositionChange:s,positionDependencies:c,opened:u,transitionProps:f,onExitTransitionEnd:h,onEnterTransitionEnd:m,width:g,middlewares:y,withArrow:x,arrowSize:S,arrowOffset:j,arrowRadius:C,arrowPosition:T,unstyled:R,classNames:E,styles:_,closeOnClickOutside:k,withinPortal:I,portalProps:D,closeOnEscape:P,clickOutsideEvents:$,trapFocus:B,onClose:W,onDismiss:Y,onOpen:Z,onChange:U,zIndex:G,radius:M,shadow:L,id:z,defaultOpened:V,__staticSelector:K,withRoles:O,disabled:F,returnFocus:se,variant:de,keepMounted:ye,vars:je,floatingStrategy:Ee,withOverlay:Ke,overlayProps:De,hideDetached:dt,attributes:Ct,preventPositionChangeWhenVisible:rt,...nt}=t,mt=$e({name:K,props:t,classes:eD,classNames:E,styles:_,unstyled:R,attributes:Ct,rootSelector:"dropdown",vars:je,varsResolver:gI}),{resolvedStyles:Tt}=Ol({classNames:E,styles:_,props:t}),[wt,Te]=v.useState(u??V??!1),Pe=v.useRef(r),Ne=v.useRef(null),[Ie,lt]=v.useState(null),[et,ft]=v.useState(null),{dir:pe}=Ts(),qe=um(),Ce=ur(z),ke=pI({middlewares:y,width:g,position:K_(pe,r),offset:typeof o=="number"?o+(x?S/2:0):o,arrowRef:Ne,arrowOffset:j,onPositionChange:s,positionDependencies:c,opened:u,defaultOpened:V,onChange:U,onOpen:Z,onClose:W,onDismiss:Y,strategy:Ee,dropdownVisible:wt,setDropdownVisible:Te,positionRef:Pe,disabled:F,preventPositionChangeWhenVisible:rt,keepMounted:ye});mM(()=>{k&&(ke.onClose(),Y?.())},$,[Ie,et]);const kt=v.useCallback(nn=>{lt(nn),ke.floating.refs.setReference(nn)},[ke.floating.refs.setReference]),pn=v.useCallback(nn=>{ft(nn),ke.floating.refs.setFloating(nn)},[ke.floating.refs.setFloating]),mn=v.useCallback(()=>{f?.onExited?.(),h?.(),Te(!1),rt||(Pe.current=r)},[f?.onExited,h,rt,r]),Kn=v.useCallback(()=>{f?.onEntered?.(),m?.()},[f?.onEntered,m]);return a.jsxs(uI,{value:{returnFocus:se,disabled:F,controlled:ke.controlled,reference:kt,floating:pn,x:ke.floating.x,y:ke.floating.y,arrowX:ke.floating?.middlewareData?.arrow?.x,arrowY:ke.floating?.middlewareData?.arrow?.y,opened:ke.opened,arrowRef:Ne,transitionProps:{...f,onExited:mn,onEntered:Kn},width:g,withArrow:x,arrowSize:S,arrowOffset:j,arrowRadius:C,arrowPosition:T,placement:ke.floating.placement,trapFocus:B,withinPortal:I,portalProps:D,zIndex:G,radius:M,shadow:L,closeOnEscape:P,onDismiss:Y,onClose:ke.onClose,onToggle:ke.onToggle,getTargetId:()=>`${Ce}-target`,getDropdownId:()=>`${Ce}-dropdown`,withRoles:O,targetProps:nt,__staticSelector:K,classNames:E,styles:_,unstyled:R,variant:de,keepMounted:ye,getStyles:mt,resolvedStyles:Tt,floatingStrategy:Ee,referenceHidden:dt&&qe!=="test"?ke.floating.middlewareData.hide?.referenceHidden:!1},children:[n,Ke&&a.jsx(lo,{transition:"fade",mounted:ke.opened,duration:f?.duration||250,exitDuration:f?.exitDuration||250,children:nn=>a.jsx(wa,{withinPortal:I,children:a.jsx(Yc,{...De,...mt("overlay",{className:De?.className,style:[nn,De?.style]})})})})]})}Zr.Target=nD;Zr.Dropdown=Yb;Zr.displayName="@mantine/core/Popover";Zr.extend=e=>e;var io={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 rD=v.forwardRef(({className:e,...t},n)=>a.jsxs(le,{component:"span",className:Bt(io.barsLoader,e),...t,ref:n,children:[a.jsx("span",{className:io.bar}),a.jsx("span",{className:io.bar}),a.jsx("span",{className:io.bar})]}));rD.displayName="@mantine/core/Bars";const iD=v.forwardRef(({className:e,...t},n)=>a.jsxs(le,{component:"span",className:Bt(io.dotsLoader,e),...t,ref:n,children:[a.jsx("span",{className:io.dot}),a.jsx("span",{className:io.dot}),a.jsx("span",{className:io.dot})]}));iD.displayName="@mantine/core/Dots";const oD=v.forwardRef(({className:e,...t},n)=>a.jsx(le,{component:"span",className:Bt(io.ovalLoader,e),...t,ref:n}));oD.displayName="@mantine/core/Oval";const aD={bars:rD,oval:oD,dots:iD},vI={loaders:aD,type:"oval"},yI=(e,{size:t,color:n})=>({root:{"--loader-size":ot(t,"loader-size"),"--loader-color":n?Kt(n,e):void 0}}),_r=ge((e,t)=>{const n=oe("Loader",vI,e),{size:r,color:o,type:s,vars:c,className:u,style:f,classNames:h,styles:m,unstyled:g,loaders:y,variant:x,children:S,attributes:j,...C}=n,T=$e({name:"Loader",props:n,classes:io,className:u,style:f,classNames:h,styles:m,unstyled:g,attributes:j,vars:c,varsResolver:yI});return S?a.jsx(le,{...T("root"),ref:t,...C,children:S}):a.jsx(le,{...T("root"),ref:t,component:y[s],variant:x,size:r,...C})});_r.defaultLoaders=aD;_r.classes=io;_r.displayName="@mantine/core/Loader";var lu={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const ZE={orientation:"horizontal"},xI=(e,{borderWidth:t})=>({group:{"--ai-border-width":ce(t)}}),Kb=ge((e,t)=>{const n=oe("ActionIconGroup",ZE,e),{className:r,style:o,classNames:s,styles:c,unstyled:u,orientation:f,vars:h,borderWidth:m,variant:g,mod:y,attributes:x,...S}=oe("ActionIconGroup",ZE,e),j=$e({name:"ActionIconGroup",props:n,classes:lu,className:r,style:o,classNames:s,styles:c,unstyled:u,attributes:x,vars:h,varsResolver:xI,rootSelector:"group"});return a.jsx(le,{...j("group"),ref:t,variant:g,mod:[{"data-orientation":f},y],role:"group",...S})});Kb.classes=lu;Kb.displayName="@mantine/core/ActionIconGroup";const bI=(e,{radius:t,color:n,gradient:r,variant:o,autoContrast:s,size:c})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:s});return{groupSection:{"--section-height":ot(c,"section-height"),"--section-padding-x":ot(c,"section-padding-x"),"--section-fz":Wn(c),"--section-radius":t===void 0?void 0:Vt(t),"--section-bg":n||o?u.background:void 0,"--section-color":u.color,"--section-bd":n||o?u.border:void 0}}},Xb=ge((e,t)=>{const n=oe("ActionIconGroupSection",null,e),{className:r,style:o,classNames:s,styles:c,unstyled:u,vars:f,variant:h,gradient:m,radius:g,autoContrast:y,attributes:x,...S}=n,j=$e({name:"ActionIconGroupSection",props:n,classes:lu,className:r,style:o,classNames:s,styles:c,unstyled:u,attributes:x,vars:f,varsResolver:bI,rootSelector:"groupSection"});return a.jsx(le,{...j("groupSection"),ref:t,variant:h,...S})});Xb.classes=lu;Xb.displayName="@mantine/core/ActionIconGroupSection";const SI=(e,{size:t,radius:n,variant:r,gradient:o,color:s,autoContrast:c})=>{const u=e.variantColorResolver({color:s||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:c});return{root:{"--ai-size":ot(t,"ai-size"),"--ai-radius":n===void 0?void 0:Vt(n),"--ai-bg":s||r?u.background:void 0,"--ai-hover":s||r?u.hover:void 0,"--ai-hover-color":s||r?u.hoverColor:void 0,"--ai-color":u.color,"--ai-bd":s||r?u.border:void 0}}},Rn=ar((e,t)=>{const n=oe("ActionIcon",null,e),{className:r,unstyled:o,variant:s,classNames:c,styles:u,style:f,loading:h,loaderProps:m,size:g,color:y,radius:x,__staticSelector:S,gradient:j,vars:C,children:T,disabled:R,"data-disabled":E,autoContrast:_,mod:k,attributes:I,...D}=n,P=$e({name:["ActionIcon",S],props:n,className:r,style:f,classes:lu,classNames:c,styles:u,unstyled:o,attributes:I,vars:C,varsResolver:SI});return a.jsxs(Pn,{...P("root",{active:!R&&!h&&!E}),...D,unstyled:o,variant:s,size:g,disabled:R||h,ref:t,mod:[{loading:h,disabled:R||E},k],children:[typeof h=="boolean"&&a.jsx(lo,{mounted:h,transition:"slide-down",duration:150,children:$=>a.jsx(le,{component:"span",...P("loader",{style:$}),"aria-hidden":!0,children:a.jsx(_r,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...m})})}),a.jsx(le,{component:"span",mod:{loading:h},...P("icon"),children:T})]})});Rn.classes=lu;Rn.displayName="@mantine/core/ActionIcon";Rn.Group=Kb;Rn.GroupSection=Xb;const sD=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"})}));sD.displayName="@mantine/core/CloseIcon";var lD={root:"m_86a44da5","root--subtle":"m_220c80f2"};const wI={variant:"subtle"},jI=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":ot(t,"cb-size"),"--cb-radius":n===void 0?void 0:Vt(n),"--cb-icon-size":ce(r)}}),Rs=ar((e,t)=>{const n=oe("CloseButton",wI,e),{iconSize:r,children:o,vars:s,radius:c,className:u,classNames:f,style:h,styles:m,unstyled:g,"data-disabled":y,disabled:x,variant:S,icon:j,mod:C,attributes:T,__staticSelector:R,...E}=n,_=$e({name:R||"CloseButton",props:n,className:u,style:h,classes:lD,classNames:f,styles:m,unstyled:g,attributes:T,vars:s,varsResolver:jI});return a.jsxs(Pn,{ref:t,...E,unstyled:g,variant:S,disabled:x,mod:[{disabled:x||y},C],..._("root",{variant:S,active:!x&&!y}),children:[j||a.jsx(sD,{}),o]})});Rs.classes=lD;Rs.displayName="@mantine/core/CloseButton";function CI(e){return v.Children.toArray(e).filter(Boolean)}var cD={root:"m_4081bf90"};const EI={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},TI=(e,{grow:t,preventGrowOverflow:n,gap:r,align:o,justify:s,wrap:c},{childWidth:u})=>({root:{"--group-child-width":t&&n?u:void 0,"--group-gap":Gn(r),"--group-align":o,"--group-justify":s,"--group-wrap":c}}),xe=ge((e,t)=>{const n=oe("Group",EI,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,children:f,gap:h,align:m,justify:g,wrap:y,grow:x,preventGrowOverflow:S,vars:j,variant:C,__size:T,mod:R,attributes:E,..._}=n,k=CI(f),I=k.length,D=Gn(h??"md"),$={childWidth:`calc(${100/I}% - (${D} - ${D} / ${I}))`},B=$e({name:"Group",props:n,stylesCtx:$,className:o,style:s,classes:cD,classNames:r,styles:c,unstyled:u,attributes:E,vars:j,varsResolver:TI});return a.jsx(le,{...B("root"),ref:t,variant:C,mod:[{grow:x},R],size:T,..._,children:k})});xe.classes=cD;xe.displayName="@mantine/core/Group";const[RI,Da]=Ar("ModalBase component was not found in tree");function _I({opened:e,transitionDuration:t}){const[n,r]=v.useState(e),o=v.useRef(-1),c=_b()?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 u=ur(e),[f,h]=v.useState(!1),[m,g]=v.useState(!1),y=typeof t?.duration=="number"?t?.duration:200,x=_I({opened:n,transitionDuration:y});return i_("keydown",S=>{S.key==="Escape"&&o&&!S.isComposing&&n&&S.target?.getAttribute("data-mantine-stop-propagation")!=="true"&&s()},{capture:!0}),e_({opened:n,shouldReturnFocus:r&&c}),{_id:u,titleMounted:f,bodyMounted:m,shouldLockScroll:x,setTitleMounted:h,setBodyMounted:g}}const uD=v.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:o,onExitTransitionEnd:s,onEnterTransitionEnd:c,trapFocus:u,closeOnEscape:f,returnFocus:h,closeOnClickOutside:m,withinPortal:g,portalProps:y,lockScroll:x,children:S,zIndex:j,shadow:C,padding:T,__vars:R,unstyled:E,removeScrollProps:_,...k},I)=>{const{_id:D,titleMounted:P,bodyMounted:$,shouldLockScroll:B,setTitleMounted:W,setBodyMounted:Y}=DI({id:r,transitionProps:o,opened:t,trapFocus:u,closeOnEscape:f,onClose:n,returnFocus:h}),{key:Z,...U}=_||{};return a.jsx(wa,{...y,withinPortal:g,children:a.jsx(RI,{value:{opened:t,onClose:n,closeOnClickOutside:m,onExitTransitionEnd:s,onEnterTransitionEnd:c,transitionProps:{...o,keepMounted:e},getTitleId:()=>`${D}-title`,getBodyId:()=>`${D}-body`,titleMounted:P,bodyMounted:$,setTitleMounted:W,setBodyMounted:Y,trapFocus:u,closeOnEscape:f,zIndex:j,unstyled:E},children:a.jsx(yl,{enabled:B&&x,...U,children:a.jsx(le,{ref:I,...k,__vars:{...R,"--mb-z-index":(j||zr("modal")).toString(),"--mb-shadow":Tb(C),"--mb-padding":Gn(T)},children:S})},Z)})})});uD.displayName="@mantine/core/ModalBase";var Kc={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};function AI(){const e=Da();return v.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}const dD=v.forwardRef(({className:e,...t},n)=>{const r=AI(),o=Da();return a.jsx(le,{ref:n,...t,id:r,className:Bt({[Kc.body]:!o.unstyled},e)})});dD.displayName="@mantine/core/ModalBaseBody";const fD=v.forwardRef(({className:e,onClick:t,...n},r)=>{const o=Da();return a.jsx(Rs,{ref:r,...n,onClick:s=>{o.onClose(),t?.(s)},className:Bt({[Kc.close]:!o.unstyled},e),unstyled:o.unstyled})});fD.displayName="@mantine/core/ModalBaseCloseButton";const hD=v.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:o,...s},c)=>{const u=Da();return a.jsx(lo,{mounted:u.opened,transition:"pop",...u.transitionProps,onExited:()=>{u.onExitTransitionEnd?.(),u.transitionProps?.onExited?.()},onEntered:()=>{u.onEnterTransitionEnd?.(),u.transitionProps?.onEntered?.()},...e,children:f=>a.jsx("div",{...n,className:Bt({[Kc.inner]:!u.unstyled},n.className),children:a.jsx(xm,{active:u.opened&&u.trapFocus,innerRef:c,children:a.jsx(Mr,{...s,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":u.bodyMounted?u.getBodyId():void 0,"aria-labelledby":u.titleMounted?u.getTitleId():void 0,style:[o,f],className:Bt({[Kc.content]:!u.unstyled},t),unstyled:u.unstyled,children:s.children})})})})});hD.displayName="@mantine/core/ModalBaseContent";const pD=v.forwardRef(({className:e,...t},n)=>{const r=Da();return a.jsx(le,{component:"header",ref:n,className:Bt({[Kc.header]:!r.unstyled},e),...t})});pD.displayName="@mantine/core/ModalBaseHeader";const kI={duration:200,timingFunction:"ease",transition:"fade"};function PI(e){const t=Da();return{...kI,...t.transitionProps,...e}}const mD=v.forwardRef(({onClick:e,transitionProps:t,style:n,visible:r,...o},s)=>{const c=Da(),u=PI(t);return a.jsx(lo,{mounted:r!==void 0?r:c.opened,...u,transition:"fade",children:f=>a.jsx(Yc,{ref:s,fixed:!0,style:[n,f],zIndex:c.zIndex,unstyled:c.unstyled,onClick:h=>{e?.(h),c.closeOnClickOutside&&c.onClose()},...o})})});mD.displayName="@mantine/core/ModalBaseOverlay";function NI(){const e=Da();return v.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const gD=v.forwardRef(({className:e,...t},n)=>{const r=NI(),o=Da();return a.jsx(le,{component:"h2",ref:n,className:Bt({[Kc.title]:!o.unstyled},e),...t,id:r})});gD.displayName="@mantine/core/ModalBaseTitle";function OI({children:e}){return a.jsx(a.Fragment,{children:e})}const[MI,LI]=Ho({size:"sm"});var $i={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 vD=ge((e,t)=>{const n=oe("InputClearButton",null,e),{size:r,variant:o,vars:s,classNames:c,styles:u,...f}=n,h=LI(),{resolvedClassNames:m,resolvedStyles:g}=Ol({classNames:c,styles:u,props:n});return a.jsx(Rs,{variant:o||"transparent",ref:t,size:r||h?.size||"sm",classNames:m,styles:g,__staticSelector:"InputClearButton",style:{pointerEvents:"all",background:"var(--input-bg)",...f.style},...f})});vD.displayName="@mantine/core/InputClearButton";const II={xs:7,sm:8,md:10,lg:12,xl:15};function zI({__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:II[o]},children:[s,n||r]}):n===null?null:n||s||r}const[$I,cu]=Ho({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0}),UI=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${Wn(t)} - ${ce(2)})`}}),bm=ge((e,t)=>{const n=oe("InputDescription",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,size:h,__staticSelector:m,__inheritStyles:g=!0,attributes:y,variant:x,...S}=oe("InputDescription",null,n),j=cu(),C=$e({name:["InputWrapper",m],props:n,classes:$i,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:y,rootSelector:"description",vars:f,varsResolver:UI}),T=g&&j?.getStyles||C;return a.jsx(le,{component:"p",ref:t,variant:x,size:h,...T("description",j?.getStyles?{className:o,style:s}:void 0),...S})});bm.classes=$i;bm.displayName="@mantine/core/InputDescription";const BI=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${Wn(t)} - ${ce(2)})`}}),Sm=ge((e,t)=>{const n=oe("InputError",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,size:h,attributes:m,__staticSelector:g,__inheritStyles:y=!0,variant:x,...S}=n,j=$e({name:["InputWrapper",g],props:n,classes:$i,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:m,rootSelector:"error",vars:f,varsResolver:BI}),C=cu(),T=y&&C?.getStyles||j;return a.jsx(le,{component:"p",ref:t,variant:x,size:h,...T("error",C?.getStyles?{className:o,style:s}:void 0),...S})});Sm.classes=$i;Sm.displayName="@mantine/core/InputError";const eT={labelElement:"label"},VI=(e,{size:t})=>({label:{"--input-label-size":Wn(t),"--input-asterisk-color":void 0}}),tf=ge((e,t)=>{const n=oe("InputLabel",eT,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,labelElement:h,size:m,required:g,htmlFor:y,onMouseDown:x,children:S,__staticSelector:j,variant:C,mod:T,attributes:R,...E}=oe("InputLabel",eT,n),_=$e({name:["InputWrapper",j],props:n,classes:$i,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:R,rootSelector:"label",vars:f,varsResolver:VI}),k=cu(),I=k?.getStyles||_;return a.jsxs(le,{...I("label",k?.getStyles?{className:o,style:s}:void 0),component:h,variant:C,size:m,ref:t,htmlFor:h==="label"?y:void 0,mod:[{required:g},T],onMouseDown:D=>{x?.(D),!D.defaultPrevented&&D.detail>1&&D.preventDefault()},...E,children:[S,g&&a.jsx("span",{...I("required"),"aria-hidden":!0,children:" *"})]})});tf.classes=$i;tf.displayName="@mantine/core/InputLabel";const Jb=ge((e,t)=>{const n=oe("InputPlaceholder",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,__staticSelector:h,variant:m,error:g,mod:y,attributes:x,...S}=n,j=$e({name:["InputPlaceholder",h],props:n,classes:$i,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:x,rootSelector:"placeholder"});return a.jsx(le,{...j("placeholder"),mod:[{error:!!g},y],component:"span",variant:m,ref:t,...S})});Jb.classes=$i;Jb.displayName="@mantine/core/InputPlaceholder";function FI(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 HI={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},qI=(e,{size:t})=>({label:{"--input-label-size":Wn(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${Wn(t)} - ${ce(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${Wn(t)} - ${ce(2)})`}}),nf=ge((e,t)=>{const n=oe("InputWrapper",HI,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,size:h,variant:m,__staticSelector:g,inputContainer:y,inputWrapperOrder:x,label:S,error:j,description:C,labelProps:T,descriptionProps:R,errorProps:E,labelElement:_,children:k,withAsterisk:I,id:D,required:P,__stylesApiProps:$,mod:B,attributes:W,...Y}=n,Z=$e({name:["InputWrapper",g],props:$||n,classes:$i,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:W,vars:f,varsResolver:qI}),U={size:h,variant:m,__staticSelector:g},G=ur(D),M=typeof I=="boolean"?I:P,L=E?.id||`${G}-error`,z=R?.id||`${G}-description`,V=G,K=!!j&&typeof j!="boolean",O=!!C,F=`${K?L:""} ${O?z:""}`,se=F.trim().length>0?F.trim():void 0,de=T?.id||`${G}-label`,ye=S&&a.jsx(tf,{labelElement:_,id:de,htmlFor:V,required:M,...U,...T,children:S},"label"),je=O&&a.jsx(bm,{...R,...U,size:R?.size||U.size,id:R?.id||z,children:C},"description"),Ee=a.jsx(v.Fragment,{children:y(k)},"input"),Ke=K&&v.createElement(Sm,{...E,...U,size:E?.size||U.size,key:"error",id:E?.id||L},j),De=x.map(dt=>{switch(dt){case"label":return ye;case"input":return Ee;case"description":return je;case"error":return Ke;default:return null}});return a.jsx($I,{value:{getStyles:Z,describedBy:se,inputId:V,labelId:de,...FI(x,{hasDescription:O,hasError:K})},children:a.jsx(le,{ref:t,variant:m,size:h,mod:[{error:!!j},B],...Z("root"),...Y,children:De})})});nf.classes=$i;nf.displayName="@mantine/core/InputWrapper";const GI={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0,size:"sm"},WI=(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":ot(t.size,"input-height"),"--input-fz":Wn(t.size),"--input-radius":t.radius===void 0?void 0:Vt(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?ce(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?ce(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?ot(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),fn=ar((e,t)=>{const n=oe("Input",GI,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,required:f,__staticSelector:h,__stylesApiProps:m,size:g,wrapperProps:y,error:x,disabled:S,leftSection:j,leftSectionProps:C,leftSectionWidth:T,rightSection:R,rightSectionProps:E,rightSectionWidth:_,rightSectionPointerEvents:k,leftSectionPointerEvents:I,variant:D,vars:P,pointer:$,multiline:B,radius:W,id:Y,withAria:Z,withErrorStyles:U,mod:G,inputSize:M,attributes:L,__clearSection:z,__clearable:V,__defaultRightSection:K,...O}=n,{styleProps:F,rest:se}=_a(O),de=cu(),ye={offsetBottom:de?.offsetBottom,offsetTop:de?.offsetTop},je=$e({name:["Input",h],props:m||n,classes:$i,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:L,stylesCtx:ye,rootSelector:"wrapper",vars:P,varsResolver:WI}),Ee=Z?{required:f,disabled:S,"aria-invalid":!!x,"aria-describedby":de?.describedBy,id:de?.inputId||Y}:{},Ke=zI({__clearable:V,__clearSection:z,rightSection:R,__defaultRightSection:K,size:g});return a.jsx(MI,{value:{size:g||"sm"},children:a.jsxs(le,{...je("wrapper"),...F,...y,mod:[{error:!!x&&U,pointer:$,disabled:S,multiline:B,"data-with-right-section":!!Ke,"data-with-left-section":!!j},G],variant:D,size:g,children:[j&&a.jsx("div",{...C,"data-position":"left",...je("section",{className:C?.className,style:C?.style}),children:j}),a.jsx(le,{component:"input",...se,...Ee,ref:t,required:f,mod:{disabled:S,error:!!x&&U},variant:D,__size:M,...je("input")}),Ke&&a.jsx("div",{...E,"data-position":"right",...je("section",{className:E?.className,style:E?.style}),children:Ke})]})})});fn.classes=$i;fn.Wrapper=nf;fn.Label=tf;fn.Error=Sm;fn.Description=bm;fn.Placeholder=Jb;fn.ClearButton=vD;fn.displayName="@mantine/core/Input";function QI(e,t,n){const r=oe(e,t,n),{label:o,description:s,error:c,required:u,classNames:f,styles:h,className:m,unstyled:g,__staticSelector:y,__stylesApiProps:x,errorProps:S,labelProps:j,descriptionProps:C,wrapperProps:T,id:R,size:E,style:_,inputContainer:k,inputWrapperOrder:I,withAsterisk:D,variant:P,vars:$,mod:B,attributes:W,...Y}=r,{styleProps:Z,rest:U}=_a(Y),G={label:o,description:s,error:c,required:u,classNames:f,className:m,__staticSelector:y,__stylesApiProps:x||r,errorProps:S,labelProps:j,descriptionProps:C,unstyled:g,styles:h,size:E,style:_,inputContainer:k,inputWrapperOrder:I,withAsterisk:D,variant:P,id:R,mod:B,attributes:W,...T};return{...U,classNames:f,styles:h,unstyled:g,wrapperProps:{...G,...Z},inputProps:{required:u,classNames:f,styles:h,unstyled:g,size:E,__staticSelector:y,__stylesApiProps:x||r,error:c,variant:P,id:R,attributes:W}}}const YI={__staticSelector:"InputBase",withAria:!0,size:"sm"},$r=ar((e,t)=>{const{inputProps:n,wrapperProps:r,...o}=QI("InputBase",YI,e);return a.jsx(fn.Wrapper,{...r,children:a.jsx(fn,{...n,...o,ref:t})})});$r.classes={...fn.classes,...fn.Wrapper.classes};$r.displayName="@mantine/core/InputBase";const KI={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 yD={root:"m_8bffd616"};const or=ar((e,t)=>{const n=oe("Flex",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,gap:h,rowGap:m,columnGap:g,align:y,justify:x,wrap:S,direction:j,attributes:C,...T}=n,R=$e({name:"Flex",classes:yD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:C,vars:f}),E=_n(),_=Zd(),k=f_({styleProps:{gap:h,rowGap:m,columnGap:g,align:y,justify:x,wrap:S,direction:j},theme:E,data:KI});return a.jsxs(a.Fragment,{children:[k.hasResponsiveStyles&&a.jsx(Ll,{selector:`.${_}`,styles:k.styles,media:k.media}),a.jsx(le,{ref:t,...R("root",{className:_,style:Es(k.inlineStyles)}),...T})]})});or.classes=yD;or.displayName="@mantine/core/Flex";var xD={root:"m_96b553a6"};function XI(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 JI({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const o=v.useRef(-1),[s,c]=v.useState(!1),[u,f]=v.useState(typeof r=="boolean"?r:!1),h=()=>{if(!e||!t||!n.current)return;const x=e.getBoundingClientRect(),S=t.getBoundingClientRect(),j=window.getComputedStyle(e),C=window.getComputedStyle(t),T=vs(j.borderTopWidth)+vs(C.borderTopWidth),R=vs(j.borderLeftWidth)+vs(C.borderLeftWidth),E={top:x.top-S.top-T,left:x.left-S.left-R,width:x.width,height:x.height};n.current.style.transform=`translateY(${E.top}px) translateX(${E.left}px)`,n.current.style.width=`${E.width}px`,n.current.style.height=`${E.height}px`},m=()=>{window.clearTimeout(o.current),n.current&&(n.current.style.transitionDuration="0ms"),h(),o.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},g=v.useRef(null),y=v.useRef(null);return v.useEffect(()=>{if(h(),e)return g.current=new ResizeObserver(m),g.current.observe(e),t&&(y.current=new ResizeObserver(m),y.current.observe(t)),()=>{g.current?.disconnect(),y.current?.disconnect()}},[t,e]),v.useEffect(()=>{if(t){const x=S=>{XI(S.target,t)&&(m(),f(!1))};return t.addEventListener("transitionend",x),()=>{t.removeEventListener("transitionend",x)}}},[t]),UM(()=>{o_()!=="test"&&c(!0)},20,{autoInvoke:!0}),BM(x=>{x.forEach(S=>{S.type==="attributes"&&S.attributeName==="dir"&&m()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:s,hidden:u}}const ZI=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),Zb=ge((e,t)=>{const n=oe("FloatingIndicator",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,target:h,parent:m,transitionDuration:g,mod:y,displayAfterTransitionEnd:x,attributes:S,...j}=n,C=$e({name:"FloatingIndicator",classes:xD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:S,vars:f,varsResolver:ZI}),T=v.useRef(null),{initialized:R,hidden:E}=JI({target:h,parent:m,ref:T,displayAfterTransitionEnd:x}),_=Vn(t,T);return!h||!m?null:a.jsx(le,{ref:_,mod:[{initialized:R,hidden:E},y],...C("root"),...j})});Zb.displayName="@mantine/core/FloatingIndicator";Zb.classes=xD;function bD({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)},u=()=>{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:u,closeDropdown:f}}function SD({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:ce(t),height:ce(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"})})}SD.displayName="@mantine/core/AccordionChevron";var wD={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 e6=(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:Vt(t),"--alert-bg":n||r?s.background:void 0,"--alert-color":s.color,"--alert-bd":n||r?s.border:void 0}}},Go=ge((e,t)=>{const n=oe("Alert",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,radius:h,color:m,title:g,children:y,id:x,icon:S,withCloseButton:j,onClose:C,closeButtonLabel:T,variant:R,autoContrast:E,role:_,attributes:k,...I}=n,D=$e({name:"Alert",classes:wD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:k,vars:f,varsResolver:e6}),P=ur(x),$=g&&`${P}-title`||void 0,B=`${P}-body`;return a.jsx(le,{id:P,...D("root",{variant:R}),variant:R,ref:t,role:_||"alert",...I,"aria-describedby":y?B:void 0,"aria-labelledby":g?$:void 0,children:a.jsxs("div",{...D("wrapper"),children:[S&&a.jsx("div",{...D("icon"),children:S}),a.jsxs("div",{...D("body"),children:[g&&a.jsx("div",{...D("title"),"data-with-close-button":j||void 0,children:a.jsx("span",{id:$,...D("label"),children:g})}),y&&a.jsx("div",{id:B,...D("message"),"data-variant":R,children:y})]}),j&&a.jsx(Rs,{...D("closeButton"),onClick:C,variant:"transparent",size:16,iconSize:16,"aria-label":T,unstyled:u})]})})});Go.classes=wD;Go.displayName="@mantine/core/Alert";var jD={root:"m_b6d8b162"};function t6(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const n6={inherit:!1},r6=(e,{variant:t,lineClamp:n,gradient:r,size:o,color:s})=>({root:{"--text-fz":Wn(o),"--text-lh":X2(o),"--text-gradient":t==="gradient"?Ax(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":s?Kt(s,e):void 0}}),be=ar((e,t)=>{const n=oe("Text",n6,e),{lineClamp:r,truncate:o,inline:s,inherit:c,gradient:u,span:f,__staticSelector:h,vars:m,className:g,style:y,classNames:x,styles:S,unstyled:j,variant:C,mod:T,size:R,attributes:E,..._}=n,k=$e({name:["Text",h],props:n,classes:jD,className:g,style:y,classNames:x,styles:S,unstyled:j,attributes:E,vars:m,varsResolver:r6});return a.jsx(le,{...k("root",{focusable:!0}),ref:t,component:f?"span":"p",variant:C,mod:[{"data-truncate":t6(o),"data-line-clamp":typeof r=="number","data-inline":s,"data-inherit":c},T],size:R,..._})});be.classes=jD;be.displayName="@mantine/core/Text";var CD={root:"m_849cf0da"};const i6={underline:"hover"},Et=ar((e,t)=>{const{underline:n,className:r,unstyled:o,mod:s,...c}=oe("Anchor",i6,e);return a.jsx(be,{component:"a",ref:t,className:Bt({[CD.root]:!o},r),...c,mod:[{underline:n},s],__staticSelector:"Anchor",unstyled:o})});Et.classes=CD;Et.displayName="@mantine/core/Anchor";const[o6,uu]=Ar("AppShell was not found in tree");var _s={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const e0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:u,withBorder:f,zIndex:h,mod:m,...g}=oe("AppShellAside",null,e),y=uu();return y.disabled?null:a.jsx(le,{component:"aside",ref:t,mod:[{"with-border":f??y.withBorder},m],...y.getStyles("aside",{className:Bt({[yl.classNames.zeroRight]:y.offsetScrollbars},r),classNames:n,styles:s,style:o}),...g,__vars:{"--app-shell-aside-z-index":`calc(${h??y.zIndex} + 1)`}})});e0.classes=_s;e0.displayName="@mantine/core/AppShellAside";const t0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:u,withBorder:f,zIndex:h,mod:m,...g}=oe("AppShellFooter",null,e),y=uu();return y.disabled?null:a.jsx(le,{component:"footer",ref:t,mod:[{"with-border":f??y.withBorder},m],...y.getStyles("footer",{className:Bt({[yl.classNames.zeroRight]:y.offsetScrollbars},r),classNames:n,styles:s,style:o}),...g,__vars:{"--app-shell-footer-z-index":(h??y.zIndex)?.toString()}})});t0.classes=_s;t0.displayName="@mantine/core/AppShellFooter";const n0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:u,withBorder:f,zIndex:h,mod:m,...g}=oe("AppShellHeader",null,e),y=uu();return y.disabled?null:a.jsx(le,{component:"header",ref:t,mod:[{"with-border":f??y.withBorder},m],...y.getStyles("header",{className:Bt({[yl.classNames.zeroRight]:y.offsetScrollbars},r),classNames:n,styles:s,style:o}),...g,__vars:{"--app-shell-header-z-index":(h??y.zIndex)?.toString()}})});n0.classes=_s;n0.displayName="@mantine/core/AppShellHeader";const r0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...u}=oe("AppShellMain",null,e),f=uu();return a.jsx(le,{component:"main",ref:t,...f.getStyles("main",{className:r,style:o,classNames:n,styles:s}),...u})});r0.classes=_s;r0.displayName="@mantine/core/AppShellMain";function rf(e){return typeof e=="object"?e.base:e}function of(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 af(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function a6({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:o,mode:s}){const c=r?.width,u="translateX(var(--app-shell-aside-width))",f="translateX(calc(var(--app-shell-aside-width) * -1))";if(r?.breakpoint&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},s==="fixed"?(n[r?.breakpoint]["--app-shell-aside-width"]="100%",n[r?.breakpoint]["--app-shell-aside-offset"]="0px"):(n[r?.breakpoint]["--app-shell-aside-width"]="0px",n[r?.breakpoint]["--app-shell-aside-offset"]="0px")),of(c)){const h=ce(rf(c));e["--app-shell-aside-width"]=h,e["--app-shell-aside-offset"]=h}if(af(c)&&(typeof c.base<"u"&&(e["--app-shell-aside-width"]=ce(c.base),e["--app-shell-aside-offset"]=ce(c.base)),un(c).forEach(h=>{h!=="base"&&(t[h]=t[h]||{},t[h]["--app-shell-aside-width"]=ce(c[h]),t[h]["--app-shell-aside-offset"]=ce(c[h]))})),r?.breakpoint&&s==="static"&&(t[r.breakpoint]=t[r.breakpoint]||{},t[r.breakpoint]["--app-shell-aside-position"]="sticky",t[r.breakpoint]["--app-shell-aside-grid-row"]="2",t[r.breakpoint]["--app-shell-aside-grid-column"]="3",t[r.breakpoint]["--app-shell-main-column-end"]="3"),r?.collapsed?.desktop){const h=r.breakpoint;t[h]=t[h]||{},t[h]["--app-shell-aside-transform"]=u,t[h]["--app-shell-aside-transform-rtl"]=f,s==="fixed"?t[h]["--app-shell-aside-offset"]="0px !important":(t[h]["--app-shell-aside-width"]="0px",t[h]["--app-shell-aside-display"]="none",t[h]["--app-shell-main-column-end"]="-1"),t[h]["--app-shell-aside-scroll-locked-visibility"]="hidden"}if(r?.collapsed?.mobile){const h=Rb(r.breakpoint,o.breakpoints)-.1;n[h]=n[h]||{},s==="fixed"?(n[h]["--app-shell-aside-width"]="100%",n[h]["--app-shell-aside-offset"]="0px"):n[h]["--app-shell-aside-width"]="0px",n[h]["--app-shell-aside-transform"]=u,n[h]["--app-shell-aside-transform-rtl"]=f,n[h]["--app-shell-aside-scroll-locked-visibility"]="hidden"}}function s6({baseStyles:e,minMediaStyles:t,footer:n,mode:r}){const o=n?.height,s="translateY(var(--app-shell-footer-height))",c=r==="static"?!0:n?.offset??!0;if(r==="static"&&n&&(e["--app-shell-footer-position"]="sticky",e["--app-shell-footer-grid-column"]="1 / -1",e["--app-shell-footer-grid-row"]="3"),of(o)){const u=ce(rf(o));e["--app-shell-footer-height"]=u,c&&(e["--app-shell-footer-offset"]=u)}af(o)&&(typeof o.base<"u"&&(e["--app-shell-footer-height"]=ce(o.base),c&&(e["--app-shell-footer-offset"]=ce(o.base))),un(o).forEach(u=>{u!=="base"&&(t[u]=t[u]||{},t[u]["--app-shell-footer-height"]=ce(o[u]),c&&(t[u]["--app-shell-footer-offset"]=ce(o[u])))})),n?.collapsed&&(e["--app-shell-footer-transform"]=s,r==="fixed"&&(e["--app-shell-footer-offset"]="0px !important"))}function l6({baseStyles:e,minMediaStyles:t,header:n,mode:r}){const o=n?.height,s="translateY(calc(var(--app-shell-header-height) * -1))",c=r==="static"?!0:n?.offset??!0;if(r==="static"&&n&&(e["--app-shell-header-position"]="sticky",e["--app-shell-header-grid-column"]="1 / -1",e["--app-shell-header-grid-row"]="1"),of(o)){const u=ce(rf(o));e["--app-shell-header-height"]=u,c&&(e["--app-shell-header-offset"]=u)}af(o)&&(typeof o.base<"u"&&(e["--app-shell-header-height"]=ce(o.base),c&&(e["--app-shell-header-offset"]=ce(o.base))),un(o).forEach(u=>{u!=="base"&&(t[u]=t[u]||{},t[u]["--app-shell-header-height"]=ce(o[u]),c&&(t[u]["--app-shell-header-offset"]=ce(o[u])))})),n?.collapsed&&(e["--app-shell-header-transform"]=s,r==="fixed"&&(e["--app-shell-header-offset"]="0px !important"))}function c6({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:o,mode:s}){const c=r?.width,u="translateX(calc(var(--app-shell-navbar-width) * -1))",f="translateX(var(--app-shell-navbar-width))";if(r?.breakpoint&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},n[r?.breakpoint]["--app-shell-navbar-offset"]="0px",n[r?.breakpoint]["--app-shell-navbar-width"]="100%",s==="static"&&(n[r?.breakpoint]["--app-shell-navbar-grid-width"]="0px")),of(c)){const h=ce(rf(c));e["--app-shell-navbar-width"]=h,e["--app-shell-navbar-offset"]=h,s==="static"&&(e["--app-shell-navbar-grid-width"]=h)}if(af(c)&&(typeof c.base<"u"&&(e["--app-shell-navbar-width"]=ce(c.base),e["--app-shell-navbar-offset"]=ce(c.base),s==="static"&&(e["--app-shell-navbar-grid-width"]=ce(c.base))),un(c).forEach(h=>{h!=="base"&&(t[h]=t[h]||{},t[h]["--app-shell-navbar-width"]=ce(c[h]),t[h]["--app-shell-navbar-offset"]=ce(c[h]),s==="static"&&(t[h]["--app-shell-navbar-grid-width"]=ce(c[h])))})),r?.breakpoint&&s==="static"&&(t[r.breakpoint]=t[r.breakpoint]||{},t[r.breakpoint]["--app-shell-navbar-position"]="sticky",t[r.breakpoint]["--app-shell-navbar-grid-row"]="2",t[r.breakpoint]["--app-shell-navbar-grid-column"]="1",t[r.breakpoint]["--app-shell-main-column-start"]="2"),r?.collapsed?.desktop){const h=r.breakpoint;t[h]=t[h]||{},t[h]["--app-shell-navbar-transform"]=u,t[h]["--app-shell-navbar-transform-rtl"]=f,s==="fixed"?t[h]["--app-shell-navbar-offset"]="0px !important":(t[h]["--app-shell-navbar-width"]="0px",t[h]["--app-shell-navbar-display"]="none",t[h]["--app-shell-main-column-start"]="1")}if(r?.collapsed?.mobile){const h=Rb(r.breakpoint,o.breakpoints)-.1;n[h]=n[h]||{},n[h]["--app-shell-navbar-width"]="100%",n[h]["--app-shell-navbar-offset"]="0px",s==="static"&&(n[h]["--app-shell-navbar-grid-width"]="0px"),n[h]["--app-shell-navbar-transform"]=u,n[h]["--app-shell-navbar-transform-rtl"]=f}}function Qy(e){return Number(e)===0?"0px":Gn(e)}function u6({padding:e,baseStyles:t,minMediaStyles:n}){of(e)&&(t["--app-shell-padding"]=Qy(rf(e))),af(e)&&(e.base&&(t["--app-shell-padding"]=Qy(e.base)),un(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=Qy(e[r]))}))}function d6({navbar:e,header:t,footer:n,aside:r,padding:o,theme:s,mode:c}){const u={},f={},h={};c==="static"&&(h["--app-shell-main-grid-column"]="1 / -1",h["--app-shell-main-grid-row"]="2"),c6({baseStyles:h,minMediaStyles:u,maxMediaStyles:f,navbar:e,theme:s,mode:c}),a6({baseStyles:h,minMediaStyles:u,maxMediaStyles:f,aside:r,theme:s,mode:c}),l6({baseStyles:h,minMediaStyles:u,header:t,mode:c}),s6({baseStyles:h,minMediaStyles:u,footer:n,mode:c}),u6({baseStyles:h,minMediaStyles:u,padding:o});const m=_d(un(u),s.breakpoints).map(x=>({query:`(min-width: ${_p(x.px)})`,styles:u[x.value]})),g=_d(un(f),s.breakpoints).map(x=>({query:`(max-width: ${_p(x.px)})`,styles:f[x.value]})),y=[...m,...g];return{baseStyles:h,media:y}}function f6({navbar:e,header:t,aside:n,footer:r,padding:o,mode:s,selector:c}){const u=_n(),f=Ta(),{media:h,baseStyles:m}=d6({navbar:e,header:t,footer:r,aside:n,padding:o,theme:u,mode:s});return a.jsx(Ll,{media:h,styles:m,selector:c||f.cssVariablesSelector})}const i0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:u,withBorder:f,zIndex:h,mod:m,...g}=oe("AppShellNavbar",null,e),y=uu();return y.disabled?null:a.jsx(le,{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(${h??y.zIndex} + 1)`}})});i0.classes=_s;i0.displayName="@mantine/core/AppShellNavbar";const o0=ar((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,grow:u,mod:f,...h}=oe("AppShellSection",null,e),m=uu();return a.jsx(le,{ref:t,mod:[{grow:u},f],...m.getStyles("section",{className:r,style:o,classNames:n,styles:s}),...h})});o0.classes=_s;o0.displayName="@mantine/core/AppShellSection";function h6({transitionDuration:e,disabled:t}){const[n,r]=v.useState(!0),o=v.useRef(-1),s=v.useRef(-1);return i_("resize",()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),200)}),kl(()=>{r(!0),clearTimeout(s.current),s.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),e||0)},[t,e]),n}const p6={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:zr("app"),mode:"fixed"},m6=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),Rr=ge((e,t)=>{const n=oe("AppShell",p6,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,navbar:h,withBorder:m,padding:g,transitionDuration:y,transitionTimingFunction:x,header:S,zIndex:j,layout:C,disabled:T,aside:R,footer:E,offsetScrollbars:_=!0,mode:k,mod:I,attributes:D,id:P,...$}=n,B=$e({name:"AppShell",classes:_s,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:D,vars:f,varsResolver:m6}),W=h6({disabled:T,transitionDuration:y}),Y=ur(P);return a.jsxs(o6,{value:{getStyles:B,withBorder:m,zIndex:j,disabled:T,offsetScrollbars:_,mode:k},children:[a.jsx(f6,{navbar:h,header:S,aside:R,footer:E,padding:g,mode:k,selector:k==="static"?`#${Y}`:void 0}),a.jsx(le,{ref:t,...B("root"),mod:[{resizing:W,layout:C,disabled:T,mode:k},I],id:Y,...$})]})});Rr.classes=_s;Rr.displayName="@mantine/core/AppShell";Rr.Navbar=i0;Rr.Header=n0;Rr.Main=r0;Rr.Aside=e0;Rr.Footer=t0;Rr.Section=o0;function ED(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=>ED(t))}:e}function TD(e){return e?e.map(t=>ED(t)):[]}function RD(e){return e.reduce((t,n)=>"group"in n?{...t,...RD(n.items)}:(t[n.value]=n,t),{})}var Lr={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 g6={error:null},v6=(e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":ot(t,"combobox-chevron-size"),"--combobox-chevron-color":n?Kt(n,e):void 0}}),wm=ge((e,t)=>{const n=oe("ComboboxChevron",g6,e),{size:r,error:o,style:s,className:c,classNames:u,styles:f,unstyled:h,vars:m,mod:g,...y}=n,x=$e({name:"ComboboxChevron",classes:Lr,props:n,style:s,className:c,classNames:u,styles:f,unstyled:h,vars:m,varsResolver:v6,rootSelector:"chevron"});return a.jsx(le,{component:"svg",...y,...x("chevron"),size:r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:o},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"})})});wm.classes=Lr;wm.displayName="@mantine/core/ComboboxChevron";const[y6,Ui]=Ar("Combobox component was not found in tree"),_D=v.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...o},s)=>a.jsx(fn.ClearButton,{ref:s,tabIndex:-1,"aria-hidden":!0,...o,onMouseDown:c=>{c.preventDefault(),t?.(c)},onClick:c=>{r(),n?.(c)}}));_D.displayName="@mantine/core/ComboboxClearButton";const a0=ge((e,t)=>{const{classNames:n,styles:r,className:o,style:s,hidden:c,...u}=oe("ComboboxDropdown",null,e),f=Ui();return a.jsx(Zr.Dropdown,{...u,ref:t,role:"presentation","data-hidden":c||void 0,...f.getStyles("dropdown",{className:o,style:s,classNames:n,styles:r})})});a0.classes=Lr;a0.displayName="@mantine/core/ComboboxDropdown";const x6={refProp:"ref"},DD=ge((e,t)=>{const{children:n,refProp:r}=oe("ComboboxDropdownTarget",x6,e);if(Ui(),!sm(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(Zr.Target,{ref:t,refProp:r,children:n})});DD.displayName="@mantine/core/ComboboxDropdownTarget";const s0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...u}=oe("ComboboxEmpty",null,e),f=Ui();return a.jsx(le,{ref:t,...f.getStyles("empty",{className:r,classNames:n,styles:s,style:o}),...u})});s0.classes=Lr;s0.displayName="@mantine/core/ComboboxEmpty";function l0({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:o,autoComplete:s}){const c=Ui(),[u,f]=v.useState(null),h=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&&u||void 0,autoComplete:s,"data-expanded":c.store.dropdownOpened||void 0,"data-mantine-stop-propagation":c.store.dropdownOpened||void 0}:{},onKeyDown:h}}const b6={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},AD=ge((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:s,withExpandedAttribute:c,targetType:u,autoComplete:f,...h}=oe("ComboboxEventsTarget",b6,e),m=Nl(n);if(!m)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 g=Ui(),y=l0({targetType:u,withAriaAttributes:s,withKeyboardNavigation:o,withExpandedAttribute:c,onKeyDown:m.props.onKeyDown,autoComplete:f});return v.cloneElement(m,{...y,...h,[r]:Vn(t,g.store.targetRef,lm(m))})});AD.displayName="@mantine/core/ComboboxEventsTarget";const c0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...u}=oe("ComboboxFooter",null,e),f=Ui();return a.jsx(le,{ref:t,...f.getStyles("footer",{className:r,classNames:n,style:o,styles:s}),...u,onMouseDown:h=>{h.preventDefault()}})});c0.classes=Lr;c0.displayName="@mantine/core/ComboboxFooter";const u0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,children:u,label:f,id:h,...m}=oe("ComboboxGroup",null,e),g=Ui(),y=ur(h);return a.jsxs(le,{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}),u]})});u0.classes=Lr;u0.displayName="@mantine/core/ComboboxGroup";const d0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...u}=oe("ComboboxHeader",null,e),f=Ui();return a.jsx(le,{ref:t,...f.getStyles("header",{className:r,classNames:n,style:o,styles:s}),...u,onMouseDown:h=>{h.preventDefault()}})});d0.classes=Lr;d0.displayName="@mantine/core/ComboboxHeader";function kD({value:e,valuesDivider:t=",",...n}){return a.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}kD.displayName="@mantine/core/ComboboxHiddenInput";const f0=ge((e,t)=>{const n=oe("ComboboxOption",null,e),{classNames:r,className:o,style:s,styles:c,vars:u,onClick:f,id:h,active:m,onMouseDown:g,onMouseOver:y,disabled:x,selected:S,mod:j,...C}=n,T=Ui(),R=v.useId(),E=h||R;return a.jsx(le,{...T.getStyles("option",{className:o,classNames:r,styles:c,style:s}),...C,ref:t,id:E,mod:["combobox-option",{"combobox-active":m,"combobox-disabled":x,"combobox-selected":S},j],role:"option",onClick:_=>{x?_.preventDefault():(T.onOptionSubmit?.(n.value,n),f?.(_))},onMouseDown:_=>{_.preventDefault(),g?.(_)},onMouseOver:_=>{T.resetSelectionOnOptionHover&&T.store.resetSelectedOption(),y?.(_)}})});f0.classes=Lr;f0.displayName="@mantine/core/ComboboxOption";const h0=ge((e,t)=>{const n=oe("ComboboxOptions",null,e),{classNames:r,className:o,style:s,styles:c,id:u,onMouseDown:f,labelledBy:h,...m}=n,g=Ui(),y=ur(u);return v.useEffect(()=>{g.store.setListId(y)},[y]),a.jsx(le,{ref:t,...g.getStyles("options",{className:o,style:s,classNames:r,styles:c}),...m,id:y,role:"listbox","aria-labelledby":h,onMouseDown:x=>{x.preventDefault(),f?.(x)}})});h0.classes=Lr;h0.displayName="@mantine/core/ComboboxOptions";const S6={withAriaAttributes:!0,withKeyboardNavigation:!0},p0=ge((e,t)=>{const n=oe("ComboboxSearch",S6,e),{classNames:r,styles:o,unstyled:s,vars:c,withAriaAttributes:u,onKeyDown:f,withKeyboardNavigation:h,size:m,...g}=n,y=Ui(),x=y.getStyles("search"),S=l0({targetType:"input",withAriaAttributes:u,withKeyboardNavigation:h,withExpandedAttribute:!1,onKeyDown:f,autoComplete:"off"});return a.jsx(fn,{ref:Vn(t,y.store.searchRef),classNames:[{input:x.className},r],styles:[{input:x.style},o],size:m||y.size,...S,...g,__staticSelector:"Combobox"})});p0.classes=Lr;p0.displayName="@mantine/core/ComboboxSearch";const w6={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},PD=ge((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:s,withExpandedAttribute:c,targetType:u,autoComplete:f,...h}=oe("ComboboxTarget",w6,e),m=Nl(n);if(!m)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 g=Ui(),y=l0({targetType:u,withAriaAttributes:s,withKeyboardNavigation:o,withExpandedAttribute:c,onKeyDown:m.props.onKeyDown,autoComplete:f}),x=v.cloneElement(m,{...y,...h});return a.jsx(Zr.Target,{ref:Vn(t,g.store.targetRef),children:x})});PD.displayName="@mantine/core/ComboboxTarget";function j6(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 C6(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 E6(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function Il({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:o,loop:s=!0,scrollBehavior:c="instant"}={}){const[u,f]=ir({value:t,defaultValue:e,finalValue:!1,onChange:n}),h=v.useRef(null),m=v.useRef(-1),g=v.useRef(null),y=v.useRef(null),x=v.useRef(-1),S=v.useRef(-1),j=v.useRef(-1),C=v.useCallback((M="unknown")=>{u||(f(!0),o?.(M))},[f,o,u]),T=v.useCallback((M="unknown")=>{u&&(f(!1),r?.(M))},[f,r,u]),R=v.useCallback((M="unknown")=>{u?T(M):C(M)},[T,C,u]),E=v.useCallback(()=>{const M=ls(y.current),L=vp(`#${h.current} [data-combobox-selected]`,M);L?.removeAttribute("data-combobox-selected"),L?.removeAttribute("aria-selected")},[]),_=v.useCallback(M=>{const L=ls(y.current),z=vp(`#${h.current}`,L),V=z?ds("[data-combobox-option]",z):null;if(!V)return null;const K=M>=V.length?0:M<0?V.length-1:M;return m.current=K,V?.[K]&&!V[K].hasAttribute("data-combobox-disabled")?(E(),V[K].setAttribute("data-combobox-selected","true"),V[K].setAttribute("aria-selected","true"),V[K].scrollIntoView({block:"nearest",behavior:c}),V[K].id):null},[c,E]),k=v.useCallback(()=>{const M=ls(y.current),L=vp(`#${h.current} [data-combobox-active]`,M);if(L){const V=ds(`#${h.current} [data-combobox-option]`,M).findIndex(K=>K===L);return _(V)}return _(0)},[_]),I=v.useCallback(()=>{const M=ls(y.current),L=ds(`#${h.current} [data-combobox-option]`,M);return _(C6(m.current,L,s))},[_,s]),D=v.useCallback(()=>{const M=ls(y.current),L=ds(`#${h.current} [data-combobox-option]`,M);return _(j6(m.current,L,s))},[_,s]),P=v.useCallback(()=>{const M=ls(y.current),L=ds(`#${h.current} [data-combobox-option]`,M);return _(E6(L))},[_]),$=v.useCallback((M="selected",L)=>{j.current=window.setTimeout(()=>{const z=ls(y.current),V=ds(`#${h.current} [data-combobox-option]`,z),K=V.findIndex(O=>O.hasAttribute(`data-combobox-${M}`));m.current=K,L?.scrollIntoView&&V[K]?.scrollIntoView({block:"nearest",behavior:c})},0)},[]),B=v.useCallback(()=>{m.current=-1,E()},[E]),W=v.useCallback(()=>{const M=ls(y.current);ds(`#${h.current} [data-combobox-option]`,M)?.[m.current]?.click()},[]),Y=v.useCallback(M=>{h.current=M},[]),Z=v.useCallback(()=>{x.current=window.setTimeout(()=>g.current?.focus(),0)},[]),U=v.useCallback(()=>{S.current=window.setTimeout(()=>y.current?.focus(),0)},[]),G=v.useCallback(()=>m.current,[]);return v.useEffect(()=>()=>{window.clearTimeout(x.current),window.clearTimeout(S.current),window.clearTimeout(j.current)},[]),{dropdownOpened:u,openDropdown:C,closeDropdown:T,toggleDropdown:R,selectedOptionIndex:m.current,getSelectedOptionIndex:G,selectOption:_,selectFirstOption:P,selectActiveOption:k,selectNextOption:I,selectPreviousOption:D,resetSelectedOption:B,updateSelectedOptionIndex:$,listId:h.current,setListId:Y,clickSelectedOption:W,searchRef:g,focusSearchInput:Z,targetRef:y,focusTarget:U}}const T6={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0},size:"sm"},R6=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":Wn(t),"--combobox-option-padding":ot(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:ce(n),"--combobox-option-fz":Wn(t),"--combobox-option-padding":ot(t,"combobox-option-padding")}});function Ye(e){const t=oe("Combobox",T6,e),{classNames:n,styles:r,unstyled:o,children:s,store:c,vars:u,onOptionSubmit:f,onClose:h,size:m,dropdownPadding:g,resetSelectionOnOptionHover:y,__staticSelector:x,readOnly:S,attributes:j,...C}=t,T=Il(),R=c||T,E=$e({name:x||"Combobox",classes:Lr,props:t,classNames:n,styles:r,unstyled:o,attributes:j,vars:u,varsResolver:R6}),_=()=>{h?.(),R.closeDropdown()};return a.jsx(y6,{value:{getStyles:E,store:R,onOptionSubmit:f,size:m,resetSelectionOnOptionHover:y,readOnly:S},children:a.jsx(Zr,{opened:R.dropdownOpened,preventPositionChangeWhenVisible:!1,...C,onChange:k=>!k&&_(),withRoles:!1,unstyled:o,children:s})})}const _6=e=>e;Ye.extend=_6;Ye.classes=Lr;Ye.displayName="@mantine/core/Combobox";Ye.Target=PD;Ye.Dropdown=a0;Ye.Options=h0;Ye.Option=f0;Ye.Search=p0;Ye.Empty=s0;Ye.Chevron=wm;Ye.Footer=c0;Ye.Header=d0;Ye.EventsTarget=AD;Ye.DropdownTarget=DD;Ye.Group=u0;Ye.ClearButton=_D;Ye.HiddenInput=kD;var ND={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const OD=ND,jm=v.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:o,unstyled:s,children:c,label:u,description:f,id:h,disabled:m,error:g,size:y,labelPosition:x="left",bodyElement:S="div",labelElement:j="label",variant:C,style:T,vars:R,mod:E,attributes:_,...k},I)=>{const D=$e({name:e,props:t,className:n,style:T,classes:ND,classNames:r,styles:o,unstyled:s,attributes:_});return a.jsx(le,{...D("root"),ref:I,__vars:{"--label-fz":Wn(y),"--label-lh":ot(y,"label-lh")},mod:[{"label-position":x},E],variant:C,size:y,...k,children:a.jsxs(le,{component:S,htmlFor:S==="label"?h:void 0,...D("body"),children:[c,a.jsxs("div",{...D("labelWrapper"),"data-disabled":m||void 0,children:[u&&a.jsx(le,{component:j,htmlFor:j==="label"?h:void 0,...D("label"),"data-disabled":m||void 0,children:u}),f&&a.jsx(fn.Description,{size:y,__inheritStyles:!1,...D("description"),children:f}),g&&typeof g!="boolean"&&a.jsx(fn.Error,{size:y,__inheritStyles:!1,...D("error"),children:g})]})]})})});jm.displayName="@mantine/core/InlineInput";var MD={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const LD=v.createContext(null),D6=LD.Provider,ID=()=>v.useContext(LD),[A6,k6]=Ho();var zD={card:"m_26775b0a"};const P6={withBorder:!0},N6=(e,{radius:t})=>({card:{"--card-radius":Vt(t)}}),m0=ge((e,t)=>{const n=oe("CheckboxCard",P6,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,checked:h,mod:m,withBorder:g,value:y,onClick:x,defaultChecked:S,onChange:j,attributes:C,...T}=n,R=$e({name:"CheckboxCard",classes:zD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:C,vars:f,varsResolver:N6,rootSelector:"card"}),E=ID(),_=typeof h=="boolean"?h:E?E.value.includes(y||""):void 0,[k,I]=ir({value:_,defaultValue:S,finalValue:!1,onChange:j});return a.jsx(A6,{value:{checked:k},children:a.jsx(Pn,{ref:t,mod:[{"with-border":g,checked:k},m],...R("card"),...T,role:"checkbox","aria-checked":k,onClick:D=>{x?.(D),E?.onChange(y||""),I(!k)}})})});m0.displayName="@mantine/core/CheckboxCard";m0.classes=zD;function g0({children:e,role:t}){const n=cu();return n?a.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):a.jsx(a.Fragment,{children:e})}const v0=ge((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:s,wrapperProps:c,children:u,readOnly:f,disabled:h,...m}=oe("CheckboxGroup",null,e),[g,y]=ir({value:n,defaultValue:r,finalValue:[],onChange:o}),x=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(D6,{value:{value:g,onChange:x,size:s,disabled:h},children:a.jsx(fn.Wrapper,{size:s,ref:t,...c,...m,labelElement:"div",__staticSelector:"CheckboxGroup",children:a.jsx(g0,{role:"group",children:u})})})});v0.classes=fn.Wrapper.classes;v0.displayName="@mantine/core/CheckboxGroup";function sf({size:e,style:t,...n}){const r=e!==void 0?{width:ce(e),height:ce(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 $D({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(sf,{...t})}var UD={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const O6={icon:$D,variant:"filled"},M6=(e,{radius:t,color:n,size:r,iconColor:o,variant:s,autoContrast:c})=>{const u=Xr({color:n||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{indicator:{"--checkbox-size":ot(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Vt(t),"--checkbox-color":s==="outline"?f:Kt(n,e),"--checkbox-icon-color":o?Kt(o,e):Ml(c,e)?Ra({color:n,theme:e,autoContrast:c}):void 0}}},y0=ge((e,t)=>{const n=oe("CheckboxIndicator",O6,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,icon:h,indeterminate:m,radius:g,color:y,iconColor:x,autoContrast:S,checked:j,mod:C,variant:T,disabled:R,attributes:E,..._}=n,k=$e({name:"CheckboxIndicator",classes:UD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:E,vars:f,varsResolver:M6,rootSelector:"indicator"}),I=k6(),D=typeof j=="boolean"||typeof m=="boolean"?j||m:I?.checked||!1;return a.jsx(le,{ref:t,...k("indicator",{variant:T}),variant:T,mod:[{checked:D,disabled:R},C],..._,children:a.jsx(h,{indeterminate:m,...k("icon")})})});y0.displayName="@mantine/core/CheckboxIndicator";y0.classes=UD;const L6={labelPosition:"right",icon:$D,variant:"filled"},I6=(e,{radius:t,color:n,size:r,iconColor:o,variant:s,autoContrast:c})=>{const u=Xr({color:n||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{root:{"--checkbox-size":ot(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Vt(t),"--checkbox-color":s==="outline"?f:Kt(n,e),"--checkbox-icon-color":o?Kt(o,e):Ml(c,e)?Ra({color:n,theme:e,autoContrast:c}):void 0}}},cn=ge((e,t)=>{const n=oe("Checkbox",L6,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,color:h,label:m,id:g,size:y,radius:x,wrapperProps:S,checked:j,labelPosition:C,description:T,error:R,disabled:E,variant:_,indeterminate:k,icon:I,rootRef:D,iconColor:P,onChange:$,autoContrast:B,mod:W,attributes:Y,...Z}=n,U=ID(),G=y||U?.size,M=$e({name:"Checkbox",props:n,classes:MD,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:Y,vars:f,varsResolver:I6}),{styleProps:L,rest:z}=_a(Z),V=ur(g),K={checked:U?.value.includes(z.value)??j,onChange:se=>{U?.onChange(se),$?.(se)},disabled:U?.disabled??E},O=v.useRef(null),F=t||O;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(jm,{...M("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:V,size:G,labelPosition:C,label:m,description:T,error:R,disabled:K.disabled,classNames:r,styles:c,unstyled:u,"data-checked":K.checked||j||void 0,variant:_,ref:D,mod:W,...L,...S,children:a.jsxs(le,{...M("inner"),mod:{"data-label-position":C},children:[a.jsx(le,{component:"input",id:V,ref:F,mod:{error:!!R},...M("input",{focusable:!0,variant:_}),...z,...K,type:"checkbox"}),a.jsx(I,{indeterminate:k,...M("icon")})]})})});cn.classes={...MD,...OD};cn.displayName="@mantine/core/Checkbox";cn.Group=v0;cn.Indicator=y0;cn.Card=m0;function Xc(e){return"group"in e}function BD({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;Xc(c)&&o.push({group:c.group,items:BD({options:c.items,search:t,limit:n-o.length})}),Xc(c)||c.label.toLowerCase().includes(r)&&o.push(c)}return o}function z6(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 VD(e,t=new Set){if(Array.isArray(e))for(const n of e)if(Xc(n))VD(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 $6(e,t){return Array.isArray(e)?e.includes(t):e===t}function FD({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:o,unstyled:s,renderOption:c}){if(!Xc(e)){const f=$6(r,e.value),h=t&&(f?a.jsx(sf,{className:Lr.optionsDropdownCheckIcon}):n?a.jsx("div",{className:Lr.optionsDropdownCheckPlaceholder}):null),m=a.jsxs(a.Fragment,{children:[o==="left"&&h,a.jsx("span",{children:e.label}),o==="right"&&h]});return a.jsx(Ye.Option,{value:e.value,disabled:e.disabled,className:Bt({[Lr.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 u=e.items.map(f=>a.jsx(FD,{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:u})}function U6({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:o,limit:s,maxDropdownHeight:c,withScrollArea:u=!0,filterOptions:f=!0,withCheckIcon:h=!1,withAlignedLabels:m=!1,value:g,checkIconPosition:y,nothingFoundMessage:x,unstyled:S,labelId:j,renderOption:C,scrollAreaProps:T,"aria-label":R}){VD(e);const _=typeof o=="string"?(r||BD)({options:e,search:f?o:"",limit:s??1/0}):e,k=z6(_),I=_.map(D=>a.jsx(FD,{data:D,withCheckIcon:h,withAlignedLabels:m,value:g,checkIconPosition:y,unstyled:S,renderOption:C},Xc(D)?D.group:D.value));return a.jsx(Ye.Dropdown,{hidden:t||n&&k,"data-composed":!0,children:a.jsxs(Ye.Options,{labelledBy:j,"aria-label":R,children:[u?a.jsx(Jr.Autosize,{mah:c??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...T,children:I}):I,k&&x&&a.jsx(Ye.Empty,{children:x})]})})}var Cm={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const HD=v.createContext(null),B6=HD.Provider;function V6(){return{withinGroup:!!v.useContext(HD)}}const F6=(e,{spacing:t})=>({group:{"--ag-spacing":Gn(t)}}),x0=ge((e,t)=>{const n=oe("AvatarGroup",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,spacing:h,attributes:m,...g}=n,y=$e({name:"AvatarGroup",classes:Cm,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:m,vars:f,varsResolver:F6,rootSelector:"group"});return a.jsx(B6,{value:!0,children:a.jsx(le,{ref:t,...y("group"),...g})})});x0.classes=Cm;x0.displayName="@mantine/core/AvatarGroup";function H6(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 q6(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 G6=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function W6(e,t=G6){const n=q6(e),r=Math.abs(n)%t.length;return t[r]}function Q6(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 Y6=(e,{size:t,radius:n,variant:r,gradient:o,color:s,autoContrast:c,name:u,allowedInitialsColors:f})=>{const h=s==="initials"&&typeof u=="string"?W6(u,f):s,m=e.variantColorResolver({color:h||"gray",theme:e,gradient:o,variant:r||"light",autoContrast:c});return{root:{"--avatar-size":ot(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:Vt(n),"--avatar-bg":h||r?m.background:void 0,"--avatar-color":h||r?m.color:void 0,"--avatar-bd":h||r?m.border:void 0}}},Jc=ar((e,t)=>{const n=oe("Avatar",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,src:h,alt:m,radius:g,color:y,gradient:x,imageProps:S,children:j,autoContrast:C,mod:T,name:R,allowedInitialsColors:E,attributes:_,...k}=n,I=V6(),[D,P]=v.useState(!h),$=$e({name:"Avatar",props:n,classes:Cm,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:_,vars:f,varsResolver:Y6});return v.useEffect(()=>P(!h),[h]),a.jsx(le,{...$("root"),mod:[{"within-group":I.withinGroup},T],ref:t,...k,children:D||!h?a.jsx("span",{...$("placeholder"),title:m,children:j||typeof R=="string"&&Q6(R)||a.jsx(H6,{})}):a.jsx("img",{...S,...$("image"),src:h,alt:m,onError:B=>{P(!0),S?.onError?.(B)}})})});Jc.classes=Cm;Jc.displayName="@mantine/core/Avatar";Jc.Group=x0;var qD={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const K6=(e,{radius:t,color:n,gradient:r,variant:o,size:s,autoContrast:c,circle:u})=>{const f=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:c});return{root:{"--badge-height":ot(s,"badge-height"),"--badge-padding-x":ot(s,"badge-padding-x"),"--badge-fz":ot(s,"badge-fz"),"--badge-radius":u||t===void 0?void 0:Vt(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}}},b0=ar((e,t)=>{const n=oe("Badge",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,radius:h,color:m,gradient:g,leftSection:y,rightSection:x,children:S,variant:j,fullWidth:C,autoContrast:T,circle:R,mod:E,attributes:_,...k}=n,I=$e({name:"Badge",props:n,classes:qD,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:_,vars:f,varsResolver:K6});return a.jsxs(le,{variant:j,mod:[{block:C,circle:R,"with-right-section":!!x,"with-left-section":!!y},E],...I("root",{variant:j}),ref:t,...k,children:[y&&a.jsx("span",{...I("section"),"data-position":"left",children:y}),a.jsx("span",{...I("label"),children:S}),x&&a.jsx("span",{...I("section"),"data-position":"right",children:x})]})});b0.classes=qD;b0.displayName="@mantine/core/Badge";var GD={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const X6={iconSize:48},J6=(e,{color:t,iconSize:n,radius:r})=>{const o=Xr({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),s=Xr({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":ki(s.value,.07),"--bq-bg-dark":ki(o.value,.06),"--bq-bd":Kt(t,e),"--bq-icon-size":ce(n),"--bq-radius":Vt(r)}}},S0=ge((e,t)=>{const n=oe("Blockquote",X6,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,children:h,icon:m,iconSize:g,cite:y,attributes:x,...S}=n,j=$e({name:"Blockquote",classes:GD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:x,vars:f,varsResolver:J6});return a.jsxs(le,{component:"blockquote",ref:t,...j("root"),...S,children:[m&&a.jsx("span",{...j("icon"),children:m}),h,y&&a.jsx("cite",{...j("cite"),children:y})]})});S0.classes=GD;S0.displayName="@mantine/core/Blockquote";var du={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const tT={orientation:"horizontal"},Z6=(e,{borderWidth:t})=>({group:{"--button-border-width":ce(t)}}),w0=ge((e,t)=>{const n=oe("ButtonGroup",tT,e),{className:r,style:o,classNames:s,styles:c,unstyled:u,orientation:f,vars:h,borderWidth:m,variant:g,mod:y,attributes:x,...S}=oe("ButtonGroup",tT,e),j=$e({name:"ButtonGroup",props:n,classes:du,className:r,style:o,classNames:s,styles:c,unstyled:u,attributes:x,vars:h,varsResolver:Z6,rootSelector:"group"});return a.jsx(le,{...j("group"),ref:t,variant:g,mod:[{"data-orientation":f},y],role:"group",...S})});w0.classes=du;w0.displayName="@mantine/core/ButtonGroup";const e7=(e,{radius:t,color:n,gradient:r,variant:o,autoContrast:s,size:c})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:s});return{groupSection:{"--section-height":ot(c,"section-height"),"--section-padding-x":ot(c,"section-padding-x"),"--section-fz":c?.includes("compact")?Wn(c.replace("compact-","")):Wn(c),"--section-radius":t===void 0?void 0:Vt(t),"--section-bg":n||o?u.background:void 0,"--section-color":u.color,"--section-bd":n||o?u.border:void 0}}},j0=ge((e,t)=>{const n=oe("ButtonGroupSection",null,e),{className:r,style:o,classNames:s,styles:c,unstyled:u,vars:f,variant:h,gradient:m,radius:g,autoContrast:y,attributes:x,...S}=n,j=$e({name:"ButtonGroupSection",props:n,classes:du,className:r,style:o,classNames:s,styles:c,unstyled:u,attributes:x,vars:f,varsResolver:e7,rootSelector:"groupSection"});return a.jsx(le,{...j("groupSection"),ref:t,variant:h,...S})});j0.classes=du;j0.displayName="@mantine/core/ButtonGroupSection";const t7={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${ce(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},n7=(e,{radius:t,color:n,gradient:r,variant:o,size:s,justify:c,autoContrast:u})=>{const f=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:u});return{root:{"--button-justify":c,"--button-height":ot(s,"button-height"),"--button-padding-x":ot(s,"button-padding-x"),"--button-fz":s?.includes("compact")?Wn(s.replace("compact-","")):Wn(s),"--button-radius":t===void 0?void 0:Vt(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}}},Oe=ar((e,t)=>{const n=oe("Button",null,e),{style:r,vars:o,className:s,color:c,disabled:u,children:f,leftSection:h,rightSection:m,fullWidth:g,variant:y,radius:x,loading:S,loaderProps:j,gradient:C,classNames:T,styles:R,unstyled:E,"data-disabled":_,autoContrast:k,mod:I,attributes:D,...P}=n,$=$e({name:"Button",props:n,classes:du,className:s,style:r,classNames:T,styles:R,unstyled:E,attributes:D,vars:o,varsResolver:n7}),B=!!h,W=!!m;return a.jsxs(Pn,{ref:t,...$("root",{active:!u&&!S&&!_}),unstyled:E,variant:y,disabled:u||S,mod:[{disabled:u||_,loading:S,block:g,"with-left-section":B,"with-right-section":W},I],...P,children:[typeof S=="boolean"&&a.jsx(lo,{mounted:S,transition:t7,duration:150,children:Y=>a.jsx(le,{component:"span",...$("loader",{style:Y}),"aria-hidden":!0,children:a.jsx(_r,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...j})})}),a.jsxs("span",{...$("inner"),children:[h&&a.jsx(le,{component:"span",...$("section"),mod:{position:"left"},children:h}),a.jsx(le,{component:"span",mod:{loading:S},...$("label"),children:f}),m&&a.jsx(le,{component:"span",...$("section"),mod:{position:"right"},children:m})]})]})});Oe.classes=du;Oe.displayName="@mantine/core/Button";Oe.Group=w0;Oe.GroupSection=j0;var WD={root:"m_4451eb3a"};const Do=ar((e,t)=>{const n=oe("Center",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,inline:h,mod:m,attributes:g,...y}=n,x=$e({name:"Center",props:n,classes:WD,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:g,vars:f});return a.jsx(le,{ref:t,mod:[{inline:h},m],...x("root"),...y})});Do.classes=WD;Do.displayName="@mantine/core/Center";var QD={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[r7,i7]=Ho();function YD(e){const{value:t,defaultValue:n,onChange:r,multiple:o,children:s}=oe("ChipGroup",null,e),[c,u]=ir({value:t,defaultValue:n,finalValue:o?[]:null,onChange:r}),f=m=>Array.isArray(c)?c.includes(m):m===c,h=m=>{const g=m.currentTarget.value;Array.isArray(c)?u(c.includes(g)?c.filter(y=>y!==g):[...c,g]):u(g)};return a.jsx(r7,{value:{isChipSelected:f,onChange:h,multiple:o},children:s})}YD.displayName="@mantine/core/ChipGroup";const o7={type:"checkbox"},a7=(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":Wn(t),"--chip-size":ot(t,"chip-size"),"--chip-radius":n===void 0?void 0:Vt(n),"--chip-checked-padding":ot(t,"chip-checked-padding"),"--chip-padding":ot(t,"chip-padding"),"--chip-icon-size":ot(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":ot(t,"chip-spacing")}}},Od=ge((e,t)=>{const n=oe("Chip",o7,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,id:h,checked:m,defaultChecked:g,onChange:y,value:x,wrapperProps:S,type:j,disabled:C,children:T,size:R,variant:E,icon:_,rootRef:k,autoContrast:I,mod:D,attributes:P,...$}=n,B=$e({name:"Chip",classes:QD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:P,vars:f,varsResolver:a7}),W=i7(),Y=ur(h),{styleProps:Z,rest:U}=_a($),[G,M]=ir({value:m,defaultValue:g,finalValue:!1,onChange:y}),L=W?{checked:W.isChipSelected(x),onChange:V=>{W.onChange(V),y?.(V.currentTarget.checked)},type:W.multiple?"checkbox":"radio"}:{},z=L.checked||G;return a.jsxs(le,{size:R,variant:E,ref:k,mod:D,...B("root"),...Z,...S,children:[a.jsx("input",{type:j,...B("input"),checked:z,onChange:V=>M(V.currentTarget.checked),id:Y,disabled:C,ref:t,value:x,...L,...U}),a.jsxs("label",{htmlFor:Y,"data-checked":z||void 0,"data-disabled":C||void 0,...B("label",{variant:E||"filled"}),children:[z&&_!==null&&_!==!1&&a.jsx("span",{...B("iconWrapper"),children:_===void 0?a.jsx(sf,{...B("checkIcon")}):_}),a.jsx("span",{children:T})]})]})});Od.classes=QD;Od.displayName="@mantine/core/Chip";Od.Group=YD;var KD={root:"m_b183c0a2"};const s7=(e,{color:t})=>({root:{"--code-bg":t?Kt(t,e):void 0}}),lf=ge((e,t)=>{const n=oe("Code",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,color:h,block:m,variant:g,mod:y,attributes:x,...S}=n,j=$e({name:"Code",props:n,classes:KD,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:x,vars:f,varsResolver:s7});return a.jsx(le,{component:m?"pre":"code",variant:g,ref:t,mod:[{block:m},y],...j("root"),...S,dir:"ltr"})});lf.classes=KD;lf.displayName="@mantine/core/Code";var XD={root:"m_7485cace"};const l7=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:ot(t,"container-size")}}),cf=ge((e,t)=>{const n=oe("Container",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,fluid:h,mod:m,attributes:g,strategy:y,...x}=n,S=$e({name:"Container",classes:XD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:g,vars:f,varsResolver:l7});return a.jsx(le,{ref:t,mod:[{fluid:h,strategy:y||"block"},m],...S("root"),...x})});cf.classes=XD;cf.displayName="@mantine/core/Container";const c7={timeout:1e3};function C0(e){const{children:t,timeout:n,value:r,...o}=oe("CopyButton",c7,e),s=J2({timeout:n}),c=()=>s.copy(r);return a.jsx(a.Fragment,{children:t({copy:c,copied:s.copied,...o})})}C0.displayName="@mantine/core/CopyButton";var JD={root:"m_3eebeb36",label:"m_9e365f20"};const u7={orientation:"horizontal"},d7=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?Kt(t,e):void 0,"--divider-border-style":n,"--divider-size":ot(r,"divider-size")}}),wn=ge((e,t)=>{const n=oe("Divider",u7,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,color:h,orientation:m,label:g,labelPosition:y,mod:x,attributes:S,...j}=n,C=$e({name:"Divider",classes:JD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:S,vars:f,varsResolver:d7});return a.jsx(le,{ref:t,mod:[{orientation:m,"with-label":!!g},x],...C("root"),...j,role:"separator",children:g&&a.jsx(le,{component:"span",mod:{position:y},...C("label"),children:g})})});wn.classes=JD;wn.displayName="@mantine/core/Divider";const[nT,ZD]=Ar("Grid component was not found in tree");var E0={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const Vx=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,rT=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":Vx(e,t),iT=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},oT=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function f7({span:e,order:t,offset:n,selector:r}){const o=_n(),s=ZD(),c=s.breakpoints||o.breakpoints,f=no(e)===void 0?12:no(e),h=Es({"--col-order":no(t)?.toString(),"--col-flex-grow":iT(f,s.grow),"--col-flex-basis":Vx(f,s.columns),"--col-width":f==="content"?"auto":void 0,"--col-max-width":rT(f,s.columns,s.grow),"--col-offset":oT(no(n),s.columns)}),m=un(c).reduce((x,S)=>(x[S]||(x[S]={}),typeof t=="object"&&t[S]!==void 0&&(x[S]["--col-order"]=t[S]?.toString()),typeof e=="object"&&e[S]!==void 0&&(x[S]["--col-flex-grow"]=iT(e[S],s.grow),x[S]["--col-flex-basis"]=Vx(e[S],s.columns),x[S]["--col-width"]=e[S]==="content"?"auto":void 0,x[S]["--col-max-width"]=rT(e[S],s.columns,s.grow)),typeof n=="object"&&n[S]!==void 0&&(x[S]["--col-offset"]=oT(n[S],s.columns)),x),{}),y=_d(un(m),c).filter(x=>un(m[x.value]).length>0).map(x=>({query:s.type==="container"?`mantine-grid (min-width: ${c[x.value]})`:`(min-width: ${c[x.value]})`,styles:m[x.value]}));return a.jsx(Ll,{styles:h,media:s.type==="container"?void 0:y,container:s.type==="container"?y:void 0,selector:r})}const h7={span:12},T0=ge((e,t)=>{const n=oe("GridCol",h7,e),{classNames:r,className:o,style:s,styles:c,vars:u,span:f,order:h,offset:m,...g}=n,y=ZD(),x=Zd();return a.jsxs(a.Fragment,{children:[a.jsx(f7,{selector:`.${x}`,span:f,order:h,offset:m}),a.jsx(le,{ref:t,...y.getStyles("col",{className:Bt(o,x),style:s,classNames:r,styles:c}),...g})]})});T0.classes=E0;T0.displayName="@mantine/core/GridCol";function aT({gutter:e,selector:t,breakpoints:n,type:r}){const o=_n(),s=n||o.breakpoints,c=Es({"--grid-gutter":Gn(no(e))}),u=un(s).reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--grid-gutter"]=Gn(e[g])),m),{}),h=_d(un(u),s).filter(m=>un(u[m.value]).length>0).map(m=>({query:r==="container"?`mantine-grid (min-width: ${s[m.value]})`:`(min-width: ${s[m.value]})`,styles:u[m.value]}));return a.jsx(Ll,{styles:c,media:r==="container"?void 0:h,container:r==="container"?h:void 0,selector:t})}const p7={gutter:"md",grow:!1,columns:12},m7=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),kn=ge((e,t)=>{const n=oe("Grid",p7,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,grow:h,gutter:m,columns:g,align:y,justify:x,children:S,breakpoints:j,type:C,attributes:T,...R}=n,E=$e({name:"Grid",classes:E0,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:T,vars:f,varsResolver:m7}),_=Zd();return C==="container"&&j?a.jsxs(nT,{value:{getStyles:E,grow:h,columns:g,breakpoints:j,type:C},children:[a.jsx(aT,{selector:`.${_}`,...n}),a.jsx("div",{...E("container"),children:a.jsx(le,{ref:t,...E("root",{className:_}),...R,children:a.jsx("div",{...E("inner"),children:S})})})]}):a.jsxs(nT,{value:{getStyles:E,grow:h,columns:g,breakpoints:j,type:C},children:[a.jsx(aT,{selector:`.${_}`,...n}),a.jsx(le,{ref:t,...E("root",{className:_}),...R,children:a.jsx("div",{...E("inner"),children:S})})]})});kn.classes=E0;kn.displayName="@mantine/core/Grid";kn.Col=T0;function sT({color:e,theme:t,defaultShade:n}){const r=Xr({color:e,theme:t});return r.isThemeColor?r.shade===void 0?`var(--mantine-color-${r.color}-${n})`:`var(${r.variable})`:e}var eA={root:"m_bcb3f3c2"};const g7={color:"yellow"},v7=(e,{color:t})=>({root:{"--mark-bg-dark":sT({color:t,theme:e,defaultShade:5}),"--mark-bg-light":sT({color:t,theme:e,defaultShade:2})}}),R0=ge((e,t)=>{const n=oe("Mark",g7,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,color:h,variant:m,attributes:g,...y}=n,x=$e({name:"Mark",props:n,className:o,style:s,classes:eA,classNames:r,styles:c,unstyled:u,attributes:g,vars:f,varsResolver:v7});return a.jsx(le,{component:"mark",ref:t,variant:m,...x("root"),...y})});R0.classes=eA;R0.displayName="@mantine/core/Mark";function lT(e){return e.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&")}function y7(e,t){if(t==null)return[{chunk:e,highlighted:!1}];const n=Array.isArray(t)?t.map(lT):lT(t);if(!(Array.isArray(n)?n.filter(u=>u.trim().length>0).length>0:n.trim()!==""))return[{chunk:e,highlighted:!1}];const o=typeof n=="string"?n.trim():n.filter(u=>u.trim().length!==0).map(u=>u.trim()).sort((u,f)=>f.length-u.length).join("|"),s=new RegExp(`(${o})`,"gi");return e.split(s).map(u=>({chunk:u,highlighted:s.test(u)})).filter(({chunk:u})=>u)}const _0=ar((e,t)=>{const{unstyled:n,children:r,highlight:o,highlightStyles:s,color:c,...u}=oe("Highlight",null,e),f=y7(r,o);return a.jsx(be,{unstyled:n,ref:t,...u,__staticSelector:"Highlight",children:f.map(({chunk:h,highlighted:m},g)=>m?a.jsx(R0,{unstyled:n,color:c,style:s,"data-highlight":h,children:h},g):a.jsx("span",{children:h},g))})});_0.classes=be.classes;_0.displayName="@mantine/core/Highlight";var tA={root:"m_9e117634"};const x7=(e,{radius:t,fit:n})=>({root:{"--image-radius":t===void 0?void 0:Vt(t),"--image-object-fit":n}}),D0=ar((e,t)=>{const n=oe("Image",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,onError:h,src:m,radius:g,fit:y,fallbackSrc:x,mod:S,attributes:j,...C}=n,[T,R]=v.useState(!m);v.useEffect(()=>R(!m),[m]);const E=$e({name:"Image",classes:tA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:j,vars:f,varsResolver:x7});return T&&x?a.jsx(le,{component:"img",ref:t,src:x,...E("root"),onError:h,mod:["fallback",S],...C}):a.jsx(le,{component:"img",ref:t,...E("root"),src:m,onError:_=>{h?.(_),R(!0)},mod:S,...C})});D0.classes=tA;D0.displayName="@mantine/core/Image";function Ip(){return Ip=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},Ip.apply(null,arguments)}function A0(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 b7=v.useLayoutEffect,S7=function(t){var n=Mn.useRef(t);return b7(function(){n.current=t}),n},cT=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},w7=function(t,n){var r=Mn.useRef();return Mn.useCallback(function(o){t.current=o,r.current&&cT(r.current,null),r.current=n,n&&cT(n,o)},[n])},uT={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},j7=function(t){Object.keys(uT).forEach(function(n){t.style.setProperty(n,uT[n],"important")})},dT=j7,Pr=null,fT=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function C7(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),Pr||(Pr=document.createElement("textarea"),Pr.setAttribute("tabindex","-1"),Pr.setAttribute("aria-hidden","true"),dT(Pr)),Pr.parentNode===null&&document.body.appendChild(Pr);var o=e.paddingSize,s=e.borderSize,c=e.sizingStyle,u=c.boxSizing;Object.keys(c).forEach(function(y){var x=y;Pr.style[x]=c[x]}),dT(Pr),Pr.value=t;var f=fT(Pr,e);Pr.value=t,f=fT(Pr,e),Pr.value="x";var h=Pr.scrollHeight-o,m=h*n;u==="border-box"&&(m=m+o+s),f=Math.max(m,f);var g=h*r;return u==="border-box"&&(g=g+o+s),f=Math.min(g,f),[f,h]}var hT=function(){},E7=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},T7=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],R7=!!document.documentElement.currentStyle,_7=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=E7(T7,n),o=r.boxSizing;if(o==="")return null;R7&&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}},D7=_7;function k0(e,t,n){var r=S7(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 A7=function(t,n){k0(document.body,"reset",function(r){t.current.form===r.target&&n(r)})},k7=function(t){k0(window,"resize",t)},P7=function(t){k0(document.fonts,"loadingdone",t)},N7=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],O7=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,s=t.minRows,c=t.onChange,u=c===void 0?hT:c,f=t.onHeightChange,h=f===void 0?hT:f,m=A0(t,N7),g=m.value!==void 0,y=v.useRef(null),x=w7(y,n),S=v.useRef(0),j=v.useRef(),C=function(){var E=y.current,_=r&&j.current?j.current:D7(E);if(_){j.current=_;var k=C7(_,E.value||E.placeholder||"x",s,o),I=k[0],D=k[1];S.current!==I&&(S.current=I,E.style.setProperty("height",I+"px","important"),h(I,{rowHeight:D}))}},T=function(E){g||C(),u(E)};return v.useLayoutEffect(C),A7(y,function(){if(!g){var R=y.current.value;requestAnimationFrame(function(){var E=y.current;E&&R!==E.value&&C()})}}),k7(C),P7(C),v.createElement("textarea",Ip({},m,{onChange:T,ref:x}))},M7=v.forwardRef(O7);const L7={size:"sm"},zl=ge((e,t)=>{const{autosize:n,maxRows:r,minRows:o,__staticSelector:s,resize:c,...u}=oe("Textarea",L7,e),f=n&&o_()!=="test",h=f?{maxRows:r,minRows:o}:{};return a.jsx($r,{component:f?M7:"textarea",ref:t,...u,__staticSelector:s||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":c},...h})});zl.classes=$r.classes;zl.displayName="@mantine/core/Textarea";function pT(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const I7={serialize:JSON.stringify,deserialize:JSON.parse,size:"sm"},fu=ge((e,t)=>{const{value:n,defaultValue:r,onChange:o,formatOnBlur:s,validationError:c,serialize:u,deserialize:f,onFocus:h,onBlur:m,readOnly:g,error:y,...x}=oe("JsonInput",I7,e),[S,j]=ir({value:n,defaultValue:r,finalValue:"",onChange:o}),[C,T]=v.useState(pT(S,f)),R=_=>{h?.(_),T(!0)},E=_=>{typeof m=="function"&&m(_);const k=pT(_.currentTarget.value,f);s&&!g&&k&&_.currentTarget.value.trim()!==""&&j(u(f(_.currentTarget.value),null,2)),T(k)};return a.jsx(zl,{value:S,onChange:_=>j(_.currentTarget.value),onFocus:R,onBlur:E,ref:t,readOnly:g,...x,autoComplete:"off",__staticSelector:"JsonInput",error:C?y:c||!0,"data-monospace":!0})});fu.classes=$r.classes;fu.displayName="@mantine/core/JsonInput";var nA={root:"m_dc6f14e2"};const z7=(e,{size:t})=>({root:{"--kbd-fz":ot(t,"kbd-fz")}}),$c=ge((e,t)=>{const n=oe("Kbd",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,attributes:h,...m}=n,g=$e({name:"Kbd",classes:nA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:h,vars:f,varsResolver:z7});return a.jsx(le,{component:"kbd",ref:t,...g("root"),...m})});$c.classes=nA;$c.displayName="@mantine/core/Kbd";const[$7,U7]=Ar("List component was not found in tree");var P0={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const N0=ge((e,t)=>{const n=oe("ListItem",null,e),{classNames:r,className:o,style:s,styles:c,vars:u,icon:f,children:h,mod:m,...g}=n,y=U7(),x=f||y.icon,S={classNames:r,styles:c};return a.jsx(le,{...y.getStyles("item",{...S,className:o,style:s}),component:"li",mod:[{"with-icon":!!x,centered:y.center},m],ref:t,...g,children:a.jsxs("div",{...y.getStyles("itemWrapper",S),children:[x&&a.jsx("span",{...y.getStyles("itemIcon",S),children:x}),a.jsx("span",{...y.getStyles("itemLabel",S),children:h})]})})});N0.classes=P0;N0.displayName="@mantine/core/ListItem";const B7={type:"unordered"},V7=(e,{size:t,spacing:n})=>({root:{"--list-fz":Wn(t),"--list-lh":X2(t),"--list-spacing":Gn(n)}}),Or=ge((e,t)=>{const n=oe("List",B7,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,children:h,type:m,withPadding:g,icon:y,spacing:x,center:S,listStyleType:j,mod:C,attributes:T,...R}=n,E=$e({name:"List",classes:P0,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:T,vars:f,varsResolver:V7});return a.jsx($7,{value:{center:S,icon:y,getStyles:E},children:a.jsx(le,{...E("root",{style:{listStyleType:j}}),component:m==="unordered"?"ul":"ol",mod:[{"with-padding":g,type:y?"none":j},C],ref:t,...R,children:h})})});Or.classes=P0;Or.displayName="@mantine/core/List";Or.Item=N0;var rA={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const mT={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:zr("overlay")},F7=(e,{zIndex:t})=>({root:{"--lo-z-index":t?.toString()}}),Em=ge((e,t)=>{const n=oe("LoadingOverlay",mT,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,transitionProps:h,loaderProps:m,overlayProps:g,visible:y,zIndex:x,attributes:S,...j}=n,C=_n(),T=$e({name:"LoadingOverlay",classes:rA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:S,vars:f,varsResolver:F7}),R={...mT.overlayProps,...g};return a.jsx(lo,{transition:"fade",...h,mounted:!!y,children:E=>a.jsxs(le,{...T("root",{style:E}),ref:t,...j,children:[a.jsx(_r,{...T("loader"),unstyled:u,...m}),a.jsx(Yc,{...R,...T("overlay"),darkHidden:!0,unstyled:u,color:g?.color||C.white}),a.jsx(Yc,{...R,...T("overlay"),lightHidden:!0,unstyled:u,color:g?.color||C.colors.dark[5]})]})})});Em.classes=rA;Em.displayName="@mantine/core/LoadingOverlay";const[H7,Ds]=Ar("Menu component was not found in the tree");var As={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504",chevron:"m_b85b0bed"};const O0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...u}=oe("MenuDivider",null,e),f=Ds();return a.jsx(le,{ref:t,...f.getStyles("divider",{className:r,style:o,styles:s,classNames:n}),...u})});O0.classes=As;O0.displayName="@mantine/core/MenuDivider";const M0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,onMouseEnter:u,onMouseLeave:f,onKeyDown:h,children:m,...g}=oe("MenuDropdown",null,e),y=v.useRef(null),x=Ds(),S=lr(h,T=>{(T.key==="ArrowUp"||T.key==="ArrowDown")&&(T.preventDefault(),y.current?.querySelectorAll("[data-menu-item]:not(:disabled)")[0]?.focus())}),j=lr(u,()=>(x.trigger==="hover"||x.trigger==="click-hover")&&x.openDropdown()),C=lr(f,()=>(x.trigger==="hover"||x.trigger==="click-hover")&&x.closeDropdown());return a.jsxs(Zr.Dropdown,{...g,onMouseEnter:j,onMouseLeave:C,role:"menu","aria-orientation":"vertical",ref:Vn(t,y),...x.getStyles("dropdown",{className:r,style:o,styles:s,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:S,children:[x.withInitialFocusPlaceholder&&a.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),m]})});M0.classes=As;M0.displayName="@mantine/core/MenuDropdown";const[q7,Tm]=Ho(),L0=ar((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,color:u,closeMenuOnClick:f,leftSection:h,rightSection:m,children:g,disabled:y,"data-disabled":x,...S}=oe("MenuItem",null,e),j=Ds(),C=Tm(),T=_n(),{dir:R}=Ts(),E=v.useRef(null),_=S,k=lr(_.onClick,()=>{x||(typeof f=="boolean"?f&&j.closeDropdownImmediately():j.closeOnItemClick&&j.closeDropdownImmediately())}),I=u?T.variantColorResolver({color:u,theme:T,variant:"light"}):void 0,D=u?Xr({color:u,theme:T}):null,P=lr(_.onKeyDown,$=>{$.key==="ArrowLeft"&&C&&(C.close(),C.focusParentItem())});return a.jsxs(Pn,{onMouseDown:$=>$.preventDefault(),...S,unstyled:j.unstyled,tabIndex:j.menuItemTabIndex,...j.getStyles("item",{className:r,style:o,styles:s,classNames:n}),ref:Vn(E,t),role:"menuitem",disabled:y,"data-menu-item":!0,"data-disabled":y||x||void 0,"data-mantine-stop-propagation":!0,onClick:k,onKeyDown:Eb({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:j.loop,dir:R,orientation:"vertical",onKeyDown:P}),__vars:{"--menu-item-color":D?.isThemeColor&&D?.shade===void 0?`var(--mantine-color-${D.color}-6)`:I?.color,"--menu-item-hover":I?.hover},children:[h&&a.jsx("div",{...j.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"left",children:h}),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})]})});L0.classes=As;L0.displayName="@mantine/core/MenuItem";const I0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...u}=oe("MenuLabel",null,e),f=Ds();return a.jsx(le,{ref:t,...f.getStyles("label",{className:r,style:o,styles:s,classNames:n}),...u})});I0.classes=As;I0.displayName="@mantine/core/MenuLabel";const z0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,onMouseEnter:u,onMouseLeave:f,onKeyDown:h,children:m,...g}=oe("MenuSubDropdown",null,e),y=v.useRef(null),x=Ds(),S=Tm(),j=lr(u,S?.open),C=lr(f,S?.close);return a.jsx(Zr.Dropdown,{...g,onMouseEnter:j,onMouseLeave:C,role:"menu","aria-orientation":"vertical",ref:Vn(t,y),...x.getStyles("dropdown",{className:r,style:o,styles:s,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,children:m})});z0.classes=As;z0.displayName="@mantine/core/MenuSubDropdown";const $0=ar((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,color:u,leftSection:f,rightSection:h,children:m,disabled:g,"data-disabled":y,closeMenuOnClick:x,...S}=oe("MenuSubItem",null,e),j=Ds(),C=Tm(),T=_n(),{dir:R}=Ts(),E=v.useRef(null),_=S,k=u?T.variantColorResolver({color:u,theme:T,variant:"light"}):void 0,I=u?Xr({color:u,theme:T}):null,D=lr(_.onKeyDown,W=>{W.key==="ArrowRight"&&(C?.open(),C?.focusFirstItem()),W.key==="ArrowLeft"&&C?.parentContext&&(C.parentContext.close(),C.parentContext.focusParentItem())}),P=lr(_.onClick,()=>{!y&&x&&j.closeDropdownImmediately()}),$=lr(_.onMouseEnter,C?.open),B=lr(_.onMouseLeave,C?.close);return a.jsxs(Pn,{onMouseDown:W=>W.preventDefault(),...S,unstyled:j.unstyled,tabIndex:j.menuItemTabIndex,...j.getStyles("item",{className:r,style:o,styles:s,classNames:n}),ref:Vn(E,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:$,onMouseLeave:B,onClick:P,onKeyDown:Eb({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:j.loop,dir:R,orientation:"vertical",onKeyDown:D}),__vars:{"--menu-item-color":I?.isThemeColor&&I?.shade===void 0?`var(--mantine-color-${I.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:h||a.jsx(SD,{...j.getStyles("chevron"),size:14})})]})});$0.classes=As;$0.displayName="@mantine/core/MenuSubItem";function iA({children:e,refProp:t}){if(!sm(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 Ds(),a.jsx(Zr.Target,{refProp:t,popupType:"menu",children:e})}iA.displayName="@mantine/core/MenuSubTarget";const G7={offset:0,position:"right-start",transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function hu(e){const{children:t,closeDelay:n,openDelay:r,...o}=oe("MenuSub",G7,e),s=ur(),[c,{open:u,close:f}]=Pl(!1),h=Tm(),{openDropdown:m,closeDropdown:g}=bD({open:u,close:f,closeDelay:n,openDelay:r}),y=()=>window.setTimeout(()=>{document.getElementById(`${s}-dropdown`)?.querySelectorAll("[data-menu-item]:not([data-disabled])")[0]?.focus()},16),x=()=>window.setTimeout(()=>{document.getElementById(`${s}-target`)?.focus()},16);return a.jsx(q7,{value:{opened:c,close:g,open:m,focusFirstItem:y,focusParentItem:x,parentContext:h},children:a.jsx(Zr,{opened:c,withinPortal:!1,withArrow:!1,id:s,...o,children:t})})}hu.extend=e=>e;hu.displayName="@mantine/core/MenuSub";hu.Target=iA;hu.Dropdown=z0;hu.Item=$0;const W7={refProp:"ref"},oA=v.forwardRef((e,t)=>{const{children:n,refProp:r,...o}=oe("MenuTarget",W7,e),s=Nl(n);if(!s)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 c=Ds(),u=s.props,f=lr(u.onClick,()=>{c.trigger==="click"?c.toggleDropdown():c.trigger==="click-hover"&&(c.setOpenedViaClick(!0),c.opened||c.openDropdown())}),h=lr(u.onMouseEnter,()=>(c.trigger==="hover"||c.trigger==="click-hover")&&c.openDropdown()),m=lr(u.onMouseLeave,()=>{(c.trigger==="hover"||c.trigger==="click-hover"&&!c.openedViaClick)&&c.closeDropdown()});return a.jsx(Zr.Target,{refProp:r,popupType:"menu",ref:t,...o,children:v.cloneElement(s,{onClick:f,onMouseEnter:h,onMouseLeave:m,"data-expanded":c.opened?!0:void 0})})});oA.displayName="@mantine/core/MenuTarget";const Q7={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function we(e){const t=oe("Menu",Q7,e),{children:n,onOpen:r,onClose:o,opened:s,defaultOpened:c,trapFocus:u,onChange:f,closeOnItemClick:h,loop:m,closeOnEscape:g,trigger:y,openDelay:x,closeDelay:S,classNames:j,styles:C,unstyled:T,variant:R,vars:E,menuItemTabIndex:_,keepMounted:k,withInitialFocusPlaceholder:I,attributes:D,...P}=t,$=$e({name:"Menu",classes:As,props:t,classNames:j,styles:C,unstyled:T,attributes:D}),[B,W]=ir({value:s,defaultValue:c,finalValue:!1,onChange:f}),[Y,Z]=v.useState(!1),U=()=>{W(!1),Z(!1),B&&o?.()},G=()=>{W(!0),!B&&r?.()},M=()=>{B?U():G()},{openDropdown:L,closeDropdown:z}=bD({open:G,close:U,closeDelay:S,openDelay:x}),V=F=>fM("[data-menu-item]","[data-menu-dropdown]",F),{resolvedClassNames:K,resolvedStyles:O}=Ol({classNames:j,styles:C,props:t});return a.jsx(H7,{value:{getStyles:$,opened:B,toggleDropdown:M,getItemIndex:V,openedViaClick:Y,setOpenedViaClick:Z,closeOnItemClick:h,closeDropdown:y==="click"?U:z,openDropdown:y==="click"?G:L,closeDropdownImmediately:U,loop:m,trigger:y,unstyled:T,menuItemTabIndex:_,withInitialFocusPlaceholder:I},children:a.jsx(Zr,{returnFocus:!0,...P,opened:B,onChange:M,defaultOpened:c,trapFocus:k?!1:u,closeOnEscape:g,__staticSelector:"Menu",classNames:K,styles:O,unstyled:T,variant:R,keepMounted:k,children:n})})}we.extend=e=>e;we.withProps=J5(we);we.classes=As;we.displayName="@mantine/core/Menu";we.Item=L0;we.Label=I0;we.Dropdown=M0;we.Target=oA;we.Divider=O0;we.Sub=hu;var Aa={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const[Y7,pu]=Ar("Modal component was not found in tree"),Rm=ge((e,t)=>{const n=oe("ModalBody",null,e),{classNames:r,className:o,style:s,styles:c,vars:u,...f}=n,h=pu();return a.jsx(dD,{ref:t,...h.getStyles("body",{classNames:r,style:s,styles:c,className:o}),...f})});Rm.classes=Aa;Rm.displayName="@mantine/core/ModalBody";const _m=ge((e,t)=>{const n=oe("ModalCloseButton",null,e),{classNames:r,className:o,style:s,styles:c,vars:u,...f}=n,h=pu();return a.jsx(fD,{ref:t,...h.getStyles("close",{classNames:r,style:s,styles:c,className:o}),...f})});_m.classes=Aa;_m.displayName="@mantine/core/ModalCloseButton";const Dm=ge((e,t)=>{const n=oe("ModalContent",null,e),{classNames:r,className:o,style:s,styles:c,vars:u,children:f,__hidden:h,...m}=n,g=pu(),y=g.scrollAreaComponent||OI;return a.jsx(hD,{...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":h||void 0,ref:t,...m,children:a.jsx(y,{style:{maxHeight:g.fullScreen?"100dvh":`calc(100dvh - (${ce(g.yOffset)} * 2))`},children:f})})});Dm.classes=Aa;Dm.displayName="@mantine/core/ModalContent";const Am=ge((e,t)=>{const n=oe("ModalHeader",null,e),{classNames:r,className:o,style:s,styles:c,vars:u,...f}=n,h=pu();return a.jsx(pD,{ref:t,...h.getStyles("header",{classNames:r,style:s,styles:c,className:o}),...f})});Am.classes=Aa;Am.displayName="@mantine/core/ModalHeader";const km=ge((e,t)=>{const n=oe("ModalOverlay",null,e),{classNames:r,className:o,style:s,styles:c,vars:u,...f}=n,h=pu();return a.jsx(mD,{ref:t,...h.getStyles("overlay",{classNames:r,style:s,styles:c,className:o}),...f})});km.classes=Aa;km.displayName="@mantine/core/ModalOverlay";const K7={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:zr("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},X7=(e,{radius:t,size:n,yOffset:r,xOffset:o})=>({root:{"--modal-radius":t===void 0?void 0:Vt(t),"--modal-size":ot(n,"modal-size"),"--modal-y-offset":ce(r),"--modal-x-offset":ce(o)}}),Pm=ge((e,t)=>{const n=oe("ModalRoot",K7,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,yOffset:h,scrollAreaComponent:m,radius:g,fullScreen:y,centered:x,xOffset:S,__staticSelector:j,attributes:C,...T}=n,R=$e({name:j,classes:Aa,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:C,vars:f,varsResolver:X7});return a.jsx(Y7,{value:{yOffset:h,scrollAreaComponent:m,getStyles:R,fullScreen:y},children:a.jsx(uD,{ref:t,...R("root"),"data-full-screen":y||void 0,"data-centered":x||void 0,"data-offset-scrollbars":m===Jr.Autosize||void 0,unstyled:u,...T})})});Pm.classes=Aa;Pm.displayName="@mantine/core/ModalRoot";const[J7,Z7]=Ho();function aA({children:e}){const[t,n]=v.useState([]),[r,o]=v.useState(zr("modal"));return a.jsx(J7,{value:{stack:t,addModal:(s,c)=>{n(u=>[...new Set([...u,s])]),o(u=>typeof c=="number"&&typeof u=="number"?Math.max(u,c):u)},removeModal:s=>n(c=>c.filter(u=>u!==s)),getZIndex:s=>`calc(${r} + ${t.indexOf(s)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}aA.displayName="@mantine/core/ModalStack";const Nm=ge((e,t)=>{const n=oe("ModalTitle",null,e),{classNames:r,className:o,style:s,styles:c,vars:u,...f}=n,h=pu();return a.jsx(gD,{ref:t,...h.getStyles("title",{classNames:r,style:s,styles:c,className:o}),...f})});Nm.classes=Aa;Nm.displayName="@mantine/core/ModalTitle";const ez={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:zr("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},In=ge((e,t)=>{const{title:n,withOverlay:r,overlayProps:o,withCloseButton:s,closeButtonProps:c,children:u,radius:f,opened:h,stackId:m,zIndex:g,...y}=oe("Modal",ez,e),x=Z7(),S=!!n||s,j=x&&m?{closeOnEscape:x.currentId===m,trapFocus:x.currentId===m,zIndex:x.getZIndex(m)}:{},C=r===!1?!1:m&&x?x.currentId===m:h;return v.useEffect(()=>{x&&m&&(h?x.addModal(m,g||zr("modal")):x.removeModal(m))},[h,m,g]),a.jsxs(Pm,{ref:t,radius:f,opened:h,zIndex:x&&m?x.getZIndex(m):g,...y,...j,children:[r&&a.jsx(km,{visible:C,transitionProps:x&&m?{duration:0}:void 0,...o}),a.jsxs(Dm,{radius:f,__hidden:x&&m&&h?m!==x.currentId:!1,children:[S&&a.jsxs(Am,{children:[n&&a.jsx(Nm,{children:n}),s&&a.jsx(_m,{...c})]}),a.jsx(Rm,{children:u})]})]})});In.classes=Aa;In.displayName="@mantine/core/Modal";In.Root=Pm;In.Overlay=km;In.Content=Dm;In.Body=Rm;In.Header=Am;In.Title=Nm;In.CloseButton=_m;In.Stack=aA;const[tz,U0]=Ho();var Om={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const[nz,rz]=Ho(),iz=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?ot(t):ot(n,"pg-gap")}}),B0=ge((e,t)=>{const n=oe("PillGroup",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,size:h,disabled:m,attributes:g,...y}=n,S=U0()?.size||h||void 0,j=$e({name:"PillGroup",classes:Om,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:g,vars:f,varsResolver:iz,stylesCtx:{size:S},rootSelector:"group"});return a.jsx(nz,{value:{size:S,disabled:m},children:a.jsx(le,{ref:t,size:S,...j("group"),...y})})});B0.classes=Om;B0.displayName="@mantine/core/PillGroup";const oz={variant:"default"},az=(e,{radius:t},{size:n})=>({root:{"--pill-fz":ot(n,"pill-fz"),"--pill-height":ot(n,"pill-height"),"--pill-radius":t===void 0?void 0:Vt(t)}}),ja=ge((e,t)=>{const n=oe("Pill",oz,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,variant:h,children:m,withRemoveButton:g,onRemove:y,removeButtonProps:x,radius:S,size:j,disabled:C,mod:T,attributes:R,...E}=n,_=rz(),k=U0(),I=j||_?.size||void 0,D=k?.variant==="filled"?"contrast":h||"default",P=$e({name:"Pill",classes:Om,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:R,vars:f,varsResolver:az,stylesCtx:{size:I}});return a.jsxs(le,{component:"span",ref:t,variant:D,size:I,...P("root",{variant:D}),mod:[{"with-remove":g&&!C,disabled:C||_?.disabled},T],...E,children:[a.jsx("span",{...P("label"),children:m}),g&&a.jsx(Rs,{variant:"transparent",radius:S,tabIndex:-1,"aria-hidden":!0,unstyled:u,...x,...P("remove",{className:x?.className,style:x?.style}),onMouseDown:$=>{$.preventDefault(),$.stopPropagation(),x?.onMouseDown?.($)},onClick:$=>{$.stopPropagation(),y?.(),x?.onClick?.($)}})]})});ja.classes=Om;ja.displayName="@mantine/core/Pill";ja.Group=B0;var sA={field:"m_45c4369d"};const sz={type:"visible"},V0=ge((e,t)=>{const n=oe("PillsInputField",sz,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,type:h,disabled:m,id:g,pointer:y,mod:x,attributes:S,...j}=n,C=U0(),T=cu(),R=$e({name:"PillsInputField",classes:sA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:S,rootSelector:"field"}),E=m||C?.disabled;return a.jsx(le,{component:"input",ref:Vn(t,C?.fieldRef),"data-type":h,disabled:E,mod:[{disabled:E,pointer:y},x],...R("field"),...j,id:T?.inputId||g,"aria-invalid":C?.hasError,"aria-describedby":T?.describedBy,type:"text",onMouseDown:_=>!y&&_.stopPropagation()})});V0.classes=sA;V0.displayName="@mantine/core/PillsInputField";const lz={size:"sm"},Ss=ge((e,t)=>{const n=oe("PillsInput",lz,e),{children:r,onMouseDown:o,onClick:s,size:c,disabled:u,__staticSelector:f,error:h,variant:m,...g}=n,y=v.useRef(null);return a.jsx(tz,{value:{fieldRef:y,size:c,disabled:u,hasError:!!h,variant:m},children:a.jsx($r,{size:c,error:h,variant:m,component:"div",ref:t,"data-no-overflow":!0,onMouseDown:x=>{x.preventDefault(),o?.(x),y.current?.focus()},onClick:x=>{x.preventDefault(),x.currentTarget.closest("fieldset")?.disabled||(y.current?.focus(),s?.(x))},...g,multiline:!0,disabled:u,__staticSelector:f||"PillsInput",withAria:!1,children:r})})});Ss.displayName="@mantine/core/PillsInput";Ss.Field=V0;function cz({data:e,value:t}){const n=t.map(o=>o.trim().toLowerCase());return e.reduce((o,s)=>(Xc(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 uz={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:",",clearSearchOnChange:!0,openOnFocus:!0,size:"sm"},Mm=ge((e,t)=>{const n=oe("MultiSelect",uz,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,size:h,value:m,defaultValue:g,onChange:y,onKeyDown:x,variant:S,data:j,dropdownOpened:C,defaultDropdownOpened:T,onDropdownOpen:R,onDropdownClose:E,selectFirstOptionOnChange:_,selectFirstOptionOnDropdownOpen:k,onOptionSubmit:I,comboboxProps:D,filter:P,limit:$,withScrollArea:B,maxDropdownHeight:W,searchValue:Y,defaultSearchValue:Z,onSearchChange:U,readOnly:G,disabled:M,onFocus:L,onBlur:z,radius:V,rightSection:K,rightSectionWidth:O,rightSectionPointerEvents:F,rightSectionProps:se,leftSection:de,leftSectionWidth:ye,leftSectionPointerEvents:je,leftSectionProps:Ee,inputContainer:Ke,inputWrapperOrder:De,withAsterisk:dt,labelProps:Ct,descriptionProps:rt,errorProps:nt,wrapperProps:mt,description:Tt,label:wt,error:Te,maxValues:Pe,searchable:Ne,nothingFoundMessage:Ie,withCheckIcon:lt,withAlignedLabels:et,checkIconPosition:ft,hidePickedOptions:pe,withErrorStyles:qe,name:Ce,form:ke,id:kt,clearable:pn,clearButtonProps:mn,hiddenInputProps:Kn,placeholder:nn,hiddenInputValuesDivider:Sr,required:Qt,mod:hr,renderOption:zn,onRemove:vi,onClear:Ko,scrollAreaProps:La,chevronColor:Hi,attributes:yi,clearSearchOnChange:mo,openOnFocus:qi,...go}=n,Gi=ur(kt),Ia=TD(j),pr=RD(Ia),Wi=v.useRef({}),Nn=Il({opened:C,defaultOpened:T,onDropdownOpen:()=>{R?.(),k&&Nn.selectFirstOption()},onDropdownClose:()=>{E?.(),Nn.resetSelectedOption()}}),{styleProps:Su,rest:{type:wu,autoComplete:H,...X}}=_a(go),[ee,Se]=ir({value:m,defaultValue:g,finalValue:[],onChange:y}),[_e,Xe]=ir({value:Y,defaultValue:Z,finalValue:"",onChange:U}),ze=st=>{Xe(st),Nn.resetSelectedOption()},Me=$e({name:"MultiSelect",classes:{},props:n,classNames:r,styles:c,unstyled:u,attributes:yi}),{resolvedClassNames:Ue,resolvedStyles:Qe}=Ol({props:n,styles:c,classNames:r}),at=st=>{x?.(st),st.key===" "&&!Ne&&(st.preventDefault(),Nn.toggleDropdown()),st.key==="Backspace"&&_e.length===0&&ee.length>0&&(vi?.(ee[ee.length-1]),Se(ee.slice(0,ee.length-1)))},tt=ee.map((st,vn)=>{const _t=pr[st]||Wi.current[st];return a.jsx(ja,{withRemoveButton:!G&&!pr[st]?.disabled,onRemove:()=>{Se(ee.filter(Xn=>st!==Xn)),vi?.(st)},unstyled:u,disabled:M,...Me("pill"),children:_t?.label||st},`${st}-${vn}`)});v.useEffect(()=>{_&&Nn.selectFirstOption()},[_,_e]),v.useEffect(()=>{ee.forEach(st=>{st in pr&&(Wi.current[st]=pr[st])})},[pr,ee]);const Pt=a.jsx(Ye.ClearButton,{...mn,onClear:()=>{Ko?.(),Se([]),ze("")}}),Rt=cz({data:Ia,value:ee}),gn=pn&&ee.length>0&&!M&&!G;return a.jsxs(a.Fragment,{children:[a.jsxs(Ye,{store:Nn,classNames:Ue,styles:Qe,unstyled:u,size:h,readOnly:G,__staticSelector:"MultiSelect",attributes:yi,onOptionSubmit:st=>{I?.(st),mo&&ze(""),Nn.updateSelectedOptionIndex("selected"),ee.includes(pr[st].value)?(Se(ee.filter(vn=>vn!==pr[st].value)),vi?.(pr[st].value)):ee.length<Pe&&Se([...ee,pr[st].value])},...D,children:[a.jsx(Ye.DropdownTarget,{children:a.jsx(Ss,{...Su,__staticSelector:"MultiSelect",classNames:Ue,styles:Qe,unstyled:u,size:h,className:o,style:s,variant:S,disabled:M,radius:V,__defaultRightSection:a.jsx(Ye.Chevron,{size:h,error:Te,unstyled:u,color:Hi}),__clearSection:Pt,__clearable:gn,rightSection:K,rightSectionPointerEvents:F||"none",rightSectionWidth:O,rightSectionProps:se,leftSection:de,leftSectionWidth:ye,leftSectionPointerEvents:je,leftSectionProps:Ee,inputContainer:Ke,inputWrapperOrder:De,withAsterisk:dt,labelProps:Ct,descriptionProps:rt,errorProps:nt,wrapperProps:mt,description:Tt,label:wt,error:Te,withErrorStyles:qe,__stylesApiProps:{...n,rightSectionPointerEvents:F||(gn?"all":"none"),multiline:!0},pointer:!Ne,onClick:()=>Ne?Nn.openDropdown():Nn.toggleDropdown(),"data-expanded":Nn.dropdownOpened||void 0,id:Gi,required:Qt,mod:hr,attributes:yi,children:a.jsxs(ja.Group,{attributes:yi,disabled:M,unstyled:u,...Me("pillsList"),children:[tt,a.jsx(Ye.EventsTarget,{autoComplete:H,children:a.jsx(Ss.Field,{...X,ref:t,id:Gi,placeholder:nn,type:!Ne&&!nn?"hidden":"visible",...Me("inputField"),unstyled:u,onFocus:st=>{L?.(st),qi&&Ne&&Nn.openDropdown()},onBlur:st=>{z?.(st),Nn.closeDropdown(),ze("")},onKeyDown:at,value:_e,onChange:st=>{ze(st.currentTarget.value),Ne&&Nn.openDropdown(),_&&Nn.selectFirstOption()},disabled:M,readOnly:G||!Ne,pointer:!Ne})})]})})}),a.jsx(U6,{data:pe?Rt:Ia,hidden:G||M,filter:P,search:_e,limit:$,hiddenWhenEmpty:!Ie,withScrollArea:B,maxDropdownHeight:W,filterOptions:Ne,value:ee,checkIconPosition:ft,withCheckIcon:lt,withAlignedLabels:et,nothingFoundMessage:Ie,unstyled:u,labelId:wt?`${Gi}-label`:void 0,"aria-label":wt?void 0:go["aria-label"],renderOption:zn,scrollAreaProps:La})]}),a.jsx(Ye.HiddenInput,{name:Ce,valuesDivider:Sr,value:ee,form:ke,disabled:M,...Kn})]})});Mm.classes={...$r.classes,...Ye.classes};Mm.displayName="@mantine/core/MultiSelect";function dz(e){return"group"in e}function F0({data:e}){if(dz(e)){const o=e.items.map(s=>a.jsx(F0,{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)}F0.displayName="@mantine/core/NativeSelectOption";const fz={rightSectionPointerEvents:"none"},dn=ge((e,t)=>{const{data:n,children:r,size:o,error:s,rightSection:c,unstyled:u,...f}=oe("NativeSelect",fz,e),h=TD(n).map((m,g)=>a.jsx(F0,{data:m},g));return a.jsx($r,{component:"select",ref:t,...f,__staticSelector:"NativeSelect",size:o,pointer:!0,error:s,unstyled:u,rightSection:c||a.jsx(wm,{size:o,error:s,unstyled:u}),children:r||h})});dn.classes=$r.classes;dn.displayName="@mantine/core/NativeSelect";var lA={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const hz={withCloseButton:!0},pz=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:Vt(t),"--notification-color":n?Kt(n,e):void 0}}),H0=ge((e,t)=>{const n=oe("Notification",hz,e),{className:r,color:o,radius:s,loading:c,withCloseButton:u,withBorder:f,title:h,icon:m,children:g,onClose:y,closeButtonProps:x,classNames:S,style:j,styles:C,unstyled:T,vars:R,mod:E,loaderProps:_,role:k,attributes:I,...D}=n,P=$e({name:"Notification",classes:lA,props:n,className:r,style:j,classNames:S,styles:C,unstyled:T,attributes:I,vars:R,varsResolver:pz});return a.jsxs(le,{...P("root"),mod:[{"data-with-icon":!!m||c,"data-with-border":f},E],ref:t,role:k||"alert",...D,children:[m&&!c&&a.jsx("div",{...P("icon"),children:m}),c&&a.jsx(_r,{size:28,color:o,..._,...P("loader")}),a.jsxs("div",{...P("body"),children:[h&&a.jsx("div",{...P("title"),children:h}),a.jsx(le,{...P("description"),mod:{"data-with-title":!!h},children:g})]}),u&&a.jsx(Rs,{iconSize:16,color:"gray",...x,unstyled:T,onClick:y,...P("closeButton")})]})});H0.classes=lA;H0.displayName="@mantine/core/Notification";function cA(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 Md;(function(e){e.event="event",e.props="prop"})(Md||(Md={}));function ps(){}function mz(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 Ld(e){return!!(e||"").match(/\d/)}function Fc(e){return e==null}function gz(e){return typeof e=="number"&&isNaN(e)}function uA(e){return Fc(e)||gz(e)||typeof e=="number"&&!isFinite(e)}function dA(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function vz(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;default:return/(\d)(?=(\d{3})+(?!\d))/g}}function yz(e,t,n){var r=vz(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 xz(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 q0(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 bz(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 fA(e,t,n){for(var r="",o=n?"0":"",s=0;s<=t-1;s++)r+=e[s]||o;return r}function gT(e,t){return Array(t+1).join(e)}function hA(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,u=o.length;return c<0?o="0."+gT("0",Math.abs(c))+o:c>=u?o=o+gT("0",c-u):o=(o.substring(0,c)||"0")+"."+o.substring(c),n+o}function vT(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,o=q0(e),s=o.beforeDecimal,c=o.afterDecimal,u=o.hasNegation,f=parseFloat("0."+(c||"0")),h=c.length<=t?"0."+c:f.toFixed(t),m=h.split("."),g=s;s&&Number(m[0])&&(g=s.split("").reverse().reduce(function(j,C,T){return j.length>T?(Number(j[0])+Number(C)).toString()+j.substring(1,j.length):C+j},m[0]));var y=fA(m[1]||"",t,n),x=u?"-":"",S=r?".":"";return""+x+g+S+y}function al(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 pA=mz(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}}}),Sz=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function wz(e,t,n){return Math.min(Math.max(e,t),n)}function Yy(e){return Math.max(e.selectionStart,e.selectionEnd)}function jz(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function Cz(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function Ez(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,o=e.formattedValueIndex;return t[r]===n[o]}function Tz(e,t,n,r,o,s,c){c===void 0&&(c=Ez);var u=o.findIndex(function(_){return _}),f=e.slice(0,u);!t&&!n.startsWith(f)&&(t=f,n=f+n,r=r+f.length);for(var h=n.length,m=e.length,g={},y=new Array(h),x=0;x<h;x++){y[x]=-1;for(var S=0,j=m;S<j;S++){var C=c({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:x,formattedValueIndex:S});if(C&&g[S]!==!0){y[x]=S,g[S]=!0;break}}}for(var T=r;T<h&&(y[T]===-1||!s(n[T]));)T++;var R=T===h||y[T]===-1?m:y[T];for(T=r-1;T>0&&y[T]===-1;)T--;var E=T===-1||y[T]===-1?0:y[T]+1;return E>R?R:r-E<R-r?E:R}function yT(e,t,n,r){var o=e.length;if(t=wz(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 Rz(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(Ld(e[n])||Ld(e[n-1]));return t}function mA(e,t,n,r,o,s){s===void 0&&(s=ps);var c=xz(function(S,j){var C,T;return uA(S)?(T="",C=""):typeof S=="number"||j?(T=typeof S=="number"?hA(S):S,C=r(T)):(T=o(S,void 0),C=r(T)),{formattedValue:C,numAsString:T}}),u=v.useState(function(){return c(Fc(e)?t:e,n)}),f=u[0],h=u[1],m=function(S,j){S.formattedValue!==f.formattedValue&&h({formattedValue:S.formattedValue,numAsString:S.value}),s(S,j)},g=e,y=n;Fc(e)&&(g=f.numAsString,y=!0);var x=c(g,y);return v.useMemo(function(){h(x)},[x.formattedValue]),[f,m]}function _z(e){return e.replace(/[^0-9]/g,"")}function Dz(e){return e}function Az(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=Dz);var u=e.removeFormatting;u===void 0&&(u=_z);var f=e.defaultValue,h=e.valueIsNumericString,m=e.onValueChange,g=e.isAllowed,y=e.onChange;y===void 0&&(y=ps);var x=e.onKeyDown;x===void 0&&(x=ps);var S=e.onMouseUp;S===void 0&&(S=ps);var j=e.onFocus;j===void 0&&(j=ps);var C=e.onBlur;C===void 0&&(C=ps);var T=e.value,R=e.getCaretBoundary;R===void 0&&(R=Rz);var E=e.isValidInputCharacter;E===void 0&&(E=Ld);var _=e.isCharacterSame,k=cA(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),I=mA(T,f,!!h,c,u,m),D=I[0],P=D.formattedValue,$=D.numAsString,B=I[1],W=v.useRef(),Y=v.useRef({formattedValue:P,numAsString:$}),Z=function(Te,Pe){Y.current={formattedValue:Te.formattedValue,numAsString:Te.value},B(Te,Pe)},U=v.useState(!1),G=U[0],M=U[1],L=v.useRef(null),z=v.useRef({setCaretTimeout:null,focusTimeout:null});v.useEffect(function(){return M(!0),function(){clearTimeout(z.current.setCaretTimeout),clearTimeout(z.current.focusTimeout)}},[]);var V=c,K=function(Te,Pe){var Ne=parseFloat(Pe);return{formattedValue:Te,value:Pe,floatValue:isNaN(Ne)?void 0:Ne}},O=function(Te,Pe,Ne){Te.selectionStart===0&&Te.selectionEnd===Te.value.length||(al(Te,Pe),z.current.setCaretTimeout=setTimeout(function(){Te.value===Ne&&Te.selectionStart!==Pe&&al(Te,Pe)},0))},F=function(Te,Pe,Ne){return yT(Te,Pe,R(Te),Ne)},se=function(Te,Pe,Ne){var Ie=R(Pe),lt=Tz(Pe,P,Te,Ne,Ie,E,_);return lt=yT(Pe,lt,Ie),lt},de=function(Te){var Pe=Te.formattedValue;Pe===void 0&&(Pe="");var Ne=Te.input,Ie=Te.source,lt=Te.event,et=Te.numAsString,ft;if(Ne){var pe=Te.inputValue||Ne.value,qe=Yy(Ne);Ne.value=Pe,ft=se(pe,Pe,qe),ft!==void 0&&O(Ne,ft,Pe)}Pe!==P&&Z(K(Pe,et),{event:lt,source:Ie})};v.useEffect(function(){var Te=Y.current,Pe=Te.formattedValue,Ne=Te.numAsString;(P!==Pe||$!==Ne)&&Z(K(P,$),{event:void 0,source:Md.props})},[P,$]);var ye=L.current?Yy(L.current):void 0,je=typeof window<"u"?v.useLayoutEffect:v.useEffect;je(function(){var Te=L.current;if(P!==Y.current.formattedValue&&Te){var Pe=se(Y.current.formattedValue,P,ye);Te.value=P,O(Te,Pe,P)}},[P]);var Ee=function(Te,Pe,Ne){var Ie=Pe.target,lt=W.current?Sz(W.current,Ie.selectionEnd):pA(P,Te),et=Object.assign(Object.assign({},lt),{lastValue:P}),ft=u(Te,et),pe=V(ft);if(ft=u(pe,void 0),g&&!g(K(pe,ft))){var qe=Pe.target,Ce=Yy(qe),ke=se(Te,P,Ce);return qe.value=P,O(qe,ke,P),!1}return de({formattedValue:pe,numAsString:ft,inputValue:Te,event:Pe,source:Ne,input:Pe.target}),!0},Ke=function(Te,Pe){Pe===void 0&&(Pe=0);var Ne=Te.selectionStart,Ie=Te.selectionEnd;W.current={selectionStart:Ne,selectionEnd:Ie+Pe}},De=function(Te){var Pe=Te.target,Ne=Pe.value,Ie=Ee(Ne,Te,Md.event);Ie&&y(Te),W.current=void 0},dt=function(Te){var Pe=Te.target,Ne=Te.key,Ie=Pe.selectionStart,lt=Pe.selectionEnd,et=Pe.value;et===void 0&&(et="");var ft;Ne==="ArrowLeft"||Ne==="Backspace"?ft=Math.max(Ie-1,0):Ne==="ArrowRight"?ft=Math.min(Ie+1,et.length):Ne==="Delete"&&(ft=Ie);var pe=0;Ne==="Delete"&&Ie===lt&&(pe=1);var qe=Ne==="ArrowLeft"||Ne==="ArrowRight";if(ft===void 0||Ie!==lt&&!qe){x(Te),Ke(Pe,pe);return}var Ce=ft;if(qe){var ke=Ne==="ArrowLeft"?"left":"right";Ce=F(et,ft,ke),Ce!==ft&&Te.preventDefault()}else Ne==="Delete"&&!E(et[ft])?Ce=F(et,ft,"right"):Ne==="Backspace"&&!E(et[ft])&&(Ce=F(et,ft,"left"));Ce!==ft&&O(Pe,Ce,et),x(Te),Ke(Pe,pe)},Ct=function(Te){var Pe=Te.target,Ne=function(){var Ie=Pe.selectionStart,lt=Pe.selectionEnd,et=Pe.value;if(et===void 0&&(et=""),Ie===lt){var ft=F(et,Ie);ft!==Ie&&O(Pe,ft,et)}};Ne(),requestAnimationFrame(function(){Ne()}),S(Te),Ke(Pe)},rt=function(Te){Te.persist&&Te.persist();var Pe=Te.target,Ne=Te.currentTarget;L.current=Pe,z.current.focusTimeout=setTimeout(function(){var Ie=Pe.selectionStart,lt=Pe.selectionEnd,et=Pe.value;et===void 0&&(et="");var ft=F(et,Ie);ft!==Ie&&!(Ie===0&<===et.length)&&O(Pe,ft,et),j(Object.assign(Object.assign({},Te),{currentTarget:Ne}))},0)},nt=function(Te){L.current=null,clearTimeout(z.current.focusTimeout),clearTimeout(z.current.setCaretTimeout),C(Te)},mt=G&&jz()?"numeric":void 0,Tt=Object.assign({inputMode:mt},k,{type:t,value:P,onChange:De,onKeyDown:dt,onMouseUp:Ct,onFocus:rt,onBlur:nt});if(n==="text")return o?Mn.createElement(Mn.Fragment,null,o(P,k)||null):Mn.createElement("span",Object.assign({},k,{ref:s}),P);if(r){var wt=r;return Mn.createElement(wt,Object.assign({},Tt,{ref:s}))}return Mn.createElement("input",Object.assign({},Tt,{ref:s}))}function xT(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,u=t.thousandsGroupStyle;if(u===void 0&&(u="thousand"),e===""||e==="-")return e;var f=Lm(t),h=f.thousandSeparator,m=f.decimalSeparator,g=n!==0&&e.indexOf(".")!==-1||n&&r,y=q0(e,c),x=y.beforeDecimal,S=y.afterDecimal,j=y.addNegation;return n!==void 0&&(S=fA(S,n,!!r)),h&&(x=yz(x,h,u)),o&&(x=o+x),s&&(S=S+s),j&&(x="-"+x),e=x+(g&&m||"")+S,e}function Lm(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 kz(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 Pz(e,t){return new RegExp("(^-)|[0-9]|"+dA(e),"g")}function Nz(e,t,n){return e===""?!0:!t?.match(/\d/)&&!n?.match(/\d/)&&typeof e=="string"&&!isNaN(Number(e))}function Oz(e,t,n){var r;t===void 0&&(t=Cz(e));var o=n.allowNegative,s=n.prefix;s===void 0&&(s="");var c=n.suffix;c===void 0&&(c="");var u=n.decimalScale,f=t.from,h=t.to,m=h.start,g=h.end,y=Lm(n),x=y.allowedDecimalSeparators,S=y.decimalSeparator,j=e[g]===S;if(Ld(e)&&(e===s||e===c)&&t.lastValue==="")return e;if(g-m===1&&x.indexOf(e[m])!==-1){var C=u===0?"":S;e=e.substring(0,m)+C+e.substring(m+1,e.length)}var T=function(L,z,V){var K=!1,O=!1;s.startsWith("-")?K=!1:L.startsWith("--")?(K=!1,O=!0):c.startsWith("-")&&L.length===c.length?K=!1:L[0]==="-"&&(K=!0);var F=K?1:0;return O&&(F=2),F&&(L=L.substring(F),z-=F,V-=F),{value:L,start:z,end:V,hasNegation:K}},R=T(e,m,g),E=R.hasNegation;r=R,e=r.value,m=r.start,g=r.end;var _=T(t.lastValue,f.start,f.end),k=_.start,I=_.end,D=_.value,P=e.substring(m,g);e.length&&D.length&&(k>D.length-c.length||I<s.length)&&!(P&&c.startsWith(P))&&(e=D);var $=0;e.startsWith(s)?$+=s.length:m<s.length&&($=m),e=e.substring($),g-=$;var B=e.length,W=e.length-c.length;e.endsWith(c)?B=W:(g>W||g>e.length-c.length)&&(B=g),e=e.substring(0,B),e=kz(E?"-"+e:e,o),e=(e.match(Pz(S))||[]).join("");var Y=e.indexOf(S);e=e.replace(new RegExp(dA(S),"g"),function(L,z){return z===Y?".":""});var Z=q0(e,o),U=Z.beforeDecimal,G=Z.afterDecimal,M=Z.addNegation;return h.end-h.start<f.end-f.start&&U===""&&j&&!parseFloat(G)&&(e=M?"-":""),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 Lz(e){var t=Lm(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(`
|
|
46
|
-
Decimal separator can't be same as thousand separator.
|
|
47
|
-
thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
48
|
-
decimalSeparator: `+r+` (default value for decimalSeparator is .)
|
|
49
|
-
`);return o.startsWith("-")&&s&&(console.error(`
|
|
50
|
-
Prefix can't start with '-' when allowNegative is true.
|
|
51
|
-
prefix: `+o+`
|
|
52
|
-
allowNegative: `+s+`
|
|
53
|
-
`),s=!1),Object.assign(Object.assign({},e),{allowNegative:s})}function Iz(e){e=Lz(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,o=e.onKeyDown;o===void 0&&(o=ps);var s=e.onBlur;s===void 0&&(s=ps);var c=e.thousandSeparator,u=e.decimalScale,f=e.fixedDecimalScale,h=e.prefix;h===void 0&&(h="");var m=e.defaultValue,g=e.value,y=e.valueIsNumericString,x=e.onValueChange,S=cA(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),j=Lm(e),C=j.decimalSeparator,T=j.allowedDecimalSeparators,R=function(M){return xT(M,e)},E=function(M,L){return Oz(M,L,e)},_=Fc(g)?m:g,k=y??Nz(_,h,t);Fc(g)?Fc(m)||(k=k||typeof m=="number"):k=k||typeof g=="number";var I=function(M){return uA(M)?M:(typeof M=="number"&&(M=hA(M)),k&&typeof u=="number"?vT(M,u,!!f):M)},D=mA(I(g),I(m),!!k,R,E,x),P=D[0],$=P.numAsString,B=P.formattedValue,W=D[1],Y=function(M){var L=M.target,z=M.key,V=L.selectionStart,K=L.selectionEnd,O=L.value;if(O===void 0&&(O=""),(z==="Backspace"||z==="Delete")&&K<h.length){M.preventDefault();return}if(V!==K){o(M);return}z==="Backspace"&&O[0]==="-"&&V===h.length+1&&n&&al(L,1),u&&f&&(z==="Backspace"&&O[V-1]===C?(al(L,V-1),M.preventDefault()):z==="Delete"&&O[V]===C&&M.preventDefault()),T?.includes(z)&&O[V]===C&&al(L,V+1);var F=c===!0?",":c;z==="Backspace"&&O[V-1]===F&&al(L,V-1),z==="Delete"&&O[V]===F&&al(L,V+1),o(M)},Z=function(M){var L=$;if(L.match(/\d/g)||(L=""),r||(L=bz(L)),f&&u&&(L=vT(L,u,f)),L!==$){var z=xT(L,e);W({formattedValue:z,value:L,floatValue:parseFloat(L)},{event:M,source:Md.event})}s(M)},U=function(M){return M===C?!0:Ld(M)},G=function(M){var L=M.currentValue,z=M.lastValue,V=M.formattedValue,K=M.currentValueIndex,O=M.formattedValueIndex,F=L[K],se=V[O],de=pA(z,L),ye=de.to,je=function(Ee){return E(Ee).indexOf(".")+h.length};return g===0&&f&&u&&L[ye.start]===C&&je(L)<K&&je(V)>O?!1:K>=ye.start&&K<ye.end&&T&&T.includes(F)&&se===C?!0:F===se};return Object.assign(Object.assign({},S),{value:B,valueIsNumericString:!1,isValidInputCharacter:U,isCharacterSame:G,onValueChange:W,format:R,removeFormatting:E,getCaretBoundary:function(M){return Mz(M,e)},onKeyDown:Y,onBlur:Z})}function zz(e){var t=Iz(e);return Mn.createElement(Az,Object.assign({},t))}var Fx={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};function bT({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"})})}const $z=/^(0\.0*|-0(\.0*)?)$/,Uz=/^-?0\d+(\.\d+)?\.?$/,Bz=/\.\d*0$/,gA=/^-?\d+\.$/;function Hx(e){return typeof e=="string"&&e!==""&&!Number.isNaN(Number(e))}function Ky(e){return typeof e=="number"?e<Number.MAX_SAFE_INTEGER:e===""||Hx(e)&&Number(e)<Number.MAX_SAFE_INTEGER}function Vz(e){return e.toString().replace(".","").length}function Fz(e,t){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&Vz(t)<14&&t!==""}function ST(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 Hz={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0,allowedDecimalSeparators:[".",","]},qz=(e,{size:t})=>({controls:{"--ni-chevron-size":ot(t,"ni-chevron-size")}});function Gz(e,t,n){const r=e.toString(),o=gA.test(r),s=r.replace(/^0+(?=\d)/,""),c=parseFloat(s);if(Number.isNaN(c))return s;if(c>Number.MAX_SAFE_INTEGER)return t!==void 0?t:s;const u=jd(c,n,t);return o?`${u.toString().replace(/^0+(?=\d)/,"")}.`:u}const Yr=ge((e,t)=>{const n=oe("NumberInput",Hz,e),{className:r,classNames:o,styles:s,unstyled:c,vars:u,onChange:f,onValueChange:h,value:m,defaultValue:g,max:y,min:x,step:S,hideControls:j,rightSection:C,isAllowed:T,clampBehavior:R,onBlur:E,allowDecimal:_,decimalScale:k,onKeyDown:I,onKeyDownCapture:D,handlersRef:P,startValue:$,disabled:B,rightSectionPointerEvents:W,allowNegative:Y,readOnly:Z,size:U,rightSectionWidth:G,stepHoldInterval:M,stepHoldDelay:L,allowLeadingZeros:z,withKeyboardEvents:V,trimLeadingZeroesOnBlur:K,allowedDecimalSeparators:O,attributes:F,...se}=n,de=$e({name:"NumberInput",classes:Fx,props:n,classNames:o,styles:s,unstyled:c,attributes:F,vars:u,varsResolver:qz}),{resolvedClassNames:ye,resolvedStyles:je}=Ol({classNames:o,styles:s,props:n}),[Ee,Ke]=ir({value:m,defaultValue:g,finalValue:"",onChange:f}),De=L!==void 0&&M!==void 0,dt=v.useRef(null),Ct=v.useRef(null),rt=v.useRef(0),nt=(Ce,ke)=>{ke.source==="event"&&Ke(Fz(Ce.floatValue,Ce.value)&&!$z.test(Ce.value)&&!(z&&Uz.test(Ce.value))&&!Bz.test(Ce.value)&&!gA.test(Ce.value)?Ce.floatValue:Ce.value),h?.(Ce,ke)},mt=Ce=>{const ke=String(Ce).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return ke?Math.max(0,(ke[1]?ke[1].length:0)-(ke[2]?+ke[2]:0)):0},Tt=Ce=>{dt.current&&typeof Ce<"u"&&dt.current.setSelectionRange(Ce,Ce)},wt=v.useRef(Ap);wt.current=()=>{if(!Ky(Ee))return;let Ce;const ke=mt(Ee),kt=mt(S),pn=Math.max(ke,kt),mn=10**pn;if(!Hx(Ee)&&(typeof Ee!="number"||Number.isNaN(Ee)))Ce=jd($,x,y);else if(y!==void 0){const nn=(Math.round(Number(Ee)*mn)+Math.round(S*mn))/mn;Ce=nn<=y?nn:y}else Ce=(Math.round(Number(Ee)*mn)+Math.round(S*mn))/mn;const Kn=Ce.toFixed(pn);Ke(parseFloat(Kn)),h?.({floatValue:parseFloat(Kn),formattedValue:Kn,value:Kn},{source:"increment"}),setTimeout(()=>Tt(dt.current?.value.length),0)};const Te=v.useRef(Ap);Te.current=()=>{if(!Ky(Ee))return;let Ce;const ke=x!==void 0?x:Y?Number.MIN_SAFE_INTEGER:0,kt=mt(Ee),pn=mt(S),mn=Math.max(kt,pn),Kn=10**mn;if(!Hx(Ee)&&typeof Ee!="number"||Number.isNaN(Ee))Ce=jd($,ke,y);else{const Sr=(Math.round(Number(Ee)*Kn)-Math.round(S*Kn))/Kn;Ce=ke!==void 0&&Sr<ke?ke:Sr}const nn=Ce.toFixed(mn);Ke(parseFloat(nn)),h?.({floatValue:parseFloat(nn),formattedValue:nn,value:nn},{source:"decrement"}),setTimeout(()=>Tt(dt.current?.value.length),0)};const Pe=Ce=>{I?.(Ce),!(Z||!V)&&(Ce.key==="ArrowUp"&&(Ce.preventDefault(),wt.current?.()),Ce.key==="ArrowDown"&&(Ce.preventDefault(),Te.current?.()))},Ne=Ce=>{if(D?.(Ce),Ce.key==="Backspace"){const ke=dt.current;ke&&ke.selectionStart===0&&ke.selectionStart===ke.selectionEnd&&(Ce.preventDefault(),window.setTimeout(()=>Tt(0),0))}},Ie=Ce=>{let ke=Ee;R==="blur"&&typeof ke=="number"&&(ke=jd(ke,x,y)),K&&typeof ke=="string"&&mt(ke)<15&&(ke=Gz(ke,y,x)),Ee!==ke&&Ke(ke),E?.(Ce)};Dd(P,{increment:wt.current,decrement:Te.current});const lt=Ce=>{Ce?wt.current?.():Te.current?.(),rt.current+=1},et=Ce=>{if(lt(Ce),De){const ke=typeof M=="number"?M:M(rt.current);Ct.current=window.setTimeout(()=>et(Ce),ke)}},ft=(Ce,ke)=>{Ce.preventDefault(),dt.current?.focus(),lt(ke),De&&(Ct.current=window.setTimeout(()=>et(ke),L))},pe=()=>{Ct.current&&window.clearTimeout(Ct.current),Ct.current=null,rt.current=0},qe=a.jsxs("div",{...de("controls"),children:[a.jsx(Pn,{...de("control"),tabIndex:-1,"aria-hidden":!0,disabled:B||typeof Ee=="number"&&y!==void 0&&Ee>=y,mod:{direction:"up"},onMouseDown:Ce=>Ce.preventDefault(),onPointerDown:Ce=>{ft(Ce,!0)},onPointerUp:pe,onPointerLeave:pe,children:a.jsx(bT,{direction:"up"})}),a.jsx(Pn,{...de("control"),tabIndex:-1,"aria-hidden":!0,disabled:B||typeof Ee=="number"&&x!==void 0&&Ee<=x,mod:{direction:"down"},onMouseDown:Ce=>Ce.preventDefault(),onPointerDown:Ce=>{ft(Ce,!1)},onPointerUp:pe,onPointerLeave:pe,children:a.jsx(bT,{direction:"down"})})]});return a.jsx($r,{component:zz,allowNegative:Y,className:Bt(Fx.root,r),size:U,inputMode:"decimal",...se,readOnly:Z,disabled:B,value:Ee,getInputRef:Vn(t,dt),onValueChange:nt,rightSection:j||Z||!Ky(Ee)?C:C||qe,classNames:ye,styles:je,unstyled:c,__staticSelector:"NumberInput",decimalScale:_?k:0,onKeyDown:Pe,onKeyDownCapture:Ne,rightSectionPointerEvents:W??(B?"none":void 0),rightSectionWidth:G??`var(--ni-right-section-width-${U||"sm"})`,allowLeadingZeros:z,allowedDecimalSeparators:O,onBlur:Ie,attributes:F,isAllowed:Ce=>R==="strict"?T?T(Ce)&&ST(Ce.floatValue,x,y):ST(Ce.floatValue,x,y):T?T(Ce):!0})});Yr.classes={...$r.classes,...Fx};Yr.displayName="@mantine/core/NumberInput";var uf={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const[Wz,Im]=Ar("Pagination.Root component was not found in tree"),Qz={withPadding:!0},df=ge((e,t)=>{const n=oe("PaginationControl",Qz,e),{classNames:r,className:o,style:s,styles:c,vars:u,active:f,disabled:h,withPadding:m,mod:g,...y}=n,x=Im(),S=h||x.disabled;return a.jsx(Pn,{ref:t,disabled:S,mod:[{active:f,disabled:S,"with-padding":m},g],...x.getStyles("control",{className:o,style:s,classNames:r,styles:c,active:!S}),...y})});df.classes=uf;df.displayName="@mantine/core/PaginationControl";function ff({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 Yz=e=>a.jsx(ff,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),Kz=e=>a.jsx(ff,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),Xz=e=>a.jsx(ff,{...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"}),Jz=e=>a.jsx(ff,{...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"}),Zz=e=>a.jsx(ff,{...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"}),e$={icon:Zz},zm=ge((e,t)=>{const n=oe("PaginationDots",e$,e),{classNames:r,className:o,style:s,styles:c,vars:u,icon:f,...h}=n,m=Im();return a.jsx(le,{ref:t,...m.getStyles("dots",{className:o,style:s,styles:c,classNames:r}),...h,children:a.jsx(f,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});zm.classes=uf;zm.displayName="@mantine/core/PaginationDots";function $m({icon:e,name:t,action:n,type:r}){const o={icon:e},s=v.forwardRef((c,u)=>{const{icon:f,...h}=oe(t,o,c),m=Im(),g=r==="next"?m.active===m.total:m.active===1;return a.jsx(df,{disabled:m.disabled||g,ref:u,onClick:m[n],withPadding:!1,...h,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 vA=$m({icon:Yz,name:"PaginationNext",action:"onNext",type:"next"}),yA=$m({icon:Kz,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),xA=$m({icon:Xz,name:"PaginationFirst",action:"onFirst",type:"previous"}),bA=$m({icon:Jz,name:"PaginationLast",action:"onLast",type:"next"});function G0({dotsIcon:e}){const t=Im(),n=t.range.map((r,o)=>r==="dots"?a.jsx(zm,{icon:e},o):a.jsx(df,{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})}G0.displayName="@mantine/core/PaginationItems";const t$={siblings:1,boundaries:1},n$=(e,{size:t,radius:n,color:r,autoContrast:o})=>({root:{"--pagination-control-radius":n===void 0?void 0:Vt(n),"--pagination-control-size":ot(t,"pagination-control-size"),"--pagination-control-fz":Wn(t),"--pagination-active-bg":r?Kt(r,e):void 0,"--pagination-active-color":Ml(o,e)?Ra({color:r,theme:e,autoContrast:o}):void 0}}),Um=ge((e,t)=>{const n=oe("PaginationRoot",t$,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,total:h,value:m,defaultValue:g,onChange:y,disabled:x,siblings:S,boundaries:j,color:C,radius:T,onNextPage:R,onPreviousPage:E,onFirstPage:_,onLastPage:k,getItemProps:I,autoContrast:D,attributes:P,...$}=n,B=$e({name:"Pagination",classes:uf,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:P,vars:f,varsResolver:n$}),{range:W,setPage:Y,next:Z,previous:U,active:G,first:M,last:L}=AM({page:m,initialPage:g,onChange:y,total:h,siblings:S,boundaries:j}),z=lr(R,Z),V=lr(E,U),K=lr(_,M),O=lr(k,L);return a.jsx(Wz,{value:{total:h,range:W,active:G,disabled:x,getItemProps:I,onChange:Y,onNext:z,onPrevious:V,onFirst:K,onLast:O,getStyles:B},children:a.jsx(le,{ref:t,...B("root"),...$})})});Um.classes=uf;Um.displayName="@mantine/core/PaginationRoot";const r$={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8},Bi=ge((e,t)=>{const n=oe("Pagination",r$,e),{withEdges:r,withControls:o,getControlProps:s,nextIcon:c,previousIcon:u,lastIcon:f,firstIcon:h,dotsIcon:m,total:g,gap:y,hideWithOnePage:x,withPages:S,...j}=n;return g<=0||x&&g===1?null:a.jsx(Um,{ref:t,total:g,...j,children:a.jsxs(xe,{gap:y,children:[r&&a.jsx(xA,{icon:h,...s?.("first")}),o&&a.jsx(yA,{icon:u,...s?.("previous")}),S&&a.jsx(G0,{dotsIcon:m}),o&&a.jsx(vA,{icon:c,...s?.("next")}),r&&a.jsx(bA,{icon:f,...s?.("last")})]})})});Bi.classes=uf;Bi.displayName="@mantine/core/Pagination";Bi.Root=Um;Bi.Control=df;Bi.Dots=zm;Bi.First=xA;Bi.Last=bA;Bi.Next=vA;Bi.Previous=yA;Bi.Items=G0;var qx={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const i$=({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"})}),o$={visibilityToggleIcon:i$},a$=(e,{size:t})=>({root:{"--psi-icon-size":ot(t,"psi-icon-size"),"--psi-button-size":ot(t,"psi-button-size")}}),oo=ge((e,t)=>{const n=oe("PasswordInput",o$,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,required:h,error:m,leftSection:g,disabled:y,id:x,variant:S,inputContainer:j,description:C,label:T,size:R,errorProps:E,descriptionProps:_,labelProps:k,withAsterisk:I,inputWrapperOrder:D,wrapperProps:P,radius:$,rightSection:B,rightSectionWidth:W,rightSectionPointerEvents:Y,leftSectionWidth:Z,visible:U,defaultVisible:G,onVisibilityChange:M,visibilityToggleIcon:L,visibilityToggleButtonProps:z,rightSectionProps:V,leftSectionProps:K,leftSectionPointerEvents:O,withErrorStyles:F,mod:se,attributes:de,...ye}=n,je=ur(x),[Ee,Ke]=ir({value:U,defaultValue:G,finalValue:!1,onChange:M}),De=()=>Ke(!Ee),dt=$e({name:"PasswordInput",classes:qx,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:de,vars:f,varsResolver:a$}),{resolvedClassNames:Ct,resolvedStyles:rt}=Ol({classNames:r,styles:c,props:n}),{styleProps:nt,rest:mt}=_a(ye),Tt=E?.id||`${je}-error`,wt=_?.id||`${je}-description`,Ne=`${!!m&&typeof m!="boolean"?Tt:""} ${!!C?wt:""}`,Ie=Ne.trim().length>0?Ne.trim():void 0,lt=a.jsx(Rn,{...dt("visibilityToggle"),disabled:y,radius:$,"aria-hidden":!z,"aria-pressed":Ee,tabIndex:-1,...z,variant:z?.variant??"subtle",color:"gray",unstyled:u,onTouchEnd:et=>{et.preventDefault(),z?.onTouchEnd?.(et),De()},onMouseDown:et=>{et.preventDefault(),z?.onMouseDown?.(et),De()},onKeyDown:et=>{z?.onKeyDown?.(et),et.key===" "&&(et.preventDefault(),De())},children:a.jsx(L,{reveal:Ee})});return a.jsx(fn.Wrapper,{required:h,id:je,label:T,error:m,description:C,size:R,classNames:Ct,styles:rt,__staticSelector:"PasswordInput",unstyled:u,withAsterisk:I,inputWrapperOrder:D,inputContainer:j,variant:S,labelProps:{...k,htmlFor:je},descriptionProps:{..._,id:wt},errorProps:{...E,id:Tt},mod:se,attributes:de,...dt("root"),...nt,...P,children:a.jsx(fn,{component:"div",error:m,leftSection:g,size:R,classNames:{...Ct,input:Bt(qx.input,Ct.input)},styles:rt,radius:$,disabled:y,__staticSelector:"PasswordInput",rightSectionWidth:W,rightSection:B??lt,variant:S,unstyled:u,leftSectionWidth:Z,rightSectionPointerEvents:Y||"all",rightSectionProps:V,leftSectionProps:K,leftSectionPointerEvents:O,withAria:!1,withErrorStyles:F,attributes:de,children:a.jsx("input",{required:h,"data-invalid":!!m||void 0,"data-with-left-section":!!g||void 0,...dt("innerInput"),disabled:y,id:je,ref:t,...mt,"aria-describedby":Ie,autoComplete:mt.autoComplete||"off",type:Ee?"text":"password"})})})});oo.classes={...$r.classes,...qx};oo.displayName="@mantine/core/PasswordInput";var SA={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const[s$,wA]=Ho(),[l$,c$]=Ho();var jA={card:"m_9dc8ae12"};const u$={withBorder:!0},d$=(e,{radius:t})=>({card:{"--card-radius":Vt(t)}}),W0=ge((e,t)=>{const n=oe("RadioCard",u$,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,checked:h,mod:m,withBorder:g,value:y,onClick:x,name:S,onKeyDown:j,attributes:C,...T}=n,R=$e({name:"RadioCard",classes:jA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:C,vars:f,varsResolver:d$,rootSelector:"card"}),{dir:E}=Ts(),_=wA(),k=typeof h=="boolean"?h:_?.value===y||!1,I=S||_?.name,D=P=>{if(j?.(P),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(P.nativeEvent.code)){P.preventDefault();const $=Array.from(document.querySelectorAll(`[role="radio"][name="${I||"__mantine"}"]`)),B=$.findIndex(Z=>Z===P.target),W=B+1>=$.length?0:B+1,Y=B-1<0?$.length-1:B-1;P.nativeEvent.code==="ArrowDown"&&($[W].focus(),$[W].click()),P.nativeEvent.code==="ArrowUp"&&($[Y].focus(),$[Y].click()),P.nativeEvent.code==="ArrowLeft"&&($[E==="ltr"?Y:W].focus(),$[E==="ltr"?Y:W].click()),P.nativeEvent.code==="ArrowRight"&&($[E==="ltr"?W:Y].focus(),$[E==="ltr"?W:Y].click())}};return a.jsx(l$,{value:{checked:k},children:a.jsx(Pn,{ref:t,mod:[{"with-border":g,checked:k},m],...R("card"),...T,role:"radio","aria-checked":k,name:I,onClick:P=>{x?.(P),_?.onChange(y||"")},onKeyDown:D})})});W0.displayName="@mantine/core/RadioCard";W0.classes=jA;const Q0=ge((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:s,wrapperProps:c,children:u,name:f,readOnly:h,disabled:m,...g}=oe("RadioGroup",null,e),y=ur(f),[x,S]=ir({value:n,defaultValue:r,finalValue:"",onChange:o}),j=C=>!h&&S(typeof C=="string"?C:C.currentTarget.value);return a.jsx(s$,{value:{value:x,onChange:j,size:s,name:y,disabled:m},children:a.jsx(fn.Wrapper,{size:s,ref:t,...c,...g,labelElement:"div",__staticSelector:"RadioGroup",children:a.jsx(g0,{role:"radiogroup",children:u})})})});Q0.classes=fn.Wrapper.classes;Q0.displayName="@mantine/core/RadioGroup";function CA({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:ce(e),height:ce(e),...t},"aria-hidden":!0,...n,children:a.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}var EA={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const f$={icon:CA},h$=(e,{radius:t,color:n,size:r,iconColor:o,variant:s,autoContrast:c})=>{const u=Xr({color:n||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{indicator:{"--radio-size":ot(r,"radio-size"),"--radio-radius":t===void 0?void 0:Vt(t),"--radio-color":s==="outline"?f:Kt(n,e),"--radio-icon-size":ot(r,"radio-icon-size"),"--radio-icon-color":o?Kt(o,e):Ml(c,e)?Ra({color:n,theme:e,autoContrast:c}):void 0}}},Y0=ge((e,t)=>{const n=oe("RadioIndicator",f$,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,icon:h,radius:m,color:g,iconColor:y,autoContrast:x,checked:S,mod:j,variant:C,disabled:T,attributes:R,...E}=n,_=$e({name:"RadioIndicator",classes:EA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:R,vars:f,varsResolver:h$,rootSelector:"indicator"}),k=c$(),I=typeof S=="boolean"?S:k?.checked||!1;return a.jsx(le,{ref:t,..._("indicator",{variant:C}),variant:C,mod:[{checked:I,disabled:T},j],...E,children:a.jsx(h,{..._("icon")})})});Y0.displayName="@mantine/core/RadioIndicator";Y0.classes=EA;const p$={labelPosition:"right"},m$=(e,{size:t,radius:n,color:r,iconColor:o,variant:s,autoContrast:c})=>{const u=Xr({color:r||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{root:{"--radio-size":ot(t,"radio-size"),"--radio-radius":n===void 0?void 0:Vt(n),"--radio-color":s==="outline"?f:Kt(r,e),"--radio-icon-color":o?Kt(o,e):Ml(c,e)?Ra({color:r,theme:e,autoContrast:c}):void 0,"--radio-icon-size":ot(t,"radio-icon-size")}}},jr=ge((e,t)=>{const n=oe("Radio",p$,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,id:h,size:m,label:g,labelPosition:y,description:x,error:S,radius:j,color:C,variant:T,disabled:R,wrapperProps:E,icon:_=CA,rootRef:k,iconColor:I,onChange:D,mod:P,attributes:$,checked:B,...W}=n,Y=$e({name:"Radio",classes:SA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:$,vars:f,varsResolver:m$}),Z=wA(),U=Z?.size??m,G=n.size?m:U,{styleProps:M,rest:L}=_a(W),z=ur(h),V=Z?Z.value===L.value:void 0,K={checked:V??B,name:Z?.name??L.name,onChange:O=>{Z?.onChange(O),D?.(O)},disabled:Z?.disabled??R};return a.jsx(jm,{...Y("root"),__staticSelector:"Radio",__stylesApiProps:n,id:z,size:G,labelPosition:y,label:g,description:x,error:S,disabled:K.disabled,classNames:r,styles:c,unstyled:u,"data-checked":(V??B)||void 0,variant:T,ref:k,mod:P,...M,...E,children:a.jsxs(le,{...Y("inner"),mod:{"label-position":y},children:[a.jsx(le,{...Y("radio",{focusable:!0,variant:T}),...L,...K,component:"input",mod:{error:!!S},ref:t,id:z,type:"radio"}),a.jsx(_,{...Y("icon"),"aria-hidden":!0})]})})});jr.classes=SA;jr.displayName="@mantine/core/Radio";jr.Group=Q0;jr.Card=W0;jr.Indicator=Y0;const g$={duration:100,transition:"fade"};function wT(e,t){return{...g$,...t,...e}}var Bm={tooltip:"m_1b3c8819",arrow:"m_f898399f"};function v$({offset:e,position:t,defaultOpened:n}){const[r,o]=v.useState(n),s=v.useRef(null),{x:c,y:u,elements:f,refs:h,update:m,placement:g}=qb({placement:t,middleware:[Bb({crossAxis:!0,padding:5,rootBoundary:"document"})]}),y=g.includes("right")?e:t.includes("left")?e*-1:0,x=g.includes("bottom")?e:t.includes("top")?e*-1:0,S=v.useCallback(({clientX:j,clientY:C})=>{h.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:j,y:C,left:j+y,top:C+x,right:j,bottom:C}}})},[f.reference]);return v.useEffect(()=>{if(h.floating.current){const j=s.current;j.addEventListener("mousemove",S);const C=ba(h.floating.current);return C.forEach(T=>{T.addEventListener("scroll",m)}),()=>{j.removeEventListener("mousemove",S),C.forEach(T=>{T.removeEventListener("scroll",m)})}}},[f.reference,h.floating.current,m,S,r]),{handleMouseMove:S,x:c,y:u,opened:r,setOpened:o,boundaryRef:s,floating:h.setFloating}}const y$={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:zr("popover")},x$=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Vt(t),"--tooltip-bg":n?Kt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),K0=ge((e,t)=>{const n=oe("TooltipFloating",y$,e),{children:r,refProp:o,withinPortal:s,style:c,className:u,classNames:f,styles:h,unstyled:m,radius:g,color:y,label:x,offset:S,position:j,multiline:C,zIndex:T,disabled:R,defaultOpened:E,variant:_,vars:k,portalProps:I,attributes:D,...P}=n,$=_n(),B=$e({name:"TooltipFloating",props:n,classes:Bm,className:u,style:c,classNames:f,styles:h,unstyled:m,attributes:D,rootSelector:"tooltip",vars:k,varsResolver:x$}),{handleMouseMove:W,x:Y,y:Z,opened:U,boundaryRef:G,floating:M,setOpened:L}=v$({offset:S,position:j,defaultOpened:E}),z=Nl(r);if(!z)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 V=Vn(G,lm(z),t),K=z.props,O=se=>{K.onMouseEnter?.(se),W(se),L(!0)},F=se=>{K.onMouseLeave?.(se),L(!1)};return a.jsxs(a.Fragment,{children:[a.jsx(wa,{...I,withinPortal:s,children:a.jsx(le,{...P,...B("tooltip",{style:{...h_(c,$),zIndex:T,display:!R&&U?"block":"none",top:(Z&&Math.round(Z))??"",left:(Y&&Math.round(Y))??""}}),variant:_,ref:M,mod:{multiline:C},children:x})}),v.cloneElement(z,{...K,[o]:V,onMouseEnter:O,onMouseLeave:F})]})});K0.classes=Bm;K0.displayName="@mantine/core/TooltipFloating";const TA=v.createContext(!1),b$=TA.Provider,S$=()=>v.useContext(TA),w$={openDelay:0,closeDelay:0};function X0(e){const{openDelay:t,closeDelay:n,children:r}=oe("TooltipGroup",w$,e);return a.jsx(b$,{value:!0,children:a.jsx(OL,{delay:{open:t,close:n},children:r})})}X0.displayName="@mantine/core/TooltipGroup";X0.extend=e=>e;function j$(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 C$(e){const t=j$(e.middlewares),n=[A_(e.offset)];return t.shift&&n.push(Bb(typeof t.shift=="boolean"?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip=="boolean"?Mp():Mp(t.flip)),n.push(k_({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline=="boolean"?Cd():Cd(t.inline)):e.inline&&n.push(Cd()),n}function E$(e){const[t,n]=v.useState(e.defaultOpened),o=typeof e.opened=="boolean"?e.opened:t,s=S$(),c=ur(),u=v.useCallback(k=>{n(k),k&&T(c)},[c]),{x:f,y:h,context:m,refs:g,placement:y,middlewareData:{arrow:{x,y:S}={}}}=qb({strategy:e.strategy,placement:e.position,open:o,onOpenChange:u,middleware:C$(e),whileElementsMounted:zx}),{delay:j,currentId:C,setCurrentId:T}=ML(m,{id:c}),{getReferenceProps:R,getFloatingProps:E}=BL([PL(m,{enabled:e.events?.hover,delay:s?j:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch}),UL(m,{enabled:e.events?.focus,visibleOnly:!0}),FL(m,{role:"tooltip"}),zL(m,{enabled:typeof e.opened>"u"})]);xl(()=>{e.onPositionChange?.(y)},[y]);const _=o&&C&&C!==c;return{x:f,y:h,arrowX:x,arrowY:S,reference:g.setReference,floating:g.setFloating,getFloatingProps:E,getReferenceProps:R,isGroupPhase:_,opened:o,placement:y}}const jT={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:zr("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},T$=(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:Vt(t),"--tooltip-bg":n?s.background:void 0,"--tooltip-color":n?s.color:void 0}}},di=ge((e,t)=>{const n=oe("Tooltip",jT,e),{children:r,position:o,refProp:s,label:c,openDelay:u,closeDelay:f,onPositionChange:h,opened:m,defaultOpened:g,withinPortal:y,radius:x,color:S,classNames:j,styles:C,unstyled:T,style:R,className:E,withArrow:_,arrowSize:k,arrowOffset:I,arrowRadius:D,arrowPosition:P,offset:$,transitionProps:B,multiline:W,events:Y,zIndex:Z,disabled:U,positionDependencies:G,onClick:M,onMouseEnter:L,onMouseLeave:z,inline:V,variant:K,keepMounted:O,vars:F,portalProps:se,mod:de,floatingStrategy:ye,middlewares:je,autoContrast:Ee,attributes:Ke,target:De,...dt}=oe("Tooltip",jT,n),{dir:Ct}=Ts(),rt=v.useRef(null),nt=E$({position:K_(Ct,o),closeDelay:f,openDelay:u,onPositionChange:h,opened:m,defaultOpened:g,events:Y,arrowRef:rt,arrowOffset:I,offset:typeof $=="number"?$+(_?k/2:0):$,positionDependencies:[...G,De??r],inline:V,strategy:ye,middlewares:je});v.useEffect(()=>{const Ne=De instanceof HTMLElement?De:typeof De=="string"?document.querySelector(De):De?.current||null;Ne&&nt.reference(Ne)},[De,nt]);const mt=$e({name:"Tooltip",props:n,classes:Bm,className:E,style:R,classNames:j,styles:C,unstyled:T,attributes:Ke,rootSelector:"tooltip",vars:F,varsResolver:T$}),Tt=Nl(r);if(!De&&!Tt)return null;if(De){const Ne=wT(B,{duration:100,transition:"fade"});return a.jsx(a.Fragment,{children:a.jsx(wa,{...se,withinPortal:y,children:a.jsx(lo,{...Ne,keepMounted:O,mounted:!U&&!!nt.opened,duration:nt.isGroupPhase?10:Ne.duration,children:Ie=>a.jsxs(le,{...dt,"data-fixed":ye==="fixed"||void 0,variant:K,mod:[{multiline:W},de],...nt.getFloatingProps({ref:nt.floating,className:mt("tooltip").className,style:{...mt("tooltip").style,...Ie,zIndex:Z,top:nt.y??0,left:nt.x??0}}),children:[c,a.jsx(Lp,{ref:rt,arrowX:nt.arrowX,arrowY:nt.arrowY,visible:_,position:nt.placement,arrowSize:k,arrowOffset:I,arrowRadius:D,arrowPosition:P,...mt("arrow")})]})})})})}const wt=Tt.props,Te=Vn(nt.reference,lm(Tt),t),Pe=wT(B,{duration:100,transition:"fade"});return a.jsxs(a.Fragment,{children:[a.jsx(wa,{...se,withinPortal:y,children:a.jsx(lo,{...Pe,keepMounted:O,mounted:!U&&!!nt.opened,duration:nt.isGroupPhase?10:Pe.duration,children:Ne=>a.jsxs(le,{...dt,"data-fixed":ye==="fixed"||void 0,variant:K,mod:[{multiline:W},de],...nt.getFloatingProps({ref:nt.floating,className:mt("tooltip").className,style:{...mt("tooltip").style,...Ne,zIndex:Z,top:nt.y??0,left:nt.x??0}}),children:[c,a.jsx(Lp,{ref:rt,arrowX:nt.arrowX,arrowY:nt.arrowY,visible:_,position:nt.placement,arrowSize:k,arrowOffset:I,arrowRadius:D,arrowPosition:P,...mt("arrow")})]})})}),v.cloneElement(Tt,nt.getReferenceProps({onClick:M,onMouseEnter:L,onMouseLeave:z,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,...wt,className:Bt(E,wt.className),[s]:Te}))]})});di.classes=Bm;di.displayName="@mantine/core/Tooltip";di.Floating=K0;di.Group=X0;function R$({size:e,thickness:t,sum:n,value:r,root:o,offset:s}){const c=(e*.9-t*2)/2,u=Math.PI*c*2/100,f=o||r===void 0?`${(100-n)*u}, ${n*u}`:`${r*u}, ${(100-r)*u}`;return{strokeWidth:Number.isNaN(t)?12:t,cx:e/2||0,cy:e/2||0,r:c||0,transform:o?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:f,strokeDashoffset:o?0:s||0}}function RA({size:e,value:t,offset:n,sum:r,thickness:o,root:s,color:c,lineRoundCaps:u,tooltip:f,getStyles:h,display:m,...g}){const y=_n();return a.jsx(di.Floating,{disabled:!f,label:f,children:a.jsx(le,{component:"circle",...g,...h("curve"),__vars:{"--curve-color":c?Kt(c,y):void 0},fill:"none",strokeLinecap:u?"round":"butt",...R$({sum:r,size:e,thickness:o,value:t,offset:n,root:s})})})}RA.displayName="@mantine/core/Curve";function _$({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 u=c;const f=[],h=[];for(let m=0;m<n.length;m+=1)f.push({sum:s,offset:u,data:n[m],root:!1}),u-=n[m].value/100*c;if(f.push({sum:s,offset:u,data:{color:o},root:!0}),h.push({...f[f.length-1],lineRoundCaps:!1}),f.length>2){h.push({...f[0],lineRoundCaps:r}),h.push({...f[f.length-2],lineRoundCaps:r});for(let m=1;m<=f.length-3;m+=1)h.push({...f[m],lineRoundCaps:!1})}else h.push({...f[0],lineRoundCaps:r});return h}var _A={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function D$(e,t){return Math.min(e||12,(t||120)/4)}const A$={size:120,thickness:12},k$=(e,{size:t,thickness:n,transitionDuration:r})=>({root:{"--rp-size":ce(t),"--rp-label-offset":ce(n*2),"--rp-transition-duration":r?`${r}ms`:void 0}}),Vm=ge((e,t)=>{const n=oe("RingProgress",A$,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,label:h,sections:m,size:g,thickness:y,roundCaps:x,rootColor:S,transitionDuration:j,attributes:C,...T}=n,R=$e({name:"RingProgress",classes:_A,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:C,vars:f,varsResolver:k$}),E=D$(y,g),_=_$({size:g,thickness:E,sections:m,renderRoundedLineCaps:x,rootColor:S}).map(({data:k,sum:I,root:D,lineRoundCaps:P,offset:$},B)=>v.createElement(RA,{...k,key:B,size:g,thickness:E,sum:I,offset:$,color:k?.color,root:D,lineRoundCaps:P,getStyles:R}));return a.jsxs(le,{...R("root"),size:g,ref:t,...T,children:[a.jsx("svg",{...R("svg"),children:_}),h&&a.jsx("div",{...R("label"),children:h})]})});Vm.classes=_A;Vm.displayName="@mantine/core/RingProgress";var DA={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const P$={withItemsBorders:!0},N$=(e,{radius:t,color:n,transitionDuration:r,size:o,transitionTimingFunction:s})=>({root:{"--sc-radius":t===void 0?void 0:Vt(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":ot(o,"sc-padding"),"--sc-font-size":Wn(o)}}),Zc=ge((e,t)=>{const n=oe("SegmentedControl",P$,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,data:h,value:m,defaultValue:g,onChange:y,size:x,name:S,disabled:j,readOnly:C,fullWidth:T,orientation:R,radius:E,color:_,transitionDuration:k,transitionTimingFunction:I,variant:D,autoContrast:P,withItemsBorders:$,mod:B,attributes:W,...Y}=n,Z=$e({name:"SegmentedControl",props:n,classes:DA,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:W,vars:f,varsResolver:N$}),U=_n(),G=h.map(De=>typeof De=="string"?{label:De,value:De}:De),M=VM(),[L,z]=v.useState(kp()),[V,K]=v.useState(null),[O,F]=v.useState({}),se=(De,dt)=>{O[dt]=De,F(O)},[de,ye]=ir({value:m,defaultValue:g,finalValue:Array.isArray(h)?G.find(De=>!De.disabled)?.value??h[0]?.value??null:null,onChange:y}),je=ur(S),Ee=G.map(De=>v.createElement(le,{...Z("control"),mod:{active:de===De.value,orientation:R},key:De.value},v.createElement("input",{...Z("input"),disabled:j||De.disabled,type:"radio",name:je,value:De.value,id:`${je}-${De.value}`,checked:de===De.value,onChange:()=>!C&&ye(De.value),"data-focus-ring":U.focusRing,key:`${De.value}-input`}),v.createElement(le,{component:"label",...Z("label"),mod:{active:de===De.value&&!(j||De.disabled),disabled:j||De.disabled,"read-only":C},htmlFor:`${je}-${De.value}`,ref:dt=>se(dt,De.value),__vars:{"--sc-label-color":_!==void 0?Ra({color:_,theme:U,autoContrast:P}):void 0},key:`${De.value}-label`},a.jsx("span",{...Z("innerLabel"),children:De.label})))),Ke=Vn(t,De=>K(De));return NM(()=>{z(kp())},[h.length]),h.length===0?null:a.jsxs(le,{...Z("root"),variant:D,size:x,ref:Ke,mod:[{"full-width":T,orientation:R,initialized:M,"with-items-borders":$},B],...Y,role:"radiogroup","data-disabled":j,children:[typeof de=="string"&&a.jsx(Zb,{target:O[de],parent:V,component:"span",transitionDuration:"var(--sc-transition-duration)",...Z("indicator")},L),Ee]})});Zc.classes=DA;Zc.displayName="@mantine/core/SegmentedControl";var AA={container:"m_925c2d2c",root:"m_2415a157"};function O$({spacing:e,verticalSpacing:t,cols:n,selector:r}){const o=_n(),s=t===void 0?e:t,c=Es({"--sg-spacing-x":Gn(no(e)),"--sg-spacing-y":Gn(no(s)),"--sg-cols":no(n)?.toString()}),u=un(o.breakpoints).reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--sg-spacing-x"]=Gn(e[g])),typeof s=="object"&&s[g]!==void 0&&(m[g]["--sg-spacing-y"]=Gn(s[g])),typeof n=="object"&&n[g]!==void 0&&(m[g]["--sg-cols"]=n[g]),m),{}),h=_d(un(u),o.breakpoints).filter(m=>un(u[m.value]).length>0).map(m=>({query:`(min-width: ${o.breakpoints[m.value]})`,styles:u[m.value]}));return a.jsx(Ll,{styles:c,media:h,selector:r})}function Xy(e){return typeof e=="object"&&e!==null?un(e):[]}function M$(e){return e.sort((t,n)=>Rd(t)-Rd(n))}function L$({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...Xy(e),...Xy(t),...Xy(n)]));return M$(r)}function I$({spacing:e,verticalSpacing:t,cols:n,selector:r}){const o=t===void 0?e:t,s=Es({"--sg-spacing-x":Gn(no(e)),"--sg-spacing-y":Gn(no(o)),"--sg-cols":no(n)?.toString()}),c=L$({spacing:e,verticalSpacing:t,cols:n}),u=c.reduce((h,m)=>(h[m]||(h[m]={}),typeof e=="object"&&e[m]!==void 0&&(h[m]["--sg-spacing-x"]=Gn(e[m])),typeof o=="object"&&o[m]!==void 0&&(h[m]["--sg-spacing-y"]=Gn(o[m])),typeof n=="object"&&n[m]!==void 0&&(h[m]["--sg-cols"]=n[m]),h),{}),f=c.map(h=>({query:`simple-grid (min-width: ${h})`,styles:u[h]}));return a.jsx(Ll,{styles:s,container:f,selector:r})}const z$={cols:1,spacing:"md",type:"media"},Fm=ge((e,t)=>{const n=oe("SimpleGrid",z$,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,cols:h,verticalSpacing:m,spacing:g,type:y,attributes:x,...S}=n,j=$e({name:"SimpleGrid",classes:AA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:x,vars:f}),C=Zd();return y==="container"?a.jsxs(a.Fragment,{children:[a.jsx(I$,{...n,selector:`.${C}`}),a.jsx("div",{...j("container"),children:a.jsx(le,{ref:t,...j("root",{className:C}),...S})})]}):a.jsxs(a.Fragment,{children:[a.jsx(O$,{...n,selector:`.${C}`}),a.jsx(le,{ref:t,...j("root",{className:C}),...S})]})});Fm.classes=AA;Fm.displayName="@mantine/core/SimpleGrid";const kA=ge((e,t)=>{const{w:n,h:r,miw:o,mih:s,...c}=oe("Space",null,e);return a.jsx(le,{ref:t,...c,w:n,miw:o??n,h:r,mih:s??r})});kA.displayName="@mantine/core/Space";var PA={root:"m_6d731127"};const $$={gap:"md",align:"stretch",justify:"flex-start"},U$=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":Gn(t),"--stack-align":n,"--stack-justify":r}}),Le=ge((e,t)=>{const n=oe("Stack",$$,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,align:h,justify:m,gap:g,variant:y,attributes:x,...S}=n,j=$e({name:"Stack",props:n,classes:PA,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:x,vars:f,varsResolver:U$});return a.jsx(le,{ref:t,...j("root"),variant:y,...S})});Le.classes=PA;Le.displayName="@mantine/core/Stack";const[B$,V$]=Ar("Stepper component was not found in tree");var J0={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 zp=()=>null;zp.displayName="@mantine/core/StepperCompleted";const ip=(e,t)=>typeof e=="function"?a.jsx(e,{step:t||0}):e,F$={withIcon:!0,allowStepClick:!0,iconPosition:"left"},Z0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,step:u,state:f,color:h,icon:m,completedIcon:g,progressIcon:y,label:x,description:S,withIcon:j,iconSize:C,loading:T,allowStepClick:R,allowStepSelect:E,iconPosition:_,orientation:k,mod:I,...D}=oe("StepperStep",F$,e),P=V$(),$=_n(),B={classNames:n,styles:s},W=f==="stepCompleted"?null:f==="stepProgress"?y:m,Y={"data-progress":f==="stepProgress"||void 0,"data-completed":f==="stepCompleted"||void 0};return a.jsxs(Pn,{...P.getStyles("step",{className:r,style:o,variant:P.orientation,...B}),mod:[{"icon-position":_||P.iconPosition,"allow-click":R},I],ref:t,...Y,...D,__vars:{"--step-color":h?Kt(h,$):void 0},tabIndex:R?0:-1,children:[j&&a.jsxs("span",{...P.getStyles("stepWrapper",B),children:[a.jsxs("span",{...P.getStyles("stepIcon",B),...Y,children:[a.jsx(lo,{mounted:f==="stepCompleted",transition:"pop",duration:200,children:Z=>a.jsx("span",{...P.getStyles("stepCompletedIcon",{style:Z,...B}),children:T?a.jsx(_r,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...P.getStyles("stepLoader",B)}):ip(g,u)||a.jsx(sf,{size:"60%"})})}),f!=="stepCompleted"?T?a.jsx(_r,{...P.getStyles("stepLoader",B),size:"calc(var(--stepper-icon-size) / 2)",color:h}):ip(W||m,u):null]}),k==="vertical"&&a.jsx("span",{...P.getStyles("verticalSeparator",B),"data-active":f==="stepCompleted"||void 0})]}),(x||S)&&a.jsxs("span",{...P.getStyles("stepBody",B),"data-orientation":P.orientation,"data-icon-position":_||P.iconPosition,children:[x&&a.jsx("span",{...P.getStyles("stepLabel",B),children:ip(x,u)}),S&&a.jsx("span",{...P.getStyles("stepDescription",B),children:ip(S,u)})]})]})});Z0.classes=J0;Z0.displayName="@mantine/core/StepperStep";const H$={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},q$=(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":Ml(c,e)?Ra({color:t,theme:e,autoContrast:c}):void 0,"--stepper-icon-size":n===void 0?ot(r,"stepper-icon-size"):ce(n),"--stepper-content-padding":Gn(o),"--stepper-radius":s===void 0?void 0:Vt(s),"--stepper-fz":Wn(r),"--stepper-spacing":Gn(r)}}),eu=ge((e,t)=>{const n=oe("Stepper",H$,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,children:h,onStepClick:m,active:g,icon:y,completedIcon:x,progressIcon:S,color:j,iconSize:C,contentPadding:T,orientation:R,iconPosition:E,size:_,radius:k,allowNextStepsSelect:I,wrap:D,autoContrast:P,attributes:$,...B}=n,W=$e({name:"Stepper",classes:J0,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:$,vars:f,varsResolver:q$}),Y=v.Children.toArray(h),Z=Y.filter(V=>V.type!==zp),U=Y.find(V=>V.type===zp),G=Z.reduce((V,K,O)=>{const F=g===O?"stepProgress":g>O?"stepCompleted":"stepInactive",de=typeof m!="function"?!1:typeof K.props.allowStepSelect=="boolean"?K.props.allowStepSelect:F==="stepCompleted"||I;return V.push(v.cloneElement(K,{icon:K.props.icon||y||O+1,key:O,step:O,state:F,onClick:()=>de&&m?.(O),allowStepClick:de,completedIcon:K.props.completedIcon||x,progressIcon:K.props.progressIcon||S,color:K.props.color||j,iconSize:C,iconPosition:K.props.iconPosition||E,orientation:R})),R==="horizontal"&&O!==Z.length-1&&V.push(v.createElement("div",{...W("separator"),"data-active":O<g||void 0,"data-orientation":R,key:`separator-${O}`})),V},[]),M=Z[g]?.props?.children,L=U?.props?.children,z=g>Z.length-1?L:M;return a.jsx(B$,{value:{getStyles:W,orientation:R,iconPosition:E},children:a.jsxs(le,{...W("root"),ref:t,size:_,...B,children:[a.jsx(le,{...W("steps"),mod:{orientation:R,"icon-position":E,wrap:D&&R!=="vertical"},children:G}),z&&a.jsx("div",{...W("content"),children:z})]})})});eu.classes=J0;eu.displayName="@mantine/core/Stepper";eu.Completed=zp;eu.Step=Z0;var NA={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const OA=v.createContext(null),G$=OA.Provider,W$=()=>v.useContext(OA),eS=ge((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:s,wrapperProps:c,children:u,readOnly:f,disabled:h,...m}=oe("SwitchGroup",null,e),[g,y]=ir({value:n,defaultValue:r,finalValue:[],onChange:o}),x=S=>{const j=S.currentTarget.value;!f&&y(g.includes(j)?g.filter(C=>C!==j):[...g,j])};return a.jsx(G$,{value:{value:g,onChange:x,size:s,disabled:h},children:a.jsx(fn.Wrapper,{size:s,ref:t,...c,...m,labelElement:"div",__staticSelector:"SwitchGroup",children:a.jsx(g0,{role:"group",children:u})})})});eS.classes=fn.Wrapper.classes;eS.displayName="@mantine/core/SwitchGroup";const Q$={labelPosition:"right",withThumbIndicator:!0},Y$=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:Vt(t),"--switch-height":ot(r,"switch-height"),"--switch-width":ot(r,"switch-width"),"--switch-thumb-size":ot(r,"switch-thumb-size"),"--switch-label-font-size":ot(r,"switch-label-font-size"),"--switch-track-label-padding":ot(r,"switch-track-label-padding"),"--switch-color":n?Kt(n,e):void 0}}),hf=ge((e,t)=>{const n=oe("Switch",Q$,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,color:h,label:m,offLabel:g,onLabel:y,id:x,size:S,radius:j,wrapperProps:C,thumbIcon:T,checked:R,defaultChecked:E,onChange:_,labelPosition:k,description:I,error:D,disabled:P,variant:$,rootRef:B,mod:W,withThumbIndicator:Y,attributes:Z,...U}=n,G=W$(),M=S||G?.size,L=$e({name:"Switch",props:n,classes:NA,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:Z,vars:f,varsResolver:Y$}),{styleProps:z,rest:V}=_a(U),K=ur(x),O={checked:G?.value.includes(V.value)??R,onChange:de=>{G?.onChange(de),_?.(de)},disabled:G?.disabled??P},[F,se]=ir({value:O.checked??R,defaultValue:E,finalValue:!1});return a.jsxs(jm,{...L("root"),__staticSelector:"Switch",__stylesApiProps:n,id:K,size:M,labelPosition:k,label:m,description:I,error:D,disabled:O.disabled,bodyElement:"label",labelElement:"span",classNames:r,styles:c,unstyled:u,"data-checked":O.checked,variant:$,ref:B,mod:W,...z,...C,children:[a.jsx("input",{...V,...O,checked:F,"data-checked":O.checked,onChange:de=>{O.onChange?.(de),se(de.currentTarget.checked)},id:K,ref:t,type:"checkbox",role:"switch",...L("input")}),a.jsxs(le,{"aria-hidden":"true",component:"span",mod:{error:D,"label-position":k,"without-labels":!y&&!g},...L("track"),children:[a.jsx(le,{component:"span",mod:{"reduce-motion":!0,"with-thumb-indicator":Y&&!T},...L("thumb"),children:T}),a.jsx("span",{...L("trackLabel"),children:F?y:g})]})]})});hf.classes={...NA,...OD};hf.displayName="@mantine/core/Switch";hf.Group=eS;const[K$,X$]=Ar("Table component was not found in the tree");var pf={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 J$(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:u,className:f,style:h,styles:m,...g}=c,y=X$();return a.jsx(le,{component:e,ref:s,...J$(y,t),...y.getStyles(e,{className:f,classNames:u,style:h,styles:m,props:c}),...g})});return r.displayName=`@mantine/core/${n}`,r.classes=pf,r}const Gx=$l("th",{columnBorder:!0}),MA=$l("td",{columnBorder:!0}),Sp=$l("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),LA=$l("thead",{stickyHeader:!0}),IA=$l("tbody"),zA=$l("tfoot"),$A=$l("caption",{captionSide:!0});function tS({data:e}){return a.jsxs(a.Fragment,{children:[e.caption&&a.jsx($A,{children:e.caption}),e.head&&a.jsx(LA,{children:a.jsx(Sp,{children:e.head.map((t,n)=>a.jsx(Gx,{children:t},n))})}),e.body&&a.jsx(IA,{children:e.body.map((t,n)=>a.jsx(Sp,{children:t.map((r,o)=>a.jsx(MA,{children:r},o))},n))}),e.foot&&a.jsx(zA,{children:a.jsx(Sp,{children:e.foot.map((t,n)=>a.jsx(Gx,{children:t},n))})})]})}tS.displayName="@mantine/core/TableDataRenderer";const Z$={type:"scrollarea"},e8=(e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":ce(t),"--table-max-height":ce(n),"--table-overflow":r==="native"?"auto":void 0}}),nS=ge((e,t)=>{const n=oe("TableScrollContainer",Z$,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,children:h,minWidth:m,maxHeight:g,type:y,scrollAreaProps:x,attributes:S,...j}=n,C=$e({name:"TableScrollContainer",classes:pf,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:S,vars:f,varsResolver:e8,rootSelector:"scrollContainer"});return a.jsx(le,{component:y==="scrollarea"?Jr:"div",...y==="scrollarea"?g?{offsetScrollbars:"xy",...x}:{offsetScrollbars:"x",...x}:{},ref:t,...C("scrollContainer"),...j,children:a.jsx("div",{...C("scrollContainerInner"),children:h})})});nS.classes=pf;nS.displayName="@mantine/core/TableScrollContainer";const t8={withRowBorders:!0,verticalSpacing:7},n8=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:o,borderColor:s,stripedColor:c,highlightOnHoverColor:u,striped:f,highlightOnHover:h,stickyHeaderOffset:m,stickyHeader:g})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":Gn(r),"--table-vertical-spacing":Gn(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":h&&u?Kt(u,e):void 0,"--table-sticky-header-offset":g?ce(m):void 0}}),te=ge((e,t)=>{const n=oe("Table",t8,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,horizontalSpacing:h,verticalSpacing:m,captionSide:g,stripedColor:y,highlightOnHoverColor:x,striped:S,highlightOnHover:j,withColumnBorders:C,withRowBorders:T,withTableBorder:R,borderColor:E,layout:_,variant:k,data:I,children:D,stickyHeader:P,stickyHeaderOffset:$,mod:B,tabularNums:W,attributes:Y,...Z}=n,U=$e({name:"Table",props:n,className:o,style:s,classes:pf,classNames:r,styles:c,unstyled:u,attributes:Y,rootSelector:"table",vars:f,varsResolver:n8});return a.jsx(K$,{value:{getStyles:U,stickyHeader:P,striped:S===!0?"odd":S||void 0,highlightOnHover:j,withColumnBorders:C,withRowBorders:T,captionSide:g||"bottom"},children:a.jsx(le,{component:"table",variant:k,ref:t,mod:[{"data-with-table-border":R,"data-tabular-nums":W},B],...U("table"),...Z,children:D||!!I&&a.jsx(tS,{data:I})})})});te.classes=pf;te.displayName="@mantine/core/Table";te.Td=MA;te.Th=Gx;te.Tr=Sp;te.Thead=LA;te.Tbody=IA;te.Tfoot=zA;te.Caption=$A;te.ScrollContainer=nS;te.DataRenderer=tS;const[r8,rS]=Ar("Tabs component was not found in the tree");var mf={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 iS=ge((e,t)=>{const n=oe("TabsList",null,e),{children:r,className:o,grow:s,justify:c,classNames:u,styles:f,style:h,mod:m,...g}=n,y=rS();return a.jsx(le,{...g,...y.getStyles("list",{className:o,style:h,classNames:u,styles:f,props:n,variant:y.variant}),ref:t,role:"tablist",variant:y.variant,mod:[{grow:s,orientation:y.orientation,placement:y.orientation==="vertical"&&y.placement,inverted:y.inverted},m],"aria-orientation":y.orientation,__vars:{"--tabs-justify":c},children:r})});iS.classes=mf;iS.displayName="@mantine/core/TabsList";const oS=ge((e,t)=>{const n=oe("TabsPanel",null,e),{children:r,className:o,value:s,classNames:c,styles:u,style:f,mod:h,keepMounted:m,...g}=n,y=rS(),x=y.value===s,S=y.keepMounted||m||x?r:null;return a.jsx(le,{...y.getStyles("panel",{className:o,classNames:c,styles:u,style:[f,x?void 0:{display:"none"}],props:n}),ref:t,mod:[{orientation:y.orientation},h],role:"tabpanel",id:y.getPanelId(s),"aria-labelledby":y.getTabId(s),...g,children:S})});oS.classes=mf;oS.displayName="@mantine/core/TabsPanel";const aS=ge((e,t)=>{const n=oe("TabsTab",null,e),{className:r,children:o,rightSection:s,leftSection:c,value:u,onClick:f,onKeyDown:h,disabled:m,color:g,style:y,classNames:x,styles:S,vars:j,mod:C,tabIndex:T,...R}=n,E=_n(),{dir:_}=Ts(),k=rS(),I=u===k.value,D=$=>{k.onChange(k.allowTabDeactivation&&u===k.value?null:u),f?.($)},P={classNames:x,styles:S,props:n};return a.jsxs(Pn,{...k.getStyles("tab",{className:r,style:y,variant:k.variant,...P}),disabled:m,unstyled:k.unstyled,variant:k.variant,mod:[{active:I,disabled:m,orientation:k.orientation,inverted:k.inverted,placement:k.orientation==="vertical"&&k.placement},C],ref:t,role:"tab",id:k.getTabId(u),"aria-selected":I,tabIndex:T!==void 0?T:I||k.value===null?0:-1,"aria-controls":k.getPanelId(u),onClick:D,__vars:{"--tabs-color":g?Kt(g,E):void 0},onKeyDown:Eb({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:k.activateTabWithKeyboard,loop:k.loop,orientation:k.orientation||"horizontal",dir:_,onKeyDown:h}),...R,children:[c&&a.jsx("span",{...k.getStyles("tabSection",P),"data-position":"left",children:c}),o&&a.jsx("span",{...k.getStyles("tabLabel",P),children:o}),s&&a.jsx("span",{...k.getStyles("tabSection",P),"data-position":"right",children:s})]})});aS.classes=mf;aS.displayName="@mantine/core/TabsTab";const CT="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",i8={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,variant:"default",placement:"left"},o8=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":Vt(t),"--tabs-color":Kt(n,e),"--tabs-text-color":Ml(r,e)?Ra({color:n,theme:e,autoContrast:r}):void 0}}),jn=ge((e,t)=>{const n=oe("Tabs",i8,e),{defaultValue:r,value:o,onChange:s,orientation:c,children:u,loop:f,id:h,activateTabWithKeyboard:m,allowTabDeactivation:g,variant:y,color:x,radius:S,inverted:j,placement:C,keepMounted:T,classNames:R,styles:E,unstyled:_,className:k,style:I,vars:D,autoContrast:P,mod:$,attributes:B,...W}=n,Y=ur(h),[Z,U]=ir({value:o,defaultValue:r,finalValue:null,onChange:s}),G=$e({name:"Tabs",props:n,classes:mf,className:k,style:I,classNames:R,styles:E,unstyled:_,attributes:B,vars:D,varsResolver:o8});return a.jsx(r8,{value:{placement:C,value:Z,orientation:c,id:Y,loop:f,activateTabWithKeyboard:m,getTabId:vE(`${Y}-tab`,CT),getPanelId:vE(`${Y}-panel`,CT),onChange:U,allowTabDeactivation:g,variant:y,color:x,radius:S,inverted:j,keepMounted:T,unstyled:_,getStyles:G},children:a.jsx(le,{ref:t,id:Y,variant:y,mod:[{orientation:c,inverted:c==="horizontal"&&j,placement:c==="vertical"&&C},$],...G("root"),...W,children:u})})});jn.classes=mf;jn.displayName="@mantine/core/Tabs";jn.Tab=aS;jn.Panel=oS;jn.List=iS;const He=ge((e,t)=>{const n=oe("TextInput",null,e);return a.jsx($r,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});He.classes=$r.classes;He.displayName="@mantine/core/TextInput";var UA={root:"m_7341320d"};const a8=(e,{size:t,radius:n,variant:r,gradient:o,color:s,autoContrast:c})=>{const u=e.variantColorResolver({color:s||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:c});return{root:{"--ti-size":ot(t,"ti-size"),"--ti-radius":n===void 0?void 0:Vt(n),"--ti-bg":s||r?u.background:void 0,"--ti-color":s||r?u.color:void 0,"--ti-bd":s||r?u.border:void 0}}},sS=ge((e,t)=>{const n=oe("ThemeIcon",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,autoContrast:h,attributes:m,...g}=n,y=$e({name:"ThemeIcon",classes:UA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:m,vars:f,varsResolver:a8});return a.jsx(le,{ref:t,...y("root"),...g})});sS.classes=UA;sS.displayName="@mantine/core/ThemeIcon";const s8=["h1","h2","h3","h4","h5","h6"],l8=["xs","sm","md","lg","xl"];function c8(e,t){const n=t!==void 0?t:`h${e}`;return s8.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:l8.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:ce(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var BA={root:"m_8a5d1357"};const u8={order:1},d8=(e,{order:t,size:n,lineClamp:r,textWrap:o})=>{const s=c8(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}}},Ve=ge((e,t)=>{const n=oe("Title",u8,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,order:f,vars:h,size:m,variant:g,lineClamp:y,textWrap:x,mod:S,attributes:j,...C}=n,T=$e({name:"Title",props:n,classes:BA,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:j,vars:h,varsResolver:d8});return[1,2,3,4,5,6].includes(f)?a.jsx(le,{...T("root"),component:`h${f}`,variant:g,ref:t,mod:[{order:f,"data-line-clamp":typeof y=="number"},S],size:m,...C}):null});Ve.classes=BA;Ve.displayName="@mantine/core/Title";function VA(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 FA(e){return v.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function f8(e,t,n){const r=[],o=[],s={};for(const c of e){const u=c.position||t;s[u]=s[u]||0,s[u]+=1,s[u]<=n?o.push(c):r.push(c)}return{notifications:o,queue:r}}const h8=()=>VA({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),Ul=h8(),p8=(e=Ul)=>FA(e);function mu(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]),o=f8(r,n.defaultPosition,n.limit);e.setState({notifications:o.notifications,queue:o.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function Ae(e,t=Ul){const n=e.id||kp();return mu(t,r=>e.id&&r.some(o=>o.id===e.id)?r:[...r,{...e,id:n}]),n}function HA(e,t=Ul){return mu(t,n=>n.filter(r=>r.id===e?(r.onClose?.(r),!1):!0)),e}function ul(e,t=Ul){return mu(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function m8(e=Ul){mu(e,()=>[])}function g8(e=Ul){mu(e,t=>t.slice(0,e.getState().limit))}const Ni={show:Ae,hide:HA,update:ul,clean:m8,cleanQueue:g8,updateState:mu};function Wx(e,t){return Wx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Wx(e,t)}function qA(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Wx(e,t)}var Jy={exports:{}},Zy,ET;function v8(){if(ET)return Zy;ET=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Zy=e,Zy}var ex,TT;function y8(){if(TT)return ex;TT=1;var e=v8();function t(){}function n(){}return n.resetWarningCache=t,ex=function(){function r(c,u,f,h,m,g){if(g!==e){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}}r.isRequired=r;function 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},ex}var RT;function x8(){return RT||(RT=1,Jy.exports=y8()()),Jy.exports}var b8=x8();const ln=om(b8),_T={disabled:!1},$p=Mn.createContext(null);var S8=function(t){return t.scrollTop},bd="unmounted",rl="exited",il="entering",Ic="entered",Qx="exiting",ka=(function(e){qA(t,e);function t(r,o){var s;s=e.call(this,r,o)||this;var c=o,u=c&&!c.isMounting?r.enter:r.appear,f;return s.appearStatus=null,r.in?u?(f=rl,s.appearStatus=il):f=Ic:r.unmountOnExit||r.mountOnEnter?f=bd:f=rl,s.state={status:f},s.nextCallback=null,s}t.getDerivedStateFromProps=function(o,s){var c=o.in;return c&&s.status===bd?{status:rl}: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!==il&&c!==Ic&&(s=il):(c===il||c===Ic)&&(s=Qx)}this.updateStatus(!1,s)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,s,c,u;return s=c=u=o,o!=null&&typeof o!="number"&&(s=o.exit,c=o.enter,u=o.appear!==void 0?o.appear:c),{exit:s,enter:c,appear:u}},n.updateStatus=function(o,s){if(o===void 0&&(o=!1),s!==null)if(this.cancelNextCallback(),s===il){if(this.props.unmountOnExit||this.props.mountOnEnter){var c=this.props.nodeRef?this.props.nodeRef.current:xd.findDOMNode(this);c&&S8(c)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===rl&&this.setState({status:bd})},n.performEnter=function(o){var s=this,c=this.props.enter,u=this.context?this.context.isMounting:o,f=this.props.nodeRef?[u]:[xd.findDOMNode(this),u],h=f[0],m=f[1],g=this.getTimeouts(),y=u?g.appear:g.enter;if(!o&&!c||_T.disabled){this.safeSetState({status:Ic},function(){s.props.onEntered(h)});return}this.props.onEnter(h,m),this.safeSetState({status:il},function(){s.props.onEntering(h,m),s.onTransitionEnd(y,function(){s.safeSetState({status:Ic},function(){s.props.onEntered(h,m)})})})},n.performExit=function(){var o=this,s=this.props.exit,c=this.getTimeouts(),u=this.props.nodeRef?void 0:xd.findDOMNode(this);if(!s||_T.disabled){this.safeSetState({status:rl},function(){o.props.onExited(u)});return}this.props.onExit(u),this.safeSetState({status:Qx},function(){o.props.onExiting(u),o.onTransitionEnd(c.exit,function(){o.safeSetState({status:rl},function(){o.props.onExited(u)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,s){s=this.setNextCallback(s),this.setState(o,s)},n.setNextCallback=function(o){var s=this,c=!0;return this.nextCallback=function(u){c&&(c=!1,s.nextCallback=null,o(u))},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:xd.findDOMNode(this),u=o==null&&!this.props.addEndListener;if(!c||u){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var f=this.props.nodeRef?[this.nextCallback]:[c,this.nextCallback],h=f[0],m=f[1];this.props.addEndListener(h,m)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===bd)return null;var s=this.props,c=s.children;s.in,s.mountOnEnter,s.unmountOnExit,s.appear,s.enter,s.exit,s.timeout,s.addEndListener,s.onEnter,s.onEntering,s.onEntered,s.onExit,s.onExiting,s.onExited,s.nodeRef;var u=A0(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Mn.createElement($p.Provider,{value:null},typeof c=="function"?c(o,u):Mn.cloneElement(Mn.Children.only(c),u))},t})(Mn.Component);ka.contextType=$p;ka.propTypes={};function Dc(){}ka.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Dc,onEntering:Dc,onEntered:Dc,onExit:Dc,onExiting:Dc,onExited:Dc};ka.UNMOUNTED=bd;ka.EXITED=rl;ka.ENTERING=il;ka.ENTERED=Ic;ka.EXITING=Qx;function w8(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lS(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 j8(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,u={};for(var f in t){if(r[f])for(c=0;c<r[f].length;c++){var h=r[f][c];u[r[f][c]]=n(h)}u[f]=n(f)}for(c=0;c<o.length;c++)u[o[c]]=n(o[c]);return u}function dl(e,t,n){return n[t]!=null?n[t]:e.props[t]}function C8(e,t){return lS(e.children,function(n){return v.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:dl(n,"appear",e),enter:dl(n,"enter",e),exit:dl(n,"exit",e)})})}function E8(e,t,n){var r=lS(e.children),o=j8(t,r);return Object.keys(o).forEach(function(s){var c=o[s];if(v.isValidElement(c)){var u=s in t,f=s in r,h=t[s],m=v.isValidElement(h)&&!h.props.in;f&&(!u||m)?o[s]=v.cloneElement(c,{onExited:n.bind(null,c),in:!0,exit:dl(c,"exit",e),enter:dl(c,"enter",e)}):!f&&u&&!m?o[s]=v.cloneElement(c,{in:!1}):f&&u&&v.isValidElement(h)&&(o[s]=v.cloneElement(c,{onExited:n.bind(null,c),in:h.props.in,exit:dl(c,"exit",e),enter:dl(c,"enter",e)}))}}),o}var T8=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},R8={component:"div",childFactory:function(t){return t}},fs=(function(e){qA(t,e);function t(r,o){var s;s=e.call(this,r,o)||this;var c=s.handleExited.bind(w8(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,u=s.handleExited,f=s.firstRender;return{children:f?C8(o,u):E8(o,c,u),firstRender:!1}},n.handleExited=function(o,s){var c=lS(this.props.children);o.key in c||(o.props.onExited&&o.props.onExited(s),this.mounted&&this.setState(function(u){var f=Ip({},u.children);return delete f[o.key],{children:f}}))},n.render=function(){var o=this.props,s=o.component,c=o.childFactory,u=A0(o,["component","childFactory"]),f=this.state.contextValue,h=T8(this.state.children).map(c);return delete u.appear,delete u.enter,delete u.exit,s===null?Mn.createElement($p.Provider,{value:f},h):Mn.createElement($p.Provider,{value:f},Mn.createElement(s,u,h))},t})(Mn.Component);fs.propTypes={};fs.defaultProps=R8;const GA=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function _8(e,t){return e.reduce((n,r)=>(n[r.position||t].push(r),n),GA.reduce((n,r)=>(n[r]=[],n),{}))}const DT={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},D8={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function A8({state:e,maxHeight:t,position:n,transitionDuration:r}){const[o,s]=n.split("-"),c=s==="center"?`${o}-center`:s,u={opacity:0,maxHeight:t,transform:DT[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:D8[c]},h={opacity:0,maxHeight:0,transform:DT[c]};return{...u,...{entering:f,entered:f,exiting:h,exited:h}[e]}}function k8(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const WA=v.forwardRef(({data:e,onHide:t,autoClose:n,...r},o)=>{const{autoClose:s,message:c,...u}=e,f=k8(n,e.autoClose),h=v.useRef(-1),m=()=>window.clearTimeout(h.current),g=()=>{t(e.id),m()},y=()=>{typeof f=="number"&&(h.current=window.setTimeout(g,f))};return v.useEffect(()=>{e.onOpen?.(e)},[]),v.useEffect(()=>(y(),m),[f]),a.jsx(H0,{...r,...u,onClose:g,ref:o,onMouseEnter:m,onMouseLeave:y,children:c})});WA.displayName="@mantine/notifications/NotificationContainer";var QA={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const P8=ka,N8={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:zr("overlay"),store:Ul,withinPortal:!0},O8=(e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t?.toString(),"--notifications-container-width":ce(n)}}),Pa=ge((e,t)=>{const n=oe("Notifications",N8,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,position:h,autoClose:m,transitionDuration:g,containerWidth:y,notificationMaxHeight:x,limit:S,zIndex:j,store:C,portalProps:T,withinPortal:R,...E}=n,_=_n(),k=p8(C),I=TM(),D=_b(),P=v.useRef({}),$=v.useRef(0),W=(_.respectReducedMotion?D:!1)?1:g,Y=$e({name:"Notifications",classes:QA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:O8});v.useEffect(()=>{C?.updateState(G=>({...G,limit:S||5,defaultPosition:h}))},[S,h]),xl(()=>{k.notifications.length>$.current&&setTimeout(()=>I(),0),$.current=k.notifications.length},[k.notifications]);const Z=_8(k.notifications,h),U=GA.reduce((G,M)=>(G[M]=Z[M].map(({style:L,...z})=>a.jsx(P8,{timeout:W,onEnter:()=>P.current[z.id].offsetHeight,nodeRef:{current:P.current[z.id]},children:V=>a.jsx(WA,{ref:K=>{K&&(P.current[z.id]=K)},data:z,onHide:K=>HA(K,C),autoClose:m,...Y("notification",{style:{...A8({state:V,position:M,transitionDuration:W,maxHeight:x}),...L}})})},z.id)),G),{});return a.jsxs(wa,{withinPortal:R,...T,children:[a.jsx(le,{...Y("root"),"data-position":"top-center",ref:t,...E,children:a.jsx(fs,{children:U["top-center"]})}),a.jsx(le,{...Y("root"),"data-position":"top-left",...E,children:a.jsx(fs,{children:U["top-left"]})}),a.jsx(le,{...Y("root",{className:yl.classNames.fullWidth}),"data-position":"top-right",...E,children:a.jsx(fs,{children:U["top-right"]})}),a.jsx(le,{...Y("root",{className:yl.classNames.fullWidth}),"data-position":"bottom-right",...E,children:a.jsx(fs,{children:U["bottom-right"]})}),a.jsx(le,{...Y("root"),"data-position":"bottom-left",...E,children:a.jsx(fs,{children:U["bottom-left"]})}),a.jsx(le,{...Y("root"),"data-position":"bottom-center",...E,children:a.jsx(fs,{children:U["bottom-center"]})})]})});Pa.classes=QA;Pa.displayName="@mantine/notifications/Notifications";Pa.show=Ni.show;Pa.hide=Ni.hide;Pa.update=Ni.update;Pa.clean=Ni.clean;Pa.cleanQueue=Ni.cleanQueue;Pa.updateState=Ni.updateState;class M8{operator;child;constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class gf{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 L8{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 u=o.consumeAndParse(n);return r(s,c,u)},precedence:n})}construct(t){return new I8(t,this.prefixParselets,this.infixParselets)}}class I8{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 new 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 new Error("Cant consume unknown more tokens.");if(t&&this.peek()?.id!==t){const r=this.peek();throw new 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 new 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 YA{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 fo="http://hl7.org",KA="ok",z8="created",$8="gone",U8="not-modified",B8="not-found",V8="unauthorized",F8="forbidden",H8="accepted",q8={resourceType:"OperationOutcome",id:KA,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},G8={resourceType:"OperationOutcome",id:B8,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},Id={resourceType:"OperationOutcome",id:V8,issue:[{severity:"error",code:"login",details:{text:"Unauthorized"}}]},W8={...Id,issue:[...Id.issue,{severity:"error",code:"expired",details:{text:"Token expired"}}]},AT={...Id,issue:[...Id.issue,{severity:"error",code:"invalid",details:{text:"Token not issued for this audience"}}]},vf={resourceType:"OperationOutcome",id:F8,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function No(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},...t?{expression:[t]}:void 0}]}}function En(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function Q8(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function Y8(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 yf(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function XA(e){return e.id===KA||e.id===z8||e.id===U8||e.id===H8}function K8(e){return e.id===$8}class ht extends Error{outcome;constructor(t,n){super(JA(t),n),this.name="OperationOutcomeError",this.outcome=t}}function Wt(e){return e instanceof ht?e.outcome:yf(e)?e:No(Ge(e))}function Ge(e){return e?typeof e=="string"?e:Y8(e)?e.message:yf(e)?JA(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function JA(e){const t=e.issue?.map(ZA)??[];return t.length>0?t.join("; "):"Unknown error"}function ZA(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 X8(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 J8(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,X8(o,s)])),constraints:[],innerTypes:[]};return t}const Z8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},eU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},tU={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"}]}}},nU={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"}]}}},rU={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"}]}}},iU={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"}]}}},oU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},aU={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"}]}}},sU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},lU={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"}]}}},cU={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"}]}}},uU={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"}]}}},dU={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"}]}}},fU={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"}]}}},hU={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"}]}}},pU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},direction:{min:1,type:[{code:"code"}]}}},mU={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"}]}}},gU={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"]}]}}},vU={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"]}]}}},yU={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"}]}}},xU={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"}]}}},bU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},path:{min:1,type:[{code:"string"}]}}},SU={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"}]}}},wU={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"}]}}},jU={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"}]}}},CU={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"}]}}},EU={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"]}]}}},TU={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"]}]}}},RU={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"}]}}},_U={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"}]}}},DU={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"}]}}},AU={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"}]}}},kU={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"]}]}}},PU={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"}]}}},NU={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"}]}}},OU={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"}]}}},LU={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"]}]}}},IU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},zU={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"}]}}},$U={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"}]}}},UU={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"}]}}},BU={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"}]}}},VU={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"]}]}}},FU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},HU={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"}]}}},qU={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"]}]}}},GU={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"}]}}},WU={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"}]}}},QU={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"}]}}},YU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},lowLimit:{type:[{code:"Quantity"}]},highLimit:{type:[{code:"Quantity"}]}}},KU={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"}]}}},XU={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"}]}}},JU={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"}]}}},ZU={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"]}]}}},eB={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"}]}}},tB={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"}]}}},nB={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"}]}}},rB={Element:Z8,BackboneElement:eU,Address:tU,Age:nU,Annotation:rU,Attachment:iU,CodeableConcept:oU,Coding:aU,ContactDetail:sU,ContactPoint:lU,Contributor:cU,Count:uU,DataRequirement:dU,DataRequirementCodeFilter:fU,DataRequirementDateFilter:hU,DataRequirementSort:pU,Distance:mU,Dosage:gU,DosageDoseAndRate:vU,Duration:yU,ElementDefinition:xU,ElementDefinitionSlicingDiscriminator:bU,ElementDefinitionSlicing:SU,ElementDefinitionBase:wU,ElementDefinitionType:jU,ElementDefinitionExample:CU,ElementDefinitionConstraint:EU,ElementDefinitionBinding:TU,ElementDefinitionMapping:RU,Expression:_U,Extension:DU,HumanName:AU,Identifier:kU,MarketingStatus:PU,Meta:NU,Money:OU,Narrative:MU,ParameterDefinition:LU,Period:IU,Population:zU,ProdCharacteristic:$U,ProductShelfLife:UU,Quantity:BU,Range:VU,Ratio:FU,Reference:HU,RelatedArtifact:qU,SampledData:GU,Signature:WU,SubstanceAmount:QU,SubstanceAmountReferenceRange:YU,Timing:KU,TimingRepeat:XU,TriggerDefinition:JU,UsageContext:ZU,MoneyQuantity:eB,SimpleQuantity:tB,IdentityProvider:nB};function iB(e){return new aB(e).parse()}const Up=J8(rB),cS=Object.create(null),kT=Object.create(null),oB={"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 ek(e){let t;return t=kT[e],t||(t=kT[e]=Object.create(null)),t}function PT(e){const n=(Array.isArray(e)?e:e.entry?.map(r=>r.resource)??[]).filter(r=>r?.resourceType==="StructureDefinition");WB(n);for(const r of n)tk(r)}function tk(e){if(!e?.name)throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=iB(e),n=oB[e.url];let r,o;n?(r=Up,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=Up,o=e.type):(r=ek(e.url),o=e.type),r[o]=t;for(const s of t.innerTypes)s.parentType=t,r[s.name]=s;cS[e.url]=t}function nk(e){return!!Up[e]}function Hm(e,t){if(t){const n=ek(t)[e];if(n)return n}return Up[e]}function rk(e,t){const n=Hm(e,t);if(!n)throw new ht(No("Unknown data type: "+e));return n}function uS(e){return!!cS[e]}function gu(e){return cS[e]}class aB{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:cB(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=tx(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[tx(t,r.path)]=n;break}r=r.parent}if(!r){const o=tx(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&&!Ac(this.slicingContext.path,t?.path)&&(this.slicingContext=void 0),t.slicing&&!this.slicingContext&&this.enterSlice(t,n)}enterInnerType(t){for(;this.backboneContext&&!Ac(this.backboneContext?.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;const n=UT(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:Ac(this.backboneContext?.path,t.path)?this.backboneContext:this.backboneContext?.parent}}enterSlice(t,n){lB(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&&!Ac(this.backboneContext.path,t?.path))if(this.backboneContext.parent)do this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;while(this.backboneContext&&!Ac(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!!(Ac(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=UT(t)),r||(r=Wo(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=NT(t.max),r=t.base?.max?NT(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:OT(zd(o,"fixed[x]")),pattern:OT(zd(o,"pattern[x]")),binding:t.binding}}}function NT(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function tx(e,t=""){return sB(e.path,t)}function sB(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function Ac(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function OT(e){return Array.isArray(e)&&e.length>0?e[0]:Tn(e)?void 0:e}function lB(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 cB(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 uB(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n?.withPath?ik:zd,[o,...s]=t.split(".");let c=[r(e,o,n)];for(const u of s){const f=[];for(const h of c)if(Array.isArray(h))for(const m of h)f.push(r(m,u,n));else(n?.withPath&&h?.value!==void 0||!n?.withPath&&h!==void 0)&&f.push(r(h,u,n));c=f}return c}function ik(e,t,n){const r=e.path;return dB(zd(e,t,n),r,t)}function dB(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 ok={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 fB(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 hS(e,o.pattern);if(o.fixed)return $o(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:ie.boolean,value:e}]}function hi(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:ie.integer,value:e}:typeof e=="number"?{type:ie.decimal,value:e}:typeof e=="boolean"?{type:ie.boolean,value:e}:typeof e=="string"?{type:ie.string,value:e}:Oi(e)?{type:ie.Quantity,value:e}:Qo(e)?{type:e.resourceType,value:e}:yk(e)?{type:ie.CodeableConcept,value:e}:vk(e)?{type:ie.Coding,value:e}:{type:ie.BackboneElement,value:e}}function Ao(e){return e.length===0?!1:!!e[0].value}function Ca(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 zd(e,t,n){if(!e.value)return;const r=ks(e.type,t,n?.profileUrl);return r?ak(e,t,r):xf(e,t)}function ak(e,t,n){const r=e.value,o=n.type;if(!o||o.length===0)return;let s,c="undefined",u;const f=n.path.lastIndexOf("."),h=n.path.substring(f+1);for(const m of o){const g=h.replace("[x]",Qn(m.code));if(s=r[g],u=r["_"+g],s!==void 0||u!==void 0){c=m.code;break}}if(u)if(Array.isArray(s)){s=s.slice();for(let m=0;m<Math.max(s.length,u.length);m++)s[m]=nx(s[m],u[m])}else if(!s&&Array.isArray(u)){s=u.slice();for(let m=0;m<u.length;m++)s[m]=nx(void 0,u[m])}else s=nx(s,u);if(!Tn(s))return(c==="Element"||c==="BackboneElement")&&(c=n.type[0].code),Array.isArray(s)?s.map(m=>MT(m,c)):MT(s,c)}function MT(e,t){return t==="Resource"&&Qo(e)&&(t=e.resourceType),{type:t,value:e}}function xf(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(hi):r=hi(o)}else{const o=t.endsWith("[x]")?t.substring(0,t.length-3):t;for(const s of Object.values(ie)){const c=o+Qn(s);if(c in n){const u=n[c];Array.isArray(u)?r=u.map(f=>({type:s,value:f})):r={type:s,value:u};break}}}if(Array.isArray(r)){if(r.length===0||Tn(r[0]))return}else if(Tn(r))return;return r}function sk(e){const t=[];for(const n of e){let r=!1;for(const o of t)if(Ao(qm(n,o))){r=!0;break}r||t.push(n)}return t}function hB(e){return Ze(!Ao(e))}function pB(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Ze(!1):Ze(e.every((n,r)=>Ao(qm(n,t[r]))))}function mB(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Ze(!0):Ze(e.some((n,r)=>!Ao(qm(n,t[r]))))}function qm(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):Oi(n)&&Oi(r)?Ze(hk(n,r)):Ze(typeof n=="object"&&typeof r=="object"?dS(e,t):n===r)}function lk(e,t){return e.length===0&&t.length===0?Ze(!0):e.length!==t.length?Ze(!1):(e.sort(LT),t.sort(LT),Ze(e.every((n,r)=>Ao(gB(n,t[r])))))}function gB(e,t){const{type:n,value:r}=e,{type:o,value:s}=t,c=r?.valueOf(),u=s?.valueOf();return typeof c=="number"&&typeof u=="number"?Ze(Math.abs(c-u)<.01):Oi(c)&&Oi(u)?Ze(hk(c,u)):Ze(n==="Coding"&&o==="Coding"?typeof c!="object"||typeof u!="object"?!1:c.code===u.code&&c.system===u.system:typeof c=="object"&&typeof u=="object"?dS({...c,id:void 0},{...u,id:void 0}):typeof c=="string"&&typeof u=="string"?c.toLowerCase()===u.toLowerCase():c===u)}function LT(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 ck(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 uk(n);case"DateTime":return $d(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return dk(n);case"Quantity":return Oi(n);default:return e.type===r||typeof n=="object"&&n?.resourceType===r}}function uk(e){return typeof e=="string"&&!!ok.date.exec(e)}function $d(e){return typeof e=="string"&&!!ok.dateTime.exec(e)}function dk(e){return!!(e&&typeof e=="object"&&("start"in e&&$d(e.start)||"end"in e&&$d(e.end)))}function fk(e){if(e){if(uk(e)||$d(e))return{start:op(e,"0000-01-01T00:00:00.000"),end:op(e,"xxxx-12-31T23:59:59.999")};if(dk(e))return{start:e.start?op(e.start,"0000-01-01T00:00:00.000"):void 0,end:e.end?op(e.end,"xxxx-12-31T23:59:59.999"):void 0}}}function op(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 Oi(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function hk(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 dS(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(IT(s)&&IT(c)){if(!dS(s,c))return!1}else if(s!==c)return!1}return!0}function IT(e){return e!==null&&typeof e=="object"}function nx(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return vB(e??{},t)}return e}function vB(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function pk(e,t){return Qo(e,t)&&"id"in e&&typeof e.id=="string"}function Yt(e){const t=zt(e)??"undefined/undefined",n=Ea(e);return n===t?{reference:t}:{reference:t,display:n}}function zt(e){if(Oa(e))return e.reference;if(pk(e))return`${e.resourceType}/${e.id}`}function Sl(e){if(e)return Oa(e)?e.reference.split("/")[1]:e.id}function yB(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function Ea(e){if(yB(e)){const t=xB(e);if(t)return t}if(e.resourceType==="Device"){const t=bB(e);if(t)return t}if(e.resourceType==="MedicationRequest"&&e.medicationCodeableConcept)return ws(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]),yk(t))return ws(t);if(AB(t))return t.text}return zt(e)??""}function xB(e){const t=e.name;if(t&&t.length>0)return Na(t[0])}function bB(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function SB(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=zT(n);if(r)return r}else return zT(t)}function zT(e){if(e.url&&e.contentType?.startsWith("image/"))return e.url}function mk(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(),u=r.getUTCFullYear(),f=r.getUTCMonth(),h=r.getUTCDate();let m=u-o;(f<s||f===s&&h<c)&&m--;let g=u*12+f-(o*12+s);h<c&&g--;const y=Math.floor((r.getTime()-n.getTime())/(1e3*60*60*24));return{years:m,months:g,days:y}}function wB(e,t){const{years:n,months:r,days:o}=mk(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 Wo(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 co(e,t){const n=fS(e);return JSON.stringify(n,null,t?2:void 0)??""}function fS(e){if(!(e==null||e===""))return typeof e=="object"?Array.isArray(e)?jB(e):CB(e):e}function jB(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=fS(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 CB(e){let t,n=0;for(const r in e){const o=e[r],s=fS(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 Tn(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!Ln(e):!1}function Ln(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 EB(e){if(!e)return;let t=e.length-1;for(;t>=0&&Tn(e[t]);)t--;return t>=0?e.slice(0,t+1):void 0}function $o(e,t,n){return e===t||Tn(e)&&Tn(t)?!0:Tn(e)||Tn(t)?!1:Array.isArray(e)&&Array.isArray(t)?TB(e,t):Array.isArray(e)||Array.isArray(t)?!1:cr(e)&&cr(t)?RB(e,t,n):(cr(e)||cr(t),!1)}function TB(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!$o(e[n],t[n]))return!1;return!0}function RB(e,t,n){const r=new Set;for(const o of Object.keys(e))r.add(o);for(const o of Object.keys(t))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(!$o(s,c,o))return!1}return!0}function hS(e,t){return Tn(e)?!0:Tn(t)?!1:Array.isArray(e)&&Array.isArray(t)?_B(e,t):Array.isArray(e)||Array.isArray(t)?!1:cr(e)&&cr(t)?DB(e,t):cr(e)||cr(t)?!1:e===t}function _B(e,t){return t.every(n=>e.some(r=>hS(r,n)))}function DB(e,t){return Object.entries(t).every(([n,r])=>n in e&&hS(e[n],r))}function pi(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function pS(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 cr(e){return e!==null&&typeof e=="object"}function gk(e){return typeof e=="string"}function vk(e){return cr(e)&&"code"in e&&typeof e.code=="string"}function yk(e){return cr(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(vk)}function AB(e){return cr(e)&&"text"in e&&typeof e.text=="string"}const xk=[];for(let e=0;e<256;e++)xk.push(e.toString(16).padStart(2,"0"));function kB(e){const t=bk(e),n=new Uint8Array(t),r=new Array(n.length);for(let o=0;o<n.length;o++)r[o]=xk[n[o]];return r.join("")}function PB(e){const t=bk(e),n=new Uint8Array(t),r=new Array(n.length);for(let o=0;o<n.length;o++)r[o]=String.fromCodePoint(n[o]);return window.btoa(r.join(""))}function bk(e){return ArrayBuffer.isView(e)?e.buffer:e}function Qn(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function mS(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function fl(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function NB(e,t){return e.coding?.find(n=>n.system===t)?.code}function OB(e){if(e!==void 0)return Array.isArray(e)?e:[e]}const $T=(e,t)=>new Promise((n,r)=>{t?.signal?.throwIfAborted();const o=setTimeout(n,e);t?.signal?.addEventListener("abort",()=>{clearTimeout(o),r(t.signal?.reason)},{once:!0})});function Yx(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 sl(e,t){return e?(e.push(t),e):[t]}function tu(e){return e.sort((t,n)=>t.localeCompare(n))}function gS(e){return e.endsWith("/")?e:e+"/"}function LB(e){return e.startsWith("/")?e.slice(1):e}function Co(e,t){return new URL(LB(t),gS(e.toString())).toString()}function IB(e,t){return Co(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function zB(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 Sk(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 $B(e,t){if(e?.meta?.profile?.includes(t)){const n=e.meta.profile.indexOf(t);e.meta.profile.splice(n,1)}return e}const br=Object.freeze([]);function wl(e){if(!e)return"";switch(e.type){case"Address":return wk(e.value);case"CodeableConcept":return ws(e.value);case"Coding":return bf(e.value);case"ContactPoint":return e.value.value;case"HumanName":return Na(e.value);case"Quantity":return hl(e.value);case"Reference":return UB(e.value);default:return e.value?.toString()??""}}function UB(e){return e?e.display??e.reference??co(e):""}function wk(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 Na(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=Bd(e.text);if(r)return r}return n.join(" ").trim()}function Gm(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function jk(e,t,n){if(!e)return"";const[r=0,o=0,s=0]=e.split(":").map(Number),c=new Date(Date.UTC(1970,0,1,r,o,s));return Gm(c)?new Intl.DateTimeFormat(t,{hour:"numeric",minute:"2-digit",second:s===0?void 0:"numeric",...n,timeZone:"UTC"}).format(c):""}function Dr(e,t,n){if(!e)return"";const r=new Date(e);return Gm(r)?r.toLocaleString(t,n):""}function BB(e,t,n){return!e||!e.start&&!e.end?"":Dr(e.start,t,n)+" - "+Dr(e.end,t,n)}const VB={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},FB={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},HB={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function Ck(e){if(!e)return"";const t=[];return qB(t,e.repeat),e.event&&t.push(e.event.map(n=>Dr(n)).join(", ")),Qn(t.join(" ").trim())}function qB(e,t){if(!t?.periodUnit)return;const n=t.frequency??1,r=t.period??1,o=t.periodUnit;n===1&&r===1?e.push(VB[o]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+FB[o]):e.push("per "+r+" "+HB[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(Qn).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(s=>jk(s)).join(", "))}function Ud(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?`>= ${hl(r)}`:r?.value===void 0&&o?.value!==void 0?`<= ${hl(o)}`:(r?.unit===o?.unit&&delete r?.unit,`${hl(r)} - ${hl(o)}`)}function hl(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 GB(e){return e?.value===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function ws(e){if(!e)return"";const t=Bd(e.text);return t||(e.coding?e.coding.map(n=>bf(n)).join(", "):"")}function bf(e,t){const n=Bd(e?.display);return n?`${n}`:Bd(e?.code)??""}function Ek(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(hl(e.valueQuantity));else if(e.valueCodeableConcept)t.push(ws(e.valueCodeableConcept));else{const n=Bd(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>Ek(n)).join(" / ")),t.join(" / ").trim()}function Bd(e){return typeof e=="string"?e:void 0}const ie={Address:"Address",Age:"Age",Annotation:"Annotation",Attachment:"Attachment",BackboneElement:"BackboneElement",CodeableConcept:"CodeableConcept",Coding:"Coding",ContactDetail:"ContactDetail",ContactPoint:"ContactPoint",Contributor:"Contributor",Count:"Count",DataRequirement:"DataRequirement",Distance:"Distance",Dosage:"Dosage",Duration:"Duration",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 WB(e){const t=Array.isArray(e)?e:e.entry?.map(n=>n.resource)??[];for(const n of t)n?.resourceType==="StructureDefinition"&&n.kind==="resource"&&Tk(n.type)}function Tk(e){let t=Uo.types[e];return t||(t={searchParamsDetails:{}},Uo.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 QB(e){for(const t of e.base??br){const n=Tk(t);n.searchParams||(n.searchParams={}),n.searchParams[e.code]=e}}function UT(e){const t=e.type?.[0]?.code;return t==="BackboneElement"||t==="Element"?YB((e.base?.path??e.path)?.split(".")):t}function YB(e){return e.length===1?e[0]:e.map(Qn).join("")}function vS(e){return Uo.types[e]?.searchParams}function KB(e,t){return Uo.types[e]?.searchParams?.[t]}function jl(e){const t=e.replaceAll("[x]","").split(".").pop();return Rk(t)}function Rk(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(JB).join(" ").replace("_"," ").replaceAll(/\s+/g," ")}const XB=new Set(["CDS","ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function JB(e){const t=e.toUpperCase();return e===t?e:XB.has(t)?t:t.charAt(0)+e.slice(1)}function ks(e,t,n){const r=Hm(e,n);if(r)return ZB(r.elements,t)}function ZB(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 Qo(e,t){return!(!e||typeof e!="object"||!("resourceType"in e)||t&&e.resourceType!==t)}function Oa(e,t){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const Uo={types:{}};function wp(e){if(e.startsWith("T"))return e+"T00:00:00.000Z".substring(e.length);if(e.length<=10)return e;try{return new Date(e).toISOString()}catch{return e}}const ma=()=>[],Wr={empty:(e,t)=>Ze(t.every(n=>Tn(n.value))),hasValue:(e,t)=>Ze(t.length!==0),exists:(e,t,n)=>Ze(n?t.some(r=>Ao(n.eval(e,[r]))):t.length>0&&t.every(r=>!Tn(r.value))),all:(e,t,n)=>Ze(t.every(r=>Ao(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,tl(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,tl(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:ie.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===Wr.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>Ao(n.eval(e,[r]))),select:(e,t,n)=>t.flatMap(r=>n.eval({parent:e,variables:{$this:r}},[r])),repeat:ma,ofType:(e,t,n)=>t.filter(r=>r.type===n.name),single:(e,t)=>{if(t.length>1)throw new Error("Expected input length one for single()");return t.length===0?[]:t.slice(0,1)},first:(e,t)=>t.length===0?[]:t.slice(0,1),last:(e,t)=>t.length===0?[]:t.slice(-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,tl(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,tl(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,tl(e));return sk([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,tl(e));return[...t,...r]},htmlChecks:(e,t,n)=>[hi(!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 Ao(s)?r.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Eo(t,1);if(typeof n=="boolean")return[{type:ie.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(Wr.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Eo(t,1);return typeof n=="number"?[{type:ie.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:ie.integer,value:Number.parseInt(n,10)}]:typeof n=="boolean"?[{type:ie.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:Ze(Wr.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Eo(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:ie.date,value:wp(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:Ze(Wr.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Eo(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:ie.dateTime,value:wp(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:Ze(Wr.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Eo(t,1);return typeof n=="number"?[{type:ie.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:ie.decimal,value:Number.parseFloat(n)}]:typeof n=="boolean"?[{type:ie.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:Ze(Wr.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Eo(t,1);return Oi(n)?[{type:ie.Quantity,value:n}]:typeof n=="number"?[{type:ie.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:ie.Quantity,value:{value:Number.parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:ie.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:Ze(Wr.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Eo(t,1);return n==null?[]:Oi(n)?[{type:ie.string,value:`${n.value} '${n.unit}'`}]:[{type:ie.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:Ze(Wr.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Eo(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:ie.time,value:wp("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:Ze(Wr.toTime(e,t).length===1),indexOf:(e,t,n)=>Di((r,o)=>r.indexOf(o),e,t,n),substring:(e,t,n,r)=>Di((o,s,c)=>{const u=s,f=c?u+c:o.length;return u<0||u>=o.length?void 0:o.substring(u,f)},e,t,n,r),startsWith:(e,t,n)=>Di((r,o)=>r.startsWith(o),e,t,n),endsWith:(e,t,n)=>Di((r,o)=>r.endsWith(o),e,t,n),contains:(e,t,n)=>Di((r,o)=>r.includes(o),e,t,n),upper:(e,t)=>Di(n=>n.toUpperCase(),e,t),lower:(e,t)=>Di(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>Di((o,s,c)=>o.replaceAll(s,c),e,t,n,r),matches:(e,t,n)=>Di((r,o)=>!!new RegExp(o).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>Di((o,s,c)=>o.replaceAll(new RegExp(s,"g"),c.replaceAll(/\$\{(\w+)\}/g,"$<$1>")),e,t,n,r),length:(e,t)=>Di(n=>n.length,e,t),toChars:(e,t)=>Di(n=>n?n.split(""):void 0,e,t),encode:ma,decode:ma,escape:ma,unescape:ma,trim:ma,split:ma,join:(e,t,n)=>{const r=n?.eval(e,tl(e))[0]?.value??"";if(typeof r!="string")throw new TypeError("Separator must be a string.");return[{type:ie.string,value:t.map(o=>o.value?.toString()??"").join(r)}]},abs:(e,t)=>So(Math.abs,e,t),ceiling:(e,t)=>So(Math.ceil,e,t),exp:(e,t)=>So(Math.exp,e,t),floor:(e,t)=>So(Math.floor,e,t),ln:(e,t)=>So(Math.log,e,t),log:(e,t,n)=>So((r,o)=>Math.log(r)/Math.log(o),e,t,n),power:(e,t,n)=>So(Math.pow,e,t,n),round:(e,t,...n)=>So((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)=>So(Math.sqrt,e,t),truncate:(e,t)=>So(n=>Math.trunc(n),e,t),children:ma,descendants:ma,trace:(e,t,n)=>t,now:()=>[{type:ie.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:ie.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:ie.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,o)=>{const s=Wr.toDateTime(e,n.eval(e,t));if(s.length===0)throw new Error("Invalid start date");const c=Wr.toDateTime(e,r.eval(e,t));if(c.length===0)throw new Error("Invalid end date");const u=o.eval(e,t)[0]?.value;if(u!=="years"&&u!=="months"&&u!=="days")throw new Error("Invalid units");const f=mk(s[0].value,c[0].value);return[{type:ie.Quantity,value:{value:f[u],unit:u}}]},is:(e,t,n)=>{let r="";return n instanceof Vd?r=n.name:n instanceof Wm&&(r=n.left.name+"."+n.right.name),r?t.map(o=>({type:ie.boolean,value:ck(o,r)})):[]},not:(e,t)=>Wr.toBoolean(e,t).map(n=>({type:ie.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 hi(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:ie.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:ie.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:ie.BackboneElement,value:{namespace:"System",name:"Integer"}}:Qo(n)?{type:ie.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:ie.BackboneElement,value:null}),conformsTo:(e,t,n)=>{const r=n.eval(e,t)[0].value;if(!r.startsWith("http://hl7.org/fhir/StructureDefinition/"))throw new Error("Expected a StructureDefinition URL");const o=r.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(s=>({type:ie.boolean,value:s.value?.resourceType===o}))},getResourceKey:(e,t)=>{const n=t[0].value;return n?.id?[{type:ie.id,value:n.id}]:[]},getReferenceKey:(e,t,n)=>{const r=t[0].value;if(!r?.reference)return[];let o="";return n instanceof Vd&&(o=n.name),o&&!r.reference.startsWith(o+"/")?[]:[{type:ie.id,value:Sl(r)}]},extension:(e,t,n)=>{const r=n.eval(e,t)[0].value,o=t?.[0]?.value;if(o){const s=Wo(o,r);if(s)return[{type:ie.Extension,value:s}]}return[]}};function Di(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=Eo(n,1);if(typeof o!="string")throw new TypeError("String function cannot be called with non-string");const s=r.map(u=>u?.eval(t,n)[0]?.value),c=e(o,...s);return c===void 0?[]:Array.isArray(c)?c.map(hi):[hi(c)]}function So(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=Eo(n,1),s=Oi(o),c=s?o.value:o;if(typeof c!="number")throw new TypeError("Math function cannot be called with non-number");const u=e(c,...r.map(m=>m.eval(t,n)[0]?.value)),f=s?ie.Quantity:n[0].type,h=s?{...o,value:u}:u;return[{type:f,value:h}]}function Eo(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 tl(e){let t=e;for(;t.parent?.variables.$this;)t=t.parent;return[t.variables.$this]}class yS{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 kc{value;constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class Vd{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 Qo(n,this.name)?t:ik(t,this.name)}toString(){return this.name}}class eV{eval(){return[]}toString(){return"{}"}}class tV 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 Bp extends gf{constructor(t,n){super("as",t,n)}eval(t,n){return Wr.ofType(t,this.left.eval(t,n),this.right)}}class ei extends gf{}class eo extends ei{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,u=Oi(s)?s.value:s,f=Oi(c)?c.value:c,h=this.impl(u,f);return typeof h=="boolean"?Ze(h):Oi(s)?[{type:ie.Quantity,value:{...s,value:h}}]:[hi(h)]}}class nV extends gf{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:ie.string,value:s.map(c=>c.value).join("")}]:s}}class rV extends ei{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 iV extends ei{constructor(t,n){super("in",t,n)}eval(t,n){const r=Ca(this.left.eval(t,n)),o=this.right.eval(t,n);return r?Ze(o.some(s=>qm(r,s)[0].value)):[]}}class Wm extends gf{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 xS extends gf{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return sk([...r,...o])}}class oV extends ei{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return pB(r,o)}}class aV extends ei{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return mB(r,o)}}class sV extends ei{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return lk(r,o)}}class lV extends ei{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return hB(lk(r,o))}}class bS extends ei{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(ck(r[0],o))}}class cV extends ei{constructor(t,n){super("and",t,n)}eval(t,n){const r=Ca(this.left.eval(t,n),"boolean"),o=Ca(this.right.eval(t,n),"boolean");return r?.value===!0&&o?.value===!0?Ze(!0):r?.value===!1||o?.value===!1?Ze(!1):[]}}class uV extends ei{constructor(t,n){super("or",t,n)}eval(t,n){const r=Ca(this.left.eval(t,n),"boolean"),o=Ca(this.right.eval(t,n),"boolean");return r?.value===!1&&o?.value===!1?Ze(!1):r?.value||o?.value?Ze(!0):[]}}class dV extends ei{constructor(t,n){super("xor",t,n)}eval(t,n){const r=Ca(this.left.eval(t,n),"boolean"),o=Ca(this.right.eval(t,n),"boolean");return!r||!o?[]:Ze(r.value!==o.value)}}class fV extends ei{constructor(t,n){super("implies",t,n)}eval(t,n){const r=Ca(this.left.eval(t,n),"boolean"),o=Ca(this.right.eval(t,n),"boolean");return o?.value===!0||r?.value===!1?Ze(!0):!r||!o?[]:Ze(!1)}}class SS{name;args;constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=Wr[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 wS{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 hV=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"],pV={"'":"'",'"':'"',"`":"`",r:"\r",n:`
|
|
54
|
-
`,t:" ",f:"\f","\\":"\\"};class mV{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()!==`
|
|
55
|
-
`))}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=pV[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()===" "&&gV(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()===`
|
|
56
|
-
`?(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 gV(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&hV.includes(e.value)))}const vV=["true","false"],yV=["!=","!~","<=",">=","{}","->"];function xV(e){return new mV(e,vV,yV).tokenize()}const en={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},bV={parse(e){const t=e.consumeAndParse();if(!e.match(")"))throw new Error("Parse error: expected `)` got `"+e.peek()?.value+"`");return t}},SV={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new wS(t,n)},precedence:en.Indexer},wV={parse(e,t){if(!(t instanceof Vd))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new SS(t.name,n)},precedence:en.FunctionCall};function jV(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 CV(){return new L8().registerPrefix("String",{parse:(e,t)=>new kc({type:ie.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new kc({type:ie.dateTime,value:wp(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new kc({type:ie.Quantity,value:jV(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new kc({type:t.value.includes(".")?ie.decimal:ie.integer,value:Number.parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new kc({type:ie.boolean,value:!0})}).registerPrefix("false",{parse:()=>new kc({type:ie.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new Vd(t.value)}).registerPrefix("{}",{parse:()=>new eV}).registerPrefix("(",bV).registerInfix("[",SV).registerInfix("(",wV).prefix("+",en.UnaryAdd,(e,t)=>new tV("+",t,n=>n)).prefix("-",en.UnarySubtract,(e,t)=>new eo("-",t,t,(n,r)=>-r)).infixLeft(".",en.Dot,(e,t,n)=>new Wm(e,n)).infixLeft("/",en.Divide,(e,t,n)=>new eo("/",e,n,(r,o)=>r/o)).infixLeft("*",en.Multiply,(e,t,n)=>new eo("*",e,n,(r,o)=>r*o)).infixLeft("+",en.Add,(e,t,n)=>new eo("+",e,n,(r,o)=>r+o)).infixLeft("-",en.Subtract,(e,t,n)=>new eo("-",e,n,(r,o)=>r-o)).infixLeft("|",en.Union,(e,t,n)=>new xS(e,n)).infixLeft("=",en.Equals,(e,t,n)=>new oV(e,n)).infixLeft("!=",en.NotEquals,(e,t,n)=>new aV(e,n)).infixLeft("~",en.Equivalent,(e,t,n)=>new sV(e,n)).infixLeft("!~",en.NotEquivalent,(e,t,n)=>new lV(e,n)).infixLeft("<",en.LessThan,(e,t,n)=>new eo("<",e,n,(r,o)=>r<o)).infixLeft("<=",en.LessThanOrEquals,(e,t,n)=>new eo("<=",e,n,(r,o)=>r<=o)).infixLeft(">",en.GreaterThan,(e,t,n)=>new eo(">",e,n,(r,o)=>r>o)).infixLeft(">=",en.GreaterThanOrEquals,(e,t,n)=>new eo(">=",e,n,(r,o)=>r>=o)).infixLeft("&",en.Ampersand,(e,t,n)=>new nV(e,n)).infixLeft("and",en.And,(e,t,n)=>new cV(e,n)).infixLeft("as",en.As,(e,t,n)=>new Bp(e,n)).infixLeft("contains",en.Contains,(e,t,n)=>new rV(e,n)).infixLeft("div",en.Divide,(e,t,n)=>new eo("div",e,n,(r,o)=>Math.trunc(r/o))).infixLeft("in",en.In,(e,t,n)=>new iV(e,n)).infixLeft("is",en.Is,(e,t,n)=>new bS(e,n)).infixLeft("mod",en.Modulo,(e,t,n)=>new eo("mod",e,n,(r,o)=>r%o)).infixLeft("or",en.Or,(e,t,n)=>new uV(e,n)).infixLeft("xor",en.Xor,(e,t,n)=>new dV(e,n)).infixLeft("implies",en.Implies,(e,t,n)=>new fV(e,n))}const EV=CV();function jS(e){return new yS(e,EV.construct(xV(e)).consumeAndParse())}function TV(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]=hi(n[r]))}return js(e,n).map(r=>r.value)}function js(e,t,n={},r=void 0){let o;if(typeof e=="string"){const s=r?.get(e);o=s??jS(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 RV(e){const t=[];for(const n of e){const r=fk(n.value);r&&t.push(r)}return t}function _V(e){const t=new Set;for(const n of e){const r=wl(n);r&&t.add(r)}return Array.from(t)}function DV(e){const t=new Set;for(const n of e){const{value:r}=n;r&&(gk(r)?t.add(r):Oa(r)?t.add(r.reference):pk(r)?t.add(zt(r)):typeof r.identifier=="object"&&t.add(`identifier:${r.identifier.system}|${r.identifier.value}`))}return Array.from(t)}function AV(e,t={}){const n=[];for(const r of e)kV(t,n,r);return n}function kV(e,t,n){const{type:r,value:o}=n;switch(r){case ie.Identifier:PV(t,e,o);break;case ie.CodeableConcept:NV(t,e,o);break;case ie.Coding:_k(t,e,o);break;case ie.ContactPoint:OV(t,e,o);break;default:Cl(t,e,void 0,o?.toString())}}function PV(e,t,n){n?.type?.text&&Cl(e,t,t.textSearchSystem,n.type.text),Cl(e,t,n?.system,n?.value)}function NV(e,t,n){n?.text&&Cl(e,t,t.textSearchSystem,n.text);for(const r of n?.coding??br)_k(e,t,r)}function _k(e,t,n){n&&(n.display&&Cl(e,t,t.textSearchSystem,n.display),Cl(e,t,n.system,n.code))}function OV(e,t,n){n&&Cl(e,t,n.system,n.value?.toLocaleLowerCase())}function Cl(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 Qm=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"},Dk={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},CS={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 Ak(e,t){if(!e)throw new Error("Invalid search URL");let n="",r;if(typeof e=="string")if(e.includes("?")){const[c,u]=e.split("?");n=c,r=new URLSearchParams(u)}else n=e;else typeof e=="object"&&(n=e.pathname,r=e.searchParams);let o;n.includes("/")?o=n.split("/").filter(Boolean).pop():o=n;const s=[];return r&&s.push(...r.entries()),MV(o,s)}function MV(e,t){const n={resourceType:e};for(const[r,o]of t)LV(n,r,o);return n}function LV(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=sl(e.filters,{code:t,operator:he.EQUALS,value:n});return}switch(r){case"_sort":IV(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=BT(n);o==="iterate"&&(c.modifier=he.ITERATE),e.include=sl(e.include,c);break}case"_revinclude":{const c=BT(n);o==="iterate"&&(c.modifier=he.ITERATE),e.revInclude=sl(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=Uo.types[e.resourceType]?.searchParams?.[r];c?e.filters=sl(e.filters,$V(c,o,n)):e.filters=sl(e.filters,UV(r,o,n))}}}}function IV(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 zV=[he.MISSING,he.PRESENT];function $V(e,t,n){if(zV.includes(t))return{code:e.code,operator:t,value:n};switch(e.type){case"number":case"date":case"quantity":{const{operator:r,value:o}=BV(n,t||he.EQUALS);if(!VT(e,o))throw new ht(No(`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(!VT(e,n))throw new ht(No(`Invalid format for ${e.type} search parameter: ${n}`));return{code:e.code,operator:VV(t),value:n};default:throw new Error("Unrecognized search parameter type: "+e.type)}}function UV(e,t,n){let r=he.EQUALS;if(t)r=t;else if(n.length>=2){const o=n.substring(0,2);o in CS&&(n.length===2||n.at(2)?.match(/\d/))&&(r=o,n=n.substring(o.length))}return{code:e,operator:r,value:n}}function BV(e,t){const n=e.substring(0,2),r=CS[n];return r?{operator:r,value:e.substring(2)}:{operator:t,value:e}}function VV(e){return Dk[e]??he.EQUALS}function BT(e){const t=e.split(":");if(t.includes("*"))throw new ht(No("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new ht(No(`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 ht(No(`Invalid include value '${e}'`))}function VT(e,t){return e.type==="date"?$d(t):!0}function ys(e){const t=[];e.fields&&t.push("_fields="+e.fields.join(","));for(const n of e.filters??br)t.push(FV(n));e.sortRules&&e.sortRules.length>0&&t.push(HV(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(","));for(const n of e.include??br)t.push(FT("_include",n));for(const n of e.revInclude??br)t.push(FT("_revinclude",n));return t.length===0?"":(tu(t),"?"+t.join("&"))}function FV(e){const t=e.operator in Dk?":"+e.operator:"",n=e.operator!==he.EQUALS&&e.operator in CS?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function HV(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function FT(e,t){return e+(t.modifier?":"+t.modifier:"")+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function Ym(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 qV(e,t){if(t.resourceType!==e.resourceType)return!1;for(const n of t.filters??br)if(!GV(e,t,n))return!1;return!0}function GV(e,t,n){const r=Uo.types[t.resourceType]?.searchParams?.[n.code];if(!r)return!1;const o=js(r.expression,[hi(e)]);if(n.operator===he.MISSING||n.operator===he.PRESENT)return WV(o,n);switch(r.type){case"reference":return QV(o,n);case"string":case"uri":return XV(o,n);case"token":return YV(o,n);case"date":return ZV(o,n);default:return!1}}function WV(e,t){const n=e.length>0;return(t.operator===he.MISSING&&t.value==="false"||t.operator===he.PRESENT&&t.value==="true")===n}function QV(e,t){const n=Km(t.operator);if(t.value===""&&e.length===0)return t.operator===he.EQUALS;const r=DV(e);for(const o of Ym(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 YV(e,t){const n=AV(e),r=Ym(t.value),o=Km(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 XV(e,t){const n=_V(e),r=Ym(t.value),o=Km(t.operator);for(const s of n)for(const c of r)if(JV(s,c))return!o;return o}function JV(e,t){return e.toLowerCase().includes(t.toLowerCase())}function ZV(e,t){const n=RV(e),r=Ym(t.value),o=Km(t.operator);for(const s of n)for(const c of r)if(eF(s,t.operator,c))return!o;return o}function eF(e,t,n){if(!e)return!1;const r=fk(n);if(!r)return!1;const o=e.start??"0000",s=e.end??"9999",c=r.start,u=r.end;switch(t){case he.APPROXIMATELY:case he.EQUALS:case he.NOT_EQUALS:return o<u&&s>c;case he.LESS_THAN:return o<c;case he.GREATER_THAN:return s>u;case he.LESS_THAN_OR_EQUALS:return o<=u;case he.GREATER_THAN_OR_EQUALS:return s>=c;case he.STARTS_AFTER:return o>u;case he.ENDS_BEFORE:return s<c;default:return!1}}function Km(e){return e===he.NOT_EQUALS||e===he.NOT}const tF={resourceType:"*"},nF=["DomainConfiguration","JsonWebKey","Login"],rF=["UserSecurityRequest","Project","ProjectMembership","User"],pl={READ:"read",VREAD:"vread",UPDATE:"update",HISTORY:"history",SEARCH:"search"},iF=[pl.READ,pl.VREAD,pl.HISTORY,pl.SEARCH];function oF(e,t){return nF.includes(t)?!1:aF(e,pl.UPDATE,t)}function aF(e,t,n){return!!e.resource?.some(r=>Pk(r,n,t))}function kk(e,t,n){return n?n.resource?.find(r=>sF(e,t,r)):tF}function sF(e,t,n){const r=e.resourceType;return Pk(n,r,t)?r==="Binary"?!0:!(n.compartment&&!e.meta?.compartment?.some(o=>o.reference===n.compartment?.reference)||n.criteria&&!qV(e,Ak(n.criteria))):!1}function Pk(e,t,n){return e.resourceType!==t&&(e.resourceType!=="*"||rF.includes(t))?!1:e.interaction?e.interaction.includes(n):!e.readonly||iF.includes(n)}function To(){return typeof window<"u"}function Nk(){return typeof Buffer<"u"?Buffer:void 0}const nr={assign(e){To()&&globalThis.location.assign(e)},reload(){To()&&globalThis.location.reload()},getSearch(){return To()?globalThis.location.search:""},getPathname(){return To()?globalThis.location.pathname:""},getLocation(){return To()?globalThis.location.toString():""},getOrigin(){return To()?globalThis.location.protocol+"//"+globalThis.location.host+"/":""}};function lF(e){if(To()){const n=window.atob(e),r=Uint8Array.from(n,o=>o.codePointAt(0));return new window.TextDecoder().decode(r)}const t=Nk();if(t)return t.from(e,"base64").toString("utf-8");throw new Error("Unable to decode base64")}function HT(e){if(To()){const n=new window.TextEncoder().encode(e),r=String.fromCodePoint.apply(null,n);return window.btoa(r)}const t=Nk();if(t)return t.from(e,"utf8").toString("base64");throw new Error("Unable to encode base64")}function cF(e){e=e.padEnd(e.length+(4-e.length%4)%4,"=");const t=e.replaceAll("-","+").replaceAll("_","/");return lF(t)}function qT(){const e=new Uint32Array(28);return crypto.getRandomValues(e),kB(e.buffer)}async function uF(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function Ok(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():"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 Mk(e){const t={};e=pi(e);for(const o of e.entry??br){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]=Ok(),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)=>dF(o,s,t),2);return fF(JSON.parse(r))}function dF(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 fF(e){const t=pF(e),{sorted:n,cycles:r}=hF(t),o={},s=[];for(const u of e.entry??br)u.fullUrl?o[u.fullUrl]=u:s.push(u);const c=n.map(u=>o[u]);for(const u of r)for(const f of u){const h=o[f],m={...h,request:{...h.request,method:"PUT"}};c.push(m)}return c.push(...s),{...e,entry:c}}const Pc={NotVisited:"NotVisited",Visiting:"Visiting",Visited:"Visited"};function hF(e){const t=[],n={},r=[];for(const s of Object.keys(e))n[s]=Pc.NotVisited;function o(s,c){if(n[s]===Pc.Visited)return!0;if(n[s]===Pc.Visiting){const f=c.lastIndexOf(s);return f!==-1&&r.push(c.slice(f)),!0}n[s]=Pc.Visiting,c.push(s);let u=!1;for(const f of e[s])o(f,c)||(u=!0);return n[s]=Pc.Visited,c.pop(),t.unshift(s),!u}for(const s in e)n[s]===Pc.NotVisited&&o(s,[]);return{sorted:t,cycles:r}}function Lk(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(Oa(r)){const o=r.reference;o.startsWith("urn:uuid:")&&t(o)}else Lk(r,t)}}function pF(e){const t={};for(const n of e.entry??br)n.fullUrl&&(t[n.fullUrl]=[]);for(const n of e.entry??br){const r=n.fullUrl;n.resource&&Lk(n.resource,o=>{t[o]&&t[o].push(r)})}return t}const tn={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 mF=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];for(const r of n??br)r.call(this,t);return!t.defaultPrevented}removeAllListeners(){this.listeners={}}listenerCount(t){return this.listeners[t]?.length??0}};class Xm{emitter=new mF;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 Kx={"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"},gF=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],ES=["DiagnosticReport-update"];function vF(e){return ES.includes(e)}function yF(e){if(ES.includes(e))throw new ht(En(`'context.version' is required for '${e}'.`))}const xF={"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 bF(e){return gF.includes(e)}function Ik(e){return!!e.endpoint}function GT(e){if(!TS(e))throw new ht(En("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 Ik(e)&&(s.endpoint=e.endpoint),new URLSearchParams(s).toString()}function TS(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(!Kx[s])return!1;return!(Ik(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function SF(e,t,n,r){if(typeof t!="object")throw new ht(En(`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 ht(En(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new ht(En(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const o=r.resourceType;if(o!=="*"){if(!bF(t.resourceType))throw new ht(En(`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 ht(En(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${o}.`))}}function wF(e,t,n,r,o){if(o.set(t.key,(o.get(t.key)??0)+1),r.reference){if(!Oa(t.reference))throw new ht(En(`context[${n}] is invalid. Expected key '${t.key}' to be a reference.`))}else SF(e,t.resource,n,r)}function jF(e,t){const n=new Map,r=xF[e];for(let o=0;o<t.length;o++){const s=t[o].key;if(!r[s])throw new ht(En(`Key '${s}' not found for event '${e}'. Make sure to add only valid keys.`));wF(e,t[o],o,r[s],n)}for(const[o,s]of Object.entries(r)){if(!(s.optional||n.has(o)))throw new ht(En(`Missing required key '${o}' on context for '${e}' event.`));if(!s.manyAllowed&&(n.get(o)??0)>1)throw new ht(En(`${n.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function WT(e,t,n,r){if(!(e&&typeof e=="string"))throw new ht(En("Must provide a topic."));if(!Kx[t])throw new ht(En(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Kx).join(", ")}`));if(typeof n!="object")throw new ht(En("context must be a context object or array of context objects."));if(ES.includes(t)&&!r)throw new ht(En(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(n)?n:[n];return jF(t,o),{timestamp:new Date().toISOString(),id:Ok(),event:{"hub.topic":e,"hub.event":t,context:o,...r?{"context.versionId":r}:{}}}}class CF extends Xm{subRequest;websocket;constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new ht(En("Subscription request should contain an endpoint."));if(!TS(t))throw new ht(En("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 EF(e){return JSON.parse(cF(e))}function TF(e){return e.split(".").length===3}function RS(e){const[t,n,r]=e.split(".");return EF(n)}function RF(e){try{return typeof RS(e).login_id=="string"}catch{return!1}}function _F(e){try{const n=RS(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class DF{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,tn.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}class to{[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 AF{storage;prefix="";constructor(t,n=""){this.storage=t??globalThis.localStorage??new kF,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?co(n):void 0)}}class kF{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 Hc={Event:typeof globalThis.Event<"u"?globalThis.Event:void 0,ErrorEvent:void 0,CloseEvent:void 0};let QT=!1;function PF(){if(typeof globalThis.Event>"u")throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");Hc.Event=globalThis.Event,Hc.ErrorEvent=class extends Event{message;error;constructor(t,n){super("error",n),this.message=t.message,this.error=t}},Hc.CloseEvent=class extends Event{code;reason;wasClean=!0;constructor(t=1e3,n="",r){super("close",r),this.code=t,this.reason=n}}}function NF(e,t){if(!e)throw new Error(t)}function ap(e){return new e.constructor(e.type,e)}const nl={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0};let YT=!1;class hs extends Xm{_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={}){QT||(PF(),QT=!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 hs.CONNECTING}get OPEN(){return hs.OPEN}get CLOSING(){return hs.CLOSING}get CLOSED(){return hs.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?hs.CLOSED:hs.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?.readyState===this.OPEN)this._debug("send",t),this._ws.send(t);else{const{maxEnqueuedMessages:n=nl.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=nl.reconnectionDelayGrowFactor,minReconnectionDelay:n=nl.minReconnectionDelay,maxReconnectionDelay:r=nl.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=nl.maxRetries,connectionTimeout:n=nl.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"&&!YT&&(console.error("‼️ No WebSocket implementation available. You should define options.WebSocket."),YT=!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 Hc.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new Hc.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new Hc.CloseEvent(t,n,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_handleOpen=t=>{this._debug("open event");const{minUptime:n=nl.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),n),NF(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(ap(t))};_handleMessage=t=>{this._debug("message event"),this.onmessage&&this.onmessage(t),this.dispatchEvent(ap(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(ap(t)),this._connect()};_handleClose=t=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(t),this.dispatchEvent(ap(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 OF=5e3;class Xx extends Xm{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 MF{criteria;emitter;refCount;subscriptionProps;subscriptionId;token;connecting=!1;constructor(t,n){this.criteria=t,this.emitter=new Xx(t),this.refCount=1,this.subscriptionProps=n?{...n}:void 0}clearAttachedSubscription(){this.subscriptionId=void 0,this.token=void 0}}class LF{medplum;ws;masterSubEmitter;criteriaEntries;criteriaEntriesBySubscriptionId;wsClosed;pingTimer=void 0;pingIntervalMs;waitingForPong=!1;currentProfile;constructor(t,n,r){if(!(t instanceof $k))throw new ht(En("First arg of constructor should be a `MedplumClient`"));let o;try{o=new URL(n).toString()}catch{throw new ht(En("Not a valid URL"))}const s=r?.ReconnectingWebSocket?new r.ReconnectingWebSocket(o,void 0,{debug:r?.debug,debugLogger:r?.debugLogger}):new hs(o,void 0,{debug:r?.debug,debugLogger:r?.debugLogger});this.medplum=t,this.ws=s,this.masterSubEmitter=new Xx,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.pingIntervalMs=r?.pingIntervalMs??OF,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 u=Sl(s.subscription),f={type:"connect",payload:{subscriptionId:u}};this.masterSubEmitter?.dispatchEvent(f);const h=this.criteriaEntriesBySubscriptionId.get(u);if(!h){console.warn("Received handshake for criteria the SubscriptionManager is not listening for yet");return}h.connecting=!1,h.emitter.dispatchEvent({...f});return}this.masterSubEmitter?.dispatchEvent({type:"message",payload:o});const c=this.criteriaEntriesBySubscriptionId.get(Sl(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 ht(Q8(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 ${zt(this.medplum.getProfile())}`,channel:{type:"websocket"},criteria:t.criteria})).id);const{parameter:r}=await this.medplum.get(`fhir/R4/Subscription/${n}/$get-ws-binding-token`),o=r?.find(c=>c.name==="token")?.valueString,s=r?.find(c=>c.name==="websocket-url")?.valueUrl;if(!o)throw new ht(En("Failed to get token"));if(!s)throw new ht(En("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($o(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(u=>{const f=u.subscriptionProps;return!$o(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(Ge(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 MF(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 Xx(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const zk="5.0.13-f0defec",IF=tn.FHIR_JSON+", */*; q=0.1",zF="https://api.medplum.com/",$F=1e3,UF=6e4,BF=0,VF=3e5,FF="Binary/",KT={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]},Nc={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"},HF={AccessToken:"urn:ietf:params:oauth:token-type:access_token"},qF={JwtBearer:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"};class $k extends Xm{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;logLevel;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??GF(),this.storage=t?.storage??new AF(void 0,t?.storagePrefix),this.createPdfImpl=t?.createPdf,this.baseUrl=gS(t?.baseUrl??zF),this.fhirBaseUrl=Co(this.baseUrl,t?.fhirUrlPath??"fhir/R4"),this.authorizeUrl=Co(this.baseUrl,t?.authorizeUrl??"oauth2/authorize"),this.tokenUrl=Co(this.baseUrl,t?.tokenUrl??"oauth2/token"),this.logoutUrl=Co(this.baseUrl,t?.logoutUrl??"oauth2/logout"),this.fhircastHubUrl=Co(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??VF,this.logLevel=this.initializeLogLevel(t),this.cacheTime=t?.cacheTime??(To()?UF:BF),this.cacheTime>0?this.requestCache=new YA(t?.resourceCacheSize??$F):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}initializeLogLevel(t){return t?.logLevel?t.logLevel:t?.verbose!==void 0&&t.verbose?"verbose":"none"}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(),To()&&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=Co(this.fhirBaseUrl,t);for(const r of this.requestCache?.keys()??br)(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,u)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:n,resolve:c,reject:u}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):o=this.request("GET",t,n);const s=new to(o);return this.setCacheEntry(t,s,n),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,tn.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(nr.getSearch()).get("code");if(!r){await this.requestAuthorization(t);return}return this.processCode(r)}signOutWithRedirect(){nr.assign(this.logoutUrl)}async signInWithExternalAuth(t,n,r,o,s=!0){let c=o;s&&(c=await this.ensureCodeChallenge(o)),nr.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:Nc.TokenExchange,subject_token_type:HF.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:u,codeChallengeMethod:f}=o;if(!f)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!u)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");c.searchParams.set("code_challenge_method",f),c.searchParams.set("code_challenge",u)}return c.toString()}fhirUrl(...t){return new URL(Co(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=zB(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 u=this.getBundle(o,r);return this.setCacheEntry(s,u,r),u}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 u=new to(this.search(t,o.searchParams,r).then(f=>f.entry?.[0]?.resource));return this.setCacheEntry(s,u,r),u}searchResources(t,n,r){const s="searchResources-"+this.fhirSearchUrl(t,n).toString(),c=this.getCacheEntry(s,r);if(c)return c.value;const u=new to(this.search(t,n,r).then(JT));return this.setCacheEntry(s,u,r),u}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),u=c.link?.find(f=>f.relation==="next");if(!c.entry?.length&&!u)break;yield JT(c),o=u?.url?new URL(u.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 KT;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 to(Promise.reject(new Error("Missing reference")));if(r==="system")return new to(Promise.resolve(KT));const[o,s]=r.split("/");return!o||!s?new to(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,n){if(nk(t))return Promise.resolve();const r=t+"-requestSchema",o=this.getCacheEntry(r,void 0);if(o)return o.value;const s=new to((async()=>{const c=`{
|
|
57
|
-
StructureDefinitionList(_filter: "name eq ${t}") {
|
|
58
|
-
resourceType,
|
|
59
|
-
name,
|
|
60
|
-
kind,
|
|
61
|
-
description,
|
|
62
|
-
type,
|
|
63
|
-
url,
|
|
64
|
-
snapshot {
|
|
65
|
-
element {
|
|
66
|
-
id,
|
|
67
|
-
path,
|
|
68
|
-
definition,
|
|
69
|
-
min,
|
|
70
|
-
max,
|
|
71
|
-
base {
|
|
72
|
-
path,
|
|
73
|
-
min,
|
|
74
|
-
max
|
|
75
|
-
},
|
|
76
|
-
contentReference,
|
|
77
|
-
type {
|
|
78
|
-
code,
|
|
79
|
-
profile,
|
|
80
|
-
targetProfile
|
|
81
|
-
},
|
|
82
|
-
binding {
|
|
83
|
-
strength,
|
|
84
|
-
valueSet
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
SearchParameterList(base: "${t}", _count: 100) {
|
|
90
|
-
base,
|
|
91
|
-
code,
|
|
92
|
-
type,
|
|
93
|
-
expression,
|
|
94
|
-
target
|
|
95
|
-
}
|
|
96
|
-
}`.replaceAll(/\s+/g," "),u=await this.graphql(c);PT(u.data.StructureDefinitionList);for(const f of u.data.SearchParameterList)QB(f)})());return this.setCacheEntry(r,s,n),s}requestProfileSchema(t,n){if(!n?.expandProfile&&uS(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 to((async()=>{if(n?.expandProfile){const c=this.fhirUrl("StructureDefinition","$expand-profile");c.search=new URLSearchParams({url:t}).toString();const u=await this.post(c.toString(),{});PT(u)}else{const c=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});if(!c){console.warn(`No StructureDefinition found for ${t}!`);return}tk(c)}})());return this.setCacheEntry(r,s,n),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,r),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,r),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),s}async createAttachment(t,n,r,o,s){let c=ZT(t,n,r,o);if(c.contentType===tn.XML){const h=c.data;let m;h instanceof Blob?m=await new Promise((g,y)=>{const x=new FileReader;x.onload=()=>{if(!x.result){y(new Error("Failed to load file"));return}g(x.result)},x.readAsText(h,"utf-8")}):ArrayBuffer.isView(h)?m=new TextDecoder().decode(h):m=h,m.includes("<ClinicalDocument")&&m.includes("urn:hl7-org:v3")&&(c={...c,contentType:tn.CDA_XML})}const u=s??(typeof n=="object"?n:{}),f=await this.createBinary(c,u);return{contentType:c.contentType,url:f.url,title:c.filename}}createBinary(t,n,r,o,s){const c=ZT(t,n,r,o),u=s??(typeof n=="object"?n:{}),{data:f,contentType:h,filename:m,securityContext:g,onProgress:y}=c,x=this.fhirUrl("Binary");return m&&x.searchParams.set("_filename",m),g?.reference&&this.setRequestHeader(u,"X-Security-Context",g.reference),y?this.uploadwithProgress(x,f,h,y,u):this.post(x,f,h,u)}uploadwithProgress(t,n,r,o,s){return new Promise((c,u)=>{const f=new XMLHttpRequest,h=()=>f.abort();s?.signal?.addEventListener("abort",h);const m=g=>{s?.signal?.removeEventListener("abort",h),g instanceof Error?u(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 ht(Wt(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,x]of Object.entries(g))f.setRequestHeader(y,x)}f.send(n)})}async createPdf(t,n,r,o){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const s=YF(t,n,r,o),c=typeof n=="object"?n:{},{docDefinition:u,tableLayouts:f,fonts:h,...m}=s,g=await this.createPdfImpl(u,f,h),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,n),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,o),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,tn.JSON,n)}graphql(t,n,r,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},tn.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:u,returnAck:f,...h}=c??{};return this.post(this.fhirUrl("Agent",Sl(t),"$push"),{destination:typeof n=="string"?n:zt(n),body:r,contentType:o,waitForResponse:s,...u!==void 0?{waitTimeout:u}:void 0,...f!==void 0?{returnAck:f}:void 0},tn.FHIR_JSON,h)}getCdsServices(t){return this.get("/cds-services",t)}callCdsService(t,n,r){return this.post(`/cds-services/${t}`,n,tn.JSON,r)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){(!this.sessionDetails?.profile||zt(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=_F(t),this.medplumServer=RF(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(FF)&&(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 DF(this)),this.keyValueClient}getBundle(t,n){return new to((async()=>{const r=await this.get(t,n);for(const o of r.entry??br)this.cacheResource(o.resource,n);return r})())}isCacheEnabled(t){return!!this.requestCache&&!this.getRequestHeader(t,"x-medplum-on-behalf-of")}getCacheEntry(t,n){if(!this.isCacheEnabled(n)||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,r){this.isCacheEnabled(r)&&this.requestCache.set(t,{requestTime:Date.now(),value:n})}cacheResource(t,n){t?.id&&!t.meta?.tag?.some(r=>r.code==="SUBSETTED")&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new to(Promise.resolve(t)),n)}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 u=s.headers.get("content-type")?.includes("json");if(s.status===404&&!u)throw new ht(G8);const f=await this.parseBody(s,u);if(s.status===200&&r.followRedirectOnOk||s.status===201&&r.followRedirectOnCreated){const h=await XT(s,f);if(h)return this.request("GET",h,{...r,body:void 0})}if(s.status===202&&r.pollStatusOnAccepted){const m=await XT(s,f)??o.statusUrl;if(m)return this.pollStatus(m,r,o)}if(s.status>=400)throw new ht(Wt(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=Co(this.baseUrl,t));const r=n?.maxRetries??2;for(let o=0;o<=r;o++)try{this.logLevel!=="none"&&this.logRequest(t,n);const s=await this.fetch(t,n);if(this.logLevel!=="none"&&this.logResponse(s),this.setCurrentRateLimit(s),o>=r||!KF(s))return s;const c=this.getRetryDelay(o),u=n.maxRetryTime??2e3;if(c>u)return s;await $T(c,{signal:n.signal})}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}`),this.logLevel==="verbose"&&n.headers){const r=n.headers;for(const o of tu(Object.keys(r)))console.log(`> ${o}: ${r[o]}`)}}logResponse(t){console.log(`< ${t.status} ${t.statusText}`),this.logLevel==="verbose"&&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(h=>h.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(h=>h.startsWith("r="))?.substring(2),c=s?Number.parseInt(s,10):Number.NaN,u=r.find(h=>h.startsWith("t="))?.substring(2),f=u?Number.parseInt(u,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 $T(s,{signal:n.signal}),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,Co(this.fhirBaseUrl,o.url),o.options))}catch(s){o.reject(new ht(Wt(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&&!XA(c.response.outcome)?s.reject(new ht(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",IF,!0),this.options.extendedMode!==!1&&this.setRequestHeader(t,"X-Medplum","extended"),t.body&&this.setRequestHeader(t,"Content-Type",tn.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)}getRequestHeader(t,n){const r=t?.headers;if(r)if(Array.isArray(r)){const o=r.find(([s])=>s.toLowerCase()===n.toLowerCase());return o?o[1]:void 0}else{if(r instanceof Headers)return r.get(n)??void 0;if(cr(r))return r[n]??void 0}else return}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):cr(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 ht(Id)}async startPkce(){const t=qT();sessionStorage.setItem("pkceState",t);const n=qT().slice(0,128);sessionStorage.setItem("codeVerifier",n);try{const r=await uF(n);return{codeChallengeMethod:"S256",codeChallenge:PB(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??nr.getOrigin()),r.searchParams.set("code_challenge_method",n.codeChallengeMethod),r.searchParams.set("code_challenge",n.codeChallenge),r.searchParams.set("scope",n.scope??"openid profile"),nr.assign(r.toString())}processCode(t,n){const r={grant_type:Nc.AuthorizationCode,code:t,client_id:n?.clientId??this.clientId??"",redirect_uri:n?.redirectUri??nr.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:Nc.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:Nc.ClientCredentials,client_id:t,client_secret:n})}async startJwtBearerLogin(t,n,r){return this.clientId=t,this.fetchTokens({grant_type:Nc.JwtBearer,client_id:t,assertion:n,scope:r})}async startJwtAssertionLogin(t){return this.fetchTokens({grant_type:Nc.ClientCredentials,client_assertion_type:qF.JwtBearer,client_assertion:t})}setBasicAuth(t,n){this.clientId=t,this.clientSecret=n,this.basicAuth=HT(t+":"+n)}setLogLevel(t){this.logLevel=t,this.options.verbose=t==="verbose"}getLogLevel(){return this.logLevel}setVerbose(t){this.logLevel=t?"verbose":"none",this.options.verbose=t}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new ht(En("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new ht(En("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,GT(r),tn.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!s)throw new Error("Invalid response!");return r.endpoint=s,r}async fhircastUnsubscribe(t){if(!TS(t))throw new ht(En("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new ht(En("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post(this.fhircastHubUrl,GT(t),tn.FORM_URL_ENCODED)}fhircastConnect(t){return new CF(t)}async fhircastPublish(t,n,r,o){return vF(n)?this.post(this.fhircastHubUrl,WT(t,n,r,o),tn.JSON):(yF(n),this.post(this.fhircastHubUrl,WT(t,n,r),tn.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 handleTokenError(t){try{const n=await t.json();throw yf(n)?new ht(n):n.error_description?new ht(No(n.error_description)):new Error(JSON.stringify(n))}catch(n){throw n instanceof ht?(n.message=`Failed to fetch tokens: ${n.message}`,n):new ht(No("Failed to fetch tokens"),{cause:n})}}async fetchTokens(t){const n=new URLSearchParams(t),r={...this.defaultHeaders,"Content-Type":tn.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 ${HT(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(u){throw this.refreshPromise=void 0,u}s.ok||(this.clearActiveLogin(),this.onUnauthenticated?.(),await this.handleTokenError(s));const c=await s.json();return await this.verifyTokens(c),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(TF(n)){const r=RS(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new ht(W8);if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new ht(AT)}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new ht(AT)}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)nr.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)?nr.reload():r?this.setAccessToken(r.accessToken,r.refreshToken):this.clear()}})}catch{}}getSubscriptionManager(){return this.subscriptionManager||(this.subscriptionManager=new LF(this,IB(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 GF(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}async function XT(e,t){const n=e.headers.get("content-location");if(n)return n;const r=e.headers.get("location");if(r)return r;if(yf(t)&&t.issue?.[0]?.diagnostics)return t.issue[0].diagnostics}function JT(e){const t=e.entry?.map(n=>n.resource)??[];return Object.assign(t,{bundle:e})}function WF(e){return cr(e)&&"data"in e&&"contentType"in e}function ZT(e,t,n,r){return WF(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function QF(e){return cr(e)&&"docDefinition"in e}function YF(e,t,n,r){return QF(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function KF(e){return e.status===429||e.status>=500}function nu({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=XF(t,n,e,!!o);const u=Yx(t,".",2)[1];c=JF(c,s,u),c=ZF(c,s,u);const f=Object.create(null);for(const[m,g]of Object.entries(c))f[t+"."+m]=g;let h;if(e&&!e.isDefaultContext)h=e.getExtendedProps;else{const m=Object.create(null);h=g=>{const y=Yx(g,".",2)[1];if(y){if(!m[y]){const x=Vp(y,s?.hiddenFields);m[y]={hidden:x,readonly:x||Vp(y,s?.readonlyFields)}}return m[y]}}}return{path:t,elements:c,elementsByPath:f,profileUrl:r??e?.profileUrl,debugMode:o,getExtendedProps:h,accessPolicyResource:s}}function XF(e,t,n,r){const o=Object.create(null);if(n)for(const[c,u]of Object.entries(n.elementsByPath)){const f=fl(e,c);f!==void 0&&(o[f]=u)}let s=!1;if(t)for(const[c,u]of Object.entries(t))c in o||(o[c]=u,s=!0);return r&&console.assert(s,"Unnecessary ElementsContext; not using any newly provided elements"),o}function JF(e,t,n){if(!t?.hiddenFields?.length)return e;const r=n?n+".":"";return Object.fromEntries(Object.entries(e).filter(([o])=>!Vp(r+o,t.hiddenFields)))}function ZF(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))Vp(o+s,t.readonlyFields)?r[s]={...c,readonly:!0}:r[s]=c;return r}function Vp(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 Uk(e){return e.type!==void 0&&e.type.length>0}function eH(e,t,n,r){const o=uB(e,t.path,{profileUrl:r});if(o){const s=n.typeSchema?.elements??n.elements;return o.some(c=>fB(c,t,n,s))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function Bk(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=>eH(s,c,o,o.typeSchema?.url??r)))return o.name}}class tH{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=nu({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(!Ln(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=nH(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);Ln(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(!Uk(s))continue;const c=s.type.find(u=>Ln(u.profile))?.profile?.[0];if(Ln(c)){const u=gu(c);u&&(s.typeSchema=u)}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;Ln(c)&&(s=nu({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 nH(e){const t=[];function n(s,c){return c.startsWith(s+".")}function r(s,c){for(const u of s.children)if(n(u.key,c.key)){r(u,c);return}s.children.push(c)}const o=Object.entries(e);o.sort((s,c)=>s[0].localeCompare(c[0]));for(const[s,c]of o){const u={key:s,element:c,children:[]};let f=!1;for(const h of t)if(n(h.key,s)){r(h,u),f=!0;break}f||t.push(u)}return t}const rx="__sliceName";function rH(e,t){const n=new iH(e,e.resourceType,"resource");return new tH(t,n).crawlResource(),n.getDefaultValue()}function eR(e,t,n){for(const[r,o]of Object.entries(t)){if(n===void 0||n===r){Fp(e,r,o,t);continue}const s=fl(n,r);s!==void 0&&Fp(e,s,o,t)}return e}class iH{rootValue;schemaStack;valueStack;constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=pi(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=fl(s,t);if(c===void 0)throw new Error(`Expected ${t} to be prefixed by ${s}`);const u=[];for(const f of o){if(f===void 0)continue;const h=fl(r.path,s),m=Array.isArray(f)?f:[f];for(const g of m){oH(g,c,n,r.elements,h),Fp(g,c,n,r.elements);const y=Zx(g,c,r.elements,h);y!==void 0&&u.push(y)}}this.valueStack.push({type:"element",path:t,values:u})}onExitElement(t,n,r){if(!this.valueStack.pop())throw new Error("Expected value context to exist when exiting element");const s=fl(this.value.path,t);if(s===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);const c=fl(r.path,this.value.path);for(const u of this.value.values){const f=Zx(u,s,r.elements,c);if(Array.isArray(f))for(let h=f.length-1;h>=0;h--){const m=f[h];Ln(m)||f.splice(h,1)}Tn(f)&&Jx(u,void 0,s,n)}}onEnterSlice(t,n,r){const o=this.value.values,s=[];for(const c of o)if(c!==void 0){const u=Array.isArray(c)?c:[c],f=this.getMatchingSliceValues(u,n,r);s.push(f)}this.valueStack.push({type:"slice",path:t,values:s})}getMatchingSliceValues(t,n,r){const o=[];for(const s of t)(s[rx]??Bk(s,[n],r.discriminator,this.schema.url))===n.name&&o.push(s);for(let s=o.length;s<n.min;s++)if(mS(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];rx in o&&delete o[rx]}}getDefaultValue(){return this.rootValue}}function oH(e,t,n,r,o){const s=Zx(e,t,r,o);n.min>0&&s===void 0&&mS(n.type[0].code)&&(n.isArray?Jx(e,[Object.create(null)],t,n):Jx(e,Object.create(null),t,n))}function Jx(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 Zx(e,t,n,r){const o=t.split(".");let s=e,c;for(let u=0;u<o.length;u++){let f=o[u];if(f.includes("[x]")){const h=(r?r+".":"")+o.slice(0,u+1).join("."),g=n[h].type[0].code;f=f.replace("[x]",Qn(g))}if(u===o.length-1){Array.isArray(s)?c=s.map(h=>h[f]):c=s[f];continue}if(Array.isArray(s))s=s.map(h=>h[f]);else if(cr(s)){if(s[f]===void 0)return;s=s[f]}else return}return c}function Fp(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(u=>Fp(u,t,n,r));e==null&&(e=Object.create(null));const o=e,s=t.split(".");let c=o;for(let u=0;u<s.length;u++){let f=s[u];if(f.includes("[x]")){const m=r[s.slice(0,u+1).join(".")].type[0].code;f=f.replace("[x]",Qn(m))}if(u===s.length-1){const h=Array.isArray(c)?c:[c];for(const m of h)n.fixed?m[f]??=n.fixed.value:n.pattern&&(m[f]=Vk(m[f],n.pattern.value))}else{if(!(f in c)){const h=s.slice(0,u+1).join(".");c[f]=r[h].isArray?[Object.create(null)]:Object.create(null)}c=c[f]}}return o}function Vk(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return(e?.length??0)>0?e:pi(t);if(cr(t)&&(cr(e)&&!Array.isArray(e)||e===void 0)){const n=pi(e)??Object.create(null);for(const r of Object.keys(t))n[r]=Vk(n[r],t[r]);return n}return e}function aH(e){return e.match(/^\((.+)\)\.identifier$/)?.[1]}function sH(e,t){return new yS(e,new Wm(t,new Vd("identifier")))}const Cr={BOOLEAN:"BOOLEAN",NUMBER:"NUMBER",QUANTITY:"QUANTITY",TEXT:"TEXT",REFERENCE:"REFERENCE",CANONICAL:"CANONICAL",DATE:"DATE",DATETIME:"DATETIME"};function Jm(e,t){let n=Uo.types[e]?.searchParamsDetails?.[t.code];return n||(n=cH(e,t)),n}function lH(e,t,n){let r=Uo.types[e];r||(r={},Uo.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function cH(e,t){const n=t.code,r=t.expression,o=hH(e,r),s={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const f of o){const h=jp(f),m=MB(()=>h.join("."));h.length===1&&h[0]instanceof ei?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")):Fk(s,h,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=aH(r);if(f===void 0)throw new Error(`Unexpected expression for derived identifier search parameter: ${r}`);const h=tR(e,f);c=sH(r,h)}else c=tR(e,r);const u={type:fH(t,s.propertyTypes),elementDefinitions:s.elementDefinitions.map(f=>({...f,type:f.type?.filter(h=>s.propertyTypes.has(h.code))})).filter(f=>f.type&&f.type.length>0),parsedExpression:c,array:s.array};return lH(e,n,u),u}function Fk(e,t,n,r){const o=t[r];if(o instanceof Bp){e.propertyTypes.add(o.right.toString());return}if(o instanceof SS){uH(e,o);return}const s=o.toString(),c=ks(n,s);if(!c)throw new Error(`Element definition not found for ${n} ${s}`);let u=!1,f=r+1;f<t.length&&t[f]instanceof wS&&(u=!0,f++);const h=t[f];if(c.isArray&&!u&&(e.array=!0),f===t.length-1&&h instanceof Bp){e.elementDefinitions.push(c),e.propertyTypes.add(h.right.toString());return}if(f>=t.length){e.elementDefinitions.push(c);for(const m of c.type??br)e.propertyTypes.add(m.code);return}for(const m of c.type??br){let g=m.code;dH(g)&&(g=c.type[0].code),Fk(e,t,g,f)}}function uH(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 bS){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function dH(e){return e==="Element"||e==="BackboneElement"}function fH(e,t){switch(e.type){case"date":return t.size===1&&t.has(ie.date)?Cr.DATE:Cr.DATETIME;case"number":return Cr.NUMBER;case"quantity":return Cr.QUANTITY;case"reference":return t.has(ie.canonical)?Cr.CANONICAL:Cr.REFERENCE;case"token":return t.size===1&&t.has(ie.boolean)?Cr.BOOLEAN:Cr.TEXT;default:return Cr.TEXT}}function hH(e,t){const n=[],r=jS(t);return Hp(e,r.child,n),n}function tR(e,t){const n=[],r=jS(t);if(Hp(e,r.child,n),n.length===0)return r;let o=n[0];for(let s=1;s<n.length;s++)o=new xS(o,n[s]);return new yS("<original-not-available>",o)}function Hp(e,t,n){t instanceof xS?(Hp(e,t.left,n),Hp(e,t.right,n)):t.toString().includes(e+".")&&n.push(t)}function jp(e){if(e instanceof Bp||e instanceof wS)return[jp(e.left),e].flat();if(e instanceof ei)return[e];if(e instanceof Wm)return[jp(e.left),jp(e.right)].flat();if(e instanceof SS){if(e.name==="where"&&!(e.args[0]instanceof bS))return[];if(e.name==="last")return[]}return[e]}const pH="https://meta.medplum.com/releases",ix=new Map;function mH(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 gH(e,t,n){let r=ix.get("latest");if(!r){const o="latest",s=new URL(`${pH}/${o}.json`);s.searchParams.set("a",e),s.searchParams.set("c",zk);const c=await fetch(s.toString());if(c.status!==200){let f;try{f=(await c.json()).message}catch(h){console.error(`Failed to parse message from body: ${Ge(h)}`)}throw new Error(`Received status code ${c.status} while fetching manifest for version 'latest'. Message: ${f}`)}const u=await c.json();mH(u),r=u,ix.set("latest",r),ix.set(r.tag_name.slice(1),r)}return r}async function vH(e){const t=await gH(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 Hk=v.createContext(void 0);function Zm(){return v.useContext(Hk)}function Re(){return Zm().medplum}function vu(){return Zm().navigate}function Sf(){return Zm().profile}const nR=["change","storageInitialized","storageInitFailed","profileRefreshing","profileRefreshed"];function yH(e){const t=e.medplum,n=e.navigate??xH,[r,o]=v.useState({profile:t.getProfile(),loading:t.isLoading()});v.useEffect(()=>{function c(){o(u=>({...u,profile:t.getProfile(),loading:t.isLoading()}))}for(const u of nR)t.addEventListener(u,c);return()=>{for(const u of nR)t.removeEventListener(u,c)}},[t]);const s=v.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return a.jsx(Hk.Provider,{value:s,children:e.children})}function xH(e){window.location.assign(e)}const rR=new Map,qk=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=rR.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 rR.set(t,e),e},[e]);function Xt(e,t){const n=Re(),[r,o]=v.useState(()=>iR(n,e)),s=v.useCallback(c=>{$o(c,r)||o(c)},[r]);return v.useEffect(()=>{let c=!0;const u=iR(n,e);return!u&&Oa(e)?n.readReference(e).then(f=>{c&&s(f)}).catch(f=>{c&&(s(void 0),t&&t(Wt(f)))}):s(u),(()=>c=!1)},[n,e,s,t]),r}function iR(e,t){if(t){if(Qo(t))return t;if(Oa(t))return e.getCachedReference(t)}}const vt={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"},_S=`${fo}/fhir/StructureDefinition/questionnaire-itemControl`,bH=`${fo}/fhir/StructureDefinition/questionnaire-referenceFilter`,eb=`${fo}/fhir/StructureDefinition/questionnaire-referenceResource`,SH=`${fo}/fhir/StructureDefinition/questionnaire-validationError`,wH=`${fo}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression`,jH=`${fo}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression`,CH=`${fo}/fhir/StructureDefinition/questionnaire-signatureRequired`,Cp=`${fo}/fhir/StructureDefinition/questionnaireresponse-signature`;function EH(e){return e.type==="choice"||e.type==="open-choice"}function TH(e,t){const n=RH(e,t);return n!==void 0?n:_H(e,t)}function RH(e,t){const n=Wo(e,wH);if(t&&n){const r=n.valueExpression?.expression;if(r){const o=hi(t),s=js(r,[o],{"%resource":o});return Ao(s)}}}function _H(e,t){if(!e.enableWhen)return!0;const n=e.enableBehavior??"any";for(const r of e.enableWhen){const o=Qk(t?.item,r.question);if(r.operator==="exists"&&!r.answerBoolean&&!o?.length){if(n==="any")return!0;continue}const{anyMatch:s,allMatch:c}=OH(r,o,n);if(n==="any"&&s)return!0;if(n==="all"&&!c)return!1}return n!=="any"}function Gk(e,t,n=t.item){for(const r of e){const o=n?.find(s=>s.linkId===r.linkId);o&&(DH(t,r,o),r.item&&o.item&&Gk(r.item,t,o.item))}}function DH(e,t,n){try{const r=PH(t,e);if(!r)return;const o=kH(t,r);if(!o)return;n.answer=[o]}catch(r){n.extension=[{url:SH,valueString:`Expression evaluation failed: ${Ge(r)}`}]}}const AH={[vt.boolean]:[ie.boolean],[vt.date]:[ie.date],[vt.dateTime]:[ie.dateTime],[vt.time]:[ie.time],[vt.url]:[ie.string,ie.uri,ie.url],[vt.attachment]:[ie.Attachment],[vt.reference]:[ie.Reference],[vt.quantity]:[ie.Quantity],[vt.decimal]:[ie.decimal,ie.integer],[vt.integer]:[ie.decimal,ie.integer]};function kH(e,t){if(!e.type)return;if(e.type===vt.choice||e.type===vt.openChoice)return{[`value${Qn(t.type)}`]:t.value};if(e.type===vt.string||e.type===vt.text)return typeof t.value=="string"?{valueString:t.value}:void 0;if(AH[e.type]?.includes(t.type))return{[`value${Qn(e.type)}`]:t.value}}function PH(e,t){if(!t)return;const n=Wo(e,jH);if(n){const r=n.valueExpression?.expression;if(r){const o=hi(t),s=js(r,[o],{"%resource":o});return s.length!==0?s[0]:void 0}}}function Wk(e,t,n){const r=[];for(const o of e){const s=n.answerOption?.find(c=>wl(Bo(c))===o);if(s){const c=Bo(s);c&&r.push({[t]:c.value})}}return r}function Qk(e,t){for(const n of e??br){if(n.linkId===t)return n.answer;if(n.item){const r=Qk(n.item,t);if(r)return r}}}function NH(e,t,n){if(n==="exists")return!!e===t.value;if(e){const r=n==="="||n==="!="?n?.replace("=","~"):n,[{value:o}]=js(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return o}else return!1}function OH(e,t,n){const r=t||[],o=IH(e);let s=!1,c=!0;for(const u of r){const f=zH(u),{operator:h}=e;if(NH(f,o,h)?s=!0:c=!1,n==="any"&&s)break}return{anyMatch:s,allMatch:c}}function Yk(e){const t=Wo(e,eb);if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return t.valueCodeableConcept?.coding?.map(n=>n.code)}}function ox(e,t){const n=pi(e);let r=Wo(n,eb);return!t||t.length===0?(r&&(n.extension=n.extension?.filter(o=>o!==r)),n):(r||(n.extension??=[],r={url:eb},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 MH(e,t,n){const r=Wo(e,bH);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 u of c){const[f,h]=Yx(u,"=",2);s[f]=h}return s}function oR(e,t){return{resourceType:"QuestionnaireResponse",questionnaire:e.url??zt(e),item:DS(e.item,t?.item),status:"in-progress"}}function DS(e,t){let n;for(const r of e??br){if(r.type===vt.display)continue;const o=t?.filter(s=>s.linkId===r.linkId);if(o?.length)for(const s of o)s.id=s.id??Xk(),s.text=s.text??r.text,s.item=DS(r.item,s.item),s.answer=Jk(r,s),n=sl(n,s);else n=sl(n,Kk(r))}return n}function Kk(e){return{id:Xk(),linkId:e.linkId,text:e.text,item:DS(e.item,void 0),answer:Jk(e)}}let LH=1;function Xk(){return"id-"+LH++}function Jk(e,t){if(!(e.type===vt.display||e.type===vt.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 AS(e){return xf({value:e},"value")}function Bo(e){return xf({value:e},"value")}function IH(e){return xf({value:e},"answer")}function zH(e){return xf({value:e},"value")}function $H(e){const t=Xt(e.questionnaire),n=Xt(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:UH(t)),t&&e.defaultValue&&n&&!o.current.questionnaireResponse&&(o.current.questionnaireResponse=oR(t,n),x()),t&&!e.defaultValue&&!o.current.questionnaireResponse&&(o.current.questionnaireResponse=oR(t),x()),!o.current.questionnaire||!o.current.questionnaireResponse)return{loading:!0};function s(S,j){let C=o.current.questionnaireResponse;for(const T of S)C=C?.item?.find(R=>T.id?R.id===T.id:R.linkId===T.linkId);return j&&(C=C?.item?.find(T=>T.linkId===j.linkId)),C}function c(){o.current.activePage=(o.current.activePage??0)+1,r()}function u(){o.current.activePage=(o.current.activePage??0)-1,r()}function f(S,j){const C=s(S);C&&(C.item??=[],C.item.push(Kk(j)),x())}function h(S,j){const C=s(S,j);C&&(C.answer??=[],C.answer.push({}),x())}function m(S,j,C){const T=s(S,j);T&&(T.answer=C,x())}function g(S){const j=o.current.questionnaireResponse;j&&(S?(j.extension=j.extension??[],j.extension=j.extension.filter(C=>C.url!==Cp),j.extension.push({url:Cp,valueSignature:S})):j.extension=j.extension?.filter(C=>C.url!==Cp),x())}function y(){const S=o.current.questionnaire;if(S?.item){const j=o.current.questionnaireResponse;Gk(S.item,j)}}function x(){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:BH(o.current.questionnaire,o.current.pages,o.current.activePage),responseItems:VH(o.current.questionnaireResponse,o.current.pages,o.current.activePage),onNextPage:c,onPrevPage:u,onAddGroup:f,onAddAnswer:h,onChangeAnswer:m,onChangeSignature:g}}function UH(e){if(!(!e?.item||Wo(e?.item?.[0],_S)?.valueCodeableConcept?.coding?.[0]?.code!=="page"))return e.item.map((n,r)=>({linkId:n.linkId,title:n.text??`Page ${r+1}`,group:n}))}function BH(e,t,n=0){return t&&e?.item?.[n]?[e.item[n]]:e.item??[]}function VH(e,t,n=0){return t&&e?.item?.[n]?[e.item[n]]:e.item??[]}function FH(e,t,n={leading:!1}){const[r,o]=v.useState(e),s=v.useRef(!1),c=v.useRef(void 0),u=v.useRef(!1),f=v.useCallback(()=>window.clearTimeout(c.current),[]);return v.useEffect(()=>{s.current&&(!u.current&&n.leading?(u.current=!0,o(e)):(f(),c.current=setTimeout(()=>{u.current=!1,o(e)},t)))},[e,n.leading,t,f]),v.useEffect(()=>(s.current=!0,f),[f]),[r,f]}const HH=250;function qH(e,t,n){return Zk("searchOne",e,t)}function ru(e,t,n){return Zk("searchResources",e,t)}function Zk(e,t,n,r){const o=Re(),[s,c]=v.useState(!0),[u,f]=v.useState(),[h,m]=v.useState(),g=o.fhirSearchUrl(t,n).toString(),y=v.useMemo(()=>({resourceType:t,query:n}),[g]),x=HH,[S]=FH(y,x,{leading:!0});return v.useEffect(()=>{let j=!0;return o[e](S.resourceType,S.query).then(C=>{j&&(c(!1),f(C),m(q8))}).catch(C=>{j&&(c(!1),f(void 0),m(Wt(C)))}),()=>{j=!1}},[o,e,S]),[u,s,h]}function GH(e){const t=e.value;return t?a.jsx(a.Fragment,{children:wk(t)}):null}const eP=["meta","implicitRules","contained","extension","modifierExtension"],tP=["language","text"],hn=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});hn.displayName="ElementsContext";const kS=["extension","modifierExtension"],WH=["id",...eP].filter(e=>!kS.includes(e));function QH(e){return Object.entries(e).filter(([n,r])=>!Ln(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||kS.includes(n)&&!Ln(r.slicing?.slices)||WH.includes(n)?!1:!(tP.includes(n)&&r.path.split(".").length===2||n.includes(".")))}function aR(e,t){return e.line&&e.line.length>t?e.line[t]:""}function sR(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:EB(r)}}function YH(e){const[t,n]=v.useState(e.defaultValue||{}),r=v.useRef(t);r.current=t;const{getExtendedProps:o}=v.useContext(hn),[s,c,u,f,h,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 x(_){y({...r.current,use:_})}function S(_){y({...r.current,type:_})}function j(_){y(sR(r.current||{},0,_))}function C(_){y(sR(r.current||{},1,_))}function T(_){y({...r.current,city:_})}function R(_){y({...r.current,state:_})}function E(_){y({...r.current,postalCode:_})}return a.jsxs(xe,{gap:"xs",wrap:"nowrap",grow:!0,children:[a.jsx(dn,{disabled:e.disabled||s?.readonly,"data-testid":"address-use",defaultValue:t.use,onChange:_=>x(_.currentTarget.value),data:["","home","work","temp","old","billing"]}),a.jsx(dn,{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||u?.readonly,placeholder:"Line 1",defaultValue:aR(t,0),onChange:_=>j(_.currentTarget.value)}),a.jsx(He,{disabled:e.disabled||f?.readonly,placeholder:"Line 2",defaultValue:aR(t,1),onChange:_=>C(_.currentTarget.value)}),a.jsx(He,{disabled:e.disabled||h?.readonly,placeholder:"City",defaultValue:t.city,onChange:_=>T(_.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:_=>E(_.currentTarget.value)})]})}function KH(e){const t=Sf(),[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 XH={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:u=2,title:f,className:h,children:m,...g},y)=>v.createElement("svg",{ref:y,...XH[e],width:c,height:c,className:["tabler-icon",`tabler-icon-${t}`,h].join(" "),...e==="filled"?{fill:s}:{strokeWidth:u,stroke:s},...g},[f&&v.createElement("title",{key:"svg-title"},f),...r.map(([x,S])=>v.createElement(x,S)),...Array.isArray(m)?m:[m]]));return o.displayName=`${n}`,o};const JH=[["path",{d:"M12 6a2 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:"M6 12a2 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:"M15 18a2 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"}]],ZH=Fe("outline","adjustments-horizontal","AdjustmentsHorizontal",JH);const eq=[["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"}]],Ps=Fe("outline","alert-circle","AlertCircle",eq);const tq=[["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"}]],nq=Fe("outline","arrow-down","ArrowDown",tq);const rq=[["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"}]],iq=Fe("outline","arrow-up","ArrowUp",rq);const oq=[["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"}]],aq=Fe("outline","bleach-off","BleachOff",oq);const sq=[["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"}]],lq=Fe("outline","bleach","Bleach",sq);const cq=[["path",{d:"M18 7v14l-6 -4l-6 4v-14a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4",key:"svg-0"}]],uq=Fe("outline","bookmark","Bookmark",cq);const dq=[["path",{d:"M7 5a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2l0 -10",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"}]],fq=Fe("outline","box-multiple","BoxMultiple",dq);const hq=[["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"}]],pq=Fe("outline","brackets-contain","BracketsContain",hq);const mq=[["path",{d:"M9 7a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-0"}],["path",{d:"M14 16a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M4 16a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-2"}]],gq=Fe("outline","brand-asana","BrandAsana",mq);const vq=[["path",{d:"M3 9a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v9a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2l0 -9",key:"svg-0"}],["path",{d:"M8 7v-2a2 2 0 0 1 2 -2h4a2 2 0 0 1 2 2v2",key:"svg-1"}],["path",{d:"M12 12l0 .01",key:"svg-2"}],["path",{d:"M3 13a20 20 0 0 0 18 0",key:"svg-3"}]],yq=Fe("outline","briefcase","Briefcase",vq);const xq=[["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"}]],bq=Fe("outline","bucket-off","BucketOff",xq);const Sq=[["path",{d:"M4 7a8 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"}]],wq=Fe("outline","bucket","Bucket",Sq);const jq=[["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"}]],Cq=Fe("outline","building","Building",jq);const Eq=[["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-12",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"}]],cs=Fe("outline","calendar","Calendar",Eq);const Tq=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],Yo=Fe("outline","check","Check",Tq);const Rq=[["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"}]],_q=Fe("outline","checkbox","Checkbox",Rq);const Dq=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],PS=Fe("outline","chevron-down","ChevronDown",Dq);const Aq=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l2 2l4 -4",key:"svg-1"}]],kq=Fe("outline","circle-check","CircleCheck",Aq);const Pq=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l6 0",key:"svg-1"}]],qp=Fe("outline","circle-minus","CircleMinus",Pq);const Nq=[["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"}]],Fd=Fe("outline","circle-plus","CirclePlus",Nq);const Oq=[["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"}]],NS=Fe("outline","cloud-upload","CloudUpload",Oq);const Mq=[["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"}]],Lq=Fe("outline","columns","Columns",Mq);const Iq=[["path",{d:"M7 9.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.667l0 -8.666",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"}]],OS=Fe("outline","copy","Copy",Iq);const zq=[["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"}]],$q=Fe("outline","currency-dollar","CurrencyDollar",zq);const Uq=[["path",{d:"M4 6a8 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"}]],Bq=Fe("outline","database","Database",Uq);const Vq=[["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:"M10 14a2 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"}]],Fq=Fe("outline","device-floppy","DeviceFloppy",Vq);const Hq=[["path",{d:"M4 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M18 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]],qq=Fe("outline","dots","Dots",Hq);const Gq=[["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.415",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]],nP=Fe("outline","edit","Edit",Gq);const Wq=[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}],["path",{d:"M5 19l14 -14",key:"svg-2"}]],wf=Fe("outline","equal-not","EqualNot",Wq);const Qq=[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]],jf=Fe("outline","equal","Equal",Qq);const Yq=[["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"}]],Kq=Fe("outline","eye-off","EyeOff",Yq);const Xq=[["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"}]],Jq=Fe("outline","eye","Eye",Xq);const Zq=[["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 2",key:"svg-1"}],["path",{d:"M12 17l.01 0",key:"svg-2"}],["path",{d:"M12 11l0 3",key:"svg-3"}]],lR=Fe("outline","file-alert","FileAlert",Zq);const eG=[["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 2",key:"svg-1"}],["path",{d:"M12 11l0 6",key:"svg-2"}],["path",{d:"M9 14l6 0",key:"svg-3"}]],tG=Fe("outline","file-plus","FilePlus",eG);const nG=[["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.227",key:"svg-0"}]],rG=Fe("outline","filter","Filter",nG);const iG=[["path",{d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2",key:"svg-0"}]],oG=Fe("outline","folder","Folder",iG);const aG=[["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"}]],sG=Fe("outline","forms","Forms",aG);const lG=[["path",{d:"M3 7a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v10a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3l0 -10",key:"svg-0"}],["path",{d:"M7 10a2 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"}]],cG=Fe("outline","id","Id",lG);const uG=[["path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12",key:"svg-0"}],["path",{d:"M9 4l0 16",key:"svg-1"}]],dG=Fe("outline","layout-sidebar","LayoutSidebar",uG);const fG=[["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 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4",key:"svg-4"}],["path",{d:"M3 15a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4",key:"svg-5"}]],cR=Fe("outline","list-details","ListDetails",fG);const hG=[["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 12a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v3a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1l0 -3",key:"svg-4"}],["path",{d:"M10 11v-2a2 2 0 1 1 4 0v2",key:"svg-5"}]],pG=Fe("outline","lock-access","LockAccess",hG);const mG=[["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-6",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"}]],gG=Fe("outline","lock","Lock",mG);const vG=[["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"}]],yG=Fe("outline","logout","Logout",vG);const xG=[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]],rP=Fe("outline","math-greater","MathGreater",xG);const bG=[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]],iP=Fe("outline","math-lower","MathLower",bG);const SG=[["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 -3h12",key:"svg-2"}]],wG=Fe("outline","message","Message",SG);const jG=[["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 -3l-6 6",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"}]],CG=Fe("outline","microscope","Microscope",jG);const EG=[["path",{d:"M5 12l14 0",key:"svg-0"}]],TG=Fe("outline","minus","Minus",EG);const RG=[["path",{d:"M7 16.5l-5 -3l5 -3l5 3v5.5l-5 3l0 -5.5",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 3l0 -5.5",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"}]],_G=Fe("outline","packages","Packages",RG);const DG=[["path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4",key:"svg-0"}],["path",{d:"M13.5 6.5l4 4",key:"svg-1"}]],AG=Fe("outline","pencil","Pencil",DG);const kG=[["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"}]],PG=Fe("outline","pin","Pin",kG);const NG=[["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"}]],OG=Fe("outline","pinned-off","PinnedOff",NG);const MG=[["path",{d:"M7 4v16l13 -8l-13 -8",key:"svg-0"}]],LG=Fe("outline","player-play","PlayerPlay",MG);const IG=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],zG=Fe("outline","plus","Plus",IG);const $G=[["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"}]],UG=Fe("outline","receipt","Receipt",$G);const BG=[["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"}]],oP=Fe("outline","refresh","Refresh",BG);const VG=[["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"}]],FG=Fe("outline","repeat","Repeat",VG);const HG=[["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 5a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2",key:"svg-1"}],["path",{d:"M10 14l4 0",key:"svg-2"}],["path",{d:"M12 12l0 4",key:"svg-3"}]],qG=Fe("outline","report-medical","ReportMedical",HG);const GG=[["path",{d:"M3 15a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2l0 -4",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"}]],WG=Fe("outline","router","Router",GG);const QG=[["path",{d:"M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]],eg=Fe("outline","search","Search",QG);const YG=[["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.065",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]],tb=Fe("outline","settings","Settings",YG);const KG=[["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"}]],MS=Fe("outline","sort-ascending","SortAscending",KG);const XG=[["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"}]],LS=Fe("outline","sort-descending","SortDescending",XG);const JG=[["path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14",key:"svg-0"}]],ZG=Fe("outline","square","Square",JG);const eW=[["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.873l-6.158 -3.245",key:"svg-0"}]],tW=Fe("outline","star","Star",eW);const nW=[["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"}]],rW=Fe("outline","switch-horizontal","SwitchHorizontal",nW);const iW=[["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"}]],oW=Fe("outline","table-export","TableExport",iW);const aW=[["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"}]],sW=Fe("outline","text-recognition","TextRecognition",aW);const lW=[["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"}]],tg=Fe("outline","trash","Trash",lW);const cW=[["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"}]],uR=Fe("outline","upload","Upload",cW);const uW=[["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"}]],dW=Fe("outline","webhook","Webhook",uW);const fW=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],El=Fe("outline","x","X",fW);const hW=[["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"}]],pW=Fe("filled","circle-filled","CircleFilled",hW);class IS extends v.Component{state;constructor(t){super(t),this.state={lastLocation:nr.getLocation()}}static getDerivedStateFromError(t){return{error:t,lastLocation:nr.getLocation()}}componentDidUpdate(t,n){nr.getLocation()!==this.state.lastLocation&&this.setState({lastLocation:nr.getLocation(),error:void 0})}shouldComponentUpdate(t,n){return!!(this.props.children!==t.children||n.error&&!this.state.error||this.state.lastLocation!==nr.getLocation())}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.error?a.jsx(Go,{icon:a.jsx(Ps,{size:16}),title:"Something went wrong",color:"red",children:Ge(this.state.error)}):this.props.children}}function Li(){return a.jsx(Do,{style:{width:"100%",height:"100vh"},children:a.jsx(_r,{})})}const mW="_main_6f7o5_1",gW={main:mW};function yn(e){e.preventDefault(),e.stopPropagation()}function zS(e){return e.button===1||e.ctrlKey||e.metaKey}function aP(e){if(dR(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&dR(t[0]))return!0}return!1}function dR(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}async function Ed(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 sP(e,t){const n=new Blob([e],{type:tn.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 St(e){const t=vu(),{to:n,suffix:r,label:o,onClick:s,children:c,...u}=e;let f=vW(n);return r&&(f+="/"+r),a.jsx(Et,{href:f,"aria-label":o,onAuxClick:h=>{h.stopPropagation()},onClick:h=>{h.stopPropagation(),s?(h.preventDefault(),s(h)):n&&(zS(h)||(h.preventDefault(),t(f)))},...u,children:c})}function vW(e){if(e){if(typeof e=="string")return yW(e);if(Qo(e))return xW(e);if(Oa(e))return bW(e)}return"#"}function yW(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function xW(e){return`/${e.resourceType}/${e.id}`}function bW(e){return`/${e.reference}`}function SW(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 ho(e){const t=Xt(e.value),n=t?Ea(t):e.alt??"",r=SW(n),o=(t&&SB(t))??e.src,s=qk(o??void 0),c=e.radius??"xl",u={...e,value:void 0,link:void 0};return e.link?a.jsx(St,{to:t,children:a.jsx(Jc,{src:s,alt:n,radius:c,...u,children:r})}):a.jsx(Jc,{src:s,alt:n,radius:c,...u,children:r})}const wW="_logoButton_799cf_1",jW="_user_799cf_11",CW="_userName_799cf_25",ax={logoButton:wW,user:jW,userName:CW};function $S(e){const t=e.value;return t?a.jsx(a.Fragment,{children:Na(t,e.options)}):null}function lP(){return"Medplum"}function cP(e){const t=Zm(),{medplum:n,profile:r,navigate:o}=t,s=n.getLogins(),{colorScheme:c,setColorScheme:u}=k5(),[f]=v.useState(localStorage.appShellLayoutVersion??"v1"),h=e.showLayoutVersionToggle??!0;function m(g){localStorage.appShellLayoutVersion=g,nr.reload()}return a.jsxs(a.Fragment,{children:[a.jsxs(Le,{align:"center",p:"xl",children:[a.jsx(ho,{size:"xl",radius:100,value:t.profile}),a.jsx($S,{value:t.profile?.name?.[0]}),a.jsx(be,{c:"dimmed",size:"xs",children:n.getActiveLogin()?.project.display})]}),s.length>1&&a.jsx(we.Divider,{}),s.map(g=>g.profile.reference!==zt(t.profile)&&a.jsx(we.Item,{onClick:()=>{n.setActiveLogin(g).then(()=>nr.reload()).catch(console.log)},children:a.jsxs(xe,{children:[a.jsx(Jc,{radius:"xl"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(be,{size:"sm",fw:500,children:g.profile.display}),a.jsx(be,{c:"dimmed",size:"xs",children:g.project.display})]})]})},g.profile.reference)),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(rW,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Switch to another project"}),a.jsx(we.Divider,{}),a.jsxs(xe,{justify:"center",children:[a.jsx(Zc,{size:"xs",value:c,onChange:g=>u(g),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]}),h&&a.jsx(Zc,{size:"xs",value:f,onChange:g=>m(g),data:[{label:"v1",value:"v1"},{label:"v2",value:"v2"}]})]}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(tb,{size:14,stroke:1.5}),onClick:()=>o(`/${zt(r)}`),children:"Account settings"}),a.jsx(we.Item,{leftSection:a.jsx(yG,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),o("/signin")},children:"Sign out"}),a.jsxs(be,{size:"xs",c:"dimmed",my:"sm",ta:"center",children:[lP()," ",e.version]})]})}const fR={selectedItems:"selected-items",options:"options"};function US(e){const t=Il({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:o,error:s,defaultValue:c,toOption:u,loadOptions:f,itemComponent:h,pillComponent:m,emptyComponent:g,onChange:y,onCreate:x,creatable:S,clearable:j,required:C,placeholder:T,leftSection:R,maxValues:E,optionsDropdownMaxHeight:_=320,minInputLength:k=0,...I}=e,D=I.disabled,P=EW(c),[$,B]=v.useState(""),[W,Y]=v.useState(),[Z,U]=v.useState(),[G,M]=v.useState(),[L,z]=v.useState(P.map(u)),[V,K]=v.useState([]),O=h??TW,F=m??RW,se=g??_W,de=v.useRef($);de.current=$;const ye=v.useRef(void 0),je=v.useRef(void 0),Ee=v.useRef(W);Ee.current=W;const Ke=v.useRef(Z);Ke.current=Z;const De=v.useRef(G);De.current=G;const dt=v.useRef(V);dt.current=V;const Ct=v.useCallback(()=>{if(Y(void 0),de.current===je.current&&f===ye.current||(de.current?.length??0)<k)return;je.current=de.current,ye.current=f;const Ie=new AbortController;U(Ie),f(de.current??"",Ie.signal).then(lt=>{Ie.signal.aborted||(K(lt.map(u)),De.current?(lt.length>0&&y(lt.slice(0,1)),M(!1)):lt.length>0&&t.openDropdown())}).catch(lt=>{Ie.signal.aborted||lt.message.includes("aborted")||Ae({color:"red",message:Ge(lt)})}).finally(()=>{Ie.signal.aborted||U(void 0)})},[t,f,y,u,k]),rt=v.useCallback(Ie=>{(V&&V.length>0||S)&&t.openDropdown(),t.updateSelectedOptionIndex(),B(Ie.currentTarget.value),Ke.current&&(Ke.current.abort(),U(void 0)),Ee.current!==void 0&&window.clearTimeout(Ee.current);const lt=window.setTimeout(()=>Ct(),100);Y(lt)},[t,V,S,Ct]),nt=v.useCallback(Ie=>{const lt=L.some(pe=>pe.value===Ie),et=lt?L.filter(pe=>pe.value!==Ie):[...L];let ft=V?.find(pe=>pe.value===Ie);if(!ft&&S!==!1&&x){const pe=x(Ie);ft=u(pe)}if(ft){if(E===0){y([ft.resource]),L.length>0&&z([]);return}lt||et.push(ft)}if(E!==void 0)for(;et.length>E;)et.shift();y(et.map(pe=>pe.resource)),z(et)},[S,V,L,E,y,x,u]),mt=v.useMemo(()=>{if(!D)return Ie=>{D||(E===1&&(B(""),K([]),t.closeDropdown()),je.current=void 0,Ie==="$create"?(B(""),nt($)):nt(Ie))}},[nt,t,D,E,$]),Tt=v.useCallback(Ie=>{const lt=L.filter(et=>et.value!==Ie.value);y(lt.map(et=>et.resource)),z(lt)},[L,y]),wt=v.useCallback(Ie=>{Ie.key==="Enter"?(W||Z)&&M(!0):Ie.key==="Backspace"&&$.length===0&&(yn(Ie),Tt(L[L.length-1]))},[Z,Tt,$.length,L,W]);v.useEffect(()=>()=>{Ke.current&&Ke.current.abort()},[]);const Te=!D&&j&&L.length>0&&a.jsx(Ye.ClearButton,{title:"Clear all",size:"sm",onClear:()=>{B(""),z([]),y([]),t.closeDropdown()}}),Pe=S&&$.trim().length>0,Ne=V.length>0||Pe;return a.jsxs(Ye,{store:t,onOptionSubmit:mt,withinPortal:!0,shadow:"xl",...I,children:[a.jsx(Ye.DropdownTarget,{children:a.jsx(Ss,{label:r,description:o,error:s,className:e.className,leftSection:R,rightSection:Z?a.jsx(_r,{size:16}):Te,required:C,disabled:D,children:a.jsxs(ja.Group,{"data-testid":fR.selectedItems,children:[L.map(Ie=>a.jsx(F,{item:Ie,disabled:D,onRemove:()=>Tt(Ie)},Ie.value)),!D&&(E===void 0||E===0||L.length<E)&&a.jsx(Ye.EventsTarget,{children:a.jsx(Ss.Field,{role:"searchbox",name:n,value:$,placeholder:T,onFocus:rt,onBlur:()=>{t.closeDropdown(),B("")},onKeyDown:wt,onChange:rt})})]})})}),a.jsx(Ye.Dropdown,{hidden:!Ne,"data-testid":fR.options,children:a.jsx(Ye.Options,{children:a.jsxs(ym,{type:"scroll",mah:_,children:[V.map(Ie=>{const lt=L.some(et=>et.value===Ie.value);return a.jsx(Ye.Option,{value:Ie.value,active:lt,children:a.jsx(O,{...Ie,active:lt})},Ie.value)}),Pe&&a.jsxs(Ye.Option,{value:"$create",children:["+ Create ",$]}),!S&&$.trim().length>0&&V.length===0&&a.jsx(se,{search:$})]})})})]})}function EW(e){return e?Array.isArray(e)?e:[e]:[]}function TW(e){return a.jsxs(xe,{gap:"xs",children:[e.active&&a.jsx(Yo,{size:12}),a.jsx("span",{children:e.label})]})}function RW({item:e,disabled:t,onRemove:n}){return a.jsx(ja,{withRemoveButton:!t,onRemove:n,children:e.label})}function _W(){return a.jsx(Ye.Empty,{children:"Nothing found"})}const DW="_searchInput_dick8_1",AW={searchInput:DW};function kW(e){return{value:e.id,label:Ea(e),resource:e}}function PW(e){const t=vu(),n=Re(),r=v.useCallback(async(s,c)=>{const u=OW(s),f={signal:c},h=await n.graphql(u,void 0,void 0,f);return MW(h,s)},[n]),o=v.useCallback(s=>{s.length>0&&t(`/${zt(s[0])}`)},[t]);return a.jsx(US,{size:"sm",radius:"md",className:AW.searchInput,leftSection:a.jsx(eg,{size:16}),placeholder:"Search",itemComponent:NW,toOption:kW,onChange:o,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const NW=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(xe,{wrap:"nowrap",children:[a.jsx(ho,{value:e}),a.jsxs("div",{children:[a.jsx(be,{children:Ea(e)}),a.jsx(be,{size:"xs",c:"dimmed",children:o})]})]})})});function OW(e){const t=JSON.stringify(e);return pS(e)?`{
|
|
97
|
-
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
98
|
-
resourceType
|
|
99
|
-
id
|
|
100
|
-
identifier {
|
|
101
|
-
system
|
|
102
|
-
value
|
|
103
|
-
}
|
|
104
|
-
name {
|
|
105
|
-
given
|
|
106
|
-
family
|
|
107
|
-
}
|
|
108
|
-
birthDate
|
|
109
|
-
}
|
|
110
|
-
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
111
|
-
resourceType
|
|
112
|
-
id
|
|
113
|
-
identifier {
|
|
114
|
-
system
|
|
115
|
-
value
|
|
116
|
-
}
|
|
117
|
-
subject {
|
|
118
|
-
display
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}`.replaceAll(/\s+/g," "):`{
|
|
122
|
-
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
123
|
-
resourceType
|
|
124
|
-
id
|
|
125
|
-
identifier {
|
|
126
|
-
system
|
|
127
|
-
value
|
|
128
|
-
}
|
|
129
|
-
name {
|
|
130
|
-
given
|
|
131
|
-
family
|
|
132
|
-
}
|
|
133
|
-
birthDate
|
|
134
|
-
}
|
|
135
|
-
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
136
|
-
resourceType
|
|
137
|
-
id
|
|
138
|
-
identifier {
|
|
139
|
-
system
|
|
140
|
-
value
|
|
141
|
-
}
|
|
142
|
-
name {
|
|
143
|
-
given
|
|
144
|
-
family
|
|
145
|
-
}
|
|
146
|
-
birthDate
|
|
147
|
-
}
|
|
148
|
-
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
149
|
-
resourceType
|
|
150
|
-
id
|
|
151
|
-
identifier {
|
|
152
|
-
system
|
|
153
|
-
value
|
|
154
|
-
}
|
|
155
|
-
subject {
|
|
156
|
-
display
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}`.replaceAll(/\s+/g," ")}function MW(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),IW(LW(n),t).slice(0,5)}function LW(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 IW(e,t){return e.sort((n,r)=>hR(r,t)-hR(n,t))}function hR(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,pR(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,pR(Na(r),t));return n}function pR(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function zW(e){const t=Sf(),[n,r]=v.useState(!1);return a.jsx(Rr.Header,{p:8,style:{zIndex:101},children:a.jsxs(xe,{justify:"space-between",children:[a.jsxs(xe,{gap:"xs",children:[a.jsx(Pn,{className:ax.logoButton,"aria-expanded":e.navbarOpen,"aria-controls":"navbar",onClick:()=>e.navbarToggle(),children:e.logo}),!e.headerSearchDisabled&&a.jsx(PW,{pathname:e.pathname,searchParams:e.searchParams})]}),a.jsxs(xe,{gap:"lg",pr:"sm",children:[e.notifications,a.jsxs(we,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"fade-down"},opened:n,onClose:()=>r(!1),children:[a.jsx(we.Target,{children:a.jsx(Pn,{className:ax.user,"aria-label":"User menu","data-active":n||void 0,onClick:()=>r(o=>!o),children:a.jsxs(xe,{gap:7,children:[a.jsx(ho,{value:t,radius:"xl",size:24}),a.jsx(be,{size:"sm",className:ax.userName,children:Na(t?.name?.[0])}),a.jsx(PS,{size:12,stroke:1.5})]})})}),a.jsx(we.Dropdown,{children:a.jsx(cP,{version:e.version})})]})]})]})})}const $W=()=>VA({opened:!1,empty:!1,selected:-1,listId:"",query:"",registeredActions:new Set}),UW=e=>FA(e);function iu(e,t){const n=t.getState();t.setState({...n,...e(t.getState())})}function uP(e){iu(()=>({opened:!0,selected:-1}),e)}function dP(e){iu(()=>({opened:!1}),e)}function fP(e){iu(t=>({opened:!t.opened,selected:t.opened?t.selected:-1}),e)}function hP(e,t){t.updateState(n=>({...n,selected:e}))}function BW(e,t){t.updateState(n=>({...n,listId:e}))}function Gp(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 u=Gp(e,s.shadowRoot);if(u)return u}const c=Gp(e,s);if(c)return c}return null}function ng(e,t){const n=t.getState(),r=n.listId?Gp(`#${n.listId}`):null,o=r?.querySelector("[data-selected]"),s=r?.querySelectorAll("[data-action]")??[],c=e===-1?s.length-1:e===s.length?0:e,u=jd(c,0,s.length-1);return o?.removeAttribute("data-selected"),s[u]?.scrollIntoView({block:"nearest"}),s[u]?.setAttribute("data-selected","true"),hP(u,t),u}function VW(e){return ng(e.getState().selected+1,e)}function FW(e){return ng(e.getState().selected-1,e)}function HW(e){const t=e.getState();Gp(`#${t.listId} [data-selected]`)?.click()}function qW(e,t){const n=t.getState();return n.registeredActions.add(e),()=>{n.registeredActions.delete(e)}}function GW(e,t){iu(()=>({query:e}),t),Promise.resolve().then(()=>{ng(0,t),iu(n=>({empty:n.query.trim().length>0&&n.registeredActions.size===0||!1}),t)})}function WW({clearQuery:e},t){t.updateState(n=>({...n,selected:-1,query:e?"":n.query,empty:e?!1:n.empty}))}const Oo={open:uP,close:dP,toggle:fP,updateState:iu,setSelectedAction:hP,setListId:BW,selectAction:ng,selectNextAction:VW,selectPreviousAction:FW,triggerSelectedAction:HW,registerAction:qW,setQuery:GW,clearSpotlightState:WW};function QW(){const e=$W();return[e,{open:()=>uP(e),close:()=>dP(e),toggle:()=>fP(e)}]}const[pP,Cf]=QW(),{open:iae,close:oae,toggle:aae}=Cf;function mP(e){const t=e;return t.group!==void 0&&Array.isArray(t.actions)}function YW(e){return Array.isArray(e)?e.map(t=>t.trim()).join(",").toLowerCase().trim():typeof e=="string"?e.toLowerCase().trim():""}function KW(e){return e.reduce((t,n)=>"actions"in n?[...t,...n.actions.map(r=>({...r,group:n.group}))]:[...t,n],[])}function XW(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 JW=(e,t)=>{const n=e.trim().toLowerCase(),r=[[],[]];return KW(t).forEach(s=>{s.label?.toLowerCase().includes(n)?r[0].push(s):(s.description?.toLowerCase().includes(n)||YW(s.keywords).includes(n))&&r[1].push(s)}),XW(r.flat())};function gP(e,t){if(!Array.isArray(e))return[];let n=0;return e.reduce((r,o)=>{if(n>=t)return r;if(mP(o)){const s=gP(o.actions,t-n);r.push({group:o.group,actions:s}),n+=s.length}else r.push(o),n+=1;return r},[])}var Vo={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[ZW,yu]=Ar("Spotlight component was not found in tree"),eQ={dimmedSections:!0,highlightQuery:!1},Hd=ge((e,t)=>{const n=oe("SpotlightAction",eQ,e),{className:r,style:o,classNames:s,styles:c,id:u,description:f,label:h,leftSection:m,rightSection:g,children:y,dimmedSections:x,highlightQuery:S,highlightColor:j,closeSpotlightOnTrigger:C,onClick:T,onMouseDown:R,keywords:E,vars:_,...k}=n,I=yu(),D={classNames:s,styles:c},P=S&&typeof h=="string"?a.jsx(_0,{component:"span",highlight:I.query,color:j,...I.getStyles("actionLabel",D),children:h}):a.jsx("span",{...I.getStyles("actionLabel",D),children:h});return a.jsx(Pn,{ref:t,"data-action":!0,...I.getStyles("action",{className:r,style:o,...D}),...k,onMouseDown:$=>{$.preventDefault(),R?.($)},onClick:$=>{T?.($),(C??I.closeOnActionTrigger)&&Oo.close(I.store)},tabIndex:-1,children:y||a.jsxs(a.Fragment,{children:[m&&a.jsx(le,{component:"span",mod:{position:"left",dimmed:x},...I.getStyles("actionSection",D),children:m}),a.jsxs("span",{...I.getStyles("actionBody",D),children:[P,a.jsx("span",{...I.getStyles("actionDescription",D),children:f})]}),g&&a.jsx(le,{component:"span",mod:{position:"right",dimmed:x},...I.getStyles("actionSection",D),children:g})]})})});Hd.classes=Vo;Hd.displayName="@mantine/spotlight/SpotlightAction";const rg=ge((e,t)=>{const{className:n,style:r,styles:o,classNames:s,label:c,children:u,...f}=oe("SpotlightActionsGroup",null,e),h=yu();return a.jsx(le,{...h.getStyles("actionsGroup",{className:n,style:r,classNames:s,styles:o}),ref:t,...f,__vars:{"--spotlight-label":`'${c?.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`},children:u})});rg.classes=Vo;rg.displayName="@mantine/core/SpotlightActionsGroup";const ig=ge((e,t)=>{const{className:n,style:r,id:o,children:s,vars:c,classNames:u,styles:f,...h}=oe("SpotlightActionsList",null,e),m=yu(),g=`mantine-${v.useId().replace(/:/g,"")}`,y=o||g;return v.useEffect(()=>(Oo.setListId(y,m.store),()=>Oo.setListId("",m.store)),[]),a.jsx(Jr.Autosize,{...m.getStyles("actionsList",{className:n,style:r,classNames:u,styles:f}),ref:t,type:"scroll",scrollbarSize:"var(--spotlight-actions-list-padding)",offsetScrollbars:"y",id:y,...h,children:s})});ig.classes=Vo;ig.displayName="@mantine/spotlight/SpotlightActionsList";const og=ge((e,t)=>{const{className:n,style:r,classNames:o,styles:s,...c}=oe("SpotlightEmpty",null,e),u=yu();return a.jsx(le,{ref:t,...u.getStyles("empty",{classNames:o,styles:s,className:n,style:r}),...c})});og.classes=Vo;og.displayName="@mantine/spotlight/SpotlightEmpty";const BS=ge((e,t)=>{const{className:n,style:r,classNames:o,styles:s,...c}=oe("SpotlightFooter",null,e),u=yu();return a.jsx(le,{ref:t,...u.getStyles("footer",{className:n,classNames:o,style:r,styles:s}),...c})});BS.classes=Vo;BS.displayName="@mantine/spotlight/SpotlightFooter";function tQ(e,t){if(!e)return[];const n=()=>Oo.open(t);return Array.isArray(e)?e.map(r=>[r,n]):[[e,n]]}const nQ={size:600,yOffset:80,zIndex:zr("max"),overlayProps:{backgroundOpacity:.35,blur:7},transitionProps:{duration:200,transition:"pop"},store:pP,clearQueryOnClose:!0,closeOnActionTrigger:!0,shortcut:"mod + K",maxHeight:400},ag=ge((e,t)=>{const n=oe("SpotlightRoot",nQ,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,store:h,children:m,query:g,onQueryChange:y,transitionProps:x,clearQueryOnClose:S,shortcut:j,tagsToIgnore:C,triggerOnContentEditable:T,disabled:R,onSpotlightOpen:E,onSpotlightClose:_,forceOpened:k,closeOnActionTrigger:I,maxHeight:D,scrollable:P,attributes:$,...B}=n,W=_n(),{opened:Y,query:Z}=UW(h),U=typeof g=="string"?g:Z,G=L=>{y?.(L),Oo.setQuery(L,h)},M=$e({name:"Spotlight",classes:Vo,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:$});return $M(tQ(j,h),C,T),xl(()=>{Y?E?.():_?.()},[Y]),R?null:a.jsx(ZW,{value:{getStyles:M,query:U,setQuery:G,store:h,closeOnActionTrigger:I},children:a.jsx(In,{ref:t,...B,withCloseButton:!1,opened:Y||!!k,padding:0,onClose:()=>Oo.close(h),className:o,style:s,classNames:Jd({theme:W,classNames:[Vo,r],props:n,stylesCtx:void 0}),styles:Ad({theme:W,styles:c,props:n,stylesCtx:void 0}),transitionProps:{...x,onExited:()=>{S&&G(""),Oo.clearSpotlightState({clearQuery:S},h),x?.onExited?.()}},__vars:{"--spotlight-max-height":P?ce(D):void 0},__staticSelector:"Spotlight","data-scrollable":P||void 0,children:m})})});ag.classes=Vo;ag.displayName="@mantine/spotlight/SpotlightRoot";const rQ={size:"lg"},sg=ge((e,t)=>{const{classNames:n,styles:r,onKeyDown:o,onChange:s,vars:c,value:u,...f}=oe("SpotlightSearch",rQ,e),h=yu(),m=h.getStyles("search"),[g,y]=v.useState(!1),x=S=>{o?.(S),!g&&(S.nativeEvent.code==="ArrowDown"&&(S.preventDefault(),Oo.selectNextAction(h.store)),S.nativeEvent.code==="ArrowUp"&&(S.preventDefault(),Oo.selectPreviousAction(h.store)),(S.nativeEvent.code==="Enter"||S.nativeEvent.code==="NumpadEnter")&&(S.preventDefault(),Oo.triggerSelectedAction(h.store)))};return a.jsx(fn,{ref:t,classNames:[{input:m.className},n],styles:[{input:m.style},r],...f,value:u??h.query,onChange:S=>{h.setQuery(S.currentTarget.value),s?.(S)},onKeyDown:x,onCompositionStart:()=>y(!0),onCompositionEnd:()=>y(!1)})});sg.classes=Vo;sg.displayName="@mantine/spotlight/SpotlightSearch";const iQ={size:600,yOffset:80,limit:1/0,zIndex:zr("max"),overlayProps:{backgroundOpacity:.35,blur:7},transitionProps:{duration:200,transition:"pop"},store:pP,filter:JW,clearQueryOnClose:!0,closeOnActionTrigger:!0,shortcut:"mod + K"},mi=ge((e,t)=>{const n=oe("Spotlight",iQ,e),{searchProps:r,filter:o,query:s,onQueryChange:c,actions:u,nothingFound:f,highlightQuery:h,limit:m,scrollAreaProps:g,...y}=n,[x,S]=ir({value:s,defaultValue:"",finalValue:"",onChange:c}),j=gP(o(x,u),m).map(C=>{if(mP(C)){const T=C.actions.map(({id:R,...E})=>a.jsx(Hd,{highlightQuery:h,...E},R));return a.jsx(rg,{label:C.group,children:T},C.group)}return a.jsx(Hd,{highlightQuery:h,...C},C.id)});return a.jsxs(ag,{...y,query:x,onQueryChange:S,ref:t,children:[a.jsx(sg,{...r}),a.jsxs(ig,{...g,children:[j,j.length===0&&f&&a.jsx(og,{children:f})]})]})});mi.classes=Vo;mi.displayName="@mantine/spotlight/Spotlight";mi.Search=sg;mi.ActionsList=ig;mi.Action=Hd;mi.Empty=og;mi.ActionsGroup=rg;mi.Footer=BS;mi.Root=ag;mi.open=Cf.open;mi.close=Cf.close;mi.toggle=Cf.toggle;const VS=v.createContext({submitting:!1});VS.displayName="FormContext";function oQ(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?aQ(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&sQ(t,n);return t}function aQ(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function sQ(e,t){e[t.name]=t.value}function pt(e){const[t,n]=v.useState(!1);return a.jsx(VS.Provider,{value:{submitting:t},children:a.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:r=>{r.preventDefault();const o=oQ(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 dr(e){const{children:t,...n}=e,{submitting:r}=v.useContext(VS);return a.jsx(Oe,{type:"submit",loading:r,...n,children:t})}function lQ(e){const t=Re(),n=t.getUserConfiguration();function r(o){const{menuname:s,bookmarkname:c}=o,u=`${e.pathname}?${e.searchParams.toString()}`,f=pi(n);f.menu?.find(({title:m})=>m===s)?.link?.push({name:c,target:u}),t.updateResource(f).then(m=>{n.menu=m.menu,t.dispatchEvent({type:"change"}),Ae({color:"green",message:"Success"}),e.onOk()}).catch(m=>{Ae({color:"red",message:Ge(m)})})}return a.jsx(In,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:a.jsx(pt,{onSubmit:r,children:a.jsxs(Le,{children:[a.jsx(cQ,{config:n}),a.jsx(He,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",defaultValue:e.pathname.split("/")[1]||"",withAsterisk:!0}),a.jsx(xe,{justify:"flex-end",children:a.jsx(dr,{mt:"sm",children:"OK"})})]})})})}function cQ(e){function t(r){return r?.menu?.map(o=>o.title)}const n=t(e.config);return a.jsx(dn,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function vP(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function uQ(e){return typeof e.display=="string"?e.display:vP(e)}function dQ(e){return{value:vP(e),label:uQ(e),resource:e}}function fQ(e){return{code:e,display:e}}function Ef(e){const t=Re(),{binding:n,creatable:r,clearable:o,expandParams:s,withHelpText:c,...u}=e,f=v.useCallback(async(h,m)=>{if(!n)return[];const y=(await t.valueSetExpand({...s,url:n,filter:h,count:10},{signal:m})).expansion?.contains??[],x=[];for(const S of y)S.code&&!x.some(j=>j.code===S.code)&&x.push(S);return x},[t,s,n]);return a.jsx(US,{...u,creatable:r??!0,clearable:o??!0,toOption:dQ,loadOptions:f,onCreate:fQ,itemComponent:c?hQ:void 0})}const hQ=v.forwardRef(({label:e,resource:t,active:n,...r},o)=>a.jsx("div",{ref:o,...r,children:a.jsxs(xe,{wrap:"nowrap",gap:"xs",children:[n&&a.jsx(Yo,{size:12}),a.jsxs("div",{children:[a.jsx(be,{children:e}),a.jsx(be,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})]})}));function yP(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[s,c]=v.useState(t);function u(f){const h=f[0],m=mQ(h);c(m),n&&n(m)}return a.jsx(Ef,{defaultValue:pQ(s),onChange:u,withHelpText:r??!0,...o})}function pQ(e){return e?{code:e}:void 0}function mQ(e){return e?.code}function FS(e){const[t,n]=v.useState(e.defaultValue),r=e.onChange,o=v.useCallback(s=>{n(s),r&&r(s)},[r]);return a.jsx(yP,{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 gQ="_navbar_qu4n7_1",vQ="_logoButton_qu4n7_6",yQ="_menuTitle_qu4n7_25",xQ="_link_qu4n7_51",bQ="_linkLabel_qu4n7_97",SQ="_addBookmarkLink_qu4n7_108",wQ="_toggleButton_qu4n7_118",jQ="_divider_qu4n7_143",Qr={navbar:gQ,logoButton:vQ,menuTitle:yQ,link:xQ,linkLabel:bQ,addBookmarkLink:SQ,toggleButton:wQ,divider:jQ},CQ="_actionSection_1l8yv_8",EQ="_action_1l8yv_8",TQ="_actionDescription_1l8yv_27",RQ="_actionsGroup_1l8yv_32",_Q="_actionsList_1l8yv_55",DQ="_content_1l8yv_60",us={actionSection:CQ,action:EQ,actionDescription:TQ,actionsGroup:RQ,actionsList:_Q,content:DQ},AQ=200;function mR(){return a.jsxs(Le,{gap:"xs",py:"lg",children:[a.jsxs(be,{size:"sm",c:"dimmed",children:["Press ",a.jsx($c,{children:"⌘"})," + ",a.jsx($c,{children:"K"})," to open Search next time."]}),a.jsxs(be,{size:"sm",c:"dimmed",children:["(",a.jsx($c,{children:"Ctrl"})," + ",a.jsx($c,{children:"K"})," on Windows)"]})]})}function kQ({patientsOnly:e}){const t=Re(),n=vu(),[r,o]=v.useState(a.jsx(mR,{})),[s,c]=v.useState([]),u=Xd(h=>{const m=PQ(h);e?t.graphql(m).then(g=>{const x=gR(g).filter(S=>S.resourceType==="Patient");c(OQ(x,n))}).catch(console.error).finally(()=>o("No results found")):Promise.all([t.graphql(m),t.valueSetExpand({url:"https://medplum.com/fhir/ValueSet/resource-types",filter:h,count:5})]).then(([g,y])=>{const x=gR(g),S=y.expansion?.contains??[];c(MQ(x,S,n))}).catch(console.error).finally(()=>o("No results found"))},AQ),f=h=>{if(!h){u.cancel(),o(a.jsx(mR,{})),c([]);return}o("Searching..."),u(h)};return a.jsx(mi,{actions:s,nothingFound:r,radius:"md",highlightQuery:!0,searchProps:{leftSection:a.jsx(eg,{size:"1.2rem",stroke:2,color:"var(--mantine-color-gray-5)"}),placeholder:"Start typing to search…",type:"search",autoComplete:"off",autoCorrect:"off",spellCheck:!1,name:e?"provider-spotlight-search":"spotlight-search",inputProps:{"data-1p-ignore":"true","data-lpignore":"true"},leftSectionProps:{style:{marginLeft:"calc(var(--mantine-spacing-md) - 12px)"}}},classNames:{body:us.body,content:us.content,search:us.search,actionsList:us.actionsList,action:us.action,actionSection:us.actionSection,actionDescription:us.actionDescription,actionsGroup:us.actionsGroup},onQueryChange:f})}function PQ(e){const t=JSON.stringify(e);return pS(e)?`{
|
|
160
|
-
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
161
|
-
resourceType
|
|
162
|
-
id
|
|
163
|
-
identifier { system value }
|
|
164
|
-
name { given family }
|
|
165
|
-
birthDate
|
|
166
|
-
photo { url contentType }
|
|
167
|
-
}
|
|
168
|
-
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
169
|
-
resourceType
|
|
170
|
-
id
|
|
171
|
-
identifier { system value }
|
|
172
|
-
subject { display }
|
|
173
|
-
}
|
|
174
|
-
}`.replaceAll(/\s+/g," "):`{
|
|
175
|
-
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
176
|
-
resourceType
|
|
177
|
-
id
|
|
178
|
-
identifier { system value }
|
|
179
|
-
name { given family }
|
|
180
|
-
birthDate
|
|
181
|
-
photo { url contentType }
|
|
182
|
-
}
|
|
183
|
-
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
184
|
-
resourceType
|
|
185
|
-
id
|
|
186
|
-
identifier { system value }
|
|
187
|
-
name { given family }
|
|
188
|
-
birthDate
|
|
189
|
-
photo { url contentType }
|
|
190
|
-
}
|
|
191
|
-
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
192
|
-
resourceType
|
|
193
|
-
id
|
|
194
|
-
identifier { system value }
|
|
195
|
-
subject { display }
|
|
196
|
-
}
|
|
197
|
-
}`.replaceAll(/\s+/g," ")}function gR(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),NQ(t)}function NQ(e){const t=new Set,n=[];for(const r of e)r.id&&!t.has(r.id)&&(t.add(r.id),n.push(r));return n}function OQ(e,t){const n=e.filter(r=>!!r.id).map(r=>({id:r.id,label:r.name?Na(r.name[0]):r.id,description:r.birthDate,leftSection:a.jsx(ho,{value:r,radius:"xl",size:24}),onClick:()=>t(`/Patient/${r.id}`)}));return n.length>0?[{group:"Patients",actions:n}]:[]}function MQ(e,t,n){const r=[],o=t.map(u=>({id:`resource-type-${u.code}`,label:u.display??u.code??"",description:"Resource Type",onClick:()=>n(`/${u.code}`)}));o.length>0&&r.push({group:"Resource Types",actions:o});const s=[],c=[];for(const u of e)u.resourceType==="Patient"&&u.id?s.push({id:u.id,label:u.name?Na(u.name[0]):u.id,description:u.birthDate,leftSection:a.jsx(ho,{value:u,radius:"xl",size:24}),onClick:()=>n(`/Patient/${u.id}`)}):u.resourceType==="ServiceRequest"&&u.id&&c.push({id:u.id,label:u.id,description:u.subject?.display,onClick:()=>n(`/ServiceRequest/${u.id}`)});return s.length>0&&r.push({group:"Patients",actions:s}),c.length>0&&r.push({group:"Service Requests",actions:c}),r}function vR(e){const t=vu(),n=Sf(),r=IQ(e.pathname,e.searchParams,e.menus),[o,s]=v.useState(!1),[c,u]=v.useState(!1);function f(g,y){g.stopPropagation(),g.preventDefault(),t(y),window.innerWidth<768&&e.closeNavbar()}function h(g){g&&t(`/${g}`)}const m=e.opened??!0;return a.jsxs(a.Fragment,{children:[a.jsxs(Rr.Navbar,{id:"navbar",className:Qr.navbar,children:[e.logo&&a.jsx(Rr.Section,{px:"xs",pt:"xs",pb:"4px",children:a.jsx(Pn,{className:Qr.logoButton,onClick:e.navbarToggle,"aria-expanded":m,"aria-controls":"navbar","aria-label":"Medplum Logo",children:e.logo})}),a.jsx(Jr,{px:"xs",pb:"xs",pt:"sm",h:"100%",children:a.jsxs(Rr.Section,{grow:!0,children:[e.spotlightEnabled&&a.jsx(le,{mb:2,children:a.jsx(di,{label:"Search",position:"right",transitionProps:{duration:0},disabled:m,children:a.jsxs(Pn,{className:Qr.link,onClick:()=>Cf.open(),"aria-label":"Search",children:[a.jsx(eg,{size:"1.2rem"}),a.jsx("span",{className:Qr.linkLabel,"data-opened":m||void 0,children:"Search"})]})})}),e.spotlightEnabled&&a.jsx(kQ,{patientsOnly:e.patientsOnly}),!e.resourceTypeSearchDisabled&&a.jsx(Rr.Section,{mb:"sm",children:a.jsx(FS,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:g=>h(g)},window.location.pathname)}),e.menus?.map((g,y)=>a.jsxs(v.Fragment,{children:[g.title&&a.jsx(be,{className:Qr.menuTitle,"data-opened":m||void 0,children:g.title}),a.jsx(Le,{gap:"2",children:g.links?.map(x=>a.jsx(LQ,{to:x.href,active:x.href===r?.href,onClick:S=>f(S,x.href),icon:x.icon,label:x.label??"",opened:m},x.href))})]},`menu-${g.title??y}`)),e.displayAddBookmark&&a.jsx(di,{label:"Add Bookmark",position:"right",transitionProps:{duration:0},disabled:m,children:a.jsxs(Pn,{className:`${Qr.link} ${Qr.addBookmarkLink}`,onClick:()=>u(!0),children:[a.jsx(Fd,{}),a.jsx("span",{className:Qr.linkLabel,"data-opened":m||void 0,children:"Add Bookmark"})]})})]})}),e.userMenuEnabled&&a.jsxs(Rr.Section,{px:"xs",py:"xs",children:[a.jsx(di,{label:m?"Close Sidebar":"Open Sidebar",position:"right",transitionProps:{duration:0},children:a.jsx(Pn,{className:Qr.toggleButton,"aria-label":m?"Close Sidebar":"Open Sidebar",onClick:e.navbarToggle,"aria-expanded":m,"aria-controls":"navbar",children:a.jsx(dG,{})})}),a.jsx(wn,{my:"xs",mx:6,className:Qr.divider}),a.jsxs(we,{width:260,shadow:"xl",position:"top-start",transitionProps:{transition:"fade-up"},opened:o,onClose:()=>s(!1),children:[a.jsx(we.Target,{children:a.jsxs(Pn,{className:Qr.link,pl:"7","aria-label":"User menu","data-active":o||void 0,onClick:()=>s(g=>!g),bd:"1px 0 0 0 solid var(--mantine-color-gray-200)",children:[a.jsx(ho,{value:n,radius:"xl",size:24}),a.jsx("span",{className:Qr.linkLabel,"data-opened":m||void 0,children:Na(n?.name?.[0])})]})}),a.jsx(we.Dropdown,{children:a.jsx(cP,{version:e.version,showLayoutVersionToggle:e.showLayoutVersionToggle})})]})]})]}),e.pathname&&e.searchParams&&a.jsx(lQ,{pathname:e.pathname,searchParams:e.searchParams,visible:c,onOk:()=>u(!1),onCancel:()=>u(!1)})]})}function LQ(e){const{to:t,icon:n,label:r,onClick:o,active:s}=e;return a.jsx(di,{label:r,position:"right",transitionProps:{duration:0},disabled:e.opened,children:a.jsxs(St,{to:t,onClick:o,className:Qr.link,"data-active":s||void 0,children:[n??a.jsx(uq,{}),a.jsx("span",{className:Qr.linkLabel,"data-opened":e.opened||void 0,children:r})]})})}function IQ(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 u=zQ(e,t,c.href);u>o&&(o=u,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,u]of r.searchParams.entries())if(!o.includes(c)&&t.get(c)!==u)return 0;let s=1;for(const[c,u]of t.entries())o.includes(c)||r.searchParams.get(c)===u&&s++;return s}const yR=250,$Q=59;function UQ(e){const[t,n]=v.useState(localStorage.navbarOpen==="true"),[r]=v.useState(e.layoutVersion??localStorage.appShellLayoutVersion??"v1"),o=Re(),s=Sf();function c(x){localStorage.navbarOpen=x.toString(),n(x)}function u(){c(!1)}function f(){c(!t)}if(o.isLoading())return a.jsx(Li,{});let h,m,g,y;return r==="v2"?(h={height:0},m={width:t?yR:$Q,breakpoint:0,collapsed:{desktop:!s,mobile:!s}},g=void 0,y=s?a.jsx(vR,{logo:e.logo,pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,navbarToggle:f,closeNavbar:u,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:!0,opened:t,spotlightEnabled:!0,patientsOnly:e.spotlightPatientsOnly,userMenuEnabled:!0,version:e.version,showLayoutVersionToggle:e.showLayoutVersionToggle}):void 0):(h={height:60},m={width:yR,breakpoint:"sm",collapsed:{desktop:!s||!t,mobile:!s||!t}},g=s&&a.jsx(zW,{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(vR,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,navbarToggle:f,closeNavbar:u,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled,patientsOnly:e.spotlightPatientsOnly}):void 0),a.jsxs(Rr,{header:h,navbar:m,padding:0,children:[g,y,a.jsx(Rr.Main,{className:gW.main,children:a.jsx(IS,{children:a.jsx(v.Suspense,{fallback:a.jsx(Li,{}),children:e.children})})})]})}const BQ="https://ccda.medplum.com",VQ="https://ccda-validator.medplum.com/";function FQ(e){const{url:t}=e,[n,r]=v.useState(!1),o=v.useRef(null),[s,c]=v.useState(),[u,f]=v.useState(!1);v.useEffect(()=>{t&&n&&o.current&&(Ed(o.current,{command:"loadCcdaXml",value:t}).catch(console.error),r(!1))},[t,n]);const h=async()=>{if(t)try{f(!0);const x=await(await fetch(t)).text(),S=new FormData;S.append("ccdaFile",new Blob([x],{type:"text/xml"}),"ccda.xml");const j=`${VQ}referenceccdaservice/?validationObjective=C-CDA_IG_Plus_Vocab&referenceFileName=No%20scenario%20File&curesUpdate=true&severityLevel=WARNING`,C=await fetch(j,{method:"POST",body:S,credentials:"omit",redirect:"manual"});if(!C.ok)throw new Error(`Validation failed: ${C.status} ${C.statusText}`);const T=await C.json();c(T)}catch(y){c(void 0),console.error("CCDA validation error:",y)}finally{f(!1)}},m=()=>{if(!s)return;const y=JSON.stringify(s,null,2);sP(y,"ccda-validation-results")},g=()=>s?s.resultsMetaData.resultMetaData.filter(y=>y?.type.includes("Error")).reduce((y,x)=>y+(x.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:BQ,allowFullScreen:!0,frameBorder:0,seamless:!0,onLoad:()=>r(!0)})}),a.jsxs("div",{style:{marginTop:"10px",marginBottom:"10px",display:"flex",alignItems:"center"},children:[a.jsx(Oe,{type:"button",onClick:h,disabled:u,children:u?"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(Oe,{type:"button",onClick:m,color:"green",style:{marginLeft:"auto"},children:"Download Full Results"})]})]})]}):null}function Tf(e){const{contentType:t,url:n,title:r}=e.value??{},o=qk(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===tn.CDA_XML&&a.jsx(FQ,{url:o}),a.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:a.jsx(Et,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:HQ(r),children:r||"Download"})})]}):null}function HQ(e){return e?.includes(".")?e:void 0}const qQ="_root_1bd5a_1",GQ="_compact_1bd5a_19",xR={root:qQ,compact:GQ};function Rf(e){const{children:t,compact:n}=e;return a.jsx("dl",{className:Bt(xR.root,{[xR.compact]:n}),children:t})}function Ir(e){return a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:e.term}),a.jsx("dd",{children:e.children})]})}function WQ(e){const t=e.values?.map((r,o)=>a.jsx("div",{children:a.jsx(Tf,{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(!Ln(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const r=e.path.split(".").pop();n=a.jsx(Ir,{term:jl(r),children:t})}else n=a.jsx(a.Fragment,{children:t});return n}function HS(e){const t=Re(),n=v.useRef(null);function r(c){yn(c),n.current?.click()}function o(c){yn(c);const u=c.target.files;u&&Array.from(u).forEach(s)}function s(c){!c||!c.name||(e.onUploadStart&&e.onUploadStart(),t.createAttachment({data:c,contentType:c.type||"application/octet-stream",filename:c.name,securityContext:e.securityContext,onProgress:e.onUploadProgress}).then(f=>e.onUpload(f)).catch(f=>{e.onUploadError&&e.onUploadError(Wt(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 QQ(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(Tf,{value:s,maxWidth:200})}),a.jsx("td",{children:a.jsx(Rn,{disabled:e.disabled,title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:u=>{yn(u);const f=t.slice();f.splice(c,1),o(f)},children:a.jsx(qp,{})})})]},`${c}-${t.length}`)),a.jsxs("tr",{children:[a.jsx("td",{}),a.jsx("td",{children:a.jsx(HS,{disabled:e.disabled,onUpload:s=>{o([...r.current,s])},children:s=>a.jsx(Rn,{...s,title:"Add",variant:"subtle",size:"sm",color:s.disabled?"gray":"green",children:a.jsx(NS,{})})})})]})]})]})}function xP(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(Tf,{value:t,maxWidth:200}),a.jsx(Oe,{disabled:e.disabled,onClick:o=>{yn(o),r(void 0)},children:"Remove"})]}):a.jsx(HS,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:o=>a.jsx(Oe,{...o,children:"Upload..."})})}function Vi(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 Wp(e){const[t,n]=v.useState();return a.jsxs(pt,{onSubmit:r=>{n(void 0),e.onSubmit(r)?.catch(o=>n(Ge(o)))},children:[a.jsxs(Do,{style:{flexDirection:"column"},children:[a.jsx(Vi,{size:32}),a.jsx(Ve,{order:3,py:"lg",children:e.title}),!e.qrCodeUrl&&e.description&&a.jsx(be,{c:"dimmed",mb:"lg",mt:"-lg",children:e.description})]}),t&&a.jsx(Go,{icon:a.jsx(Ps,{size:16}),title:"Error",color:"red",mb:"lg",children:t}),e.qrCodeUrl&&a.jsx(Do,{children:a.jsxs(Le,{mb:"xl",children:[e.description&&a.jsx(be,{c:"dimmed",mb:"md",mt:"-lg",ta:"center",children:e.description}),a.jsx(D0,{src:e.qrCodeUrl,alt:"Multi Factor Auth QR Code",w:"60%",mx:"auto",radius:"md",p:"xs",bg:"var(--mantine-color-white)",style:{border:"1px solid light-dark(var(--mantine-color-gray-2), var(--mantine-color-dark-4))"}})]})}),a.jsx(Le,{gap:"sm",children:a.jsx(He,{name:"token",label:"MFA code",autoComplete:"one-time-code",required:!0,autoFocus:!0})}),a.jsx(Le,{gap:"xs",pt:"md",children:a.jsx(dr,{fullWidth:!0,children:e.buttonText})})]})}const YQ="_root_1vii2_1",KQ={root:YQ};function xu(e){const{children:t,...n}=e;return a.jsx(cf,{className:KQ.root,...n,children:t})}const XQ="_paper_1igaj_1",JQ="_fill_1igaj_20",bR={paper:XQ,fill:JQ};function Bl(e){const{width:t,fill:n,className:r,children:o,...s}=e,c=t?{maxWidth:t}:void 0;return a.jsx(Mr,{className:Bt(bR.paper,n&&bR.fill,r),style:c,shadow:"sm",radius:"sm",withBorder:!0,...s,children:o})}function ut(e){const{children:t,...n}=e;return a.jsx(xu,{children:a.jsx(Bl,{...n,children:t})})}function fr(e){const{outcome:t,issues:n,...r}=e,o=t?.issue||n;return!o||o.length===0?null:a.jsx(Go,{icon:a.jsx(Ps,{size:16}),color:"red",...r,children:o.map(s=>a.jsx("div",{"data-testid":"text-field-error",children:ZA(s)},s.details?.text))})}function $t(e,t){return e?.issue?.filter(n=>bP(n.expression?.[0],t))?.map(n=>n.details?.text)?.join(`
|
|
198
|
-
`)}function Ns(e,t){return e?.issue?.filter(n=>bP(n.expression?.[0],t))}const sp=/\[\d+\]/;function bP(e,t){const n=typeof e=="string"&&sp.test(e),r=typeof t=="string"&&sp.test(t);if(n!==r&&(e=e?.replace(sp,""),t=t?.replace(sp,"")),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 SP(e){const t=Re(),[n,r]=v.useState(),o=Ns(n,void 0);return a.jsxs(pt,{onSubmit:async s=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:s.projectName}))}catch(c){r(Wt(c))}},children:[a.jsxs(or,{direction:"column",align:"center",justify:"center",children:[a.jsx(Vi,{size:32}),a.jsx(Ve,{order:3,py:"lg",children:"Create a new project"})]}),a.jsx(fr,{issues:o,mb:"lg"}),a.jsx(Le,{gap:"sm",children:a.jsx(He,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:$t(n,"projectName")})}),a.jsxs(Le,{gap:"xs",mt:"md",children:[a.jsx(dr,{fullWidth:!0,children:"Create Project"}),a.jsxs(be,{c:"dimmed",size:"xs",pt:"lg",ta:"center",children:['By clicking "Create Project" you agree to the Medplum'," ",a.jsx(Et,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Et,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]})]})}function wP(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 jP(e){const{googleClientId:t,handleGoogleCredential:n}=e,r=v.useRef(null),[o,s]=v.useState(typeof google<"u"),c=v.useRef(!1),u=v.useRef(!1);return v.useEffect(()=>{if(typeof google>"u"){wP("https://accounts.google.com/gsi/client",()=>s(!0));return}c.current||(google.accounts.id.initialize({client_id:t,callback:n}),c.current=!0),r.current&&!u.current&&(google.accounts.id.renderButton(r.current,{type:"standard",logo_alignment:"center",width:r.current.clientWidth}),u.current=!0)},[t,o,n]),t?a.jsx(le,{ref:r,w:"100%",h:40,display:"flex",style:{justifyContent:"center"}}):null}function CP(e){if(e)return e;const t=nr.getOrigin();if(t&&[].includes(t))return"__GOOGLE_CLIENT_ID__"}function EP(e){typeof grecaptcha>"u"&&wP("https://www.google.com/recaptcha/api.js?render="+e)}function TP(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function ZQ(e){const t=CP(e.googleClientId),n=e.recaptchaSiteKey,r=Re(),[o,s]=v.useState(),c=Ns(o,void 0);return v.useEffect(()=>{n&&EP(n)},[n]),a.jsxs(pt,{onSubmit:async u=>{s(void 0);try{let f="";n&&(f=await TP(n)),e.handleAuthResponse(await r.startNewUser({projectId:e.projectId,clientId:e.clientId,firstName:u.firstName,lastName:u.lastName,email:u.email,password:u.password,remember:u.remember==="true",recaptchaSiteKey:n,recaptchaToken:f}))}catch(f){s(Wt(f))}},children:[a.jsx(or,{direction:"column",align:"center",justify:"center",children:e.children}),a.jsx(fr,{issues:c,mb:"lg"}),t&&a.jsxs(a.Fragment,{children:[a.jsx(le,{style:{minHeight:40},children:a.jsx(jP,{googleClientId:t,handleGoogleCredential:async u=>{try{e.handleAuthResponse(await r.startGoogleLogin({googleClientId:u.clientId,googleCredential:u.credential,projectId:e.projectId,createUser:!0}))}catch(f){s(Wt(f))}}})}),a.jsx(wn,{label:"or",labelPosition:"center",my:"lg"})]}),a.jsxs(Le,{gap:"sm",children:[a.jsx(He,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:$t(o,"firstName")}),a.jsx(He,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:$t(o,"lastName")}),a.jsx(He,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:$t(o,"email")}),a.jsx(oo,{name:"password",label:"Password",autoComplete:"off",required:!0,error:$t(o,"password")})]}),a.jsxs(Le,{gap:"xs",children:[a.jsx(cn,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1},pt:"md",pb:"xs"}),a.jsx(dr,{fullWidth:!0,children:"Register Account"}),a.jsxs(be,{c:"dimmed",size:"xs",pt:"lg",ta:"center",children:['By clicking "Register Account" you agree to the Medplum'," ",a.jsx(Et,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Et,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),a.jsxs(be,{c:"dimmed",size:"xs",ta:"center",children:["This site is protected by reCAPTCHA and the Google"," ",a.jsx(Et,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Et,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]})]})}function eY(e){const{type:t,projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:s,onSuccess:c}=e,u=Re(),[f,h]=v.useState(),[m,g]=v.useState();v.useEffect(()=>{t==="patient"&&f&&u.startNewPatient({login:f,projectId:n}).then(S=>u.processCode(S.code)).then(()=>c()).catch(S=>g(Wt(S)))},[u,t,n,f,c]);function y(S){S.code?u.processCode(S.code).then(()=>c()).catch(j=>g(Wt(j))):S.login&&h(S.login)}const x=Ns(m,void 0);return a.jsxs(ut,{width:400,px:"xl",py:"xl",bdrs:"md",children:[a.jsx(fr,{issues:x,mb:"lg"}),!f&&a.jsx(ZQ,{projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:s,handleAuthResponse:y,children:e.children}),f&&t==="project"&&a.jsx(SP,{login:f,handleAuthResponse:y})]})}function tY(e){const[t,n]=v.useState();return t?a.jsx(rY,{email:t,resetEmail:()=>n(void 0),...e}):a.jsx(nY,{setEmail:n,...e})}function nY(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:o,disableEmailAuth:s,...c}=e,u=Re(),f=!e.disableGoogleAuth&&CP(e.googleClientId),[h,m]=v.useState(),g=Ns(h,void 0),y=v.useCallback(async j=>{if(!j.authorizeUrl)return!1;const C=JSON.stringify({...await u.ensureCodeChallenge(c),domain:j.domain}),T=new URL(j.authorizeUrl);return T.searchParams.set("state",C),nr.assign(T.toString()),!0},[u,c]),x=v.useCallback(async j=>{const C=await u.post("auth/method",{email:j.email});await y(C)||t(j.email)},[u,y,t]),S=v.useCallback(async j=>{try{const C=await u.startGoogleLogin({...c,googleCredential:j.credential});await y(C)||r(C)}catch(C){m(Wt(C))}},[u,c,y,r]);return a.jsxs(pt,{onSubmit:x,children:[a.jsx(or,{direction:"column",align:"center",justify:"center",children:o}),a.jsx(fr,{issues:g,mb:"lg"}),f&&a.jsxs(a.Fragment,{children:[a.jsx(le,{style:{minHeight:40},children:a.jsx(jP,{googleClientId:f,handleGoogleCredential:S})}),!s&&a.jsx(wn,{label:"or",labelPosition:"center",my:"lg"})]}),!s&&a.jsx(He,{name:"email",type:"email",label:"Email",mb:"md",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:$t(h,"email"),"data-testid":"auth.email"}),a.jsxs(Le,{gap:"xs",children:[!s&&a.jsx(dr,{fullWidth:!0,children:"Continue"}),n&&a.jsxs(be,{size:"sm",mt:"lg",c:"dimmed",style:{textAlign:"center"},"data-dashlane-ignore":"true","data-lp-ignore":"true","data-no-autofill":"true","data-form-type":"navigation",children:["Don’t have an account? ",a.jsx(Et,{onClick:n,children:"Register"})]})]})]})}function rY(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...o}=e,s=Re(),[c,u]=v.useState(),f=Ns(c,void 0),h=v.useCallback(m=>{s.startLogin({...o,password:m.password,remember:m.remember==="on"}).then(n).catch(g=>u(Wt(g)))},[s,o,n]);return a.jsxs(pt,{onSubmit:h,children:[a.jsx(or,{direction:"column",align:"center",justify:"center",children:r}),a.jsx(fr,{issues:f,mb:"lg"}),a.jsxs(Le,{gap:"sm",children:[a.jsx(He,{label:"Email",value:e.email,disabled:!0,rightSectionWidth:36,rightSection:a.jsx(Rn,{variant:"subtle",color:"gray",onClick:e.resetEmail,"aria-label":"Change email",children:a.jsx(AG,{size:"1rem",stroke:1.5})})}),a.jsx(oo,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:$t(c,"password"),"data-testid":"auth.password"})]}),a.jsxs(Le,{gap:"xs",children:[a.jsx(cn,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1},pt:"md",pb:"xs"}),a.jsx(dr,{children:"Sign In"}),t&&a.jsx(be,{size:"sm",mt:"lg",c:"dimmed",style:{textAlign:"center"},"data-dashlane-ignore":"true","data-lp-ignore":"true","data-no-autofill":"true","data-form-type":"navigation",children:a.jsx(Et,{onClick:t,children:"Reset Password"})})]})]})}const iY="_option_18k89_1",oY="_iconBox_18k89_9",RP={option:iY,iconBox:oY};function aY(e){const t=Re(),n=Il(),[r,o]=v.useState(""),[s,c]=v.useState();function u(g){return!!g?.toLowerCase()?.includes(r.toLowerCase())}function f(g){return u(g.profile?.display)||u(g.project?.display)}function h(g){t.post("auth/profile",{login:e.login,profile:g}).then(e.handleAuthResponse).catch(y=>c(Wt(y)))}const m=e.memberships.filter(f).slice(0,10).map(g=>a.jsx(Ye.Option,{value:g.id,className:RP.option,children:a.jsx(lY,{...g})},g.id));return a.jsxs(Le,{gap:"0",children:[a.jsxs(or,{justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[a.jsx(Vi,{size:32}),a.jsx(Ve,{order:3,py:"lg",children:"Choose a Project"})]}),a.jsx(fr,{outcome:s,mb:"lg"}),a.jsxs(Ye,{store:n,onOptionSubmit:h,children:[a.jsx(Ye.EventsTarget,{children:a.jsx(He,{placeholder:"Search",value:r,mb:"md",autoFocus:!0,leftSection:a.jsx(eg,{size:16}),onChange:g=>{o(g.currentTarget.value),n.updateSelectedOptionIndex()}})}),a.jsx("div",{children:a.jsx(Ye.Options,{style:{marginLeft:"-10px",marginRight:"-10px",marginBottom:"-10px"},children:m.length>0?m:a.jsx(Ye.Empty,{children:"Nothing found..."})})})]}),a.jsx(be,{size:"sm",ta:"center",mt:"md",children:a.jsx(Et,{component:"button",type:"button",onClick:()=>{window.location.href=`/signin?project=new&login=${e.login}`},children:"Create a new project"})})]})}function sY(e){return e.identifier?.find(t=>t.system==="https://medplum.com/identifier/label")?.value}function lY(e){const t=sY(e);return a.jsxs(xe,{gap:"xs",align:"center",children:[a.jsx(le,{className:RP.iconBox,children:a.jsx(yq,{size:16,stroke:2})}),a.jsxs("div",{children:[a.jsxs(be,{size:"sm",fw:500,children:[e.project?.display," ",t?` - ${t}`:""]}),a.jsx(be,{size:"xs",c:"dimmed",children:e.profile?.display})]})]})}const cY=/^patient\/Condition\.(?:\*|c?r?u?d?s?)$/,uY="?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis",dY="?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item",fY="?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern",hY=/^patient\/Observation\.(?:\*|c?r?u?d?s?)$/,pY="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-observation-category|clinical-test",mY="?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory",gY="?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history",vY="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh",yY="?category=http://terminology.hl7.org/CodeSystem/observation-category|survey",xY="?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs";function bY(e){const t=Re();return a.jsx(pt,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:a.jsxs(Le,{children:[a.jsxs(or,{direction:"column",align:"center",justify:"center",children:[a.jsx(Vi,{size:32}),a.jsx(Ve,{order:3,py:"lg",children:"Choose scope"})]}),a.jsx(Le,{children:(e.scope??"openid").split(" ").map(n=>{let r;return cY.test(n)?r=[n+uY,n+dY,n+fY]:hY.test(n)&&(r=[n+pY,n+mY,n+gY,n+vY,n+yY,n+xY]),a.jsxs(a.Fragment,{children:[a.jsx(cn,{id:n,name:n,label:n,defaultChecked:!0},n),r?.map(o=>a.jsx(cn,{id:o,name:o,label:o},o))]},n+"_group")})}),a.jsx(xe,{justify:"flex-end",mt:"xl",children:a.jsx(dr,{fullWidth:!0,children:"Set Scope"})})]})})}function _P(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:o,onRegister:s,onCode:c,...u}=e,f=Re(),[h,m]=v.useState(),g=v.useRef(!1),[y,x]=v.useState(!1),[S,j]=v.useState(),[C,T]=v.useState(!1),[R,E]=v.useState(),_=v.useCallback(D=>{c?c(D):f.processCode(D).then(()=>{r&&r()}).catch(P=>Ae({color:"red",message:Ge(P)}))},[f,c,r]),k=v.useCallback(D=>{x(!!D.mfaEnrollRequired),j(D.enrollQrCode),T(!!D.mfaRequired),D.login&&m(D.login),D.memberships&&E(D.memberships),D.code&&(n?E(void 0):_(D.code))},[n,_]),I=v.useCallback(D=>{_(D.code)},[_]);return v.useEffect(()=>{t&&!g.current&&!h&&(g.current=!0,f.get("auth/login/"+t).then(k).catch(D=>Ae({color:"red",message:Ge(D)})))},[f,t,g,h,k]),a.jsx(ut,{width:400,px:"xl",py:"xl",bdrs:"md",children:h?y&&S?a.jsx(Wp,{title:"Enroll in MFA",description:"Scan this QR code with your authenticator app.",buttonText:"Enroll",qrCodeUrl:S,onSubmit:async D=>{const P=await f.post("auth/mfa/login-enroll",{login:h,token:D.token});k(P)}}):C?a.jsx(Wp,{title:"Enter MFA code",description:"Enter the code from your authenticator app.",buttonText:"Submit Code",onSubmit:async D=>{const P=await f.post("auth/mfa/verify",{login:h,token:D.token});k(P)}}):e.projectId==="new"?a.jsx(SP,{login:h,handleAuthResponse:k}):R?a.jsx(aY,{login:h,memberships:R,handleAuthResponse:k}):e.chooseScopes?a.jsx(bY,{login:h,scope:e.scope,handleAuthResponse:I}):a.jsx("div",{children:"Success"}):a.jsx(tY,{onForgotPassword:o,onRegister:s,handleAuthResponse:k,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...u,children:e.children})})}function Mo(e){return a.jsx(a.Fragment,{children:ws(e.value)})}function SY(e){return a.jsx(a.Fragment,{children:bf(e.value)})}function DP(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 wY(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[t.name,t.name&&": ",t.telecom?.map(n=>a.jsx(DP,{value:n},`telecom-${t.name}-${n.value}`))]}):null}function lg(e,t,n){const r=zd(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 jY(e,t,n){const r=ak(e,t,n);return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function CY(e){const{elementDefinitionType:t}=e,n=Re(),r=v.useContext(hn),[o,s]=v.useState(rk("Extension")),c=v.useMemo(()=>{if(Ln(t?.profile))return t.profile[0]},[t]),[u,f]=v.useState(c!==void 0);if(v.useEffect(()=>{c&&(f(!0),n.requestProfileSchema(c).then(()=>{const g=gu(c);f(!1),g&&s(g)}).catch(g=>{f(!1),console.warn(g)}))},[n,c]),c&&(u||!uS(c)))return a.jsx("div",{children:"Loading..."});if(o.elements["value[x]"]?.max!==0){const[g,y]=lg({type:"Extension",value:e.value},"value[x]",c??r.profileUrl);return a.jsx(uo,{propertyType:y,value:g})}return a.jsx(Yp,{path:e.path,value:{type:o.type,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:c})}function EY(e){return a.jsxs("div",{children:[e.value?.system,": ",e.value?.value]})}function TY(e){return a.jsx(a.Fragment,{children:GB(e.value)})}function qd(e){return a.jsx(a.Fragment,{children:hl(e.value)})}function qS(e){return a.jsx(a.Fragment,{children:Ud(e.value)})}function RY(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[a.jsx(qd,{value:t.numerator})," / ",a.jsx(qd,{value:t.denominator})]}):null}function Qp(e){if(!e.value)return null;const t=e.value.display||e.value.reference||co(e.value);return e.link!==!1&&e.value.reference?a.jsx(St,{to:e.value,children:t}):a.jsx(a.Fragment,{children:t})}function AP(e,t,n,r){if(!Ln(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=Bk(s,t,n.discriminator,r);let u=c?t.findIndex(f=>f.name===c):-1;u===-1&&(u=t.length),o[u].push(s)}return o}async function kP({medplum:e,property:t}){return new Promise((n,r)=>{if(!t.slicing){n([]);return}const o=[],s=[],c=[];for(const u of t.slicing.slices){if(!Uk(u)){console.debug("Unsupported slice definition",u);continue}let f;Ln(u.elements)||(f=u.type[0]?.profile?.[0]),o.push(u),s.push(f),f&&c.push(e.requestProfileSchema(f))}Promise.all(c).then(()=>{for(let u=0;u<o.length;u++){const f=o[u],h=s[u];if(h){const m=gu(h);f.typeSchema=m}}n(o)}).catch(r)})}function cg(e,t,n){return t!==void 0?a.jsx(e,{value:t,children:n}):n}function _Y(e){const{slice:t,property:n}=e,r=t.typeSchema?.elements??t.elements,o=v.useContext(hn),s=v.useMemo(()=>{if(Ln(r))return nu({parentContext:o,elements:r,path:e.path,profileUrl:t.typeSchema?.url})},[o,e.path,t.typeSchema?.url,r]);return cg(hn.Provider,s,a.jsx(a.Fragment,{children:e.value.map((c,u)=>a.jsx("div",{children:a.jsx(uo,{property:n,path:e.path,arrayElement:!0,elementDefinitionType:t.type[0],propertyType:t.type[0].code,value:c,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${u}-${e.value.length}`))}))}const SR=50;function DY(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),[u,f]=v.useState([]),[h,m]=v.useState(()=>[o]),[g,y]=v.useState(0),x=v.useContext(hn);if(v.useEffect(()=>{kP({medplum:r,property:t}).then(C=>{y(o.length),f(C);const T=o.slice(0,SR),R=AP(T,C,t.slicing,x.profileUrl);m(R),c(!1)}).catch(C=>{console.error(C),c(!1)})},[r,t,x.profileUrl,m,o]),s)return a.jsx("div",{children:"Loading..."});let S;if(t.type[0]?.code!=="Extension"){const C=h[u.length],T=C.map((R,E)=>a.jsx("div",{children:a.jsx(uo,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:R,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${E}-${C.length}`));if(e.includeDescriptionListEntry){if(!Ln(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const R=e.path.split(".").pop();S=a.jsx(Ir,{term:jl(R),children:T})}else S=a.jsx(a.Fragment,{children:T})}return a.jsxs(a.Fragment,{children:[u.map((C,T)=>{if(!e.path)throw new Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let R=a.jsx(_Y,{path:e.path,slice:C,property:t,value:h[T],ignoreMissingValues:e.ignoreMissingValues,link:e.link},C.name);return e.includeDescriptionListEntry&&(R=a.jsx(Ir,{term:jl(C.name),children:R},C.name)),R}),S,g>SR&&a.jsx(xe,{justify:"right",children:a.jsxs(be,{children:["... ",g," total values"]})})]})}function uo(e){const{property:t,propertyType:n,value:r}=e;if(t?.path?.endsWith(".id"))return a.jsxs(or,{gap:3,align:"center",children:[r,!Tn(r)&&a.jsx(C0,{value:r,timeout:2e3,children:({copied:s,copy:c})=>a.jsx(di,{label:s?"Copied":"Copy",withArrow:!0,position:"right",children:a.jsx(Rn,{variant:"subtle",color:s?"teal":"gray",onClick:c,children:s?a.jsx(Yo,{size:"1rem"}):a.jsx(OS,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===ie.Attachment?a.jsx(WQ,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):a.jsx(DY,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case ie.boolean:return a.jsx(a.Fragment,{children:r===void 0?"":(!!r).toString()});case ie.SystemString:case ie.string:return e.property?.path?.toLowerCase().includes("secret")?a.jsx(AY,{value:r}):a.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case ie.code:case ie.date:case ie.decimal:case ie.id:case ie.integer:case ie.positiveInt:case ie.unsignedInt:case ie.uri:case ie.url:case ie.xhtml:return a.jsx(a.Fragment,{children:r});case ie.canonical:return a.jsx(Qp,{value:{reference:r},link:e.link});case ie.dateTime:case ie.instant:return a.jsx(a.Fragment,{children:Dr(r)});case ie.time:return a.jsx(a.Fragment,{children:jk(r)});case ie.markdown:return a.jsx("pre",{children:r});case ie.Address:return a.jsx(GH,{value:r});case ie.Annotation:return a.jsx(a.Fragment,{children:r?.text});case ie.Attachment:return a.jsx(Tf,{value:r,maxWidth:e.maxWidth});case ie.CodeableConcept:return a.jsx(Mo,{value:r});case ie.Coding:return a.jsx(SY,{value:r});case ie.ContactDetail:return a.jsx(wY,{value:r});case ie.ContactPoint:return a.jsx(DP,{value:r});case ie.HumanName:return a.jsx($S,{value:r});case ie.Identifier:return a.jsx(EY,{value:r});case ie.Money:return a.jsx(TY,{value:r});case ie.Period:return a.jsx(a.Fragment,{children:BB(r)});case ie.Quantity:case ie.Duration:return a.jsx(qd,{value:r});case ie.Range:return a.jsx(qS,{value:r});case ie.Ratio:return a.jsx(RY,{value:r});case ie.Reference:return a.jsx(Qp,{value:r,link:e.link});case ie.Timing:return a.jsx(a.Fragment,{children:Ck(r)});case ie.Dosage:case ie.UsageContext:if(!e.path)throw new Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(Yp,{path:e.path,value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});case ie.Extension:if(!e.path)throw new Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(CY,{path:e.path,value:r,compact:!0,ignoreMissingValues:e.ignoreMissingValues,elementDefinitionType:e.elementDefinitionType});default:if(!t)throw new Error(`Displaying property of type ${e.propertyType} requires element schema`);if(!e.path)throw new Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(Yp,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}function AY(e){const[t,n]=v.useState(!1),r=e.value??"",o=!Tn(r),s="•".repeat(8);return a.jsxs(or,{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(C0,{value:e.value,timeout:2e3,children:({copied:c,copy:u})=>a.jsx(di,{label:c?"Copied":"Copy secret",withArrow:!0,position:"right",children:a.jsx(Rn,{variant:"subtle",color:c?"teal":"gray",onClick:u,"aria-label":c?"Copied":"Copy secret",children:c?a.jsx(Yo,{size:"1rem"}):a.jsx(OS,{size:"1rem"})})})}),a.jsx(di,{label:t?"Hide secret":"Show secret",withArrow:!0,position:"right",children:a.jsx(Rn,{variant:"subtle",color:"gray",onClick:()=>n(!t),"aria-label":t?"Hide secret":"Show secret",children:t?a.jsx(Kq,{size:"1rem"}):a.jsx(Jq,{size:"1rem"})})})]})]})}const PP=["extension","modifierExtension"],kY=eP.filter(e=>!PP.includes(e));function Yp(e){const t=e.value,{value:n,type:r}=t,o=v.useContext(hn),s=e.profileUrl??o?.profileUrl,c=v.useMemo(()=>Hm(r,s),[s,r]),u=v.useMemo(()=>{if(c)return nu({parentContext:o,elements:c.elements,path:e.path,profileUrl:c.url,accessPolicyResource:e.accessPolicyResource})},[c,o,e.path,e.accessPolicyResource]);if(Tn(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=u??o;return cg(hn.Provider,u,a.jsx(Rf,{compact:e.compact,children:Object.entries(f.elements).map(([h,m])=>{if(PP.includes(h)&&Tn(m.slicing?.slices))return null;if(kY.includes(h))return null;if(tP.includes(h)&&m.path.split(".").length===2||h.includes("."))return null;const[g,y]=lg(t,h,f.profileUrl);if((e.ignoreMissingValues||m.max===0)&&Tn(g)||e.path.endsWith(".extension")&&(h==="url"||h==="id"))return null;const x=m.max>1||m.isArray,S=a.jsx(uo,{property:m,propertyType:y,path:e.path+"."+h,value:g,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:x,link:e.link},h);return x?S:a.jsx(Ir,{term:jl(h),children:S},h)})}))}const PY="_dimmed_11me5_1",NY="_preserveBreaks_11me5_5",nb={dimmed:PY,preserveBreaks:NY},NP="Read Only";function OP(e,t){return e?a.jsx(di.Floating,{label:e,children:t}):t}function MP(e){const{debugMode:t}=v.useContext(hn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,OP(e?.readonly?NP:void 0,a.jsxs(xe,{wrap:"nowrap","data-testid":e.testId,children:[a.jsx("div",{children:e.children}),a.jsx("div",{children:a.jsx(fn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e?.readonly?nb.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function Ut(e){const{debugMode:t}=v.useContext(hn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,OP(e?.readonly?NP:void 0,a.jsx(fn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:Bt({[nb.dimmed]:e?.readonly},nb.preserveBreaks)},description:e.description,withAsterisk:e.withAsterisk,error:$t(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function OY(e,t,n,r,o){const s=r.type;if(s.length>1)for(const c of s){const u=t.replace("[x]",Qn(c.code));u in e&&delete e[u]}return Tn(o)?e[n]=void 0:e[n]=o,e}function MY(e){return!!e&&!Tn(e.url)&&!Tn(e.name)}function LY(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:o,path:s,valuePath:c,...u}=e,[f,h]=v.useState(t);function m(g){const y=zY(g);h(y),n&&n(y)}return a.jsx(Ef,{defaultValue:f&&IY(f),onChange:m,withHelpText:r??!0,...u})}function IY(e){return e.coding?.map(t=>({system:t.system,code:t.code,display:t.display}))}function zY(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function $Y(e){const{defaultValue:t,onChange:n,withHelpText:r,response:o,...s}=e,[c,u]=v.useState(o?.answer?.[0]?.valueCoding??t);function f(h){const m=h[0],g=m&&BY(m);u(g),n&&n(g)}return a.jsx(Ef,{defaultValue:c?UY(c):void 0,maxValues:1,onChange:f,withHelpText:r??!0,...s})}function UY(e){return{system:e.system,code:e.code,display:e.display}}function BY(e){return{system:e.system,code:e.code,display:e.display}}function LP(e){const{path:t,outcome:n}=e,{elementsByPath:r,getExtendedProps:o}=v.useContext(hn),[s,c]=v.useState(e.defaultValue),u=v.useRef(s);u.current=s;const[f,h,m]=v.useMemo(()=>["system","use","value"].map(E=>r[t+"."+E]),[r,t]),[g,y,x]=v.useMemo(()=>["system","use","value"].map(E=>o(t+"."+E)),[o,t]);function S(E){E&&Object.keys(E).length===0&&(E=void 0),c(E),e.onChange&&e.onChange(E)}function j(E){const _={...u.current,system:E};E||delete _.system,S(_)}function C(E){const _={...u.current,use:E};E||delete _.use,S(_)}function T(E){const _={...u.current,value:E};E||delete _.value,S(_)}const R=e.valuePath??t;return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(dn,{disabled:e.disabled||g?.readonly,"data-testid":"system",defaultValue:s?.system,required:(f?.min??0)>0,onChange:E=>j(E.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:$t(n,R+".system")}),a.jsx(dn,{disabled:e.disabled||y?.readonly,"data-testid":"use",defaultValue:s?.use,required:(h?.min??0)>0,onChange:E=>C(E.currentTarget.value),data:["","home","work","temp","old","mobile"],error:$t(n,R+".use")}),a.jsx(He,{disabled:e.disabled||x?.readonly,placeholder:"Value",defaultValue:s?.value,required:(m?.min??0)>0,onChange:E=>T(E.currentTarget.value),error:$t(n,R+".value")})]})}function VY(e){const[t,n]=v.useState(e.defaultValue),r=v.useRef(t);r.current=t;const{getExtendedProps:o}=v.useContext(hn),[s,c]=v.useMemo(()=>["name","telecom"].map(m=>o(e.path+"."+m)),[o,e.path]);function u(m){n(m),e.onChange&&e.onChange(m)}function f(m){const g={...r.current,name:m};m||delete g.name,u(g)}function h(m){const g={...r.current,telecom:m&&[m]};m||delete g.telecom,u(g)}return a.jsxs(xe,{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(LP,{disabled:e.disabled||c?.readonly,name:e.name+"-telecom",path:e.path+".telecom",defaultValue:t?.telecom?.[0],onChange:h,outcome:e.outcome})]})}function FY(e){if(!e)return"";const t=new Date(e);return Gm(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function GS(e){if(!e)return"";const t=new Date(e);return Gm(t)?t.toISOString():""}function Lo(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:HY(),step:1,defaultValue:FY(e.defaultValue),autoFocus:e.autoFocus,error:$t(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(GS(n))}}})}function HY(){return"datetime-local"}function qY(e){const{propertyType:t}=e,n=Re(),r=v.useMemo(()=>{if(Ln(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||!uS(r))?a.jsx("div",{children:"Loading..."}):a.jsx(KS,{profileUrl:r,path:e.path,typeName:"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function GY(e){const{outcome:t,path:n}=e,[r,o]=v.useState(e.defaultValue),{getExtendedProps:s}=v.useContext(hn),[c,u,f,h,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 x(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 T=e.valuePath??n;return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(dn,{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:$t(t,T+".use")}),a.jsx(He,{disabled:e.disabled||u?.readonly,placeholder:"Prefix",name:e.name+"-prefix",defaultValue:r?.prefix?.join(" "),onChange:R=>x(R.currentTarget.value),error:$t(t,T+".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:$t(t,T+".given")}),a.jsx(He,{disabled:e.disabled||h?.readonly,name:e.name+"-family",placeholder:"Family",defaultValue:r?.family,onChange:R=>j(R.currentTarget.value),error:$t(t,T+".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:$t(t,T+".suffix")})]})}function WY(e){const[t,n]=v.useState(e.defaultValue),{elementsByPath:r,getExtendedProps:o}=v.useContext(hn),[s,c]=v.useMemo(()=>["system","value"].map(g=>r[e.path+"."+g]),[r,e.path]),[u,f]=v.useMemo(()=>["system","value"].map(g=>o(e.path+"."+g)),[o,e.path]);function h(g){n(g),e.onChange&&e.onChange(g)}const m=e.valuePath??e.path;return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(He,{disabled:e.disabled||u?.readonly,placeholder:"System",required:(s?.min??0)>0,defaultValue:t?.system,onChange:g=>h({...t,system:g.currentTarget.value}),error:$t(e.outcome,m+".system")}),a.jsx(He,{disabled:e.disabled||f?.readonly,placeholder:"Value",required:(c?.min??0)>0,defaultValue:t?.value,onChange:g=>h({...t,value:g.currentTarget.value}),error:$t(e.outcome,m+".value")})]})}const QY=["USD","EUR","CAD","GBP","AUD"];function YY(e){const{onChange:t}=e,[n,r]=v.useState(e.defaultValue),{getExtendedProps:o}=v.useContext(hn),[s,c]=v.useMemo(()=>["currency","value"].map(g=>o(e.path+"."+g)),[o,e.path]),u=v.useCallback(g=>{r(g),t&&t(g)},[t]),f=v.useCallback(g=>{u({...n,currency:g.currentTarget.value})},[n,u]),h=v.useCallback(g=>{u({...n,value:g.currentTarget.valueAsNumber})},[n,u]),m=a.jsx(dn,{disabled:e.disabled||s?.readonly,defaultValue:n?.currency,data:QY,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($q,{size:14}),rightSection:m,rightSectionWidth:92,onChange:h})}function KY(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(hn),[o,s]=v.useMemo(()=>["start","end"].map(u=>r(e.path+"."+u)),[r,e.path]);function c(u){n(u),e.onChange&&e.onChange(u)}return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Lo,{disabled:e.disabled||o?.readonly,name:e.name+".start",placeholder:"Start",defaultValue:t?.start,onChange:u=>c({...t,start:u})}),a.jsx(Lo,{disabled:e.disabled||s?.readonly,name:e.name+".end",placeholder:"End",defaultValue:t?.end,onChange:u=>c({...t,end:u})})]})}function Tl(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(hn),[o,s,c]=v.useMemo(()=>["comparator","value","unit"].map(f=>r(e.path+"."+f)),[r,e.path]);function u(f){n(f),e.onChange&&e.onChange(f)}return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(dn,{disabled:e.disabled||o?.readonly,style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t?.comparator,data:["","<","<=",">=",">"],onChange:f=>u({...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=>{u({...t,value:XY(f.currentTarget.value)})}}),a.jsx(He,{disabled:e.disabled||c?.readonly,placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t?.unit,onChange:f=>u({...t,unit:f.currentTarget.value})})]})}function XY(e){if(e)return Number.parseFloat(e)}function WS(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(hn),[o,s]=v.useMemo(()=>["low","high"].map(u=>r(e.path+"."+u)),[r,e.path]);function c(u){n(u),e.onChange&&e.onChange(u)}return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Tl,{path:e.path+".low",disabled:e.disabled||o?.readonly,name:e.name+"-low",defaultValue:t?.low,onChange:u=>c({...t,low:u})}),a.jsx(Tl,{path:e.path+".high",disabled:e.disabled||s?.readonly,name:e.name+"-high",defaultValue:t?.high,onChange:u=>c({...t,high:u})})]})}function JY(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(hn),[o,s]=v.useMemo(()=>["numerator","denominator"].map(u=>r(e.path+"."+u)),[r,e.path]);function c(u){n(u),e.onChange&&e.onChange(u)}return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Tl,{path:e.path+".numerator",disabled:e.disabled||o?.readonly,name:e.name+"-numerator",defaultValue:t?.numerator,onChange:u=>c({...t,numerator:u})}),a.jsx(Tl,{path:e.path+".denominator",disabled:e.disabled||s?.readonly,name:e.name+"-denominator",defaultValue:t?.denominator,onChange:u=>c({...t,denominator:u})})]})}const ZY={Device:"device-name",Observation:"code",Subscription:"criteria",User:"email:contains"},eK=["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 tK(e){return{value:zt(e)??"",label:Ea(e),resource:e}}function Vl(e){const t=Re(),{resourceType:n,searchCriteria:r}=e,[o,s]=v.useState(),c=Xt(e.defaultValue,s),u=e.itemComponent??nK,f=e.onChange,h=v.useCallback(async(g,y)=>{const x=rK(n),S=new URLSearchParams({[x]: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 Ln(e.defaultValue)&&!o&&!c?null:a.jsx(US,{disabled:e.disabled,name:e.name,label:e.label,error:e.error,required:e.required,itemComponent:u,defaultValue:c,placeholder:e.placeholder,maxValues:1,toOption:tK,loadOptions:h,onChange:m,clearable:!0})}const nK=v.forwardRef(({label:e,resource:t,active:n,...r},o)=>a.jsx("div",{ref:o,...r,children:a.jsxs(xe,{wrap:"nowrap",children:[a.jsx(ho,{value:t}),a.jsxs("div",{children:[a.jsx(be,{children:e}),a.jsx(be,{size:"xs",c:"dimmed",children:t.birthDate||t.id})]})]})}));function rK(e){return ZY[e]??(eK.includes(e)?"name":"_id")}function bs(e){const{onChange:t}=e,n=Re(),[r,o]=v.useState(e.defaultValue),[s,c]=v.useState(()=>iK(e.targetTypes)),[u,f]=v.useState(()=>oK(e.defaultValue,s)),h=v.useRef(new YA),m=v.useMemo(()=>u?.type==="profile"?{...e.searchCriteria,_profile:u.value}:e.searchCriteria,[e.searchCriteria,u]);v.useEffect(()=>{let x=!1;const S=s?.map(j=>{if(!sK(j))return Promise.resolve(j);x=!0;const C=j.value,T=h.current.get(C);if(T)return T;const R=aK(n,j.value).then(_=>{const k={...j};return _?Ln(_.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:_})),E=new to(R);return h.current.set(C,E),E});!S||!x||Promise.all(S).then(j=>{if(c(j),!u)return;const C=j.findIndex(T=>T.value===u.value||T.resourceType===u.resourceType);if(C===-1){console.debug(`defaultValue had unexpected resourceType: ${u.resourceType}`);return}f(j[C])}).catch(console.error)},[n,u,s]);const g=v.useCallback(x=>{const S=x?Yt(x):void 0;o(S),t&&t(S)},[t]),y=v.useMemo(()=>s?s.map(x=>({value:x.value,label:x.type==="profile"?x.title??x.name??x.resourceType??x.value:x.value})):[],[s]);return a.jsxs(a.Fragment,{children:[e.name&&a.jsx("input",{type:"hidden",name:e.name,value:r?.reference??""}),a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[s&&s.length>1&&a.jsx(dn,{name:e.name+"-resourceType",disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:u?.resourceType,autoFocus:e.autoFocus,onChange:x=>{const S=x.currentTarget.value,j=s.find(C=>C.value===S);f(j)},data:y}),!s&&a.jsx(FS,{disabled:e.disabled,autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:u?.resourceType,onChange:x=>{f(x?{type:"resourceType",value:x,resourceType:x}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),a.jsx(Vl,{resourceType:u?.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:m,onChange:g,disabled:e.disabled})]})]})}function iK(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 oK(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 aK(e,t){const n=gu(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
|
|
199
|
-
StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
|
|
200
|
-
type,
|
|
201
|
-
name,
|
|
202
|
-
title,
|
|
203
|
-
}
|
|
204
|
-
}`.replaceAll(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function sK(e){return e.type==="profile"&&!e?.error&&Tn(e.resourceType)}function lK(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}const cK="_indented_ldk1d_1",IP={indented:cK};function ug({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?a.jsx(Oe,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:a.jsx(Fd,{size:"1.25rem"}),onClick:t,children:r}):a.jsx(Rn,{title:r,color:"green.6","data-testid":n,onClick:t,children:a.jsx(Fd,{size:"1.25rem"})})}function QS({propertyDisplayName:e,onClick:t,testId:n}){return a.jsx(Rn,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:a.jsx(qp,{size:"1.25rem"})})}function uK(e){const{slice:t,property:n}=e,[r,o]=v.useState(e.defaultValue),s=t.typeSchema?.elements??t.elements,c=v.useContext(hn),u=v.useMemo(()=>{if(Ln(s))return nu({parentContext:c,elements:s,path:e.path,profileUrl:t.typeSchema?.url})},[c,e.path,t.typeSchema?.url,s]);function f(x){o(x),e.onChange&&e.onChange(x)}const h=t.min>0,m=Tn(t.elements),g=Rk(t.name),y=e.property.readonly&&r.length===0;return cg(hn.Provider,u,a.jsx(Ut,{title:g,description:t.definition,withAsterisk:h,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:y?a.jsx(be,{c:"dimmed",children:"(empty)"}):a.jsxs(Le,{className:m?IP.indented:void 0,children:[r.map((x,S)=>a.jsxs(xe,{wrap:"nowrap",children:[a.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${S}`,children:a.jsx(YS,{elementDefinitionType:t.type[0],name:t.name,defaultValue:x,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(QS,{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(xe,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx(ug,{propertyDisplayName:g,onClick:x=>{yn(x);const S=[...r,void 0];f(S)},testId:e.testId&&`${e.testId}-add`})})]})}))}function dK(e){const{property:t}=e,n=Re(),[r,o]=v.useState(!0),[s,c]=v.useState([]),[u]=v.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[f,h]=v.useState(()=>[u]),m=v.useContext(hn),g=t.type[0]?.code;v.useEffect(()=>{kP({medplum:n,property:t}).then(R=>{c(R);const E=AP(u,R,t.slicing,m.profileUrl);fK(E,R),h(E),o(!1)}).catch(R=>{console.error(R),o(!1)})},[n,t,u,m.profileUrl,h]);function y(R,E){const _=[...f];if(_[E]=R,h(_),e.onChange){const k=_.flat().filter(I=>I!==void 0);e.onChange(k)}}if(r)return a.jsx("div",{children:"Loading..."});const x=s.length,S=f[x],j=!(e.hideNonSliceValues??(g==="Extension"&&s.length>0)),C=jl(t.path),T=e.property.readonly&&s.length===0&&u.length===0;return a.jsxs(Le,{className:e.indent?IP.indented:void 0,children:[T&&a.jsx(be,{c:"dimmed",children:"(empty)"}),s.map((R,E)=>a.jsx(uK,{slice:R,path:e.path,valuePath:e.valuePath,property:t,defaultValue:f[E],onChange:_=>{y(_,E)},testId:`slice-${R.name}`},R.name)),j&&S.map((R,E)=>a.jsxs(xe,{wrap:"nowrap",style:{flexGrow:1},children:[a.jsx("div",{style:{flexGrow:1},children:a.jsx(_f,{arrayElement:!0,property:e.property,name:e.name+"."+E,path:e.path,valuePath:lK(e.path,e.valuePath,E),defaultValue:R,onChange:_=>{const k=[...S];k[E]=_,y(k,x)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&a.jsx(QS,{propertyDisplayName:C,testId:`nonsliced-remove-${E}`,onClick:_=>{yn(_);const k=[...S];k.splice(E,1),y(k,x)}})]},`${E}-${S.length}`)),!e.property.readonly&&j&&f.flat().length<t.max&&a.jsx(xe,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx(ug,{propertyDisplayName:C,onClick:R=>{yn(R);const E=[...S];E.push(void 0),y(E,x)},testId:"nonsliced-add"})})]})}function fK(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 hK(e){const[t,n]=v.useState(!1),r=J2(),o=v.useRef(null),s={...e.styles};return t||(s.input||(s.input={}),s.input.WebkitTextSecurity="disc"),a.jsxs(or,{gap:"xs",children:[a.jsx(zl,{...e,styles:{...s,root:{...s.root??{},flexGrow:1}},ref:o,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),a.jsx(Rn,{title:"Copy secret",onClick:()=>{r.copy(o.current?.value),Ae({color:"green",message:"Copied"})},children:a.jsx(OS,{})})]})}const pK=["sun","mon","tue","wed","thu","fri","sat"];function mK(e){const[t,n]=v.useState(e.defaultValue),[r,o]=v.useState(!e.disabled&&(e.defaultModalOpen??!1));return a.jsxs(a.Fragment,{children:[a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx("span",{"data-testid":"timinginput-display",children:Ck(t)||"No repeat"}),a.jsx(Oe,{disabled:e.disabled,onClick:()=>o(!0),children:"Edit"})]}),!e.disabled&&a.jsx(gK,{path:e.path,visible:r,defaultValue:t,onOk:s=>{e.onChange&&e.onChange(s),n(s),o(!1)},onCancel:()=>o(!1)})]})}const wR={repeat:{period:1,periodUnit:"d"}};function gK(e){const[t,n]=v.useState(e.defaultValue||wR),[r,o]=v.useState(()=>(e.defaultValue?.repeat?.timeOfDay??[]).map((E,_)=>({id:_,value:E}))),s=v.useRef(r.length),{getExtendedProps:c}=v.useContext(hn),[u,f,h,m,g,y]=v.useMemo(()=>["event","repeat","repeat.period","repeat.periodUnit","repeat.dayOfWeek","repeat.timeOfDay"].map(E=>c(e.path+"."+E)),[c,e.path]);function x(E){n(_=>({..._,event:[E]}))}function S(E){n(_=>({..._,repeat:E}))}function j(E){n(_=>({..._,repeat:{..._.repeat,period:E}}))}function C(E){n(_=>({..._,repeat:{..._.repeat,periodUnit:E}}))}function T(E){n(_=>({..._,repeat:{..._.repeat,dayOfWeek:E}}))}function R(E){o(_=>{const k=E(_),I=k.map(D=>D.value);return n(D=>({...D,repeat:{...D.repeat,timeOfDay:I}})),k})}return a.jsx(In,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:a.jsxs(Le,{gap:"md",children:[a.jsx(Ut,{title:"Starts on",htmlFor:"timing-dialog-start",children:a.jsx(Lo,{disabled:u?.readonly,name:"timing-dialog-start",onChange:E=>x(E)})}),a.jsx(hf,{disabled:f?.readonly,label:"Repeat",checked:!!t.repeat,onChange:E=>S(E.currentTarget.checked?wR.repeat:void 0)}),t.repeat&&a.jsxs(a.Fragment,{children:[a.jsx(Ut,{title:"Repeat every",htmlFor:"timing-dialog-period",children:a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(He,{disabled:h?.readonly,type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:E=>j(Number.parseInt(E.currentTarget.value,10)||1)}),a.jsx(dn,{disabled:m?.readonly,id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:E=>C(E.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(Ut,{title:"Repeat on",children:a.jsx(Od.Group,{multiple:!0,onChange:T,value:t.repeat?.dayOfWeek,children:a.jsx(xe,{justify:"space-between",mt:"xs",gap:"xs",children:pK.map(E=>a.jsx(Od,{value:E,size:"xs",radius:"xl",disabled:g?.readonly,checked:(t.repeat?.dayOfWeek??[]).includes(E),children:E.charAt(0).toUpperCase()},E))})})}),a.jsx(Ut,{title:"At times",children:a.jsxs(Le,{mt:"xs",children:[r.map((E,_)=>a.jsxs(xe,{children:[a.jsx(He,{disabled:y?.readonly,type:"time",id:`timing-dialog-repeat-timeOfDay[${_}]`,name:`timing-dialog-repeat-timeOfDay[${_}]`,"data-testid":`timing-repeat-timeOfDay-input-${_}`,defaultValue:E.value.slice(0,5),onChange:k=>{const I=`${k.currentTarget.value}:00`;R(D=>D.with(_,{...E,value:I}))},style:{flexGrow:1}}),a.jsx(QS,{testId:`timing-repeat-timeOfDay-remove-${_}`,onClick:()=>R(k=>k.toSpliced(_,1))})]},E.id)),a.jsx(le,{children:a.jsx(ug,{propertyDisplayName:"Time of Day",onClick:()=>R(E=>{const _=s.current++;return E.concat({id:_,value:"00:00:00"})})})})]})})]}),a.jsx(xe,{justify:"flex-end",children:a.jsx(Oe,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function _f(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===ie.Attachment)return a.jsx(QQ,{name:n,defaultValue:o,onChange:r,disabled:t.readonly});const u=c[0]?.code!==ie.Extension;return a.jsx(dK,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:o,indent:u,onChange:r,outcome:e.outcome})}else return c.length>1?a.jsx(vK,{elementDefinitionTypes:c,...e}):a.jsx(YS,{name:n,defaultValue:o,onChange:u=>{if(e.onChange){const f=e.name.replace("[x]",Qn(c[0].code));e.onChange(u,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 vK(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(xe,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(dn,{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(YS,{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 YS(e){const{name:t,onChange:n,outcome:r,binding:o,path:s,valuePath:c,readOnly:u}=e,f=e.min!==void 0&&e.min>0,h=e.elementDefinitionType.code,m=v.useContext(hn),g=v.useMemo(()=>{if(!mS(h)||!Tn(e.defaultValue))return e.defaultValue;const S=Object.create(null);if(m.path===e.path)eR(S,m.elements);else{const j=fl(m.path,e.path);if(j===void 0)return e.defaultValue;eR(S,m.elements,j)}return Ln(S)?S:e.defaultValue},[h,m.path,m.elements,e.path,e.defaultValue]);if(!h)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:u}}function x(){const S=$t(e.outcome,c??s);return{id:t,name:t,"data-testid":t,defaultValue:g,required:f,error:S,disabled:u}}switch(h){case ie.SystemString:case ie.canonical:case ie.string:case ie.uri:case ie.url:return e.path==="Project.secret.value[x]"?a.jsx(hK,{...x(),onChange:S=>{e.onChange&&e.onChange(S.currentTarget.value)}}):a.jsx(He,{...x(),onChange:S=>{n&&n(S.currentTarget.value)}});case ie.date:return a.jsx(He,{...x(),type:"date",onChange:S=>{n&&n(S.currentTarget.value)}});case ie.time:return a.jsx(He,{...x(),type:"time",step:1,onChange:S=>{n&&n(S.currentTarget.value)}});case ie.dateTime:case ie.instant:return a.jsx(Lo,{...x(),onChange:n,outcome:r});case ie.decimal:case ie.integer:case ie.positiveInt:case ie.unsignedInt:return a.jsx(He,{...x(),type:"number",step:h===ie.decimal?"any":"1",onChange:S=>{if(n){const j=S.currentTarget.valueAsNumber;n(Number.isNaN(j)?void 0:j)}}});case ie.code:return a.jsx(yP,{...x(),error:void 0,onChange:n,binding:o?.valueSet,creatable:!0,maxValues:1});case ie.boolean:return a.jsx(cn,{...x(),defaultChecked:!!g,onChange:S=>{n&&n(S.currentTarget.checked)}});case ie.base64Binary:case ie.markdown:case ie.xhtml:return a.jsx(zl,{...x(),spellCheck:h!==ie.base64Binary,onChange:S=>{n&&n(S.currentTarget.value)}});case ie.Address:return a.jsx(YH,{...y()});case ie.Annotation:return a.jsx(KH,{...y()});case ie.Attachment:return a.jsx(xP,{...y()});case ie.CodeableConcept:return a.jsx(LY,{binding:o?.valueSet,...y()});case ie.Coding:return a.jsx($Y,{binding:o?.valueSet,...y()});case ie.ContactDetail:return a.jsx(VY,{...y()});case ie.ContactPoint:return a.jsx(LP,{...y()});case ie.Extension:return a.jsx(qY,{...y(),propertyType:e.elementDefinitionType});case ie.HumanName:return a.jsx(GY,{...y()});case ie.Identifier:return a.jsx(WY,{...y()});case ie.Money:return a.jsx(YY,{...y()});case ie.Period:return a.jsx(KY,{...y()});case ie.Duration:case ie.Quantity:return a.jsx(Tl,{...y()});case ie.Range:return a.jsx(WS,{...y()});case ie.Ratio:return a.jsx(JY,{...y()});case ie.Reference:return a.jsx(bs,{...y(),targetTypes:xK(e.elementDefinitionType)});case ie.Timing:return a.jsx(mK,{...y()});case ie.Dosage:case ie.UsageContext:default:return a.jsx(KS,{...y(),typeName:h})}}const yK=[`${fo}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function xK(e){return e?.targetProfile?.map(t=>{const n=yK.find(r=>t.startsWith(r));return n?t.slice(n.length):t})}function bK(e){const[t,n]=v.useState(e.defaultValue??{}),r=v.useContext(hn),o=v.useMemo(()=>QH(r.elements),[r.elements]);function s(u){n(u),e.onChange&&e.onChange(u)}const c={type:e.type,value:t};return a.jsx(Le,{style:{flexGrow:1},"data-testid":e.testId,children:o.map(([u,f])=>{const[h,m]=jY(c,u,f),g=f.min!==void 0&&f.min>0,y=e.valuePath?e.valuePath+"."+u:void 0,x=a.jsx(_f,{property:f,name:u,path:e.path+"."+u,valuePath:y,defaultValue:h,defaultPropertyType:m,onChange:(S,j)=>{s(OY({...t},u,j??u,f,S))},outcome:e.outcome},u);return e.type==="Extension"||kS.includes(u)?x:f.type.length===1&&f.type[0].code==="boolean"?a.jsx(MP,{title:jl(u),description:f.description,htmlFor:u,fhirPath:f.path,withAsterisk:g,readonly:f.readonly,children:x},u):a.jsx(Ut,{title:jl(u),description:f.description,withAsterisk:g,htmlFor:u,outcome:e.outcome,fhirPath:f.path,errorExpression:y,readonly:f.readonly,children:x},u)})})}const SK="_nested_1ya4k_1",wK={nested:SK};function KS(e){const[t]=v.useState(()=>e.defaultValue??{}),n=v.useContext(hn),r=e.profileUrl??n?.profileUrl,o=v.useMemo(()=>Hm(e.typeName,r),[e.typeName,r]),s=o?.type??e.typeName,c=v.useMemo(()=>{if(o)return nu({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 u=n.path!=="";return cg(hn.Provider,c,a.jsx(le,{className:Bt({[wK.nested]:u}),children:a.jsx(bK,{path:e.path,valuePath:e.valuePath,type:s,defaultValue:t,onChange:e.onChange,outcome:e.outcome})}))}const jK="_noteCite_10swh_5",CK="_noteRoot_10swh_10",jR={noteCite:jK,noteRoot:CK};function zP({value:e}){return e?a.jsx(Le,{justify:"flex-start",gap:"xs",children:e.map(t=>t.text&&a.jsx(S0,{classNames:{cite:jR.noteCite,root:jR.noteRoot},cite:t.authorReference?.display||t.authorString,icon:null,children:t.text},`note-${t.text}`))}):null}function Fl(e){const{value:t,link:n,...r}=e,[o,s]=v.useState(),c=Xt(t,s);let u;if(o&&!XA(o))u=`[${Ge(o)}]`;else if(c)u=Ea(c);else return null;return n?a.jsx(St,{to:t,...r,children:u}):a.jsx(be,{component:"span",...r,children:u})}function qc(e){return a.jsxs(xe,{gap:"xs",children:[a.jsx(ho,{size:24,radius:12,value:e.value,link:e.link}),a.jsx(Fl,{value:e.value,link:e.link})]})}const EK={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 dg(e){const{status:t,...n}=e;return a.jsx(b0,{color:e.color||EK[t],...n,children:t.replaceAll("-"," ")})}const TK="_table_pe9td_1",RK="_criticalRow_pe9td_12",$P={table:TK,criticalRow:RK};XS.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1,hideSubject:!1};function XS(e){const t=Re(),n=Xt(e.value),[r,o]=v.useState();if(v.useEffect(()=>{n?.specimen&&Promise.allSettled(n.specimen.map(c=>t.readReference(c))).then(c=>c.filter(u=>u.status==="fulfilled").map(u=>u.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(Le,{children:[a.jsx(Ve,{children:"Diagnostic Report"}),a.jsx(_K,{value:n,hideSubject:e.hideSubject}),r&&!e.hideSpecimenInfo&&DK(r),n.result&&a.jsx(AK,{hideObservationNotes:e.hideObservationNotes,value:n.result}),s.length>0&&a.jsx(zP,{value:s})]})}function _K({value:e,hideSubject:t=!1}){return a.jsxs(xe,{mt:"md",gap:30,children:[e.subject&&!t&&a.jsxs("div",{children:[a.jsx(be,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),a.jsx(qc,{value:e.subject,link:!0})]}),e.resultsInterpreter?.map(n=>a.jsxs("div",{children:[a.jsx(be,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),a.jsx(qc,{value:n,link:!0})]},n.reference)),e.performer?.map(n=>a.jsxs("div",{children:[a.jsx(be,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),a.jsx(qc,{value:n,link:!0})]},n.reference)),e.issued&&a.jsxs("div",{children:[a.jsx(be,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),a.jsx(be,{children:Dr(e.issued)})]}),e.status&&a.jsxs("div",{children:[a.jsx(be,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),a.jsx(dg,{status:e.status})]})]})}function DK(e){return a.jsxs(Le,{gap:"xs",children:[a.jsx(Ve,{order:2,size:"h6",children:"Specimens"}),a.jsx(Or,{type:"ordered",children:e?.map(t=>a.jsx(Or.Item,{ml:"sm",children:a.jsxs(xe,{gap:20,children:[a.jsxs(xe,{gap:5,children:[a.jsx(be,{fw:500,children:"Collected:"})," ",Dr(t.collection?.collectedDateTime)]}),a.jsxs(xe,{gap:5,children:[a.jsx(be,{fw:500,children:"Received:"})," ",Dr(t.receivedTime)]})]})},`specimen-${t.id}`))})]})}function AK(e){return a.jsxs("table",{className:$P.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(UP,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function UP(e){return a.jsx(a.Fragment,{children:e.value?.map(t=>a.jsx(kK,{value:t,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${Oa(t)?t.reference:t.id}`))})}function kK(e){const t=Xt(e.value);if(!t||e.ancestorIds?.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=OK(t);return a.jsxs(a.Fragment,{children:[a.jsxs("tr",{className:Bt({[$P.criticalRow]:r}),children:[a.jsx("td",{rowSpan:n?2:1,children:a.jsx(St,{to:t,children:a.jsx(Mo,{value:t.code})})}),a.jsx("td",{children:a.jsx(PK,{value:t})}),a.jsx("td",{children:a.jsx(NK,{value:t.referenceRange})}),a.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&a.jsx(Mo,{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(Mo,{value:o})},`category-${ws(o)}`))})}),a.jsx("td",{children:t.performer?.map(o=>a.jsx(Qp,{value:o},o.reference))}),a.jsx("td",{children:t.status&&a.jsx(dg,{status:t.status})})]}),t.hasMember&&a.jsx(UP,{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(zP,{value:t.note})})})]})}function PK(e){const t=e.value;return a.jsx(a.Fragment,{children:Ek(t)})}function NK(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(qS,{value:t}):null}function OK(e){const t=e.interpretation?.[0]?.coding?.[0]?.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}var sx={},ga={},CR;function BP(){if(CR)return ga;CR=1,Object.defineProperty(ga,"__esModule",{value:!0}),ga.Pointer=ga.escapeToken=ga.unescapeToken=void 0;function e(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}ga.unescapeToken=e;function t(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}ga.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="",u=o,f=1,h=this.tokens.length;f<h;f++)s=u,c=this.tokens[f],!(c=="__proto__"||c=="constructor"||c=="prototype")&&(u=(s||{})[c]);return{parent:s,key:c,value:u}},r.prototype.get=function(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 ga.Pointer=n,ga}var Sn={},lx={},ER;function VP(){return ER||(ER=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),u=0;u<s;u++)c[u]=r(o[u]);return c}if(o.constructor==Date){var f=new Date(+o);return f}var h={};for(var m in o)e.hasOwnProperty.call(o,m)&&(h[m]=r(o[m]));return h}e.clone=r})(lx)),lx}var Nr={},TR;function FP(){if(TR)return Nr;TR=1,Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.diffAny=Nr.diffObjects=Nr.diffArrays=Nr.intersection=Nr.subtract=Nr.isDestructive=void 0;var e=VP();function t(m){var g=m.op;return g==="remove"||g==="replace"||g==="copy"||g==="move"}Nr.isDestructive=t;function n(m,g){var y={};for(var x in m)e.hasOwnProperty.call(m,x)&&m[x]!==void 0&&(y[x]=1);for(var S in g)e.hasOwnProperty.call(g,S)&&g[S]!==void 0&&delete y[S];return Object.keys(y)}Nr.subtract=n;function r(m){for(var g=m.length,y={},x=0;x<g;x++){var S=m[x];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)}Nr.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 u(m,g,y,x){x===void 0&&(x=h);var S={"0,0":{operations:[],cost:0}};function j(_,k){var I="".concat(_,",").concat(k),D=S[I];if(D===void 0){if(_>0&&k>0&&!x(m[_-1],g[k-1],y.add(String(_-1))).length)D=j(_-1,k-1);else{var P=[];if(_>0){var $=j(_-1,k),B={op:"remove",index:_-1};P.push(c($,B))}if(k>0){var W=j(_,k-1),Y={op:"add",index:_-1,value:g[k-1]};P.push(c(W,Y))}if(_>0&&k>0){var Z=j(_-1,k-1),U={op:"replace",index:_-1,original:m[_-1],value:g[k-1]};P.push(c(Z,U))}var G=P.sort(function(M,L){return M.cost-L.cost})[0];D=G}S[I]=D}return D}var C=isNaN(m.length)||m.length<=0?0:m.length,T=isNaN(g.length)||g.length<=0?0:g.length,R=j(C,T).operations,E=R.reduce(function(_,k){var I=_[0],D=_[1];if(o(k)){var P=k.index+1+D,$=P<C+D?String(P):"-",B={op:k.op,path:y.add($).toString(),value:k.value};return[I.concat(B),D+1]}else if(s(k)){var B={op:k.op,path:y.add(String(k.index+D)).toString()};return[I.concat(B),D-1]}else{var W=y.add(String(k.index+D)),Y=x(k.original,k.value,W);return[I.concat.apply(I,Y),D]}},[[],0])[0];return E}Nr.diffArrays=u;function f(m,g,y,x){x===void 0&&(x=h);var S=[];return n(m,g).forEach(function(j){S.push({op:"remove",path:y.add(j).toString()})}),n(g,m).forEach(function(j){S.push({op:"add",path:y.add(j).toString(),value:g[j]})}),r([m,g]).forEach(function(j){S.push.apply(S,x(m[j],g[j],y.add(j)))}),S}Nr.diffObjects=f;function h(m,g,y,x){if(x===void 0&&(x=h),m===g)return[];var S=(0,e.objectType)(m),j=(0,e.objectType)(g);return S=="array"&&j=="array"?u(m,g,y,x):S=="object"&&j=="object"?f(m,g,y,x):[{op:"replace",path:y.toString(),value:g}]}return Nr.diffAny=h,Nr}var RR;function MK(){if(RR)return Sn;RR=1;var e=Sn&&Sn.__extends||(function(){var C=function(T,R){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,_){E.__proto__=_}||function(E,_){for(var k in _)Object.prototype.hasOwnProperty.call(_,k)&&(E[k]=_[k])},C(T,R)};return function(T,R){if(typeof R!="function"&&R!==null)throw new TypeError("Class extends value "+String(R)+" is not a constructor or null");C(T,R);function E(){this.constructor=T}T.prototype=R===null?Object.create(R):(E.prototype=R.prototype,new E)}})();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=BP(),n=VP(),r=FP(),o=(function(C){e(T,C);function T(R){var E=C.call(this,"Value required at path: ".concat(R))||this;return E.path=R,E.name="MissingError",E}return T})(Error);Sn.MissingError=o;var s=(function(C){e(T,C);function T(R,E){var _=C.call(this,"Test failed: ".concat(R," != ").concat(E))||this;return _.actual=R,_.expected=E,_.name="TestError",_}return T})(Error);Sn.TestError=s;function c(C,T,R){if(Array.isArray(C))if(T=="-")C.push(R);else{var E=parseInt(T,10);C.splice(E,0,R)}else C[T]=R}function u(C,T){if(Array.isArray(C)){var R=parseInt(T,10);C.splice(R,1)}else delete C[T]}function f(C,T){var R=t.Pointer.fromJSON(T.path).evaluate(C);return R.parent===void 0?new o(T.path):(c(R.parent,R.key,(0,n.clone)(T.value)),null)}Sn.add=f;function h(C,T){var R=t.Pointer.fromJSON(T.path).evaluate(C);return R.value===void 0?new o(T.path):(u(R.parent,R.key),null)}Sn.remove=h;function m(C,T){var R=t.Pointer.fromJSON(T.path).evaluate(C);if(R.parent===null)return new o(T.path);if(Array.isArray(R.parent)){if(parseInt(R.key,10)>=R.parent.length)return new o(T.path)}else if(R.value===void 0)return new o(T.path);return R.parent[R.key]=(0,n.clone)(T.value),null}Sn.replace=m;function g(C,T){var R=t.Pointer.fromJSON(T.from).evaluate(C);if(R.value===void 0)return new o(T.from);var E=t.Pointer.fromJSON(T.path).evaluate(C);return E.parent===void 0?new o(T.path):(u(R.parent,R.key),c(E.parent,E.key,R.value),null)}Sn.move=g;function y(C,T){var R=t.Pointer.fromJSON(T.from).evaluate(C);if(R.value===void 0)return new o(T.from);var E=t.Pointer.fromJSON(T.path).evaluate(C);return E.parent===void 0?new o(T.path):(c(E.parent,E.key,(0,n.clone)(R.value)),null)}Sn.copy=y;function x(C,T){var R=t.Pointer.fromJSON(T.path).evaluate(C);return(0,r.diffAny)(R.value,T.value,new t.Pointer).length?new s(R.value,T.value):null}Sn.test=x;var S=(function(C){e(T,C);function T(R){var E=C.call(this,"Invalid operation: ".concat(R.op))||this;return E.operation=R,E.name="InvalidOperationError",E}return T})(Error);Sn.InvalidOperationError=S;function j(C,T){switch(T.op){case"add":return f(C,T);case"remove":return h(C,T);case"replace":return m(C,T);case"move":return g(C,T);case"copy":return y(C,T);case"test":return x(C,T)}return new S(T)}return Sn.apply=j,Sn}var _R;function LK(){return _R||(_R=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=BP();Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=MK(),r=FP();function o(h,m){return m.map(function(g){return(0,n.apply)(h,g)})}e.applyPatch=o;function s(h){function m(g,y,x){var S=h(g,y,x);return Array.isArray(S)?S:(0,r.diffAny)(g,y,x,m)}return m}function c(h,m,g){var y=new t.Pointer;return(g?s(g):r.diffAny)(h,m,y)}e.createPatch=c;function u(h,m){var g=t.Pointer.fromJSON(m).evaluate(h);if(g!==void 0)return{op:"test",path:m,value:g.value}}function f(h,m){var g=new Array;return m.filter(r.isDestructive).forEach(function(y){var x=u(h,y.path);if(x&&g.push(x),"from"in y){var S=u(h,y.from);S&&g.push(S)}}),g}e.createTests=f})(sx)),sx}var HP=LK();const IK="_removed_el5zk_1",zK="_added_el5zk_6",DR={removed:IK,added:zK};function $K(e){const{name:t,path:n,property:r,originalValue:o,revisedValue:s}=e,c=!!r?.type?.find(m=>m.code==="Attachment"),[u,f]=v.useState(c),h=()=>f(m=>!m);return a.jsx(a.Fragment,{children:c&&!u||!c?a.jsx(a.Fragment,{children:a.jsxs(te.Tr,{children:[a.jsx(te.Td,{children:t}),a.jsx(te.Td,{className:DR.removed,children:o&&a.jsx(uo,{path:n,property:r,propertyType:o.type,value:o.value,ignoreMissingValues:!0})}),a.jsx(te.Td,{className:DR.added,children:s&&a.jsx(uo,{path:n,property:r,propertyType:s.type,value:s.value,ignoreMissingValues:!0})})]})}):a.jsxs(te.Tr,{children:[a.jsx(te.Td,{children:t}),a.jsx(te.Td,{colSpan:2,style:{textAlign:"right"},children:a.jsx(Oe,{onClick:h,variant:"light",children:"Expand"})})]})})}const UK="_root_15xvr_1",BK={root:UK};function VK(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 u=[hi(n)],f=[hi(r)],h=[],m=FK(HP.createPatch(n,r));for(const g of m){const y=g.path,x=HK(y),S=qK(n.resourceType,x),j=g.op==="add"?void 0:js(x,u),C=g.op==="remove"?void 0:js(x,f);h.push({key:`op-${g.op}-${g.path}`,name:`${Qn(g.op)} ${x}`,path:S?.path??n.resourceType+"."+x,property:S,originalValue:AR(S,j),revisedValue:AR(S,C)})}return h},[o,n,r]);return c?a.jsxs(te,{className:BK.root,children:[a.jsx(te.Thead,{children:a.jsxs(te.Tr,{children:[a.jsx(te.Th,{}),a.jsx(te.Th,{children:"Before"}),a.jsx(te.Th,{children:"After"})]})}),a.jsx(te.Tbody,{children:c.map(u=>{const{key:f,...h}=u;return a.jsx($K,{...h},f)})})]}):null}function FK(e){const t=[];for(const n of e){const{op:r,path:o}=n;if(o.startsWith("/meta/author")||o.startsWith("/meta/compartment")||o.startsWith("/meta/lastUpdated")||o.startsWith("/meta/versionId"))continue;const s=e.filter(u=>u.op===r&&u.path===o).length,c={op:r,path:o};s>1&&(r==="add"||r==="remove")&&/\/[0-9-]+$/.test(o)&&(c.op="replace",c.path=o.replace(/\/[^/]+$/,"")),t.some(u=>u.op===c.op&&u.path===c.path)||t.push(c)}return t}function HK(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 qK(e,t){try{return Jm(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 AR(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:GK(t,!!e?.isArray)}}function GK(e,t){const n=OB(e).flatMap(r=>r.value);return t?n:n[0]}function JS(e){const{profileUrl:t}=e,n=Re(),r=n.getAccessPolicy(),o=Xt(e.value),[s,c]=v.useState(!1);v.useEffect(()=>{if(o)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{gu(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 u=v.useMemo(()=>o&&kk(o,pl.READ,r),[r,o]);return!s||!o?null:a.jsx(Yp,{path:o.resourceType,value:{type:o.resourceType,value:e.forceUseInput?e.value:o},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:u})}const WK="_item_5q6yx_1",QK="_itemPadding_5q6yx_5",kR={item:WK,itemPadding:QK};function YK(e){return a.jsx(xu,{children:e.children})}function Rl(e){const{resource:t,profile:n,padding:r,popupMenuItems:o,...s}=e,c=n??t.meta?.author,u=e.dateTime??t.meta?.lastUpdated;return a.jsxs(Bl,{"data-testid":"timeline-item",fill:!0,...s,children:[a.jsxs(xe,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[a.jsx(ho,{value:c,link:!0,size:"md"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(be,{size:"sm",children:a.jsx(Fl,{c:"inherit",fw:500,value:c,link:!0})}),a.jsxs(be,{size:"xs",children:[a.jsx(St,{c:"dimmed",to:e.resource,children:Dr(u)}),a.jsx(be,{component:"span",c:"dimmed",mx:8,children:"·"}),a.jsx(St,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&a.jsxs(we,{position:"bottom-end",shadow:"md",width:200,children:[a.jsx(we.Target,{children:a.jsx(Rn,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${zt(e.resource)}`,children:a.jsx(qq,{})})}),o]})]}),a.jsx(IS,{children:a.jsx("div",{className:Bt(kR.item,{[kR.itemPadding]:r}),children:e.children})})]})}function qP(e,t){e.sort((n,r)=>{const o=PR(n,t),s=PR(r,t);return o>s?1:o<s?-1:NR(n,t)-NR(r,t)})}function PR(e,t){if(!GP(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function NR(e,t){if(!GP(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 GP(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const KK="_pinnedComment_u08s5_1",XK={pinnedComment:KK};function fg(e){const t=Re(),n=t.getProfile(),r=v.useRef(null),o=Xt(e.value),[s,c]=v.useState(),[u,f]=v.useState([]),[h,m]=v.useState(10),g=e.loadTimelineResources,y=v.useRef(u);y.current=u;const x=v.useCallback(D=>{qP(D,o),D.reverse(),f(D)},[o]),S=v.useCallback(D=>{const P=[];for(const $ of D){if($.status!=="fulfilled")continue;const B=$.value;if(B.type==="history"&&c(B),B.entry)for(const W of B.entry)P.push(W.resource)}x(P)},[x]),j=v.useCallback(D=>x([...y.current,D]),[x]),C=v.useCallback(()=>{let D,P;"resourceType"in e.value?(D=e.value.resourceType,P=e.value.id):[D,P]=e.value.reference?.split("/"),g(t,D,P).then(S).catch(console.error)},[t,e.value,g,S]);v.useEffect(()=>C(),[C]);function T(D){!o||!e.createCommunication||t.createResource(e.createCommunication(o,n,D)).then(P=>j(P)).catch(console.error)}function R(D){!o||!e.createMedia||t.createResource(e.createMedia(o,n,D)).then(P=>j(P)).then(()=>ul({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:a.jsx(Yo,{size:16}),autoClose:2e3})).catch(P=>ul({id:"upload-notification",color:"red",title:"Upload error",message:Ge(P),icon:a.jsx(lR,{size:16}),autoClose:2e3}))}function E(){Ae({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function _(D){ul({id:"upload-notification",loading:!0,title:"Uploading...",message:iX(D),autoClose:!1,withCloseButton:!1})}function k(D){ul({id:"upload-notification",color:"red",title:"Upload error",message:Ge(D),icon:a.jsx(lR,{size:16}),autoClose:2e3})}if(!o)return a.jsx(Do,{style:{width:"100%",height:"100%"},children:a.jsx(_r,{})});const I=u.filter(D=>D).slice(0,h);return a.jsxs(YK,{children:[e.createCommunication&&a.jsx(Bl,{children:a.jsx(pt,{testid:"timeline-form",onSubmit:D=>{T(D.text);const P=r.current;P&&(P.value="",P.focus())},children:a.jsxs(xe,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[a.jsx(ho,{value:n}),a.jsx(He,{name:"text",ref:r,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),a.jsx(Rn,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:a.jsx(wG,{size:16})}),a.jsx(HS,{securityContext:Yt(o),onUpload:R,onUploadStart:E,onUploadProgress:_,onUploadError:k,children:D=>a.jsx(Rn,{...D,radius:"xl",color:"blue",variant:"filled",children:a.jsx(NS,{size:16})})})]})})}),I.map(D=>{const P=`${D.resourceType}/${D.id}/${D.meta?.versionId}`,$=e.getMenu?e.getMenu({primaryResource:o,currentResource:D,reloadTimeline:C}):void 0;if(D.resourceType===o.resourceType&&D.id===o.id)return a.jsx(JK,{history:s,resource:D,popupMenuItems:$},P);switch(D.resourceType){case"AuditEvent":return a.jsx(nX,{resource:D,popupMenuItems:$},P);case"Communication":return a.jsx(eX,{resource:D,popupMenuItems:$},P);case"DiagnosticReport":return a.jsx(rX,{resource:D,popupMenuItems:$},P);case"Media":return a.jsx(tX,{resource:D,popupMenuItems:$},P);default:return a.jsx(Rl,{resource:D,padding:!0,children:a.jsx(JS,{value:D,ignoreMissingValues:!0})},P)}}),h<u.length&&a.jsx(xe,{justify:"center",pb:"lg",children:a.jsx(Oe,{onClick:()=>m(h+10),children:"Show More"})})]})}function JK(e){const{history:t,resource:n,...r}=e,o=ZK(t,n);return o?a.jsx(Rl,{resource:n,padding:!0,...r,children:a.jsx(VK,{original:o,revised:e.resource})}):a.jsxs(Rl,{resource:n,padding:!0,...r,children:[a.jsx("h3",{children:"Created"}),a.jsx(JS,{value:n,ignoreMissingValues:!0,forceUseInput:!0})]})}function ZK(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 eX(e){const n=!e.resource.priority||e.resource.priority==="routine"?void 0:XK.pinnedComment;return a.jsx(Rl,{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 tX(e){const t=e.resource.content?.contentType,n=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return a.jsx(Rl,{resource:e.resource,padding:!!n,popupMenuItems:e.popupMenuItems,children:a.jsx(Tf,{value:e.resource.content})})}function nX(e){return a.jsx(Rl,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:a.jsx(Jr,{children:a.jsx("pre",{children:e.resource.outcomeDesc})})})}function rX(e){return a.jsx(Rl,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:a.jsx(XS,{value:e.resource})})}function iX(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${cx(e.loaded)} / ${cx(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${cx(e.loaded)}`}function cx(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 oX(e){const{resource:t,...n}=e;return a.jsx(fg,{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 aX(e){const{encounter:t,...n}=e;return a.jsx(fg,{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 sX(e){let t;try{t=TV(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(uo,{value:t[0]||"",propertyType:e.propertyType})}function lX(e){return a.jsxs(In,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[a.jsxs(le,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&a.jsx(OR,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&a.jsx(OR,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),a.jsx(be,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function OR(e){return a.jsx(Oe,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const cX={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]},uX={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 ZS(e,t){return{...e,filters:t,offset:0,name:void 0}}function WP(e,t){return ZS(e,(e.filters??[]).filter(n=>n.code!==t))}function hg(e,t,n,r,o){const s=[];return e.filters&&s.push(...e.filters),s.push({code:t,operator:n,value:r??""}),ZS(e,s)}function dX(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function fX(e,t){return e1(e,t,-1)}function hX(e,t){return e1(e,t,0)}function pX(e,t){return e1(e,t,1)}function e1(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),pg(e,t,r,o)}function mX(e,t){const n=new Date,r=new Date(n.getTime()+1440*60*1e3);return pg(e,t,n,r)}function gX(e,t){return t1(e,t,-1)}function vX(e,t){return t1(e,t,0)}function yX(e,t){return t1(e,t,1)}function t1(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),pg(e,t,r,o)}function xX(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),pg(e,t,n,new Date)}function pg(e,t,n,r){return e=WP(e,t),e=MR(e,t,he.GREATER_THAN_OR_EQUALS,n),e=MR(e,t,he.LESS_THAN_OR_EQUALS,r),e}function MR(e,t,n,r){return hg(e,t,n,r.toISOString())}function LR(e,t,n=!0){return hg(e,t,he.MISSING,n.toString())}function bX(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function SX(e,t){const n=e.count??Qm,r=(t-1)*n;return bX(e,r)}function wX(e,t,n){return t===jX(e)&&n!==void 0&&n===CX(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function jX(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function CX(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function EX(e){return cX[e.type]}function QP(e){return uX[e]??""}function _l(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 TX(e,t){const n=t.name;return n==="id"?a.jsx(St,{to:`/${e.resourceType}/${e.id}`,children:e.id}):n==="meta.versionId"?e.meta?.versionId:n==="_lastUpdated"?Dr(e.meta?.lastUpdated):`${e.resourceType}.${t.name}`===t.elementDefinition?.path?RX(e,t.elementDefinition):t.searchParams?.length===1&&t.name===t.searchParams[0].code?_X(e,t.searchParams[0]):null}function RX(e,t){const n=t.path?.split(".")?.pop()?.replaceAll("[x]","")??"",[r,o]=lg({type:e.resourceType,value:e},n);return r?a.jsx(uo,{path:t.path,property:t,propertyType:o,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function _X(e,t){const n=js(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:a.jsx(a.Fragment,{children:n.map((r,o)=>a.jsx(uo,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${n.length}`))})}function DX(e){const t=v.useRef(!1),[n,r]=v.useState({search:JSON.parse(co(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,h=rk(f),m=vS(f);return tu(AX(h,m)).map(g=>({value:g,label:_l(g)}))},[e.visible,e.search.resourceType]);function u(f){r({search:{...n.search,fields:f}})}return a.jsx(In,{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(Le,{children:[a.jsx(Mm,{style:{width:550},placeholder:"Select fields to display",data:c,value:n.search.fields??[],onChange:u,onDropdownOpen:()=>s(!0),onDropdownClose:()=>s(!1),maxDropdownHeight:"250px",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),a.jsx(xe,{justify:"flex-end",children:a.jsx(Oe,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function AX(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(_l(s));if(t)for(const s of Object.keys(t)){const c=_l(s);!r.has(s)&&!o.has(c)&&(n.push(s),r.add(s),o.add(c))}return n}function YP(e){const t=Jm(e.resourceType,e.searchParam),n=e.name??"filter-value";switch(t.type){case Cr.REFERENCE:return a.jsx(bs,{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 Cr.BOOLEAN:return a.jsx(cn,{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 Cr.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 Cr.DATETIME:return a.jsx(Lo,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case Cr.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 Cr.QUANTITY:return a.jsx(Tl,{name:n,path:"",defaultValue:kX(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 kX(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:Number.parseFloat(t),system:n,unit:r}}}function PX(e){const[t,n]=v.useState(pi(e.search)),r=v.useRef(t);r.current=t,v.useEffect(()=>{n(pi(e.search))},[e.search]);function o(f){n(hg(r.current,f.code,f.operator,f.value))}const s=e.search.resourceType,c=vS(s)??{},u=t.filters||[];return a.jsx(In,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:a.jsxs(pt,{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:u.map((f,h)=>a.jsx(NX,{id:`filter-${h}-row`,resourceType:s,searchParams:c,value:f,onChange:m=>{const g=[...u];g[h]=m,n(ZS(r.current,g))},onDelete:()=>n(dX(r.current,h))},`filter-${h}-row`))})]}),a.jsx(ug,{propertyDisplayName:"Filter",onClick:()=>o({})})]}),a.jsx(xe,{justify:"flex-end",mt:"xl",children:a.jsx(dr,{children:"OK"})})]})})}function NX(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],u=c&&EX(c);return a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(dn,{"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:_l(f)}))]})}),a.jsx("td",{children:u&&a.jsx(dn,{"data-testid":`${e.id}-filter-operation`,defaultValue:t.operator,onChange:f=>o(f.currentTarget.value),data:["",...u.map(f=>({value:f,label:QP(f)}))]},`${e.id}-filter-value-${e.value.code}`)}),a.jsx("td",{children:c&&t.operator&&a.jsx(YP,{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(Rn,{variant:"outline",color:"red",radius:"xl","aria-label":"Delete filter",onClick:e.onDelete,children:a.jsx(El,{style:{width:"70%",height:"70%"},stroke:1.5})})})]})}function OX(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(In,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:a.jsx(pt,{onSubmit:r,children:a.jsxs(kn,{children:[a.jsx(kn.Col,{span:10,children:a.jsx(YP,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),a.jsx(kn.Col,{span:2,children:a.jsx(Oe,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function MX(e){const{resourceType:t,filter:n}=e,r=Uo.types[t].searchParams?.[n.code];if(r){if(r.type==="reference"&&(n.operator===he.EQUALS||n.operator===he.NOT_EQUALS))return a.jsx(Fl,{value:{reference:n.value}});const o=Jm(t,r);if(n.code==="_lastUpdated"||o.type===Cr.DATETIME)return a.jsx(a.Fragment,{children:Dr(n.value)})}return a.jsx(a.Fragment,{children:n.value})}function LX(e){if(!e.searchParams)return null;function t(s,c){o(wX(e.search,s.code,c))}function n(s){o(WP(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(IX,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:o,onClear:n}):a.jsx(we.Dropdown,{children:e.searchParams.map(s=>a.jsx(we.Item,{children:_l(s.code)},s.code))})}function IX(e){switch(e.searchParam.type){case"date":return a.jsx(zX,{...e});case"number":case"quantity":return a.jsx($X,{...e});case"reference":return a.jsx(UX,{...e});case"string":return a.jsx(BX,{...e});case"token":case"uri":return a.jsx(VX,{...e});default:return a.jsxs(a.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function zX(e){const{searchParam:t}=e,n=t.code;return a.jsxs(we.Dropdown,{children:[a.jsx(we.Item,{leftSection:a.jsx(MS,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),a.jsx(we.Item,{leftSection:a.jsx(LS,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(jf,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Equals..."}),a.jsx(we.Item,{leftSection:a.jsx(wf,{size:14}),onClick:()=>e.onPrompt(t,he.NOT_EQUALS),children:"Does not equal..."}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(iP,{size:14}),onClick:()=>e.onPrompt(t,he.ENDS_BEFORE),children:"Before..."}),a.jsx(we.Item,{leftSection:a.jsx(rP,{size:14}),onClick:()=>e.onPrompt(t,he.STARTS_AFTER),children:"After..."}),a.jsx(we.Item,{leftSection:a.jsx(pq,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Between..."}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(cs,{size:14}),onClick:()=>e.onChange(pX(e.search,n)),children:"Tomorrow"}),a.jsx(we.Item,{leftSection:a.jsx(cs,{size:14}),onClick:()=>e.onChange(hX(e.search,n)),children:"Today"}),a.jsx(we.Item,{leftSection:a.jsx(cs,{size:14}),onClick:()=>e.onChange(fX(e.search,n)),children:"Yesterday"}),a.jsx(we.Item,{leftSection:a.jsx(cs,{size:14}),onClick:()=>e.onChange(mX(e.search,n)),children:"Next 24 Hours"}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(cs,{size:14}),onClick:()=>e.onChange(yX(e.search,n)),children:"Next Month"}),a.jsx(we.Item,{leftSection:a.jsx(cs,{size:14}),onClick:()=>e.onChange(vX(e.search,n)),children:"This Month"}),a.jsx(we.Item,{leftSection:a.jsx(cs,{size:14}),onClick:()=>e.onChange(gX(e.search,n)),children:"Last Month"}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(cs,{size:14}),onClick:()=>e.onChange(xX(e.search,n)),children:"Year to date"}),a.jsx(Df,{...e})]})}function $X(e){const{searchParam:t}=e;return a.jsxs(we.Dropdown,{children:[a.jsx(we.Item,{leftSection:a.jsx(MS,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),a.jsx(we.Item,{leftSection:a.jsx(LS,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(jf,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Equals..."}),a.jsx(we.Item,{leftSection:a.jsx(wf,{size:14}),onClick:()=>e.onPrompt(t,he.NOT_EQUALS),children:"Does not equal..."}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(rP,{size:14}),onClick:()=>e.onPrompt(t,he.GREATER_THAN),children:"Greater than..."}),a.jsx(we.Item,{leftSection:a.jsx(tb,{size:14}),onClick:()=>e.onPrompt(t,he.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),a.jsx(we.Item,{leftSection:a.jsx(iP,{size:14}),onClick:()=>e.onPrompt(t,he.LESS_THAN),children:"Less than..."}),a.jsx(we.Item,{leftSection:a.jsx(tb,{size:14}),onClick:()=>e.onPrompt(t,he.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),a.jsx(Df,{...e})]})}function UX(e){const{searchParam:t}=e;return a.jsxs(we.Dropdown,{children:[a.jsx(we.Item,{leftSection:a.jsx(jf,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Equals..."}),a.jsx(we.Item,{leftSection:a.jsx(wf,{size:14}),onClick:()=>e.onPrompt(t,he.NOT),children:"Does not equal..."}),a.jsx(Df,{...e})]})}function BX(e){const{searchParam:t}=e;return a.jsxs(we.Dropdown,{children:[a.jsx(we.Item,{leftSection:a.jsx(MS,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),a.jsx(we.Item,{leftSection:a.jsx(LS,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(jf,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Equals..."}),a.jsx(we.Item,{leftSection:a.jsx(wf,{size:14}),onClick:()=>e.onPrompt(t,he.NOT),children:"Does not equal..."}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(wq,{size:14}),onClick:()=>e.onPrompt(t,he.CONTAINS),children:"Contains..."}),a.jsx(we.Item,{leftSection:a.jsx(bq,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Does not contain..."}),a.jsx(Df,{...e})]})}function VX(e){const{searchParam:t}=e;return a.jsxs(we.Dropdown,{children:[a.jsx(we.Item,{leftSection:a.jsx(jf,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Equals..."}),a.jsx(we.Item,{leftSection:a.jsx(wf,{size:14}),onClick:()=>e.onPrompt(t,he.NOT),children:"Does not equal..."}),a.jsx(Df,{...e})]})}function Df(e){const{searchParam:t}=e,n=t.code;return a.jsxs(a.Fragment,{children:[a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(lq,{size:14}),onClick:()=>e.onChange(LR(e.search,n)),children:"Missing"}),a.jsx(we.Item,{leftSection:a.jsx(aq,{size:14}),onClick:()=>e.onChange(LR(e.search,n,!1)),children:"Not missing"}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(El,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}function KP(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 FX="_root_vlout_1",HX="_table_vlout_8",qX="_tr_vlout_12",GX="_control_vlout_22",WX="_icon_vlout_31",pd={root:FX,table:HX,tr:qX,control:GX,icon:WX};function QX(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(YX(t,r));return n}function YX(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=ks(e,t),r=KB(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const o=vS(e);let s;if(o){const c=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);s=Object.values(o).filter(u=>!!u.expression&&c.test(u?.expression)),s.length===0&&(s=void 0)}return{name:t,elementDefinition:n,searchParams:s}}if(r){const o=Jm(e,r);return{name:t,elementDefinition:o.elementDefinitions?.[0],searchParams:[r]}}return{name:t}}class KX extends Event{definition;constructor(t){super("change"),this.definition=t}}class XX extends Event{response;constructor(t){super("load"),this.response=t}}class Kp extends Event{resource;browserEvent;constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function bu(e){const t=Re(),[n,r]=v.useState(),{search:o,onLoad:s}=e,[c,u]=v.useState(o);$o(o,c)||u(o);const[f,h]=v.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),m=v.useRef(f);m.current=f;const g=c.total??"accurate",y=v.useCallback(U=>{r(void 0),t.requestSchema(c.resourceType).then(()=>t.search(c.resourceType,ys({...c,total:g,fields:void 0}),U)).then(G=>{h({...m.current,searchResponse:G}),s&&s(new XX(G))}).catch(G=>{h({...m.current,searchResponse:void 0}),r(Wt(G))})},[t,c,g,s]),x=v.useCallback(()=>{h({...m.current,searchResponse:void 0}),y({cache:"reload"})},[y]);v.useEffect(()=>{y()},[y]);function S(U,G){U.stopPropagation();const L=U.target.checked,z={...m.current.selected};L?z[G]=!0:delete z[G],h({...m.current,selected:z})}function j(U){U.stopPropagation();const M=U.target.checked,L={},z=m.current.searchResponse;M&&z?.entry&&z.entry.forEach(V=>{V.resource?.id&&(L[V.resource.id]=!0)}),h({...m.current,selected:L})}function C(){const U=m.current;if(!U.searchResponse?.entry||U.searchResponse.entry.length===0)return!1;for(const G of U.searchResponse.entry)if(G.resource?.id&&!U.selected[G.resource.id])return!1;return!0}function T(U){e.onChange&&e.onChange(new KX(U))}function R(U,G){if(aP(U.target)||U.button===2)return;yn(U);const M=zS(U);!M&&e.onClick&&e.onClick(new Kp(G,U)),M&&e.onAuxClick&&e.onAuxClick(new Kp(G,U))}function E(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(n)return a.jsx(fr,{outcome:n});if(!nk(c.resourceType))return a.jsx(Do,{style:{width:"100%",height:"100%"},children:a.jsx(_r,{})});const _=e.checkboxesEnabled,k=QX(c),I=c.resourceType,D=f.searchResponse,$=D?.entry?.map(U=>U.resource),B="subtle",W="gray",Y=16,Z=window.innerWidth<768;return a.jsxs("div",{className:pd.root,"data-testid":"search-control",children:[!e.hideToolbar&&a.jsxs(xe,{justify:"space-between",mb:"xl",children:[a.jsxs(xe,{gap:2,children:[a.jsx(Oe,{size:"compact-md",variant:B,color:W,leftSection:a.jsx(Lq,{size:Y}),onClick:()=>h({...m.current,fieldEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Fields"}),a.jsx(Oe,{size:"compact-md",variant:B,color:W,leftSection:a.jsx(rG,{size:Y}),onClick:()=>h({...m.current,filterEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Filters"}),e.onNew&&a.jsx(Oe,{size:"compact-md",variant:B,color:W,leftSection:a.jsx(tG,{size:Y}),onClick:e.onNew,children:"New..."}),!Z&&E()&&a.jsx(Oe,{size:"compact-md",variant:B,color:W,leftSection:a.jsx(oW,{size:Y}),onClick:e.onExport?e.onExport:()=>h({...m.current,exportDialogVisible:!0,dialogOpenTime:Date.now()}),children:"Export..."}),!Z&&e.onDelete&&a.jsx(Oe,{size:"compact-md",variant:B,color:W,leftSection:a.jsx(tg,{size:Y}),onClick:()=>e.onDelete(Object.keys(f.selected)),children:"Delete..."}),!Z&&e.onBulk&&a.jsx(Oe,{size:"compact-md",variant:B,color:W,leftSection:a.jsx(fq,{size:Y}),onClick:()=>e.onBulk(Object.keys(f.selected)),children:"Bulk..."})]}),a.jsxs(xe,{gap:2,children:[D&&a.jsxs(be,{size:"xs",c:"dimmed","data-testid":"count-display",children:[XP(c,D).toLocaleString(),"-",tJ(c,D).toLocaleString(),D.total!==void 0&&` of ${c.total==="estimate"?"~":""}${D.total?.toLocaleString()}`]}),a.jsx(Rn,{variant:B,color:W,title:"Refresh",onClick:x,children:a.jsx(oP,{size:Y})})]})]}),a.jsxs(te,{className:pd.table,children:[a.jsxs(te.Thead,{children:[a.jsxs(te.Tr,{children:[_&&a.jsx(te.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(te.Th,{children:a.jsxs(we,{shadow:"md",width:240,position:"bottom-end",children:[a.jsx(we.Target,{children:a.jsx(Pn,{className:pd.control,p:2,children:a.jsxs(xe,{justify:"space-between",wrap:"nowrap",children:[a.jsx(be,{fw:500,children:_l(U.name)}),a.jsx(Do,{className:pd.icon,children:a.jsx(ZH,{size:14,stroke:1.5})})]})})}),a.jsx(LX,{search:c,searchParams:U.searchParams,onPrompt:(G,M)=>{h({...m.current,filterDialogVisible:!0,filterDialogSearchParam:G,filterDialogFilter:M,dialogOpenTime:Date.now()})},onChange:G=>{T(G)}})]})},U.name))]}),!e.hideFilters&&a.jsxs(te.Tr,{children:[_&&a.jsx(te.Th,{}),k.map(U=>a.jsx(te.Th,{children:U.searchParams&&a.jsx(JX,{resourceType:I,searchParams:U.searchParams,filters:c.filters})},U.name))]})]}),a.jsx(te.Tbody,{children:$?.map(U=>U&&a.jsxs(te.Tr,{className:pd.tr,"data-testid":"search-control-row",onClick:G=>R(G,U),onAuxClick:G=>R(G,U),children:[_&&a.jsx(te.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:G=>S(G,U.id)})}),k.map(G=>a.jsx(te.Td,{children:TX(U,G)},G.name))]},U.id))})]}),!$?.length&&a.jsx(xu,{children:a.jsx(Do,{style:{height:150},children:a.jsx(be,{size:"xl",c:"dimmed",children:"No results"})})}),D&&a.jsx(Do,{m:"md",p:"md",children:a.jsx(Bi,{value:ZX(c),total:eJ(c,D),onChange:U=>T(SX(c,U)),getControlProps:KP})}),a.jsx(DX,{search:c,visible:m.current.fieldEditorVisible,onOk:U=>{T(U),h({...m.current,fieldEditorVisible:!1})},onCancel:()=>{h({...m.current,fieldEditorVisible:!1})}},`search-field-editor-${f.dialogOpenTime}`),a.jsx(PX,{search:c,visible:m.current.filterEditorVisible,onOk:U=>{T(U),h({...m.current,filterEditorVisible:!1})},onCancel:()=>{h({...m.current,filterEditorVisible:!1})}},`search-filter-editor-${f.dialogOpenTime}`),a.jsx(lX,{visible:m.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{h({...m.current,exportDialogVisible:!1})}},`search-export-dialog-${f.dialogOpenTime}`),a.jsx(OX,{visible:m.current.filterDialogVisible,title:f.filterDialogSearchParam?.code?_l(f.filterDialogSearchParam.code):"",resourceType:I,searchParam:f.filterDialogSearchParam,filter:f.filterDialogFilter,defaultValue:"",onOk:U=>{T(hg(c,U.code,U.operator,U.value)),h({...m.current,filterDialogVisible:!1})},onCancel:()=>{h({...m.current,filterDialogVisible:!1})}},`search-filter-dialog-${f.dialogOpenTime}`)]})}function JX(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:[QP(n.operator)," ",a.jsx(MX,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function ZX(e){return Math.floor((e.offset??0)/(e.count??Qm))+1}function eJ(e,t){const n=e.count??Qm,r=JP(e,t);return Math.ceil(r/n)}function XP(e,t){return Math.min(JP(e,t),(e.offset??0)+1)}function tJ(e,t){return Math.max(XP(e,t)+(t.entry?.length??0)-1,0)}function JP(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 nJ(e){const t=Re(),[n,r]=v.useState(!1),[o,s]=v.useState(),{query:c,fields:u}=e,[f,h]=v.useState(),[m,g]=v.useState({}),y=v.useRef(f);y.current=f;const x=v.useRef({});x.current=m,v.useEffect(()=>{s(void 0),t.graphql(c).then(h).catch(E=>s(Wt(E)))},[t,c]);function S(E,_){E.stopPropagation();const I=E.target.checked,D={...x.current};I?D[_]=!0:delete D[_],g(D)}function j(E){E.stopPropagation();const k=E.target.checked,I={},D=y.current?.data.ResourceList;k&&D&&D.forEach(P=>{P.id&&(I[P.id]=!0)}),g(I)}function C(){const E=y.current?.data.ResourceList;if(!E||E.length===0)return!1;for(const _ of E)if(_.id&&!x.current[_.id])return!1;return!0}function T(E,_){aP(E.target)||(yn(E),E.button!==1&&e.onClick&&e.onClick(new Kp(_,E)),E.button===1&&e.onAuxClick&&e.onAuxClick(new Kp(_,E)))}if(v.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return a.jsx(_r,{});const R=e.checkboxesEnabled;return a.jsxs("div",{onContextMenu:E=>yn(E),"data-testid":"search-control",children:[a.jsxs(te,{children:[a.jsx(te.Thead,{children:a.jsxs(te.Tr,{children:[R&&a.jsx(te.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:E=>j(E)})}),u.map(E=>a.jsx(te.Th,{children:E.name},E.name))]})}),a.jsx(te.Tbody,{children:f?.data.ResourceList.map(E=>E&&a.jsxs(te.Tr,{"data-testid":"search-control-row",onClick:_=>T(_,E),onAuxClick:_=>T(_,E),children:[R&&a.jsx(te.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${E.id}`,checked:!!m[E.id],onChange:_=>S(_,E.id)})}),u.map(_=>a.jsx(te.Td,{children:a.jsx(sX,{propertyType:_.propertyType,path:_.fhirPath,resource:E})},_.name))]},E.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(Oe,{onClick:()=>e.onBulk(Object.keys(x.current)),children:"Bulk..."})]})}const rJ=v.memo(nJ),iJ="_root_1fbwr_1",oJ="_entry_1fbwr_8",aJ="_key_1fbwr_13",sJ="_value_1fbwr_20",mg={root:iJ,entry:oJ,key:aJ,value:sJ};function yt(e){return a.jsx(Jr,{children:a.jsx("div",{className:mg.root,children:e.children})})}yt.Entry=function(t){return a.jsx("div",{className:mg.entry,children:t.children})};yt.Key=function(t){return a.jsx("div",{className:mg.key,children:t.children})};yt.Value=function(t){return a.jsx("div",{className:mg.value,children:t.children})};const lJ="_list_y4z6g_1",cJ="_link_y4z6g_6",IR={list:lJ,link:cJ};function Af(e){const{baseUrl:t,tabs:n,children:r,...o}=e,s=uJ(n),c=vu(),[u,f]=v.useState(()=>{const m=nr.getPathname().split("/").pop();return m&&s.some(g=>g.value===m)?m:s[0].value});function h(m){m=m||s[0].value,f(m),c(`${t}/${m}`)}return a.jsxs(jn,{value:u.toLowerCase(),onChange:h,...o,children:[a.jsx(jn.List,{className:IR.list,children:s.map(m=>a.jsx(jn.Tab,{value:m.value,children:a.jsx(Et,{className:IR.link,href:`${t}/${m.value}`,onClick:dJ,children:m.label})},m.value))}),r]})}function uJ(e){return e.map(t=>gk(t)?{label:t,value:t.toLowerCase()}:t)}function dJ(e){zS(e)||e.preventDefault()}function fJ(e){const{group:t}=e;return a.jsx(Mr,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:a.jsxs(xe,{children:[t.measureScore&&a.jsx(mJ,{group:t}),!t.measureScore&&a.jsx(pJ,{group:t})]})})}function hJ(e){const{measure:t}=e;return a.jsxs(a.Fragment,{children:[a.jsx(be,{fz:"md",fw:500,mb:8,children:t.title}),a.jsx(be,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function pJ(e){const{group:t}=e,n=t.population,r=n?.find(f=>ws(f.code)==="numerator"),o=n?.find(f=>ws(f.code)==="denominator"),s=r?.count,c=o?.count;if(c===0)return a.jsxs(le,{children:[a.jsx(Ve,{order:3,children:"Not Applicable"}),a.jsx(be,{children:`Denominator: ${c}`})]});if(s===void 0||c===void 0)return a.jsxs(le,{children:[a.jsx(Ve,{order:3,children:"Insufficient Data"}),a.jsx(be,{children:`Numerator: ${s}`}),a.jsx(be,{children:`Denominator: ${c}`})]});const u=s/c*100;return a.jsx(Vm,{size:120,thickness:12,roundCaps:!0,sections:[{value:u,color:ZP(u)}],label:a.jsx(or,{justify:"center",children:a.jsxs(be,{fw:700,fz:18,children:[s," / ",c]})})})}function mJ(e){const{group:t}=e,n=t.measureScore?.unit??t.measureScore?.code;return a.jsx(a.Fragment,{children:n==="%"?a.jsx(Vm,{size:120,thickness:12,roundCaps:!0,sections:[{value:gJ(t),color:ZP(t?.measureScore?.value??0)}],label:a.jsx(or,{justify:"center",children:a.jsx(be,{fw:700,fz:18,children:a.jsx(qd,{value:t.measureScore})})})}):a.jsx(or,{h:120,align:"center",children:a.jsx(Ve,{order:3,children:a.jsx(qd,{value:t.measureScore})})})})}function gJ(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 vJ(e){const t=Xt(e.measureReport),[n]=qH("Measure",{url:t?.measure});return t?a.jsxs(le,{children:[n&&a.jsx(hJ,{measure:n}),a.jsx(Fm,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:t.group?.map((r,o)=>a.jsx(fJ,{group:r},r.id??o))})]}):null}const ux="patient-export",dx="Patient Export",yJ={everything:{operation:"$everything",extension:"json",contentType:tn.FHIR_JSON},summary:{operation:"$summary",extension:"json",contentType:tn.FHIR_JSON},ccda:{operation:"$ccda-export",extension:"xml",contentType:tn.CDA_XML},ccdaReferral:{operation:"$ccda-export",type:"referral",extension:"xml",contentType:tn.CDA_XML}};function xJ(e){const t=Re(),{patient:n}=e,r=v.useCallback(async o=>{const s=Sl(n),c=o.format,{operation:u,type:f,contentType:h,extension:m}=yJ[c],g=t.fhirUrl("Patient",s,u),y={};f&&(y.type=f),o.author&&(y.author={reference:o.author}),o.authoredOn&&(y.authoredOn=GS(o.authoredOn)),o.startDate&&(y.start=o.startDate),o.endDate&&(y.end=o.endDate),Ni.show({id:ux,title:dx,loading:!0,message:"Exporting...",autoClose:!1,withCloseButton:!1});try{const x=await t.post(g,y,void 0,{cache:"no-cache",headers:{Accept:h}}),S=`Patient-export-${s}-${new Date().toISOString().replaceAll(":","-")}.${m}`;bJ(x,S,h),Ni.update({id:ux,title:dx,color:"green",message:"Done",icon:a.jsx(Yo,{size:"1rem"}),loading:!1,autoClose:!0,withCloseButton:!0})}catch(x){Ni.update({id:ux,title:dx,color:"red",message:Ge(x),icon:a.jsx(El,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}},[t,n]);return a.jsx(pt,{onSubmit:r,children:a.jsxs(Le,{children:[a.jsx(Ut,{title:"Export Format",description:"Required",withAsterisk:!0,children:a.jsx(Zc,{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(Ut,{title:"Author",description:"Optional author for composition. Default value is current user.",children:a.jsx(bs,{name:"author",placeholder:"Author",targetTypes:["Organization","Practitioner","PractitionerRole"]})}),a.jsx(Ut,{title:"Authored On",description:"Optional date for composition authored on. Default value is current date.",children:a.jsx(Lo,{name:"authoredOn",placeholder:"Authored on"})}),a.jsx(Ut,{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(Lo,{name:"startDate",placeholder:"Start date"})}),a.jsx(Ut,{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(Lo,{name:"endDate",placeholder:"End date"})}),a.jsx(xe,{justify:"right",children:a.jsx(dr,{children:"Request Export"})})]})})}function bJ(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 SJ(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function eN(e){const t=Xt(e.patient);return t?a.jsxs(yt,{children:[a.jsx(ho,{value:t,size:"lg",color:SJ(t)}),a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Name"}),a.jsx(yt.Value,{children:a.jsx(St,{to:t,fw:500,children:t.name?a.jsx($S,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&a.jsxs(a.Fragment,{children:[a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"DoB"}),a.jsx(yt.Value,{children:t.birthDate})]}),a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Age"}),a.jsx(yt.Value,{children:wB(t.birthDate)})]})]}),t.gender&&a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Gender"}),a.jsx(yt.Value,{children:t.gender})]}),t.address&&a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"State"}),a.jsx(yt.Value,{children:t.address[0]?.state})]}),t.identifier?.map(n=>a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:n?.system}),a.jsx(yt.Value,{children:n?.value})]},`${n?.system}-${n?.value}`))]}):null}function wJ(e){const{patient:t,...n}=e,r=v.useCallback((o,s,c)=>{const u=`${s}/${c}`,f=100;return Promise.allSettled([o.readHistory("Patient",c),o.search("Communication",{subject:u,_count:f}),o.search("Device",{patient:u,_count:f}),o.search("DeviceRequest",{patient:u,_count:f}),o.search("DiagnosticReport",{subject:u,_count:f}),o.search("Media",{subject:u,_count:f}),o.search("ServiceRequest",{subject:u,_count:f}),o.search("Task",{subject:u,_count:f})])},[]);return a.jsx(fg,{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 jJ="_section_pqpwm_1",CJ="_hovering_pqpwm_7",rb={section:jJ,hovering:CJ};function EJ(e){const t=Re(),n=Xt(e.value),[r,o]=v.useState(!1),[s,c]=v.useState(),[u,f]=v.useState(),[h,m]=v.useState();function g(){f(void 0)}function y(){c(void 0)}const x=v.useRef(h);if(x.current=h,v.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>o(!0)).catch(console.log)},[t]),v.useEffect(()=>(m(AJ(n??{resourceType:"PlanDefinition",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",y),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",y)}),[n]),!r||!h)return null;function S(j,C){m({...x.current,[j]:C})}return a.jsx("div",{children:a.jsxs(pt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(h),children:[a.jsx(He,{label:"Plan Title",py:"md",defaultValue:h.title,onChange:j=>S("title",j.currentTarget.value)}),a.jsx(TJ,{actions:h.action||[],selectedKey:s,setSelectedKey:c,hoverKey:u,setHoverKey:f,onChange:j=>S("action",j)}),a.jsx(dr,{children:"Save"})]})})}function TJ(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(Le,{gap:"md",className:rb.section,children:[e.actions.map(s=>a.jsx(RJ,{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(Oe,{variant:"outline",onClick:s=>{yn(s),r({id:tN()})},children:"Add action"})})]})}function RJ(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(_J,{action:t,onChange:e.onChange,selectedKey:e.selectedKey,hoverKey:e.hoverKey,onRemove:e.onRemove})})}function _J(e){const{action:t}=e,[n,r]=v.useState(),o=Re(),[s,c]=v.useState(!1),[u,f]=v.useState(),h=e.selectedKey===e.action.id,m=e.hoverKey===e.action.id;function g(x,S){e.onChange({...t,[x]:S})}const y=Bt(rb.section,{[rb.hovering]:m&&!h});return v.useEffect(()=>{(async()=>{if(!t.definitionCanonical)return;c(!0);const S=await o.readCanonical(["Questionnaire","ActivityDefinition"],t.definitionCanonical);r(DJ(S)),f(S),c(!1)})().catch(console.error)},[t.definitionCanonical,o]),s?a.jsx(_r,{}):a.jsxs(Mr,{"data-testid":t.id,className:y,p:0,radius:"sm",withBorder:!0,children:[a.jsxs(or,{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:x=>g("title",x.currentTarget.value)}),a.jsx(Rs,{"data-testid":"close-button",onClick:e.onRemove})]}),h&&a.jsxs(Le,{gap:"xl",p:"md",children:[a.jsx(le,{children:a.jsx(He,{label:"Task Description",placeholder:"Enter task description",name:`actionDescription-${t.id}`,defaultValue:t.description,onChange:x=>g("description",x.currentTarget.value)})}),a.jsx(le,{children:a.jsx(dn,{label:"Type of Action",value:n,onChange:x=>{const S=x.currentTarget.value==="standard"?void 0:x.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(Le,{gap:0,children:[a.jsxs(xe,{gap:0,mb:"xs",children:[a.jsx(be,{fw:600,children:"Select questionnaire"}),a.jsx(be,{c:"red",children:"*"})]}),a.jsxs(be,{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(Et,{href:"/Questionnaire",target:"_blank",c:"blue",children:"questionnaires list"})]}),a.jsx(zR,{resource:u,resourceType:"Questionnaire",action:t,onChange:e.onChange,placeholder:"Search for questionnaire"})]}),n==="activitydefinition"&&a.jsxs(Le,{gap:0,children:[a.jsxs(xe,{gap:0,mb:"xs",children:[a.jsx(be,{fw:600,children:"Select activity definition"}),a.jsx(be,{c:"red",children:"*"})]}),a.jsxs(be,{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(Et,{href:"/ActivityDefinition",target:"_blank",c:"blue",children:"activity definitions list"})]}),a.jsx(zR,{resource:u,resourceType:"ActivityDefinition",action:t,onChange:e.onChange,placeholder:"Search for activity definition"})]})]})]})}function zR(e){const{id:t}=e.action,{resource:n}=e;return a.jsx(Vl,{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:zt(r)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function DJ(e){return e===void 0?"standard":e.resourceType.toLowerCase()}let fx=1;function tN(e){if(e){if(e.startsWith("id-")){const t=Number.parseInt(e.substring(3),10);Number.isNaN(t)||(fx=Math.max(fx,t+1))}return e}return"id-"+fx++}function AJ(e){return{...e,action:nN(e.action)}}function nN(e){if(e)return e.map(t=>({...t,id:tN(t.id),action:nN(t.action)}))}const vl=30,Xp=50;function Jp(e){const t=e.formState,n=e.item,r=e.responseItem;function o(x){if(t&&e.context)if(n.repeats&&e.index!==void 0&&n.type!==vt.choice&&n.type!==vt.openChoice){const C=[...r.answer||[]];x.length===0?C.splice(e.index,1):C[e.index]=x[0],t.onChangeAnswer(e.context,e.item,C)}else t.onChangeAnswer(e.context,e.item,x)}const s=n.type;if(!s)return null;const c=n.linkId;if(!c)return null;const f=n.repeats&&e.index!==void 0&&n.type!==vt.choice&&n.type!==vt.openChoice?`${c}-${e.index}`:c;let h;n.initial&&n.initial.length>0?h=n.initial[0]:n.answerOption&&n.answerOption.length>0&&(h=n.answerOption.find(x=>x.initialSelected));const m=r1(r,e.index)??AS(h),g=Wo(r,`${fo}/fhir/StructureDefinition/questionnaire-validationError`);let y=null;switch(s){case vt.display:y=a.jsx("p",{children:e.item.text},e.item.linkId);break;case vt.boolean:y=a.jsx(MP,{title:e.item.text,htmlFor:f,children:a.jsx(cn,{id:f,name:c,required:e.required??n.required,defaultChecked:m?.value,onChange:x=>o([{valueBoolean:x.currentTarget.checked}])})},e.item.linkId);break;case vt.decimal:y=a.jsx(He,{type:"number",step:"any",id:f,name:c,required:e.required??n.required,defaultValue:m?.value,onChange:x=>o(x.currentTarget.value===""?[]:[{valueDecimal:x.currentTarget.valueAsNumber}])});break;case vt.integer:y=a.jsx(He,{type:"number",step:1,id:f,name:c,required:e.required??n.required,defaultValue:m?.value,onChange:x=>o(x.currentTarget.value===""?[]:[{valueInteger:x.currentTarget.valueAsNumber}])});break;case vt.date:y=a.jsx(He,{type:"date",id:f,name:c,required:e.required??n.required,defaultValue:m?.value,onChange:x=>o([{valueDate:x.currentTarget.value}])});break;case vt.dateTime:y=a.jsx(Lo,{name:c,required:e.required??n.required,defaultValue:m?.value,onChange:x=>o([{valueDateTime:x}])});break;case vt.time:y=a.jsx(He,{type:"time",id:f,name:c,required:e.required??n.required,defaultValue:m?.value,onChange:x=>o([{valueTime:x.currentTarget.value}])});break;case vt.string:case vt.url:y=a.jsx(He,{id:f,name:c,required:e.required??n.required,defaultValue:m?.value,onChange:x=>{const S=x.currentTarget.value;o(S===""?[]:[{valueString:S}])}});break;case vt.text:y=a.jsx(zl,{id:f,name:c,required:e.required??n.required,defaultValue:m?.value,onChange:x=>{const S=x.currentTarget.value;o(S===""?[]:[{valueString:S}])}});break;case vt.attachment:y=a.jsx(xe,{py:4,children:a.jsx(xP,{path:"",name:f,defaultValue:m?.value,onChange:x=>o([{valueAttachment:x}])})});break;case vt.reference:y=a.jsx(bs,{name:f,required:e.required??n.required,targetTypes:Yk(n),searchCriteria:MH(n,t?.subject,t?.encounter),defaultValue:m?.value,onChange:x=>o([{valueReference:x}])});break;case vt.quantity:y=a.jsx(Tl,{path:"",name:f,required:e.required??n.required,defaultValue:m?.value,onChange:x=>o([{valueQuantity:x}]),disableWheel:!0});break;case vt.choice:case vt.openChoice:IJ(n)?y=a.jsx(OJ,{name:f,item:n,required:e.required??n.required,initial:h,response:r,onChangeAnswer:x=>o(x)}):LJ(n)||n.answerValueSet&&!zJ(n)?y=a.jsx(kJ,{name:f,item:n,required:e.required??n.required,initial:h,response:r,onChangeAnswer:x=>o(x)}):y=a.jsx(NJ,{name:f,item:n,required:e.required??n.required,initial:h,response:r,onChangeAnswer:x=>o(x)});break;default:return null}return a.jsxs(a.Fragment,{children:[y,g?.valueString&&a.jsx(be,{c:"red",size:"lg",mt:4,children:g.valueString})]})}function kJ(e){const{name:t,item:n,required:r,initial:o,onChangeAnswer:s,response:c}=e;if(!n.answerOption?.length&&!n.answerValueSet)return a.jsx(n1,{});const u=AS(o),f=r1(c)??u,h=oN(c),m=n.repeats||$J(n);if(n.answerValueSet)return a.jsx(Ef,{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}=UJ(n);return a.jsx(Mm,{data:y,placeholder:"Select items",searchable:!0,defaultValue:h||[wl(u)],required:r,onChange:x=>{if(x.length===0)s([{}]);else{const S=Wk(x,g,n);s(S)}}})}else{const g=[""];if(n.answerOption)for(const y of n.answerOption){const x=Bo(y);g.push(wl(x))}return a.jsx(dn,{id:t,name:t,required:r,onChange:y=>{const x=y.currentTarget.selectedIndex;if(x===0){s([{}]);return}const S=n.answerOption[x-1],j=Bo(S),C="value"+Qn(j.type);s([{[C]:j.value}])},defaultValue:bf(f?.value)||f?.value,data:g})}}function PJ(e,t){return e?t.valueSetExpand({url:e,count:vl+1}).then(n=>n.expansion?.contains??[]):Promise.resolve([])}function rN(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 u=await PJ(e,t);r(u)}catch(u){console.error("Error loading value set:",u)}finally{s(!1)}}}c().catch(console.error)},[e,t]),[n,o]}function iN(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 NJ(e){const{name:t,item:n,required:r,initial:o,onChangeAnswer:s,response:c}=e,u=ks("QuestionnaireItemAnswerOption","value[x]"),f=AS(o),[h,m]=rN(n.answerValueSet),g=[];let y;if(n.answerValueSet)g.push(...iN(h,t));else if(n.answerOption){const C=n.answerOption.slice(0,Xp).map((T,R)=>{const E=`${t}-option-${R}`,_=Bo(T);return _?.value?(f&&co(_)===co(f)&&(y=E),[E,_]):null}).filter(T=>T!==null);g.push(...C)}const x=r1(c),S=MJ(g,x);if(m)return a.jsx(be,{children:"Loading options..."});if(g.length===0)return a.jsx(n1,{});const j=g.slice(0,vl);return a.jsxs(a.Fragment,{children:[a.jsx(jr.Group,{name:t,value:S??y,required:r,onChange:C=>{const T=g.find(R=>R[0]===C);if(T){const R=T[1],E="value"+Qn(R.type);s([{[E]:R.value}])}},children:j.map(([C,T])=>a.jsx(jr,{id:C,value:C,py:4,required:r,label:a.jsx(uo,{property:u,propertyType:T.type,value:T.value})},C))}),(n.answerValueSet&&g.length>vl||n.answerOption&&g.length>Xp)&&a.jsxs(be,{size:"sm",c:"dimmed",mt:"xs",children:["Showing first ",vl," options"]})]})}function OJ(e){const{name:t,item:n,onChangeAnswer:r,response:o}=e,s=ks("QuestionnaireItemAnswerOption","value[x]"),[c,u]=rN(n.answerValueSet),f=n.answerValueSet?(o?.answer?.map(S=>S.valueCoding)||[]).filter(S=>S!==void 0):oN(o),[h,m]=v.useState(f),g=[];if(n.answerValueSet)g.push(...iN(c,t));else if(n.answerOption){const S=n.answerOption.slice(0,Xp).map((j,C)=>{const T=`${t}-option-${C}`,R=Bo(j);return R?.value?[T,R]:null}).filter(j=>j!==null);g.push(...S)}if(u)return a.jsx(be,{children:"Loading options..."});if(g.length===0)return a.jsx(n1,{});const y=g.slice(0,vl),x=(S,j)=>{if(n.answerValueSet){const C=h;let T;j?T=[...C,S.value]:T=C.filter(R=>!$o(R,S.value)),m(T),T.length===0?r([{}]):r(T.map(R=>({valueCoding:R})))}else{const C=h,T=wl(S);let R;if(j?R=[...C,T]:R=C.filter(E=>E!==T),m(R),R.length===0)r([{}]);else{const E=Wk(R,"value"+Qn(S.type),n);r(E)}}};return a.jsxs(xe,{style:{flexDirection:"column",alignItems:"flex-start"},children:[y.map(([S,j])=>{const C=wl(j),T=n.answerValueSet?h.some(R=>$o(R,j.value)):h.includes(C);return a.jsx(cn,{id:S,label:a.jsx(uo,{property:s,propertyType:j.type,value:j.value}),checked:T,onChange:R=>x(j,R.currentTarget.checked)},S)}),(n.answerValueSet&&g.length>vl||n.answerOption&&g.length>Xp)&&a.jsxs(be,{size:"sm",c:"dimmed",children:["Showing first ",vl," options"]})]})}function n1(){return a.jsx(He,{disabled:!0,placeholder:"No Answers Defined"})}function r1(e,t=0){return Bo(e?.answer?.[t]??{})}function oN(e){const t=e?.answer;return t?t.map(r=>Bo(r)).map(r=>bf(r?.value)||r?.value).filter(Boolean):[]}function MJ(e,t){return e.find(n=>$o(n[1].value,t?.value))?.[0]}function gg(e,t){return!!e.extension?.some(n=>n.url===_S&&n.valueCodeableConcept?.coding?.[0]?.code===t)}function LJ(e){return gg(e,"drop-down")}function IJ(e){return gg(e,"check-box")}function zJ(e){return gg(e,"radio-button")}function $J(e){return gg(e,"multi-select")}function UJ(e){if(e.answerOption?.length===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=Bo(t),r="value"+Qn(n.type),o=(e.answerOption??[]).map(s=>{const c=Bo(s),u=wl(c);return{value:u,label:u}});return{propertyName:r,data:o}}const BJ="_section_my8o4_1",VJ="_hovering_my8o4_10",FJ="_editing_my8o4_14",HJ="_questionBody_my8o4_20",qJ="_topActions_my8o4_24",GJ="_bottomActions_my8o4_33",WJ="_movementActions_my8o4_44",QJ="_movementIcons_my8o4_56",YJ="_columnAlignment_my8o4_60",KJ="_linkIdInput_my8o4_65",XJ="_typeSelect_my8o4_70",JJ="_preserveBreaks_my8o4_74",ci={section:BJ,hovering:VJ,editing:FJ,questionBody:HJ,topActions:qJ,bottomActions:GJ,movementActions:WJ,movementIcons:QJ,columnAlignment:YJ,linkIdInput:KJ,typeSelect:XJ,preserveBreaks:JJ};function ZJ(e){const t=Re(),n=Xt(e.questionnaire),[r,o]=v.useState(!1),[s,c]=v.useState(),[u,f]=v.useState(),[h,m]=v.useState();function g(){m(void 0)}function y(){f(void 0)}v.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>o(!0)).catch(console.log)},[t]),v.useEffect(()=>(c(rZ(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",y),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",y)}),[n]);const x=(S,j)=>{c(S),e.autoSave&&!j&&e.onSubmit&&e.onSubmit(S)};return!r||!s?null:a.jsx("div",{children:a.jsxs(pt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(s),children:[a.jsx(aN,{item:s,selectedKey:u,setSelectedKey:f,hoverKey:h,setHoverKey:m,onChange:x}),a.jsx(dr,{children:"Save"})]})})}function aN(e){const t=e.item,n=e.item,r=Qo(e.item),o=r||n.type===vt.group,s=n.linkId??"[untitled]",c=e.selectedKey===e.item.id,u=e.hoverKey===e.item.id,f=v.useRef(e.item);f.current=e.item;function h(E){yn(E),e.setSelectedKey(e.item.id)}function m(E){yn(E),e.setHoverKey(e.item.id)}function g(E){const _=f.current;e.onChange({..._,item:_.item?.map(k=>k.id===E.id?E:k)})}function y(E,_){e.onChange({...e.item,item:[...e.item.item??[],E]},_)}function x(E){e.onChange({...e.item,item:e.item.item?.filter(_=>_!==E)})}function S(E,_){e.onChange({...f.current,[E]:_})}function j(E){e.onChange({...e.item,...E})}function C(E){e.onChange({...e.item,item:e.item.item?.map(_=>_===E?{..._,repeats:!_.repeats}:_)})}function T(E,_){const k=aZ(e.item.item,E,_);e.onChange({...e.item,item:k})}const R=Bt(ci.section,{[ci.editing]:c,[ci.hovering]:u&&!c});return a.jsxs("div",{"data-testid":n.linkId,className:R,onClick:h,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:E=>S("title",E.currentTarget.value)}),!r&&a.jsx(zl,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:E=>S("text",E.currentTarget.value)}),n.type==="reference"&&a.jsx(nZ,{item:n,onChange:j}),EH(n)&&a.jsx(eZ,{item:n,onChange:E=>j(E)})]}):a.jsxs(a.Fragment,{children:[t.title&&a.jsx(Ve,{children:t.title}),n.text&&a.jsx("div",{className:ci.preserveBreaks,children:n.text}),!o&&a.jsx(Jp,{item:n,index:0,required:!1,responseItem:{linkId:n.linkId}})]})}),n.item?.map((E,_)=>a.jsx("div",{children:a.jsx(aN,{item:E,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:_===0,isLast:_===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:g,onRemove:()=>x(E),onRepeatable:C,onMoveUp:()=>T(_,-1),onMoveDown:()=>T(_,1)})},E.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:E=>S("linkId",E.currentTarget.value)}),!o&&a.jsx(dn,{size:"xs",className:ci.typeSelect,defaultValue:n.type,onChange:E=>S("type",E.currentTarget.value),data:[{value:"display",label:"Display"},{value:"boolean",label:"Boolean"},{value:"decimal",label:"Decimal"},{value:"integer",label:"Integer"},{value:"date",label:"Date"},{value:"dateTime",label:"Date/Time"},{value:"time",label:"Time"},{value:"string",label:"String"},{value:"text",label:"Text"},{value:"url",label:"URL"},{value:"choice",label:"Choice"},{value:"open-choice",label:"Open Choice"},{value:"attachment",label:"Attachment"},{value:"reference",label:"Reference"},{value:"quantity",label:"Quantity"}]})]}):a.jsx("div",{children:s})}),!r&&a.jsx(le,{className:ci.movementActions,children:a.jsxs(le,{className:ci.columnAlignment,children:[!e.isFirst&&a.jsx(Et,{href:"#",onClick:E=>{E.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:a.jsx(iq,{"data-testid":"up-button",size:15,className:ci.movementIcons})}),!e.isLast&&a.jsx(Et,{href:"#",onClick:E=>{E.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:a.jsx(nq,{"data-testid":"down-button",size:15,className:ci.movementIcons})})]})}),a.jsxs("div",{className:ci.bottomActions,children:[o&&a.jsxs(a.Fragment,{children:[a.jsx(Et,{href:"#",onClick:E=>{E.preventDefault(),y({id:Dl(),linkId:ab("q"),type:"string",text:"Question"})},children:"Add item"}),a.jsx(Et,{href:"#",onClick:E=>{E.preventDefault(),y({id:Dl(),linkId:ab("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&a.jsx(Et,{href:"#",onClick:E=>{E.preventDefault(),y(oZ(),!0)},children:"Add Page"}),c&&!r&&a.jsxs(a.Fragment,{children:[a.jsx(Et,{href:"#",onClick:E=>{E.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),a.jsx(Et,{href:"#",onClick:E=>{E.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function eZ(e){const t=ks("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(tZ,{options:n,property:t,item:e.item,onChange:e.onChange}),a.jsxs(le,{display:"flex",children:[a.jsx(Et,{href:"#",onClick:r=>{yn(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:Dl()}]})},children:"Add choice"}),a.jsx(kA,{w:"lg"}),a.jsx(Et,{href:"#",onClick:r=>{yn(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function tZ(e){return a.jsx("div",{children:e.options.map(t=>{const[n,r]=lg({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(_f,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(o,s)=>{const c=[...e.options],u=c.findIndex(f=>f.id===t.id);c[u]={id:t.id,[s]:o},e.onChange({...e.item,answerOption:c})},outcome:void 0},t.id)}),a.jsx("div",{children:a.jsx(Et,{href:"#",onClick:o=>{yn(o),e.onChange({...e.item,answerOption:e.options.filter(s=>s.id!==t.id)})},children:"Remove"})})]},t.id)})})}function nZ(e){const t=Yk(e.item)??[];return a.jsxs(a.Fragment,{children:[t.map((n,r)=>a.jsxs(xe,{children:[a.jsx(FS,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:o=>{e.onChange(ox(e.item,t.map(s=>s===n?o:s)))}}),a.jsx(Et,{href:"#",onClick:o=>{yn(o),e.onChange(ox(e.item,t.filter(s=>s!==n)))},children:"Remove"})]},`${n}-${r}`)),a.jsx(Et,{href:"#",onClick:n=>{yn(n),e.onChange(ox(e.item,[...t,""]))},children:"Add Resource Type"})]})}let ib=1,ob=1;function ab(e){return e+ib++}function Dl(){return"id-"+ob++}function rZ(e){return{...e,id:e.id||Dl(),item:sN(e.item)}}function sN(e){if(e)return e.forEach(t=>{t.id?.match(/^id-\d+$/)&&(ob=Math.max(ob,Number.parseInt(t.id.substring(3),10)+1)),t.linkId?.match(/^q\d+$/)&&(ib=Math.max(ib,Number.parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||Dl(),item:sN(t.item),answerOption:iZ(t.answerOption)}))}function iZ(e){if(e)return e.map(t=>({...t,id:t.id||Dl()}))}function oZ(){return{id:Dl(),linkId:ab("s"),type:"group",text:"New Page",extension:[{url:_S,valueCodeableConcept:{coding:[{system:"http://hl7.org/fhir/questionnaire-item-control",code:"page"}]}}]}}function aZ(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 Zp=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}},sZ=class lN{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 lN(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,u=n.y-r.y,f={x:(t.x+n.x)/2,y:(t.y+n.y)/2},h={x:(n.x+r.x)/2,y:(n.y+r.y)/2},m=Math.sqrt(o*o+s*s),g=Math.sqrt(c*c+u*u),y=f.x-h.x,x=f.y-h.y,S=m+g==0?0:g/(m+g),j={x:h.x+y*S,y:h.y+x*S},C=n.x-j.x,T=n.y-j.y;return{c1:new Zp(f.x+C,f.y+T),c2:new Zp(h.x+C,h.y+T)}}length(){let n=0,r,o;for(let s=0;s<=10;s+=1){const c=s/10,u=this.point(c,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),f=this.point(c,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(s>0){const h=u-r,m=f-o;n+=Math.sqrt(h*h+m*m)}r=u,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}},lZ=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 cZ(e,t=250){let n=0,r=null,o,s,c;const u=()=>{n=Date.now(),r=null,o=e.apply(s,c),r||(s=null,c=[])};return function(...h){const m=Date.now(),g=t-(m-n);return s=this,c=h,g<=0||g>t?(r&&(clearTimeout(r),r=null),n=m,o=e.apply(s,c),r||(s=null,c=[])):r||(r=window.setTimeout(u,g)),o}}var uZ=class sb extends lZ{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?cZ(sb.prototype._strokeUpdate,this.throttle):sb.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,u=n.width||this.canvas.width/c,f=n.height||this.canvas.height/c,h=n.xOffset||0,m=n.yOffset||0;this._reset(this._getPointGroupOptions()),s.onload=()=>{this._ctx.drawImage(s,h,m,u,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){return t==="image/svg+xml"?(typeof n!="object"&&(n=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(n))}`):(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,u=this._getPointGroupOptions(r);if(!s||!(s&&c)){const f=this._addPoint(n,u);s?f&&this._drawCurve(f,u):this._drawDot(n,u),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 Zp(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=sZ.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 u=c/s,f=u*u,h=f*u,m=1-u,g=m*m,y=g*m;let x=y*t.startPoint.x;x+=3*g*u*t.control1.x,x+=3*m*f*t.control2.x,x+=h*t.endPoint.x;let S=y*t.startPoint.y;S+=3*g*u*t.control1.y,S+=3*m*f*t.control2.y,S+=h*t.endPoint.y;const j=Math.min(t.startWidth+h*o,n.maxWidth);this._drawCurveSegment(x,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 u=0;u<s.length;u+=1){const f=s[u],h=new Zp(f.x,f.y,f.pressure,f.time);u===0&&this._reset(c);const m=this._addPoint(h,c);m&&n(m,c)}else this._reset(c),r(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,u=this.canvas.width/o,f=this.canvas.height/o,h=document.createElementNS("http://www.w3.org/2000/svg","svg");if(h.setAttribute("xmlns","http://www.w3.org/2000/svg"),h.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),h.setAttribute("viewBox",`${s} ${c} ${u} ${f}`),h.setAttribute("width",u.toString()),h.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),h.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,x=this._dataUrlOptions?.xOffset||0,S=this._dataUrlOptions?.yOffset||0,j=document.createElement("image");j.setAttribute("x",x.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),h.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 x=`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",x),y.setAttribute("stroke-width",(m.endWidth*2.25).toFixed(3)),y.setAttribute("stroke",g),y.setAttribute("fill","none"),y.setAttribute("stroke-linecap","round"),h.appendChild(y)}},(m,{penColor:g,dotSize:y,minWidth:x,maxWidth:S})=>{const j=document.createElement("circle"),C=y>0?y:(x+S)/2;j.setAttribute("r",C.toString()),j.setAttribute("cx",m.x.toString()),j.setAttribute("cy",m.y.toString()),j.setAttribute("fill",g),h.appendChild(j)}),h.outerHTML}};function dZ(e){const t=Re(),{width:n=500,height:r=200,defaultValue:o,who:s,onChange:c,...u}=e,f=v.useRef(null),h=v.useRef(null),m=v.useRef(c);m.current=c,v.useEffect(()=>{function y(){m.current?.({type:[{system:fo+"/fhir/signature-type",code:"ProofOfOrigin",display:"Proof of Origin"}],when:new Date().toISOString(),who:s??Yt(t.getProfile()),data:h.current?.toDataURL().split(",")[1]})}if(f.current){const x=new uZ(f.current);o?.data&&x.fromDataURL(o.data).catch(console.error),x.addEventListener("endStroke",y),h.current=x}return()=>{h.current&&h.current.removeEventListener("beginStroke",y)}},[t,o,s]);const g=()=>{h.current&&h.current.clear(),m.current?.(void 0)};return a.jsxs(Mr,{withBorder:!0,p:0,w:n,h:r,pos:"relative",...u,children:[a.jsx("canvas",{ref:f,width:n,height:r,"aria-label":"Signature input area"}),a.jsx(Oe,{onClick:g,"aria-label":"Clear signature",pos:"absolute",top:0,right:0,size:"xs",leftSection:a.jsx(tg,{size:16}),variant:"subtle",color:"gray",children:"Clear"})]})}function cN(e){const t=[...e.context,e.responseItem];return a.jsxs("div",{children:[e.item.text&&a.jsx(Ve,{order:3,mb:"md",children:e.item.text}),a.jsx(lb,{formState:e.formState,context:t,items:e.item.item??[],responseItems:e.responseItem.item??[]})]},e.item.linkId)}function fZ(e){return a.jsxs(a.Fragment,{children:[e.responseItems.map(t=>a.jsx(cN,{formState:e.formState,context:e.context,item:e.item,responseItem:t},`group-${t.id}`)),a.jsx(Et,{onClick:()=>e.formState.onAddGroup(e.context,e.item),children:`Add Group: ${e.item.text}`})]})}function hZ(e){const{formState:t,context:n,item:r,responseItem:o}=e,s=r.type!==vt.choice&&r.type!==vt.openChoice,c=o.answer&&o.answer.length>0?o.answer:[{}];return a.jsxs(Ut,{title:e.item.text,withAsterisk:e.item.required,children:[a.jsx(Le,{gap:"xs",children:c?.map((u,f)=>a.jsx(Jp,{formState:t,context:n,item:r,responseItem:o,index:f},`${r.linkId}-${f}`))}),s&&a.jsx(Et,{onClick:()=>t.onAddAnswer(n,r),children:"Add Item"})]},e.item.linkId)}function lb(e){const{formState:t,context:n,items:r,responseItems:o}=e;return a.jsx(Le,{children:r.map((s,c)=>{if(!TH(s,t.questionnaireResponse))return null;if(s.type===vt.display)return a.jsx("p",{children:s.text},`display-${s.id}-${c}`);const u=o.filter(f=>f.linkId===s.linkId);return s.type===vt.group&&s.repeats?a.jsx(fZ,{formState:t,context:n,item:s,responseItems:u},`repeating-group-${s.id}-${c}`):s.type===vt.group?a.jsx(cN,{formState:t,context:n,item:s,responseItem:u[0]},`group-${s.id}-${c}`):s.type===vt.boolean?a.jsx(Jp,{formState:t,context:n,item:s,responseItem:u[0],index:0},`boolean-item-${s.id}-${c}`):s.repeats?a.jsx(hZ,{formState:t,context:n,item:s,responseItem:u[0]},`repeating-item-${s.id}-${c}`):a.jsx(Ut,{htmlFor:s.linkId,title:s.text,withAsterisk:s.required,children:a.jsx(Jp,{formState:t,context:n,item:s,responseItem:u[0],index:0})},`repeating-item-${s.id}-${c}`)})})}function pZ(e){const{formState:t,submitButtonText:n,excludeButtons:r,children:o}=e,s=t.pages,c=t.activePage,u=c>0,f=c<s.length-1,h=c===s.length-1;return a.jsxs(a.Fragment,{children:[a.jsx(eu,{active:c,allowNextStepsSelect:!1,p:6,children:s.map((m,g)=>a.jsx(eu.Step,{label:m.title,children:g===c&&o},m.linkId))}),!r&&a.jsxs(xe,{justify:"flex-end",mt:"xl",gap:"xs",children:[u&&a.jsx(Oe,{onClick:t.onPrevPage,children:"Back"}),f&&a.jsx(Oe,{onClick:m=>{m.currentTarget.closest("form").reportValidity()&&t.onNextPage()},children:"Next"}),h&&a.jsx(dr,{children:n??"Submit"})]})]})}function uN(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=$H({questionnaire:e.questionnaire,defaultValue:e.questionnaireResponse,subject:e.subject,encounter:e.encounter,source:e.source,disablePagination:e.disablePagination,onChange:s}),u=v.useRef(c);u.current=c;const f=v.useMemo(()=>c.loading?!1:!!Wo(c.questionnaire,CH),[c]),h=v.useMemo(()=>c.loading?!1:!!c.questionnaireResponse.extension?.find(g=>g.url===Cp),[c]),m=v.useCallback(()=>{const g=u.current;if(g.loading)return;const y=o.current.onSubmit;if(!y)return;if(f&&!h){r(!0);return}const x=g.questionnaire,S=g.questionnaireResponse,j=o.current.subject;let C=o.current.source;if(!C){const T=t.getProfile();T&&(C=Yt(T))}y({...S,questionnaire:x.url??zt(x),subject:j,source:C,authored:new Date().toISOString(),status:"completed"})},[t,f,h]);return c.loading?null:a.jsxs(pt,{testid:"questionnaire-form",onSubmit:m,children:[c.questionnaire.title&&a.jsx(Ve,{children:c.questionnaire.title}),c.pagination?a.jsx(pZ,{formState:c,submitButtonText:e.submitButtonText,excludeButtons:e.excludeButtons,children:a.jsx(lb,{formState:c,context:[],items:c.items,responseItems:c.responseItems})}):a.jsxs(a.Fragment,{children:[a.jsx(lb,{formState:c,context:[],items:c.items,responseItems:c.responseItems}),f&&a.jsxs(Le,{mt:"md",gap:0,children:[a.jsx(be,{size:"sm",fw:500,children:"Signature"}),a.jsx(dZ,{onChange:c.onChangeSignature}),!h&&n&&a.jsx(be,{c:"red",size:"sm",children:"Signature is required."})]}),!e.excludeButtons&&a.jsx(xe,{justify:"flex-end",mt:"xl",gap:"xs",children:a.jsx(dr,{children:e.submitButtonText??"Submit"})})]})]})}const mZ="_section_4m5it_1",gZ={section:mZ},vZ=["gender","age","gestationalAge","context","appliesTo","category"],yZ={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function xZ(e){e=Object.assign(yZ,e);const t=e.definition,[n,r]=v.useState([]),[o,s]=v.useState(1),[c,u]=v.useState(1);return v.useEffect(()=>{const S=wZ(t,u);r(jZ(S.qualifiedInterval||[],s))},[t]),a.jsxs(pt,{testid:"reference-range-editor",onSubmit:f,children:[a.jsx(Le,{children:n.map(S=>a.jsx(bZ,{unit:EZ(t.quantitativeDetails?.unit),onChange:g,onAdd:y,onRemove:x,onRemoveGroup:m,intervalGroup:S},`group-${S.id}`))}),a.jsx(Rn,{title:"Add Group",variant:"subtle",size:"sm",onClick:S=>{yn(S),h({id:`group-id-${o}`,filters:{},intervals:[]}),s(j=>j+1)},children:a.jsx(Fd,{})}),a.jsx(xe,{justify:"flex-end",children:a.jsx(dr,{children:"Save"})})]});function f(){const S=n.flatMap(j=>j.intervals).filter(j=>!TZ(j));e.onSubmit({...t,qualifiedInterval:S})}function h(S){r(j=>[...j,S])}function m(S){r(j=>j.filter(C=>C.id!==S.id))}function g(S,j){r(C=>{C=[...C];const T=C.find(E=>E.id===S),R=T?.intervals.findIndex(E=>E.id===j.id);return R!==void 0&&T?.intervals[R]&&(T.intervals[R]=j),C})}function y(S,j){j.id===void 0&&(j.id=`id-${c}`,u(C=>C+1)),r(C=>{C=[...C];const T=C.findIndex(R=>R.id===S);if(T!==-1){const R={...C[T]};j={...j,...R.filters},R.intervals=[...R.intervals,j],C[T]=R}return C})}function x(S,j){r(C=>{C=[...C];const T=C.find(R=>R.id===S);return T&&(T.intervals=T.intervals.filter(R=>R.id!==j.id)),C})}}function bZ(e){const{intervalGroup:t,unit:n}=e;return a.jsx(xu,{"data-testid":t.id,className:gZ.section,children:a.jsxs(Le,{gap:"lg",children:[a.jsx(xe,{justify:"flex-end",children:a.jsx(Rn,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{yn(r),e.onRemoveGroup(t)},children:a.jsx(qp,{})},`remove-group-button-${t.id}`)}),a.jsx(SZ,{intervalGroup:t,onChange:e.onChange}),a.jsx(wn,{}),t.intervals.map(r=>a.jsxs(Le,{gap:"xs",children:[a.jsxs(xe,{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(Rn,{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(qp,{})},`remove-interval-${r.id}`)]}),a.jsx(WS,{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(Rn,{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(Fd,{})})]})})}function SZ(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(Le,{style:{maxWidth:"50%"},children:[a.jsx(xe,{children:a.jsx(dn,{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(xe,{gap:"xs",children:[a.jsx(be,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),a.jsx("div",{id:`div-age-${t.id}`,children:a.jsx(WS,{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(dn,{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(dn,{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 wZ(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 jZ(e,t){let n=1;const r={};for(const o of e){const s=CZ(o);s in r||(r[s]={id:`group-id-${n++}`,filters:Object.fromEntries(vZ.map(c=>[c,o[c]])),intervals:[]}),r[s].intervals.push(o)}return t(n),Object.values(r)}function CZ(e){return[`gender=${e.gender}`,`age=${Ud(e.age)}`,`gestationalAge=${Ud(e.gestationalAge)}`,`context=${e.context?.text}`,`appliesTo=${e.appliesTo?.map(n=>n.text).join("+")}`,`category=${e.category}`].join(":")}function EZ(e){return e&&(NB(e,"http://unitsofmeasure.org")||e.text)}function TZ(e){return e.range?.low?.value===void 0&&e.range?.high?.value===void 0}function RZ(e){const t=Re(),n=Xt(e.value),[r,o]=v.useState(!1),[s,c]=v.useState();if(v.useEffect(()=>{n&&!r&&(t.executeBatch(u(n)).then(c).catch(console.log),o(!0))},[t,n,r]),!n||!s)return null;return a.jsx(kn,{children:n.action?.map((h,m)=>{const g=h.resource&&f(h.resource),y=g?.input?.[0]?.valueReference,x=g?.output?.[0]?.valueReference;return a.jsxs(v.Fragment,{children:[a.jsx(kn.Col,{span:1,p:"md",children:g?.status==="completed"?a.jsx(_q,{}):a.jsx(ZG,{color:"gray"})}),a.jsxs(kn.Col,{span:9,p:"xs",children:[a.jsx(be,{fw:500,children:h.title}),h.description&&a.jsx("div",{children:h.description}),a.jsxs("div",{children:["Last edited by ",a.jsx(Fl,{value:g?.meta?.author})," on ",Dr(g?.meta?.lastUpdated)]}),a.jsxs("div",{children:["Status: ",a.jsx(dg,{status:g?.status||"unknown"})]})]}),a.jsxs(kn.Col,{span:2,p:"md",children:[y&&!x&&a.jsx(Oe,{onClick:()=>e.onStart(g,y),children:"Start"}),y&&x&&a.jsx(Oe,{onClick:()=>e.onEdit(g,y,x),children:"Edit"})]})]},`action-${m}`)})});function u(h){const m=[];if(h.action)for(const g of h.action)g.resource?.reference&&m.push({request:{method:"GET",url:g.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:m}}function f(h){for(const m of s?.entry??[])if(m.resource&&h.reference===zt(m.resource))return m.resource}}function dN(e,t){const n=_Z(e,t);return DZ(n,e,t)}function _Z(e,t){const n=e.length,r=t.length,o=n+r+1,s=1+2*o,c=Math.trunc(s/2),u=new Array(s);u[c+1]={i:0,j:-1,prev:void 0,snake:!0};for(let f=0;f<o;f++){for(let h=-f;h<=f;h+=2){const m=c+h,g=m+1,y=m-1,x=u[g],S=u[y];let j,C=0;h===-f||h!==f&&S.i<x.i?(C=x.i,j=x):(C=S.i+1,j=S),u[y]=void 0;let T=C-h,R={i:C,j:T,prev:AZ(j),snake:!1};for(;C<n&&T<r&&e[C]===t[T];)C++,T++;if(C>R.i&&(R={i:C,j:T,prev:R,snake:!0}),u[m]=R,C>=n&&T>=r)return u[m]}u[c+f-1]=void 0}}function DZ(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 u=o.i,f=o.j,h={position:u,lines:t.slice(u,s)},m={position:f,lines:n.slice(f,c)};let g;h.lines.length===0&&m.lines.length>0?g="insert":h.lines.length>0&&m.lines.length===0?g="delete":g="change",r.push({original:h,revised:m,type:g}),o.snake&&(o=o.prev)}return r}function AZ(e){return e&&!e.snake&&e.prev?e.prev:e}function kZ(e){const t=(e.entry??[]).filter(r=>!!r.resource).map(r=>({meta:r.resource?.meta,lines:co(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 PZ(n,t),NZ(n),n}function PZ(e,t){for(let n=1;n<t.length;n++){const r=dN(t[n-1].lines,t[n].lines);for(const o of r){const s=o.original.position,c=o.original.lines,u=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:u[f],span:1})}}}function NZ(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 OZ="_container_1tyf3_1",MZ="_root_1tyf3_5",LZ="_startRow_1tyf3_20",IZ="_normalRow_1tyf3_25",zZ="_author_1tyf3_30",$Z="_dateTime_1tyf3_34",UZ="_lineNumber_1tyf3_40",BZ="_line_1tyf3_40",VZ="_pre_1tyf3_55",va={container:OZ,root:MZ,startRow:LZ,normalRow:IZ,author:zZ,dateTime:$Z,lineNumber:UZ,line:BZ,pre:VZ};function FZ(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function HZ(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return Oc(n,"year");const r=Math.floor(t/2592e3);if(r>0)return Oc(r,"month");const o=Math.floor(t/86400);if(o>0)return Oc(o,"day");const s=Math.floor(t/3600);if(s>0)return Oc(s,"hour");const c=Math.floor(t/60);return c>0?Oc(c,"minute"):Oc(t,"second")}function Oc(e,t){return`${e} ${e===1?t:t+"s"} ago`}function qZ(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=kZ(n);return a.jsx("div",{className:va.container,children:a.jsx("table",{className:va.root,children:a.jsx("tbody",{children:s.map((c,u)=>a.jsxs("tr",{className:c.span>0?va.startRow:va.normalRow,children:[c.span>0&&a.jsxs(a.Fragment,{children:[a.jsx("td",{className:va.author,rowSpan:c.span,children:a.jsx(Fl,{value:c.meta.author,link:!0,fz:"xs"})}),a.jsx("td",{className:va.dateTime,rowSpan:c.span,children:a.jsx(St,{to:FZ(o,c.meta.versionId),fz:"xs",children:HZ(c.meta.lastUpdated)})})]}),a.jsx("td",{className:va.lineNumber,children:u+1}),a.jsx("td",{className:va.line,children:a.jsx("pre",{className:va.pre,children:c.value})})]},"row-"+u))})})})}const GZ="_removed_el5zk_1",WZ="_added_el5zk_6",$R={removed:GZ,added:WZ};function QZ(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=co(t,!0).match(/[^\r\n]+/g),o=co(n,!0).match(/[^\r\n]+/g),s=dN(r,o);return a.jsx("pre",{style:{color:"gray"},children:s.map((c,u)=>a.jsx(YZ,{delta:c},"delta"+u))})}function YZ(e){return a.jsxs(a.Fragment,{children:["...",a.jsx("br",{}),e.delta.original.lines.length>0&&a.jsx("div",{className:$R.removed,children:e.delta.original.lines.join(`
|
|
205
|
-
`)}),e.delta.revised.lines.length>0&&a.jsx("div",{className:$R.added,children:e.delta.revised.lines.join(`
|
|
206
|
-
`)}),"...",a.jsx("br",{})]})}const KZ="_splitButton_1i0gi_1",XZ="_menuControl_1i0gi_6",UR={splitButton:KZ,menuControl:XZ};function em(e){const{outcome:t}=e,n=Re(),r=Xt(e.defaultValue),o=r?.resourceType,[s,c]=v.useState(!1),[u,f]=v.useState(),h=n.getAccessPolicy(),m=_n();v.useEffect(()=>{if(r)if(e.profileUrl){const x=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const S=gu(x);if(S){c(!0);const j=rH(r,S);f(j)}else console.error(`Schema not found for ${x}`)}).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&&kk(r,pl.READ,h),[h,r]),y=v.useMemo(()=>n.isSuperAdmin()||!h||!Ln(u?.resourceType)?!0:oF(h,u?.resourceType),[n,h,u?.resourceType]);return!s||!u?a.jsx("div",{children:"Loading..."}):y?a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:x=>{x.preventDefault(),e.onSubmit&&e.onSubmit(u)},children:[a.jsxs(Le,{mb:"xl",children:[a.jsx(Ut,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:a.jsx(He,{name:"resourceType",defaultValue:u.resourceType,disabled:!0})}),a.jsx(Ut,{title:"ID",htmlFor:"id",outcome:t,children:a.jsx(He,{name:"id",defaultValue:u.id,disabled:!0})})]}),a.jsx(KS,{path:u.resourceType,valuePath:u.resourceType,typeName:o,defaultValue:u,outcome:t,onChange:f,profileUrl:e.profileUrl,accessPolicyResource:g}),a.jsxs(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",gap:0,children:[a.jsx(Oe,{type:"submit",className:Bt((e.onPatch||e.onDelete)&&UR.splitButton),children:r?.id?"Update":"Create"}),(e.onPatch||e.onDelete)&&a.jsxs(we,{transitionProps:{transition:"pop"},position:"bottom-end",withinPortal:!0,children:[a.jsx(we.Target,{children:a.jsx(Rn,{variant:"filled",color:m.primaryColor,size:36,className:UR.menuControl,"aria-label":"More actions",children:a.jsx(PS,{size:14,stroke:1.5})})}),a.jsxs(we.Dropdown,{children:[e.onPatch&&a.jsx(we.Item,{leftSection:a.jsx(nP,{size:14,stroke:1.5}),onClick:()=>{e.onPatch(u)},children:"Patch"}),e.onDelete&&a.jsx(we.Item,{color:"red",leftSection:a.jsx(tg,{size:14,stroke:1.5,color:"red"}),onClick:()=>{e.onDelete(u)},children:"Delete"})]})]})]})]}):a.jsxs(Go,{color:"red",title:"Permission denied",icon:a.jsx(Ps,{}),children:["Your access level prevents you from editing and creating ",u.resourceType," resources."]})}function JZ(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(te,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx(te.Thead,{children:a.jsxs(te.Tr,{children:[a.jsx(te.Th,{children:"Author"}),a.jsx(te.Th,{children:"Date"}),a.jsx(te.Th,{children:"Version"})]})}),a.jsx(te.Tbody,{children:n.entry?.map((o,s)=>a.jsx(ZZ,{entry:o},"entry-"+s))})]}):a.jsx("div",{children:"Loading..."})}function ZZ(e){const{response:t,resource:n}=e.entry;return n?a.jsxs(te.Tr,{children:[a.jsx(te.Td,{children:a.jsx(qc,{value:n.meta?.author,link:!0})}),a.jsx(te.Td,{children:Dr(n.meta?.lastUpdated)}),a.jsx(te.Td,{children:a.jsx(St,{to:eee(n),children:n.meta?.versionId})})]}):a.jsx(te.Tr,{children:a.jsx(te.Td,{colSpan:3,children:Ge(t?.outcome)})})}function eee(e){return`/${e.resourceType}/${e.id}/_history/${e.meta?.versionId}`}function tee(e){const{serviceRequest:t,...n}=e;return a.jsx(fg,{value:t,loadTimelineResources:async(r,o,s)=>{const c=`${o}/${s}`,u=100;return Promise.allSettled([r.readHistory("ServiceRequest",s),r.search("Communication",{"based-on":c,_count:u}),r.search("DiagnosticReport",{"based-on":c,_count:u}),r.search("Media",{"based-on":c,_count:u}),r.search("DocumentReference",{related:c,_count:u}),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:u})])},createCommunication:(r,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 nee(e){const t=Re(),{client:n,patient:r,encounter:o,children:s,...c}=e;function u(){t.createResource({resourceType:"SmartAppLaunch",patient:r,encounter:o}).then(f=>{const h=new URL(n.launchUri);h.searchParams.set("iss",gS(t.fhirUrl().toString())),h.searchParams.set("launch",f.id),nr.assign(h.toString())}).catch(f=>Ae({color:"red",message:Ge(f),autoClose:!1}))}return a.jsx(Et,{onClick:()=>u(),...c,children:s})}var hx={exports:{}},md={},px={exports:{}},mx={};var BR;function ree(){return BR||(BR=1,(function(e){function t(M,L){var z=M.length;M.push(L);e:for(;0<z;){var V=z-1>>>1,K=M[V];if(0<o(K,L))M[V]=L,M[z]=K,z=V;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var L=M[0],z=M.pop();if(z!==L){M[0]=z;e:for(var V=0,K=M.length,O=K>>>1;V<O;){var F=2*(V+1)-1,se=M[F],de=F+1,ye=M[de];if(0>o(se,z))de<K&&0>o(ye,se)?(M[V]=ye,M[de]=z,V=de):(M[V]=se,M[F]=z,V=F);else if(de<K&&0>o(ye,z))M[V]=ye,M[de]=z,V=de;else break e}}return L}function o(M,L){var z=M.sortIndex-L.sortIndex;return z!==0?z:M.id-L.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var f=[],h=[],m=1,g=null,y=3,x=!1,S=!1,j=!1,C=!1,T=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function _(M){for(var L=n(h);L!==null;){if(L.callback===null)r(h);else if(L.startTime<=M)r(h),L.sortIndex=L.expirationTime,t(f,L);else break;L=n(h)}}function k(M){if(j=!1,_(M),!S)if(n(f)!==null)S=!0,I||(I=!0,Y());else{var L=n(h);L!==null&&G(k,L.startTime-M)}}var I=!1,D=-1,P=5,$=-1;function B(){return C?!0:!(e.unstable_now()-$<P)}function W(){if(C=!1,I){var M=e.unstable_now();$=M;var L=!0;try{e:{S=!1,j&&(j=!1,R(D),D=-1),x=!0;var z=y;try{t:{for(_(M),g=n(f);g!==null&&!(g.expirationTime>M&&B());){var V=g.callback;if(typeof V=="function"){g.callback=null,y=g.priorityLevel;var K=V(g.expirationTime<=M);if(M=e.unstable_now(),typeof K=="function"){g.callback=K,_(M),L=!0;break t}g===n(f)&&r(f),_(M)}else r(f);g=n(f)}if(g!==null)L=!0;else{var O=n(h);O!==null&&G(k,O.startTime-M),L=!1}}break e}finally{g=null,y=z,x=!1}L=void 0}}finally{L?Y():I=!1}}}var Y;if(typeof E=="function")Y=function(){E(W)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,U=Z.port2;Z.port1.onmessage=W,Y=function(){U.postMessage(null)}}else Y=function(){T(W,0)};function G(M,L){D=T(function(){M(e.unstable_now())},L)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(M){switch(y){case 1:case 2:case 3:var L=3;break;default:L=y}var z=y;y=L;try{return M()}finally{y=z}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(M,L){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var z=y;y=M;try{return L()}finally{y=z}},e.unstable_scheduleCallback=function(M,L,z){var V=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?V+z:V):z=V,M){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=z+K,M={id:m++,callback:L,priorityLevel:M,startTime:z,expirationTime:K,sortIndex:-1},z>V?(M.sortIndex=z,t(h,M),n(f)===null&&M===n(h)&&(j?(R(D),D=-1):j=!0,G(k,z-V))):(M.sortIndex=K,t(f,M),S||x||(S=!0,I||(I=!0,Y()))),M},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(M){var L=y;return function(){var z=y;y=L;try{return M.apply(this,arguments)}finally{y=z}}}})(mx)),mx}var VR;function iee(){return VR||(VR=1,px.exports=ree()),px.exports}var FR;function oee(){if(FR)return md;FR=1;var e=iee(),t=wb(),n=y_();function r(i){var l="https://react.dev/errors/"+i;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+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,d=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(d=l.return),i=l.return;while(i)}return l.tag===3?d: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 u(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 h(i){var l=i.alternate;if(!l){if(l=s(i),l===null)throw Error(r(188));return l!==i?null:i}for(var d=i,p=l;;){var b=d.return;if(b===null)break;var w=b.alternate;if(w===null){if(p=b.return,p!==null){d=p;continue}break}if(b.child===w.child){for(w=b.child;w;){if(w===d)return f(b),i;if(w===p)return f(b),l;w=w.sibling}throw Error(r(188))}if(d.return!==p.return)d=b,p=w;else{for(var A=!1,N=b.child;N;){if(N===d){A=!0,d=b,p=w;break}if(N===p){A=!0,p=b,d=w;break}N=N.sibling}if(!A){for(N=w.child;N;){if(N===d){A=!0,d=w,p=b;break}if(N===p){A=!0,p=w,d=b;break}N=N.sibling}if(!A)throw Error(r(189))}}if(d.alternate!==p)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?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"),x=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),E=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function Y(i){return i===null||typeof i!="object"?null:(i=W&&i[W]||i["@@iterator"],typeof i=="function"?i:null)}var Z=Symbol.for("react.client.reference");function U(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Z?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case j:return"Fragment";case T:return"Profiler";case C:return"StrictMode";case k:return"Suspense";case I:return"SuspenseList";case $:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case E: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 D:return l=i.displayName||null,l!==null?l:U(i.type)||"Memo";case P:l=i._payload,i=i._init;try{return U(i(l))}catch{}}return null}var G=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},V=[],K=-1;function O(i){return{current:i}}function F(i){0>K||(i.current=V[K],V[K]=null,K--)}function se(i,l){K++,V[K]=i.current,i.current=l}var de=O(null),ye=O(null),je=O(null),Ee=O(null);function Ke(i,l){switch(se(je,l),se(ye,i),se(de,null),l.nodeType){case 9:case 11:i=(i=l.documentElement)&&(i=i.namespaceURI)?AC(i):0;break;default:if(i=l.tagName,l=l.namespaceURI)l=AC(l),i=kC(l,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}F(de),se(de,i)}function De(){F(de),F(ye),F(je)}function dt(i){i.memoizedState!==null&&se(Ee,i);var l=de.current,d=kC(l,i.type);l!==d&&(se(ye,i),se(de,d))}function Ct(i){ye.current===i&&(F(de),F(ye)),Ee.current===i&&(F(Ee),sd._currentValue=z)}var rt,nt;function mt(i){if(rt===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);rt=l&&l[1]||"",nt=-1<d.stack.indexOf(`
|
|
207
|
-
at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
208
|
-
`+rt+i+nt}var Tt=!1;function wt(i,l){if(!i||Tt)return"";Tt=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={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(ue){var ae=ue}Reflect.construct(i,[],ve)}else{try{ve.call()}catch(ue){ae=ue}i.call(ve.prototype)}}else{try{throw Error()}catch(ue){ae=ue}(ve=i())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(ue){if(ue&&ae&&typeof ue.stack=="string")return[ue.stack,ae.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=p.DetermineComponentFrameRoot(),A=w[0],N=w[1];if(A&&N){var q=A.split(`
|
|
209
|
-
`),re=N.split(`
|
|
210
|
-
`);for(b=p=0;p<q.length&&!q[p].includes("DetermineComponentFrameRoot");)p++;for(;b<re.length&&!re[b].includes("DetermineComponentFrameRoot");)b++;if(p===q.length||b===re.length)for(p=q.length-1,b=re.length-1;1<=p&&0<=b&&q[p]!==re[b];)b--;for(;1<=p&&0<=b;p--,b--)if(q[p]!==re[b]){if(p!==1||b!==1)do if(p--,b--,0>b||q[p]!==re[b]){var fe=`
|
|
211
|
-
`+q[p].replace(" at new "," at ");return i.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",i.displayName)),fe}while(1<=p&&0<=b);break}}}finally{Tt=!1,Error.prepareStackTrace=d}return(d=i?i.displayName||i.name:"")?mt(d):""}function Te(i,l){switch(i.tag){case 26:case 27:case 5:return mt(i.type);case 16:return mt("Lazy");case 13:return i.child!==l&&l!==null?mt("Suspense Fallback"):mt("Suspense");case 19:return mt("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 mt("Activity");default:return""}}function Pe(i){try{var l="",d=null;do l+=Te(i,d),d=i,i=i.return;while(i);return l}catch(p){return`
|
|
212
|
-
Error generating stack: `+p.message+`
|
|
213
|
-
`+p.stack}}var Ne=Object.prototype.hasOwnProperty,Ie=e.unstable_scheduleCallback,lt=e.unstable_cancelCallback,et=e.unstable_shouldYield,ft=e.unstable_requestPaint,pe=e.unstable_now,qe=e.unstable_getCurrentPriorityLevel,Ce=e.unstable_ImmediatePriority,ke=e.unstable_UserBlockingPriority,kt=e.unstable_NormalPriority,pn=e.unstable_LowPriority,mn=e.unstable_IdlePriority,Kn=e.log,nn=e.unstable_setDisableYieldValue,Sr=null,Qt=null;function hr(i){if(typeof Kn=="function"&&nn(i),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(Sr,i)}catch{}}var zn=Math.clz32?Math.clz32:La,vi=Math.log,Ko=Math.LN2;function La(i){return i>>>=0,i===0?32:31-(vi(i)/Ko|0)|0}var Hi=256,yi=262144,mo=4194304;function qi(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 go(i,l,d){var p=i.pendingLanes;if(p===0)return 0;var b=0,w=i.suspendedLanes,A=i.pingedLanes;i=i.warmLanes;var N=p&134217727;return N!==0?(p=N&~w,p!==0?b=qi(p):(A&=N,A!==0?b=qi(A):d||(d=N&~i,d!==0&&(b=qi(d))))):(N=p&~w,N!==0?b=qi(N):A!==0?b=qi(A):d||(d=p&~i,d!==0&&(b=qi(d)))),b===0?0:l!==0&&l!==b&&(l&w)===0&&(w=b&-b,d=l&-l,w>=d||w===32&&(d&4194048)!==0)?l:b}function Gi(i,l){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&l)===0}function Ia(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 pr(){var i=mo;return mo<<=1,(mo&62914560)===0&&(mo=4194304),i}function Wi(i){for(var l=[],d=0;31>d;d++)l.push(i);return l}function Nn(i,l){i.pendingLanes|=l,l!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Su(i,l,d,p,b,w){var A=i.pendingLanes;i.pendingLanes=d,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=d,i.entangledLanes&=d,i.errorRecoveryDisabledLanes&=d,i.shellSuspendCounter=0;var N=i.entanglements,q=i.expirationTimes,re=i.hiddenUpdates;for(d=A&~d;0<d;){var fe=31-zn(d),ve=1<<fe;N[fe]=0,q[fe]=-1;var ae=re[fe];if(ae!==null)for(re[fe]=null,fe=0;fe<ae.length;fe++){var ue=ae[fe];ue!==null&&(ue.lane&=-536870913)}d&=~ve}p!==0&&wu(i,p,0),w!==0&&b===0&&i.tag!==0&&(i.suspendedLanes|=w&~(A&~l))}function wu(i,l,d){i.pendingLanes|=l,i.suspendedLanes&=~l;var p=31-zn(l);i.entangledLanes|=l,i.entanglements[p]=i.entanglements[p]|1073741824|d&261930}function H(i,l){var d=i.entangledLanes|=l;for(i=i.entanglements;d;){var p=31-zn(d),b=1<<p;b&l|i[p]&l&&(i[p]|=l),d&=~b}}function X(i,l){var d=l&-l;return d=(d&42)!==0?1:ee(d),(d&(i.suspendedLanes|l))!==0?0:d}function ee(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 Se(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function _e(){var i=L.p;return i!==0?i:(i=window.event,i===void 0?32:eE(i.type))}function Xe(i,l){var d=L.p;try{return L.p=i,l()}finally{L.p=d}}var ze=Math.random().toString(36).slice(2),Me="__reactFiber$"+ze,Ue="__reactProps$"+ze,Qe="__reactContainer$"+ze,at="__reactEvents$"+ze,tt="__reactListeners$"+ze,Pt="__reactHandles$"+ze,Rt="__reactResources$"+ze,gn="__reactMarker$"+ze;function st(i){delete i[Me],delete i[Ue],delete i[at],delete i[tt],delete i[Pt]}function vn(i){var l=i[Me];if(l)return l;for(var d=i.parentNode;d;){if(l=d[Qe]||d[Me]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(i=zC(i);i!==null;){if(d=i[Me])return d;i=zC(i)}return l}i=d,d=i.parentNode}return null}function _t(i){if(i=i[Me]||i[Qe]){var l=i.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return i}return null}function Xn(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i.stateNode;throw Error(r(33))}function Ur(i){var l=i[Rt];return l||(l=i[Rt]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Dn(i){i[gn]=!0}var Qi=new Set,ti={};function Yi(i,l){xi(i,l),xi(i+"Capture",l)}function xi(i,l){for(ti[i]=l,i=0;i<l.length;i++)Qi.add(l[i])}var Xo=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]*$"),Ls={},Is={};function Mt(i){return Ne.call(Is,i)?!0:Ne.call(Ls,i)?!1:Xo.test(i)?Is[i]=!0:(Ls[i]=!0,!1)}function Fn(i,l,d){if(Mt(l))if(d===null)i.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":i.removeAttribute(l);return;case"boolean":var p=l.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){i.removeAttribute(l);return}}i.setAttribute(l,""+d)}}function Ki(i,l,d){if(d===null)i.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(l);return}i.setAttribute(l,""+d)}}function mr(i,l,d,p){if(p===null)i.removeAttribute(d);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(d);return}i.setAttributeNS(l,d,""+p)}}function Lt(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function zs(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function zf(i,l,d){var p=Object.getOwnPropertyDescriptor(i.constructor.prototype,l);if(!i.hasOwnProperty(l)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var b=p.get,w=p.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return b.call(this)},set:function(A){d=""+A,w.call(this,A)}}),Object.defineProperty(i,l,{enumerable:p.enumerable}),{getValue:function(){return d},setValue:function(A){d=""+A},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function ju(i){if(!i._valueTracker){var l=zs(i)?"checked":"value";i._valueTracker=zf(i,l,""+i[l])}}function j1(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var d=l.getValue(),p="";return i&&(p=zs(i)?i.checked?"true":"false":i.value),i=p,i!==d?(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 hO=/[\n"\\]/g;function bi(i){return i.replace(hO,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function wg(i,l,d,p,b,w,A,N){i.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?i.type=A:i.removeAttribute("type"),l!=null?A==="number"?(l===0&&i.value===""||i.value!=l)&&(i.value=""+Lt(l)):i.value!==""+Lt(l)&&(i.value=""+Lt(l)):A!=="submit"&&A!=="reset"||i.removeAttribute("value"),l!=null?jg(i,A,Lt(l)):d!=null?jg(i,A,Lt(d)):p!=null&&i.removeAttribute("value"),b==null&&w!=null&&(i.defaultChecked=!!w),b!=null&&(i.checked=b&&typeof b!="function"&&typeof b!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?i.name=""+Lt(N):i.removeAttribute("name")}function C1(i,l,d,p,b,w,A,N){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(i.type=w),l!=null||d!=null){if(!(w!=="submit"&&w!=="reset"||l!=null)){ju(i);return}d=d!=null?""+Lt(d):"",l=l!=null?""+Lt(l):d,N||l===i.value||(i.value=l),i.defaultValue=l}p=p??b,p=typeof p!="function"&&typeof p!="symbol"&&!!p,i.checked=N?i.checked:!!p,i.defaultChecked=!!p,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(i.name=A),ju(i)}function jg(i,l,d){l==="number"&&$f(i.ownerDocument)===i||i.defaultValue===""+d||(i.defaultValue=""+d)}function ql(i,l,d,p){if(i=i.options,l){l={};for(var b=0;b<d.length;b++)l["$"+d[b]]=!0;for(d=0;d<i.length;d++)b=l.hasOwnProperty("$"+i[d].value),i[d].selected!==b&&(i[d].selected=b),b&&p&&(i[d].defaultSelected=!0)}else{for(d=""+Lt(d),l=null,b=0;b<i.length;b++){if(i[b].value===d){i[b].selected=!0,p&&(i[b].defaultSelected=!0);return}l!==null||i[b].disabled||(l=i[b])}l!==null&&(l.selected=!0)}}function E1(i,l,d){if(l!=null&&(l=""+Lt(l),l!==i.value&&(i.value=l),d==null)){i.defaultValue!==l&&(i.defaultValue=l);return}i.defaultValue=d!=null?""+Lt(d):""}function T1(i,l,d,p){if(l==null){if(p!=null){if(d!=null)throw Error(r(92));if(G(p)){if(1<p.length)throw Error(r(93));p=p[0]}d=p}d==null&&(d=""),l=d}d=Lt(l),i.defaultValue=d,p=i.textContent,p===d&&p!==""&&p!==null&&(i.value=p),ju(i)}function Gl(i,l){if(l){var d=i.firstChild;if(d&&d===i.lastChild&&d.nodeType===3){d.nodeValue=l;return}}i.textContent=l}var pO=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 R1(i,l,d){var p=l.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?p?i.setProperty(l,""):l==="float"?i.cssFloat="":i[l]="":p?i.setProperty(l,d):typeof d!="number"||d===0||pO.has(l)?l==="float"?i.cssFloat=d:i[l]=(""+d).trim():i[l]=d+"px"}function _1(i,l,d){if(l!=null&&typeof l!="object")throw Error(r(62));if(i=i.style,d!=null){for(var p in d)!d.hasOwnProperty(p)||l!=null&&l.hasOwnProperty(p)||(p.indexOf("--")===0?i.setProperty(p,""):p==="float"?i.cssFloat="":i[p]="");for(var b in l)p=l[b],l.hasOwnProperty(b)&&d[b]!==p&&R1(i,b,p)}else for(var w in l)l.hasOwnProperty(w)&&R1(i,w,l[w])}function Cg(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 mO=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"]]),gO=/^[\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 Uf(i){return gO.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Jo(){}var Eg=null;function Tg(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Wl=null,Ql=null;function D1(i){var l=_t(i);if(l&&(i=l.stateNode)){var d=i[Ue]||null;e:switch(i=l.stateNode,l.type){case"input":if(wg(i,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),l=d.name,d.type==="radio"&&l!=null){for(d=i;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+bi(""+l)+'"][type="radio"]'),l=0;l<d.length;l++){var p=d[l];if(p!==i&&p.form===i.form){var b=p[Ue]||null;if(!b)throw Error(r(90));wg(p,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(l=0;l<d.length;l++)p=d[l],p.form===i.form&&j1(p)}break e;case"textarea":E1(i,d.value,d.defaultValue);break e;case"select":l=d.value,l!=null&&ql(i,!!d.multiple,l,!1)}}}var Rg=!1;function A1(i,l,d){if(Rg)return i(l,d);Rg=!0;try{var p=i(l);return p}finally{if(Rg=!1,(Wl!==null||Ql!==null)&&(Rh(),Wl&&(l=Wl,i=Ql,Ql=Wl=null,D1(l),i)))for(l=0;l<i.length;l++)D1(i[l])}}function Cu(i,l){var d=i.stateNode;if(d===null)return null;var p=d[Ue]||null;if(p===null)return null;d=p[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(i=i.type,p=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!p;break e;default:i=!1}if(i)return null;if(d&&typeof d!="function")throw Error(r(231,l,typeof d));return d}var Zo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_g=!1;if(Zo)try{var Eu={};Object.defineProperty(Eu,"passive",{get:function(){_g=!0}}),window.addEventListener("test",Eu,Eu),window.removeEventListener("test",Eu,Eu)}catch{_g=!1}var za=null,Dg=null,Bf=null;function k1(){if(Bf)return Bf;var i,l=Dg,d=l.length,p,b="value"in za?za.value:za.textContent,w=b.length;for(i=0;i<d&&l[i]===b[i];i++);var A=d-i;for(p=1;p<=A&&l[d-p]===b[w-p];p++);return Bf=b.slice(i,1<p?1-p:void 0)}function Vf(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 Ff(){return!0}function P1(){return!1}function Br(i){function l(d,p,b,w,A){this._reactName=d,this._targetInst=b,this.type=p,this.nativeEvent=w,this.target=A,this.currentTarget=null;for(var N in i)i.hasOwnProperty(N)&&(d=i[N],this[N]=d?d(w):w[N]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?Ff:P1,this.isPropagationStopped=P1,this}return g(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Ff)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Ff)},persist:function(){},isPersistent:Ff}),l}var $s={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hf=Br($s),Tu=g({},$s,{view:0,detail:0}),vO=Br(Tu),Ag,kg,Ru,qf=g({},Tu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ng,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!==Ru&&(Ru&&i.type==="mousemove"?(Ag=i.screenX-Ru.screenX,kg=i.screenY-Ru.screenY):kg=Ag=0,Ru=i),Ag)},movementY:function(i){return"movementY"in i?i.movementY:kg}}),N1=Br(qf),yO=g({},qf,{dataTransfer:0}),xO=Br(yO),bO=g({},Tu,{relatedTarget:0}),Pg=Br(bO),SO=g({},$s,{animationName:0,elapsedTime:0,pseudoElement:0}),wO=Br(SO),jO=g({},$s,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),CO=Br(jO),EO=g({},$s,{data:0}),O1=Br(EO),TO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},RO={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"},_O={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function DO(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=_O[i])?!!l[i]:!1}function Ng(){return DO}var AO=g({},Tu,{key:function(i){if(i.key){var l=TO[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=Vf(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?RO[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ng,charCode:function(i){return i.type==="keypress"?Vf(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Vf(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),kO=Br(AO),PO=g({},qf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),M1=Br(PO),NO=g({},Tu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ng}),OO=Br(NO),MO=g({},$s,{propertyName:0,elapsedTime:0,pseudoElement:0}),LO=Br(MO),IO=g({},qf,{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}),zO=Br(IO),$O=g({},$s,{newState:0,oldState:0}),UO=Br($O),BO=[9,13,27,32],Og=Zo&&"CompositionEvent"in window,_u=null;Zo&&"documentMode"in document&&(_u=document.documentMode);var VO=Zo&&"TextEvent"in window&&!_u,L1=Zo&&(!Og||_u&&8<_u&&11>=_u),I1=" ",z1=!1;function $1(i,l){switch(i){case"keyup":return BO.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function U1(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Yl=!1;function FO(i,l){switch(i){case"compositionend":return U1(l);case"keypress":return l.which!==32?null:(z1=!0,I1);case"textInput":return i=l.data,i===I1&&z1?null:i;default:return null}}function HO(i,l){if(Yl)return i==="compositionend"||!Og&&$1(i,l)?(i=k1(),Bf=Dg=za=null,Yl=!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 L1&&l.locale!=="ko"?null:l.data;default:return null}}var qO={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 B1(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!qO[i.type]:l==="textarea"}function V1(i,l,d,p){Wl?Ql?Ql.push(p):Ql=[p]:Wl=p,l=Oh(l,"onChange"),0<l.length&&(d=new Hf("onChange","change",null,d,p),i.push({event:d,listeners:l}))}var Du=null,Au=null;function GO(i){CC(i,0)}function Gf(i){var l=Xn(i);if(j1(l))return i}function F1(i,l){if(i==="change")return l}var H1=!1;if(Zo){var Mg;if(Zo){var Lg="oninput"in document;if(!Lg){var q1=document.createElement("div");q1.setAttribute("oninput","return;"),Lg=typeof q1.oninput=="function"}Mg=Lg}else Mg=!1;H1=Mg&&(!document.documentMode||9<document.documentMode)}function G1(){Du&&(Du.detachEvent("onpropertychange",W1),Au=Du=null)}function W1(i){if(i.propertyName==="value"&&Gf(Au)){var l=[];V1(l,Au,i,Tg(i)),A1(GO,l)}}function WO(i,l,d){i==="focusin"?(G1(),Du=l,Au=d,Du.attachEvent("onpropertychange",W1)):i==="focusout"&&G1()}function QO(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Gf(Au)}function YO(i,l){if(i==="click")return Gf(l)}function KO(i,l){if(i==="input"||i==="change")return Gf(l)}function XO(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var ni=typeof Object.is=="function"?Object.is:XO;function ku(i,l){if(ni(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var d=Object.keys(i),p=Object.keys(l);if(d.length!==p.length)return!1;for(p=0;p<d.length;p++){var b=d[p];if(!Ne.call(l,b)||!ni(i[b],l[b]))return!1}return!0}function Q1(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function Y1(i,l){var d=Q1(i);i=0;for(var p;d;){if(d.nodeType===3){if(p=i+d.textContent.length,i<=l&&p>=l)return{node:d,offset:l-i};i=p}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=Q1(d)}}function K1(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?K1(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function X1(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 d=typeof l.contentWindow.location.href=="string"}catch{d=!1}if(d)i=l.contentWindow;else break;l=$f(i.document)}return l}function Ig(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 JO=Zo&&"documentMode"in document&&11>=document.documentMode,Kl=null,zg=null,Pu=null,$g=!1;function J1(i,l,d){var p=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;$g||Kl==null||Kl!==$f(p)||(p=Kl,"selectionStart"in p&&Ig(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Pu&&ku(Pu,p)||(Pu=p,p=Oh(zg,"onSelect"),0<p.length&&(l=new Hf("onSelect","select",null,l,d),i.push({event:l,listeners:p}),l.target=Kl)))}function Us(i,l){var d={};return d[i.toLowerCase()]=l.toLowerCase(),d["Webkit"+i]="webkit"+l,d["Moz"+i]="moz"+l,d}var Xl={animationend:Us("Animation","AnimationEnd"),animationiteration:Us("Animation","AnimationIteration"),animationstart:Us("Animation","AnimationStart"),transitionrun:Us("Transition","TransitionRun"),transitionstart:Us("Transition","TransitionStart"),transitioncancel:Us("Transition","TransitionCancel"),transitionend:Us("Transition","TransitionEnd")},Ug={},Z1={};Zo&&(Z1=document.createElement("div").style,"AnimationEvent"in window||(delete Xl.animationend.animation,delete Xl.animationiteration.animation,delete Xl.animationstart.animation),"TransitionEvent"in window||delete Xl.transitionend.transition);function Bs(i){if(Ug[i])return Ug[i];if(!Xl[i])return i;var l=Xl[i],d;for(d in l)if(l.hasOwnProperty(d)&&d in Z1)return Ug[i]=l[d];return i}var ew=Bs("animationend"),tw=Bs("animationiteration"),nw=Bs("animationstart"),ZO=Bs("transitionrun"),e4=Bs("transitionstart"),t4=Bs("transitioncancel"),rw=Bs("transitionend"),iw=new Map,Bg="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(" ");Bg.push("scrollEnd");function Xi(i,l){iw.set(i,l),Yi(l,[i])}var Wf=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)},Si=[],Jl=0,Vg=0;function Qf(){for(var i=Jl,l=Vg=Jl=0;l<i;){var d=Si[l];Si[l++]=null;var p=Si[l];Si[l++]=null;var b=Si[l];Si[l++]=null;var w=Si[l];if(Si[l++]=null,p!==null&&b!==null){var A=p.pending;A===null?b.next=b:(b.next=A.next,A.next=b),p.pending=b}w!==0&&ow(d,b,w)}}function Yf(i,l,d,p){Si[Jl++]=i,Si[Jl++]=l,Si[Jl++]=d,Si[Jl++]=p,Vg|=p,i.lanes|=p,i=i.alternate,i!==null&&(i.lanes|=p)}function Fg(i,l,d,p){return Yf(i,l,d,p),Kf(i)}function Vs(i,l){return Yf(i,null,null,l),Kf(i)}function ow(i,l,d){i.lanes|=d;var p=i.alternate;p!==null&&(p.lanes|=d);for(var b=!1,w=i.return;w!==null;)w.childLanes|=d,p=w.alternate,p!==null&&(p.childLanes|=d),w.tag===22&&(i=w.stateNode,i===null||i._visibility&1||(b=!0)),i=w,w=w.return;return i.tag===3?(w=i.stateNode,b&&l!==null&&(b=31-zn(d),i=w.hiddenUpdates,p=i[b],p===null?i[b]=[l]:p.push(l),l.lane=d|536870912),w):null}function Kf(i){if(50<ed)throw ed=0,Jv=null,Error(r(185));for(var l=i.return;l!==null;)i=l,l=i.return;return i.tag===3?i.stateNode:null}var Zl={};function n4(i,l,d,p){this.tag=i,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ri(i,l,d,p){return new n4(i,l,d,p)}function Hg(i){return i=i.prototype,!(!i||!i.isReactComponent)}function ea(i,l){var d=i.alternate;return d===null?(d=ri(i.tag,l,i.key,i.mode),d.elementType=i.elementType,d.type=i.type,d.stateNode=i.stateNode,d.alternate=i,i.alternate=d):(d.pendingProps=l,d.type=i.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=i.flags&65011712,d.childLanes=i.childLanes,d.lanes=i.lanes,d.child=i.child,d.memoizedProps=i.memoizedProps,d.memoizedState=i.memoizedState,d.updateQueue=i.updateQueue,l=i.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=i.sibling,d.index=i.index,d.ref=i.ref,d.refCleanup=i.refCleanup,d}function aw(i,l){i.flags&=65011714;var d=i.alternate;return d===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=d.childLanes,i.lanes=d.lanes,i.child=d.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=d.memoizedProps,i.memoizedState=d.memoizedState,i.updateQueue=d.updateQueue,i.type=d.type,l=d.dependencies,i.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),i}function Xf(i,l,d,p,b,w){var A=0;if(p=i,typeof i=="function")Hg(i)&&(A=1);else if(typeof i=="string")A=s3(i,d,de.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case $:return i=ri(31,d,l,b),i.elementType=$,i.lanes=w,i;case j:return Fs(d.children,b,w,l);case C:A=8,b|=24;break;case T:return i=ri(12,d,l,b|2),i.elementType=T,i.lanes=w,i;case k:return i=ri(13,d,l,b),i.elementType=k,i.lanes=w,i;case I:return i=ri(19,d,l,b),i.elementType=I,i.lanes=w,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case E:A=10;break e;case R:A=9;break e;case _:A=11;break e;case D:A=14;break e;case P:A=16,p=null;break e}A=29,d=Error(r(130,i===null?"null":typeof i,"")),p=null}return l=ri(A,d,l,b),l.elementType=i,l.type=p,l.lanes=w,l}function Fs(i,l,d,p){return i=ri(7,i,p,l),i.lanes=d,i}function qg(i,l,d){return i=ri(6,i,null,l),i.lanes=d,i}function sw(i){var l=ri(18,null,null,0);return l.stateNode=i,l}function Gg(i,l,d){return l=ri(4,i.children!==null?i.children:[],i.key,l),l.lanes=d,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}var lw=new WeakMap;function wi(i,l){if(typeof i=="object"&&i!==null){var d=lw.get(i);return d!==void 0?d:(l={value:i,source:l,stack:Pe(l)},lw.set(i,l),l)}return{value:i,source:l,stack:Pe(l)}}var ec=[],tc=0,Jf=null,Nu=0,ji=[],Ci=0,$a=null,vo=1,yo="";function ta(i,l){ec[tc++]=Nu,ec[tc++]=Jf,Jf=i,Nu=l}function cw(i,l,d){ji[Ci++]=vo,ji[Ci++]=yo,ji[Ci++]=$a,$a=i;var p=vo;i=yo;var b=32-zn(p)-1;p&=~(1<<b),d+=1;var w=32-zn(l)+b;if(30<w){var A=b-b%5;w=(p&(1<<A)-1).toString(32),p>>=A,b-=A,vo=1<<32-zn(l)+b|d<<b|p,yo=w+i}else vo=1<<w|d<<b|p,yo=i}function Wg(i){i.return!==null&&(ta(i,1),cw(i,1,0))}function Qg(i){for(;i===Jf;)Jf=ec[--tc],ec[tc]=null,Nu=ec[--tc],ec[tc]=null;for(;i===$a;)$a=ji[--Ci],ji[Ci]=null,yo=ji[--Ci],ji[Ci]=null,vo=ji[--Ci],ji[Ci]=null}function uw(i,l){ji[Ci++]=vo,ji[Ci++]=yo,ji[Ci++]=$a,vo=l.id,yo=l.overflow,$a=i}var gr=null,xn=null,It=!1,Ua=null,Ei=!1,Yg=Error(r(519));function Ba(i){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ou(wi(l,i)),Yg}function dw(i){var l=i.stateNode,d=i.type,p=i.memoizedProps;switch(l[Me]=i,l[Ue]=p,d){case"dialog":At("cancel",l),At("close",l);break;case"iframe":case"object":case"embed":At("load",l);break;case"video":case"audio":for(d=0;d<nd.length;d++)At(nd[d],l);break;case"source":At("error",l);break;case"img":case"image":case"link":At("error",l),At("load",l);break;case"details":At("toggle",l);break;case"input":At("invalid",l),C1(l,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":At("invalid",l);break;case"textarea":At("invalid",l),T1(l,p.value,p.defaultValue,p.children)}d=p.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||l.textContent===""+d||p.suppressHydrationWarning===!0||_C(l.textContent,d)?(p.popover!=null&&(At("beforetoggle",l),At("toggle",l)),p.onScroll!=null&&At("scroll",l),p.onScrollEnd!=null&&At("scrollend",l),p.onClick!=null&&(l.onclick=Jo),l=!0):l=!1,l||Ba(i,!0)}function fw(i){for(gr=i.return;gr;)switch(gr.tag){case 5:case 31:case 13:Ei=!1;return;case 27:case 3:Ei=!0;return;default:gr=gr.return}}function nc(i){if(i!==gr)return!1;if(!It)return fw(i),It=!0,!1;var l=i.tag,d;if((d=l!==3&&l!==27)&&((d=l===5)&&(d=i.type,d=!(d!=="form"&&d!=="button")||hy(i.type,i.memoizedProps)),d=!d),d&&xn&&Ba(i),fw(i),l===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));xn=IC(i)}else if(l===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));xn=IC(i)}else l===27?(l=xn,ts(i.type)?(i=yy,yy=null,xn=i):xn=l):xn=gr?Ri(i.stateNode.nextSibling):null;return!0}function Hs(){xn=gr=null,It=!1}function Kg(){var i=Ua;return i!==null&&(qr===null?qr=i:qr.push.apply(qr,i),Ua=null),i}function Ou(i){Ua===null?Ua=[i]:Ua.push(i)}var Xg=O(null),qs=null,na=null;function Va(i,l,d){se(Xg,l._currentValue),l._currentValue=d}function ra(i){i._currentValue=Xg.current,F(Xg)}function Jg(i,l,d){for(;i!==null;){var p=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,p!==null&&(p.childLanes|=l)):p!==null&&(p.childLanes&l)!==l&&(p.childLanes|=l),i===d)break;i=i.return}}function Zg(i,l,d,p){var b=i.child;for(b!==null&&(b.return=i);b!==null;){var w=b.dependencies;if(w!==null){var A=b.child;w=w.firstContext;e:for(;w!==null;){var N=w;w=b;for(var q=0;q<l.length;q++)if(N.context===l[q]){w.lanes|=d,N=w.alternate,N!==null&&(N.lanes|=d),Jg(w.return,d,i),p||(A=null);break e}w=N.next}}else if(b.tag===18){if(A=b.return,A===null)throw Error(r(341));A.lanes|=d,w=A.alternate,w!==null&&(w.lanes|=d),Jg(A,d,i),A=null}else A=b.child;if(A!==null)A.return=b;else for(A=b;A!==null;){if(A===i){A=null;break}if(b=A.sibling,b!==null){b.return=A.return,A=b;break}A=A.return}b=A}}function rc(i,l,d,p){i=null;for(var b=l,w=!1;b!==null;){if(!w){if((b.flags&524288)!==0)w=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var A=b.alternate;if(A===null)throw Error(r(387));if(A=A.memoizedProps,A!==null){var N=b.type;ni(b.pendingProps.value,A.value)||(i!==null?i.push(N):i=[N])}}else if(b===Ee.current){if(A=b.alternate,A===null)throw Error(r(387));A.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(i!==null?i.push(sd):i=[sd])}b=b.return}i!==null&&Zg(l,i,d,p),l.flags|=262144}function Zf(i){for(i=i.firstContext;i!==null;){if(!ni(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Gs(i){qs=i,na=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function vr(i){return hw(qs,i)}function eh(i,l){return qs===null&&Gs(i),hw(i,l)}function hw(i,l){var d=l._currentValue;if(l={context:l,memoizedValue:d,next:null},na===null){if(i===null)throw Error(r(308));na=l,i.dependencies={lanes:0,firstContext:l},i.flags|=524288}else na=na.next=l;return d}var r4=typeof AbortController<"u"?AbortController:function(){var i=[],l=this.signal={aborted:!1,addEventListener:function(d,p){i.push(p)}};this.abort=function(){l.aborted=!0,i.forEach(function(d){return d()})}},i4=e.unstable_scheduleCallback,o4=e.unstable_NormalPriority,Jn={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ev(){return{controller:new r4,data:new Map,refCount:0}}function Mu(i){i.refCount--,i.refCount===0&&i4(o4,function(){i.controller.abort()})}var Lu=null,tv=0,ic=0,oc=null;function a4(i,l){if(Lu===null){var d=Lu=[];tv=0,ic=iy(),oc={status:"pending",value:void 0,then:function(p){d.push(p)}}}return tv++,l.then(pw,pw),l}function pw(){if(--tv===0&&Lu!==null){oc!==null&&(oc.status="fulfilled");var i=Lu;Lu=null,ic=0,oc=null;for(var l=0;l<i.length;l++)(0,i[l])()}}function s4(i,l){var d=[],p={status:"pending",value:null,reason:null,then:function(b){d.push(b)}};return i.then(function(){p.status="fulfilled",p.value=l;for(var b=0;b<d.length;b++)(0,d[b])(l)},function(b){for(p.status="rejected",p.reason=b,b=0;b<d.length;b++)(0,d[b])(void 0)}),p}var mw=M.S;M.S=function(i,l){Jj=pe(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&a4(i,l),mw!==null&&mw(i,l)};var Ws=O(null);function nv(){var i=Ws.current;return i!==null?i:sn.pooledCache}function th(i,l){l===null?se(Ws,Ws.current):se(Ws,l.pool)}function gw(){var i=nv();return i===null?null:{parent:Jn._currentValue,pool:i}}var ac=Error(r(460)),rv=Error(r(474)),nh=Error(r(542)),rh={then:function(){}};function vw(i){return i=i.status,i==="fulfilled"||i==="rejected"}function yw(i,l,d){switch(d=i[d],d===void 0?i.push(l):d!==l&&(l.then(Jo,Jo),l=d),l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,bw(i),i;default:if(typeof l.status=="string")l.then(Jo,Jo);else{if(i=sn,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=l,i.status="pending",i.then(function(p){if(l.status==="pending"){var b=l;b.status="fulfilled",b.value=p}},function(p){if(l.status==="pending"){var b=l;b.status="rejected",b.reason=p}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,bw(i),i}throw Ys=l,ac}}function Qs(i){try{var l=i._init;return l(i._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(Ys=d,ac):d}}var Ys=null;function xw(){if(Ys===null)throw Error(r(459));var i=Ys;return Ys=null,i}function bw(i){if(i===ac||i===nh)throw Error(r(483))}var sc=null,Iu=0;function ih(i){var l=Iu;return Iu+=1,sc===null&&(sc=[]),yw(sc,i,l)}function zu(i,l){l=l.props.ref,i.ref=l!==void 0?l:null}function oh(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 Sw(i){function l(J,Q){if(i){var ne=J.deletions;ne===null?(J.deletions=[Q],J.flags|=16):ne.push(Q)}}function d(J,Q){if(!i)return null;for(;Q!==null;)l(J,Q),Q=Q.sibling;return null}function p(J){for(var Q=new Map;J!==null;)J.key!==null?Q.set(J.key,J):Q.set(J.index,J),J=J.sibling;return Q}function b(J,Q){return J=ea(J,Q),J.index=0,J.sibling=null,J}function w(J,Q,ne){return J.index=ne,i?(ne=J.alternate,ne!==null?(ne=ne.index,ne<Q?(J.flags|=67108866,Q):ne):(J.flags|=67108866,Q)):(J.flags|=1048576,Q)}function A(J){return i&&J.alternate===null&&(J.flags|=67108866),J}function N(J,Q,ne,me){return Q===null||Q.tag!==6?(Q=qg(ne,J.mode,me),Q.return=J,Q):(Q=b(Q,ne),Q.return=J,Q)}function q(J,Q,ne,me){var it=ne.type;return it===j?fe(J,Q,ne.props.children,me,ne.key):Q!==null&&(Q.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===P&&Qs(it)===Q.type)?(Q=b(Q,ne.props),zu(Q,ne),Q.return=J,Q):(Q=Xf(ne.type,ne.key,ne.props,null,J.mode,me),zu(Q,ne),Q.return=J,Q)}function re(J,Q,ne,me){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==ne.containerInfo||Q.stateNode.implementation!==ne.implementation?(Q=Gg(ne,J.mode,me),Q.return=J,Q):(Q=b(Q,ne.children||[]),Q.return=J,Q)}function fe(J,Q,ne,me,it){return Q===null||Q.tag!==7?(Q=Fs(ne,J.mode,me,it),Q.return=J,Q):(Q=b(Q,ne),Q.return=J,Q)}function ve(J,Q,ne){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=qg(""+Q,J.mode,ne),Q.return=J,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case x:return ne=Xf(Q.type,Q.key,Q.props,null,J.mode,ne),zu(ne,Q),ne.return=J,ne;case S:return Q=Gg(Q,J.mode,ne),Q.return=J,Q;case P:return Q=Qs(Q),ve(J,Q,ne)}if(G(Q)||Y(Q))return Q=Fs(Q,J.mode,ne,null),Q.return=J,Q;if(typeof Q.then=="function")return ve(J,ih(Q),ne);if(Q.$$typeof===E)return ve(J,eh(J,Q),ne);oh(J,Q)}return null}function ae(J,Q,ne,me){var it=Q!==null?Q.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return it!==null?null:N(J,Q,""+ne,me);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case x:return ne.key===it?q(J,Q,ne,me):null;case S:return ne.key===it?re(J,Q,ne,me):null;case P:return ne=Qs(ne),ae(J,Q,ne,me)}if(G(ne)||Y(ne))return it!==null?null:fe(J,Q,ne,me,null);if(typeof ne.then=="function")return ae(J,Q,ih(ne),me);if(ne.$$typeof===E)return ae(J,Q,eh(J,ne),me);oh(J,ne)}return null}function ue(J,Q,ne,me,it){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return J=J.get(ne)||null,N(Q,J,""+me,it);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case x:return J=J.get(me.key===null?ne:me.key)||null,q(Q,J,me,it);case S:return J=J.get(me.key===null?ne:me.key)||null,re(Q,J,me,it);case P:return me=Qs(me),ue(J,Q,ne,me,it)}if(G(me)||Y(me))return J=J.get(ne)||null,fe(Q,J,me,it,null);if(typeof me.then=="function")return ue(J,Q,ne,ih(me),it);if(me.$$typeof===E)return ue(J,Q,ne,eh(Q,me),it);oh(Q,me)}return null}function We(J,Q,ne,me){for(var it=null,Ft=null,Je=Q,jt=Q=0,Ot=null;Je!==null&&jt<ne.length;jt++){Je.index>jt?(Ot=Je,Je=null):Ot=Je.sibling;var Ht=ae(J,Je,ne[jt],me);if(Ht===null){Je===null&&(Je=Ot);break}i&&Je&&Ht.alternate===null&&l(J,Je),Q=w(Ht,Q,jt),Ft===null?it=Ht:Ft.sibling=Ht,Ft=Ht,Je=Ot}if(jt===ne.length)return d(J,Je),It&&ta(J,jt),it;if(Je===null){for(;jt<ne.length;jt++)Je=ve(J,ne[jt],me),Je!==null&&(Q=w(Je,Q,jt),Ft===null?it=Je:Ft.sibling=Je,Ft=Je);return It&&ta(J,jt),it}for(Je=p(Je);jt<ne.length;jt++)Ot=ue(Je,J,jt,ne[jt],me),Ot!==null&&(i&&Ot.alternate!==null&&Je.delete(Ot.key===null?jt:Ot.key),Q=w(Ot,Q,jt),Ft===null?it=Ot:Ft.sibling=Ot,Ft=Ot);return i&&Je.forEach(function(as){return l(J,as)}),It&&ta(J,jt),it}function ct(J,Q,ne,me){if(ne==null)throw Error(r(151));for(var it=null,Ft=null,Je=Q,jt=Q=0,Ot=null,Ht=ne.next();Je!==null&&!Ht.done;jt++,Ht=ne.next()){Je.index>jt?(Ot=Je,Je=null):Ot=Je.sibling;var as=ae(J,Je,Ht.value,me);if(as===null){Je===null&&(Je=Ot);break}i&&Je&&as.alternate===null&&l(J,Je),Q=w(as,Q,jt),Ft===null?it=as:Ft.sibling=as,Ft=as,Je=Ot}if(Ht.done)return d(J,Je),It&&ta(J,jt),it;if(Je===null){for(;!Ht.done;jt++,Ht=ne.next())Ht=ve(J,Ht.value,me),Ht!==null&&(Q=w(Ht,Q,jt),Ft===null?it=Ht:Ft.sibling=Ht,Ft=Ht);return It&&ta(J,jt),it}for(Je=p(Je);!Ht.done;jt++,Ht=ne.next())Ht=ue(Je,J,jt,Ht.value,me),Ht!==null&&(i&&Ht.alternate!==null&&Je.delete(Ht.key===null?jt:Ht.key),Q=w(Ht,Q,jt),Ft===null?it=Ht:Ft.sibling=Ht,Ft=Ht);return i&&Je.forEach(function(y3){return l(J,y3)}),It&&ta(J,jt),it}function an(J,Q,ne,me){if(typeof ne=="object"&&ne!==null&&ne.type===j&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case x:e:{for(var it=ne.key;Q!==null;){if(Q.key===it){if(it=ne.type,it===j){if(Q.tag===7){d(J,Q.sibling),me=b(Q,ne.props.children),me.return=J,J=me;break e}}else if(Q.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===P&&Qs(it)===Q.type){d(J,Q.sibling),me=b(Q,ne.props),zu(me,ne),me.return=J,J=me;break e}d(J,Q);break}else l(J,Q);Q=Q.sibling}ne.type===j?(me=Fs(ne.props.children,J.mode,me,ne.key),me.return=J,J=me):(me=Xf(ne.type,ne.key,ne.props,null,J.mode,me),zu(me,ne),me.return=J,J=me)}return A(J);case S:e:{for(it=ne.key;Q!==null;){if(Q.key===it)if(Q.tag===4&&Q.stateNode.containerInfo===ne.containerInfo&&Q.stateNode.implementation===ne.implementation){d(J,Q.sibling),me=b(Q,ne.children||[]),me.return=J,J=me;break e}else{d(J,Q);break}else l(J,Q);Q=Q.sibling}me=Gg(ne,J.mode,me),me.return=J,J=me}return A(J);case P:return ne=Qs(ne),an(J,Q,ne,me)}if(G(ne))return We(J,Q,ne,me);if(Y(ne)){if(it=Y(ne),typeof it!="function")throw Error(r(150));return ne=it.call(ne),ct(J,Q,ne,me)}if(typeof ne.then=="function")return an(J,Q,ih(ne),me);if(ne.$$typeof===E)return an(J,Q,eh(J,ne),me);oh(J,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,Q!==null&&Q.tag===6?(d(J,Q.sibling),me=b(Q,ne),me.return=J,J=me):(d(J,Q),me=qg(ne,J.mode,me),me.return=J,J=me),A(J)):d(J,Q)}return function(J,Q,ne,me){try{Iu=0;var it=an(J,Q,ne,me);return sc=null,it}catch(Je){if(Je===ac||Je===nh)throw Je;var Ft=ri(29,Je,null,J.mode);return Ft.lanes=me,Ft.return=J,Ft}}}var Ks=Sw(!0),ww=Sw(!1),Fa=!1;function iv(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ov(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 Ha(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function qa(i,l,d){var p=i.updateQueue;if(p===null)return null;if(p=p.shared,(Gt&2)!==0){var b=p.pending;return b===null?l.next=l:(l.next=b.next,b.next=l),p.pending=l,l=Kf(i),ow(i,null,d),l}return Yf(i,p,l,d),Kf(i)}function $u(i,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194048)!==0)){var p=l.lanes;p&=i.pendingLanes,d|=p,l.lanes=d,H(i,d)}}function av(i,l){var d=i.updateQueue,p=i.alternate;if(p!==null&&(p=p.updateQueue,d===p)){var b=null,w=null;if(d=d.firstBaseUpdate,d!==null){do{var A={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};w===null?b=w=A:w=w.next=A,d=d.next}while(d!==null);w===null?b=w=l:w=w.next=l}else b=w=l;d={baseState:p.baseState,firstBaseUpdate:b,lastBaseUpdate:w,shared:p.shared,callbacks:p.callbacks},i.updateQueue=d;return}i=d.lastBaseUpdate,i===null?d.firstBaseUpdate=l:i.next=l,d.lastBaseUpdate=l}var sv=!1;function Uu(){if(sv){var i=oc;if(i!==null)throw i}}function Bu(i,l,d,p){sv=!1;var b=i.updateQueue;Fa=!1;var w=b.firstBaseUpdate,A=b.lastBaseUpdate,N=b.shared.pending;if(N!==null){b.shared.pending=null;var q=N,re=q.next;q.next=null,A===null?w=re:A.next=re,A=q;var fe=i.alternate;fe!==null&&(fe=fe.updateQueue,N=fe.lastBaseUpdate,N!==A&&(N===null?fe.firstBaseUpdate=re:N.next=re,fe.lastBaseUpdate=q))}if(w!==null){var ve=b.baseState;A=0,fe=re=q=null,N=w;do{var ae=N.lane&-536870913,ue=ae!==N.lane;if(ue?(Nt&ae)===ae:(p&ae)===ae){ae!==0&&ae===ic&&(sv=!0),fe!==null&&(fe=fe.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var We=i,ct=N;ae=l;var an=d;switch(ct.tag){case 1:if(We=ct.payload,typeof We=="function"){ve=We.call(an,ve,ae);break e}ve=We;break e;case 3:We.flags=We.flags&-65537|128;case 0:if(We=ct.payload,ae=typeof We=="function"?We.call(an,ve,ae):We,ae==null)break e;ve=g({},ve,ae);break e;case 2:Fa=!0}}ae=N.callback,ae!==null&&(i.flags|=64,ue&&(i.flags|=8192),ue=b.callbacks,ue===null?b.callbacks=[ae]:ue.push(ae))}else ue={lane:ae,tag:N.tag,payload:N.payload,callback:N.callback,next:null},fe===null?(re=fe=ue,q=ve):fe=fe.next=ue,A|=ae;if(N=N.next,N===null){if(N=b.shared.pending,N===null)break;ue=N,N=ue.next,ue.next=null,b.lastBaseUpdate=ue,b.shared.pending=null}}while(!0);fe===null&&(q=ve),b.baseState=q,b.firstBaseUpdate=re,b.lastBaseUpdate=fe,w===null&&(b.shared.lanes=0),Ka|=A,i.lanes=A,i.memoizedState=ve}}function jw(i,l){if(typeof i!="function")throw Error(r(191,i));i.call(l)}function Cw(i,l){var d=i.callbacks;if(d!==null)for(i.callbacks=null,i=0;i<d.length;i++)jw(d[i],l)}var lc=O(null),ah=O(0);function Ew(i,l){i=fa,se(ah,i),se(lc,l),fa=i|l.baseLanes}function lv(){se(ah,fa),se(lc,lc.current)}function cv(){fa=ah.current,F(lc),F(ah)}var ii=O(null),Ti=null;function Ga(i){var l=i.alternate;se(Hn,Hn.current&1),se(ii,i),Ti===null&&(l===null||lc.current!==null||l.memoizedState!==null)&&(Ti=i)}function uv(i){se(Hn,Hn.current),se(ii,i),Ti===null&&(Ti=i)}function Tw(i){i.tag===22?(se(Hn,Hn.current),se(ii,i),Ti===null&&(Ti=i)):Wa()}function Wa(){se(Hn,Hn.current),se(ii,ii.current)}function oi(i){F(ii),Ti===i&&(Ti=null),F(Hn)}var Hn=O(0);function sh(i){for(var l=i;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||gy(d)||vy(d)))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 ia=0,xt=null,rn=null,Zn=null,lh=!1,cc=!1,Xs=!1,ch=0,Vu=0,uc=null,l4=0;function $n(){throw Error(r(321))}function dv(i,l){if(l===null)return!1;for(var d=0;d<l.length&&d<i.length;d++)if(!ni(i[d],l[d]))return!1;return!0}function fv(i,l,d,p,b,w){return ia=w,xt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,M.H=i===null||i.memoizedState===null?cj:Rv,Xs=!1,w=d(p,b),Xs=!1,cc&&(w=_w(l,d,p,b)),Rw(i),w}function Rw(i){M.H=qu;var l=rn!==null&&rn.next!==null;if(ia=0,Zn=rn=xt=null,lh=!1,Vu=0,uc=null,l)throw Error(r(300));i===null||er||(i=i.dependencies,i!==null&&Zf(i)&&(er=!0))}function _w(i,l,d,p){xt=i;var b=0;do{if(cc&&(uc=null),Vu=0,cc=!1,25<=b)throw Error(r(301));if(b+=1,Zn=rn=null,i.updateQueue!=null){var w=i.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}M.H=uj,w=l(d,p)}while(cc);return w}function c4(){var i=M.H,l=i.useState()[0];return l=typeof l.then=="function"?Fu(l):l,i=i.useState()[0],(rn!==null?rn.memoizedState:null)!==i&&(xt.flags|=1024),l}function hv(){var i=ch!==0;return ch=0,i}function pv(i,l,d){l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~d}function mv(i){if(lh){for(i=i.memoizedState;i!==null;){var l=i.queue;l!==null&&(l.pending=null),i=i.next}lh=!1}ia=0,Zn=rn=xt=null,cc=!1,Vu=ch=0,uc=null}function kr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Zn===null?xt.memoizedState=Zn=i:Zn=Zn.next=i,Zn}function qn(){if(rn===null){var i=xt.alternate;i=i!==null?i.memoizedState:null}else i=rn.next;var l=Zn===null?xt.memoizedState:Zn.next;if(l!==null)Zn=l,rn=i;else{if(i===null)throw xt.alternate===null?Error(r(467)):Error(r(310));rn=i,i={memoizedState:rn.memoizedState,baseState:rn.baseState,baseQueue:rn.baseQueue,queue:rn.queue,next:null},Zn===null?xt.memoizedState=Zn=i:Zn=Zn.next=i}return Zn}function uh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fu(i){var l=Vu;return Vu+=1,uc===null&&(uc=[]),i=yw(uc,i,l),l=xt,(Zn===null?l.memoizedState:Zn.next)===null&&(l=l.alternate,M.H=l===null||l.memoizedState===null?cj:Rv),i}function dh(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Fu(i);if(i.$$typeof===E)return vr(i)}throw Error(r(438,String(i)))}function gv(i){var l=null,d=xt.updateQueue;if(d!==null&&(l=d.memoCache),l==null){var p=xt.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(l={data:p.data.map(function(b){return b.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),d===null&&(d=uh(),xt.updateQueue=d),d.memoCache=l,d=l.data[l.index],d===void 0)for(d=l.data[l.index]=Array(i),p=0;p<i;p++)d[p]=B;return l.index++,d}function oa(i,l){return typeof l=="function"?l(i):l}function fh(i){var l=qn();return vv(l,rn,i)}function vv(i,l,d){var p=i.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=d;var b=i.baseQueue,w=p.pending;if(w!==null){if(b!==null){var A=b.next;b.next=w.next,w.next=A}l.baseQueue=b=w,p.pending=null}if(w=i.baseState,b===null)i.memoizedState=w;else{l=b.next;var N=A=null,q=null,re=l,fe=!1;do{var ve=re.lane&-536870913;if(ve!==re.lane?(Nt&ve)===ve:(ia&ve)===ve){var ae=re.revertLane;if(ae===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),ve===ic&&(fe=!0);else if((ia&ae)===ae){re=re.next,ae===ic&&(fe=!0);continue}else ve={lane:0,revertLane:re.revertLane,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},q===null?(N=q=ve,A=w):q=q.next=ve,xt.lanes|=ae,Ka|=ae;ve=re.action,Xs&&d(w,ve),w=re.hasEagerState?re.eagerState:d(w,ve)}else ae={lane:ve,revertLane:re.revertLane,gesture:re.gesture,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},q===null?(N=q=ae,A=w):q=q.next=ae,xt.lanes|=ve,Ka|=ve;re=re.next}while(re!==null&&re!==l);if(q===null?A=w:q.next=N,!ni(w,i.memoizedState)&&(er=!0,fe&&(d=oc,d!==null)))throw d;i.memoizedState=w,i.baseState=A,i.baseQueue=q,p.lastRenderedState=w}return b===null&&(p.lanes=0),[i.memoizedState,p.dispatch]}function yv(i){var l=qn(),d=l.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=i;var p=d.dispatch,b=d.pending,w=l.memoizedState;if(b!==null){d.pending=null;var A=b=b.next;do w=i(w,A.action),A=A.next;while(A!==b);ni(w,l.memoizedState)||(er=!0),l.memoizedState=w,l.baseQueue===null&&(l.baseState=w),d.lastRenderedState=w}return[w,p]}function Dw(i,l,d){var p=xt,b=qn(),w=It;if(w){if(d===void 0)throw Error(r(407));d=d()}else d=l();var A=!ni((rn||b).memoizedState,d);if(A&&(b.memoizedState=d,er=!0),b=b.queue,Sv(Pw.bind(null,p,b,i),[i]),b.getSnapshot!==l||A||Zn!==null&&Zn.memoizedState.tag&1){if(p.flags|=2048,dc(9,{destroy:void 0},kw.bind(null,p,b,d,l),null),sn===null)throw Error(r(349));w||(ia&127)!==0||Aw(p,l,d)}return d}function Aw(i,l,d){i.flags|=16384,i={getSnapshot:l,value:d},l=xt.updateQueue,l===null?(l=uh(),xt.updateQueue=l,l.stores=[i]):(d=l.stores,d===null?l.stores=[i]:d.push(i))}function kw(i,l,d,p){l.value=d,l.getSnapshot=p,Nw(l)&&Ow(i)}function Pw(i,l,d){return d(function(){Nw(l)&&Ow(i)})}function Nw(i){var l=i.getSnapshot;i=i.value;try{var d=l();return!ni(i,d)}catch{return!0}}function Ow(i){var l=Vs(i,2);l!==null&&Gr(l,i,2)}function xv(i){var l=kr();if(typeof i=="function"){var d=i;if(i=d(),Xs){hr(!0);try{d()}finally{hr(!1)}}}return l.memoizedState=l.baseState=i,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:i},l}function Mw(i,l,d,p){return i.baseState=d,vv(i,rn,typeof p=="function"?p:oa)}function u4(i,l,d,p,b){if(mh(i))throw Error(r(485));if(i=l.action,i!==null){var w={payload:b,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){w.listeners.push(A)}};M.T!==null?d(!0):w.isTransition=!1,p(w),d=l.pending,d===null?(w.next=l.pending=w,Lw(l,w)):(w.next=d.next,l.pending=d.next=w)}}function Lw(i,l){var d=l.action,p=l.payload,b=i.state;if(l.isTransition){var w=M.T,A={};M.T=A;try{var N=d(b,p),q=M.S;q!==null&&q(A,N),Iw(i,l,N)}catch(re){bv(i,l,re)}finally{w!==null&&A.types!==null&&(w.types=A.types),M.T=w}}else try{w=d(b,p),Iw(i,l,w)}catch(re){bv(i,l,re)}}function Iw(i,l,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(p){zw(i,l,p)},function(p){return bv(i,l,p)}):zw(i,l,d)}function zw(i,l,d){l.status="fulfilled",l.value=d,$w(l),i.state=d,l=i.pending,l!==null&&(d=l.next,d===l?i.pending=null:(d=d.next,l.next=d,Lw(i,d)))}function bv(i,l,d){var p=i.pending;if(i.pending=null,p!==null){p=p.next;do l.status="rejected",l.reason=d,$w(l),l=l.next;while(l!==p)}i.action=null}function $w(i){i=i.listeners;for(var l=0;l<i.length;l++)(0,i[l])()}function Uw(i,l){return l}function Bw(i,l){if(It){var d=sn.formState;if(d!==null){e:{var p=xt;if(It){if(xn){t:{for(var b=xn,w=Ei;b.nodeType!==8;){if(!w){b=null;break t}if(b=Ri(b.nextSibling),b===null){b=null;break t}}w=b.data,b=w==="F!"||w==="F"?b:null}if(b){xn=Ri(b.nextSibling),p=b.data==="F!";break e}}Ba(p)}p=!1}p&&(l=d[0])}}return d=kr(),d.memoizedState=d.baseState=l,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uw,lastRenderedState:l},d.queue=p,d=aj.bind(null,xt,p),p.dispatch=d,p=xv(!1),w=Tv.bind(null,xt,!1,p.queue),p=kr(),b={state:l,dispatch:null,action:i,pending:null},p.queue=b,d=u4.bind(null,xt,b,w,d),b.dispatch=d,p.memoizedState=i,[l,d,!1]}function Vw(i){var l=qn();return Fw(l,rn,i)}function Fw(i,l,d){if(l=vv(i,l,Uw)[0],i=fh(oa)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var p=Fu(l)}catch(A){throw A===ac?nh:A}else p=l;l=qn();var b=l.queue,w=b.dispatch;return d!==l.memoizedState&&(xt.flags|=2048,dc(9,{destroy:void 0},d4.bind(null,b,d),null)),[p,w,i]}function d4(i,l){i.action=l}function Hw(i){var l=qn(),d=rn;if(d!==null)return Fw(l,d,i);qn(),l=l.memoizedState,d=qn();var p=d.queue.dispatch;return d.memoizedState=i,[l,p,!1]}function dc(i,l,d,p){return i={tag:i,create:d,deps:p,inst:l,next:null},l=xt.updateQueue,l===null&&(l=uh(),xt.updateQueue=l),d=l.lastEffect,d===null?l.lastEffect=i.next=i:(p=d.next,d.next=i,i.next=p,l.lastEffect=i),i}function qw(){return qn().memoizedState}function hh(i,l,d,p){var b=kr();xt.flags|=i,b.memoizedState=dc(1|l,{destroy:void 0},d,p===void 0?null:p)}function ph(i,l,d,p){var b=qn();p=p===void 0?null:p;var w=b.memoizedState.inst;rn!==null&&p!==null&&dv(p,rn.memoizedState.deps)?b.memoizedState=dc(l,w,d,p):(xt.flags|=i,b.memoizedState=dc(1|l,w,d,p))}function Gw(i,l){hh(8390656,8,i,l)}function Sv(i,l){ph(2048,8,i,l)}function f4(i){xt.flags|=4;var l=xt.updateQueue;if(l===null)l=uh(),xt.updateQueue=l,l.events=[i];else{var d=l.events;d===null?l.events=[i]:d.push(i)}}function Ww(i){var l=qn().memoizedState;return f4({ref:l,nextImpl:i}),function(){if((Gt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function Qw(i,l){return ph(4,2,i,l)}function Yw(i,l){return ph(4,4,i,l)}function Kw(i,l){if(typeof l=="function"){i=i();var d=l(i);return function(){typeof d=="function"?d():l(null)}}if(l!=null)return i=i(),l.current=i,function(){l.current=null}}function Xw(i,l,d){d=d!=null?d.concat([i]):null,ph(4,4,Kw.bind(null,l,i),d)}function wv(){}function Jw(i,l){var d=qn();l=l===void 0?null:l;var p=d.memoizedState;return l!==null&&dv(l,p[1])?p[0]:(d.memoizedState=[i,l],i)}function Zw(i,l){var d=qn();l=l===void 0?null:l;var p=d.memoizedState;if(l!==null&&dv(l,p[1]))return p[0];if(p=i(),Xs){hr(!0);try{i()}finally{hr(!1)}}return d.memoizedState=[p,l],p}function jv(i,l,d){return d===void 0||(ia&1073741824)!==0&&(Nt&261930)===0?i.memoizedState=l:(i.memoizedState=d,i=eC(),xt.lanes|=i,Ka|=i,d)}function ej(i,l,d,p){return ni(d,l)?d:lc.current!==null?(i=jv(i,d,p),ni(i,l)||(er=!0),i):(ia&42)===0||(ia&1073741824)!==0&&(Nt&261930)===0?(er=!0,i.memoizedState=d):(i=eC(),xt.lanes|=i,Ka|=i,l)}function tj(i,l,d,p,b){var w=L.p;L.p=w!==0&&8>w?w:8;var A=M.T,N={};M.T=N,Tv(i,!1,l,d);try{var q=b(),re=M.S;if(re!==null&&re(N,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var fe=s4(q,p);Hu(i,l,fe,li(i))}else Hu(i,l,p,li(i))}catch(ve){Hu(i,l,{then:function(){},status:"rejected",reason:ve},li())}finally{L.p=w,A!==null&&N.types!==null&&(A.types=N.types),M.T=A}}function h4(){}function Cv(i,l,d,p){if(i.tag!==5)throw Error(r(476));var b=nj(i).queue;tj(i,b,l,z,d===null?h4:function(){return rj(i),d(p)})}function nj(i){var l=i.memoizedState;if(l!==null)return l;l={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:z},next:null};var d={};return l.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:d},next:null},i.memoizedState=l,i=i.alternate,i!==null&&(i.memoizedState=l),l}function rj(i){var l=nj(i);l.next===null&&(l=i.alternate.memoizedState),Hu(i,l.next.queue,{},li())}function Ev(){return vr(sd)}function ij(){return qn().memoizedState}function oj(){return qn().memoizedState}function p4(i){for(var l=i.return;l!==null;){switch(l.tag){case 24:case 3:var d=li();i=Ha(d);var p=qa(l,i,d);p!==null&&(Gr(p,l,d),$u(p,l,d)),l={cache:ev()},i.payload=l;return}l=l.return}}function m4(i,l,d){var p=li();d={lane:p,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},mh(i)?sj(l,d):(d=Fg(i,l,d,p),d!==null&&(Gr(d,i,p),lj(d,l,p)))}function aj(i,l,d){var p=li();Hu(i,l,d,p)}function Hu(i,l,d,p){var b={lane:p,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(mh(i))sj(l,b);else{var w=i.alternate;if(i.lanes===0&&(w===null||w.lanes===0)&&(w=l.lastRenderedReducer,w!==null))try{var A=l.lastRenderedState,N=w(A,d);if(b.hasEagerState=!0,b.eagerState=N,ni(N,A))return Yf(i,l,b,0),sn===null&&Qf(),!1}catch{}if(d=Fg(i,l,b,p),d!==null)return Gr(d,i,p),lj(d,l,p),!0}return!1}function Tv(i,l,d,p){if(p={lane:2,revertLane:iy(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},mh(i)){if(l)throw Error(r(479))}else l=Fg(i,d,p,2),l!==null&&Gr(l,i,2)}function mh(i){var l=i.alternate;return i===xt||l!==null&&l===xt}function sj(i,l){cc=lh=!0;var d=i.pending;d===null?l.next=l:(l.next=d.next,d.next=l),i.pending=l}function lj(i,l,d){if((d&4194048)!==0){var p=l.lanes;p&=i.pendingLanes,d|=p,l.lanes=d,H(i,d)}}var qu={readContext:vr,use:dh,useCallback:$n,useContext:$n,useEffect:$n,useImperativeHandle:$n,useLayoutEffect:$n,useInsertionEffect:$n,useMemo:$n,useReducer:$n,useRef:$n,useState:$n,useDebugValue:$n,useDeferredValue:$n,useTransition:$n,useSyncExternalStore:$n,useId:$n,useHostTransitionStatus:$n,useFormState:$n,useActionState:$n,useOptimistic:$n,useMemoCache:$n,useCacheRefresh:$n};qu.useEffectEvent=$n;var cj={readContext:vr,use:dh,useCallback:function(i,l){return kr().memoizedState=[i,l===void 0?null:l],i},useContext:vr,useEffect:Gw,useImperativeHandle:function(i,l,d){d=d!=null?d.concat([i]):null,hh(4194308,4,Kw.bind(null,l,i),d)},useLayoutEffect:function(i,l){return hh(4194308,4,i,l)},useInsertionEffect:function(i,l){hh(4,2,i,l)},useMemo:function(i,l){var d=kr();l=l===void 0?null:l;var p=i();if(Xs){hr(!0);try{i()}finally{hr(!1)}}return d.memoizedState=[p,l],p},useReducer:function(i,l,d){var p=kr();if(d!==void 0){var b=d(l);if(Xs){hr(!0);try{d(l)}finally{hr(!1)}}}else b=l;return p.memoizedState=p.baseState=b,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:b},p.queue=i,i=i.dispatch=m4.bind(null,xt,i),[p.memoizedState,i]},useRef:function(i){var l=kr();return i={current:i},l.memoizedState=i},useState:function(i){i=xv(i);var l=i.queue,d=aj.bind(null,xt,l);return l.dispatch=d,[i.memoizedState,d]},useDebugValue:wv,useDeferredValue:function(i,l){var d=kr();return jv(d,i,l)},useTransition:function(){var i=xv(!1);return i=tj.bind(null,xt,i.queue,!0,!1),kr().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,l,d){var p=xt,b=kr();if(It){if(d===void 0)throw Error(r(407));d=d()}else{if(d=l(),sn===null)throw Error(r(349));(Nt&127)!==0||Aw(p,l,d)}b.memoizedState=d;var w={value:d,getSnapshot:l};return b.queue=w,Gw(Pw.bind(null,p,w,i),[i]),p.flags|=2048,dc(9,{destroy:void 0},kw.bind(null,p,w,d,l),null),d},useId:function(){var i=kr(),l=sn.identifierPrefix;if(It){var d=yo,p=vo;d=(p&~(1<<32-zn(p)-1)).toString(32)+d,l="_"+l+"R_"+d,d=ch++,0<d&&(l+="H"+d.toString(32)),l+="_"}else d=l4++,l="_"+l+"r_"+d.toString(32)+"_";return i.memoizedState=l},useHostTransitionStatus:Ev,useFormState:Bw,useActionState:Bw,useOptimistic:function(i){var l=kr();l.memoizedState=l.baseState=i;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=d,l=Tv.bind(null,xt,!0,d),d.dispatch=l,[i,l]},useMemoCache:gv,useCacheRefresh:function(){return kr().memoizedState=p4.bind(null,xt)},useEffectEvent:function(i){var l=kr(),d={impl:i};return l.memoizedState=d,function(){if((Gt&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}},Rv={readContext:vr,use:dh,useCallback:Jw,useContext:vr,useEffect:Sv,useImperativeHandle:Xw,useInsertionEffect:Qw,useLayoutEffect:Yw,useMemo:Zw,useReducer:fh,useRef:qw,useState:function(){return fh(oa)},useDebugValue:wv,useDeferredValue:function(i,l){var d=qn();return ej(d,rn.memoizedState,i,l)},useTransition:function(){var i=fh(oa)[0],l=qn().memoizedState;return[typeof i=="boolean"?i:Fu(i),l]},useSyncExternalStore:Dw,useId:ij,useHostTransitionStatus:Ev,useFormState:Vw,useActionState:Vw,useOptimistic:function(i,l){var d=qn();return Mw(d,rn,i,l)},useMemoCache:gv,useCacheRefresh:oj};Rv.useEffectEvent=Ww;var uj={readContext:vr,use:dh,useCallback:Jw,useContext:vr,useEffect:Sv,useImperativeHandle:Xw,useInsertionEffect:Qw,useLayoutEffect:Yw,useMemo:Zw,useReducer:yv,useRef:qw,useState:function(){return yv(oa)},useDebugValue:wv,useDeferredValue:function(i,l){var d=qn();return rn===null?jv(d,i,l):ej(d,rn.memoizedState,i,l)},useTransition:function(){var i=yv(oa)[0],l=qn().memoizedState;return[typeof i=="boolean"?i:Fu(i),l]},useSyncExternalStore:Dw,useId:ij,useHostTransitionStatus:Ev,useFormState:Hw,useActionState:Hw,useOptimistic:function(i,l){var d=qn();return rn!==null?Mw(d,rn,i,l):(d.baseState=i,[i,d.queue.dispatch])},useMemoCache:gv,useCacheRefresh:oj};uj.useEffectEvent=Ww;function _v(i,l,d,p){l=i.memoizedState,d=d(p,l),d=d==null?l:g({},l,d),i.memoizedState=d,i.lanes===0&&(i.updateQueue.baseState=d)}var Dv={enqueueSetState:function(i,l,d){i=i._reactInternals;var p=li(),b=Ha(p);b.payload=l,d!=null&&(b.callback=d),l=qa(i,b,p),l!==null&&(Gr(l,i,p),$u(l,i,p))},enqueueReplaceState:function(i,l,d){i=i._reactInternals;var p=li(),b=Ha(p);b.tag=1,b.payload=l,d!=null&&(b.callback=d),l=qa(i,b,p),l!==null&&(Gr(l,i,p),$u(l,i,p))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var d=li(),p=Ha(d);p.tag=2,l!=null&&(p.callback=l),l=qa(i,p,d),l!==null&&(Gr(l,i,d),$u(l,i,d))}};function dj(i,l,d,p,b,w,A){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(p,w,A):l.prototype&&l.prototype.isPureReactComponent?!ku(d,p)||!ku(b,w):!0}function fj(i,l,d,p){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,p),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,p),l.state!==i&&Dv.enqueueReplaceState(l,l.state,null)}function Js(i,l){var d=l;if("ref"in l){d={};for(var p in l)p!=="ref"&&(d[p]=l[p])}if(i=i.defaultProps){d===l&&(d=g({},d));for(var b in i)d[b]===void 0&&(d[b]=i[b])}return d}function hj(i){Wf(i)}function pj(i){console.error(i)}function mj(i){Wf(i)}function gh(i,l){try{var d=i.onUncaughtError;d(l.value,{componentStack:l.stack})}catch(p){setTimeout(function(){throw p})}}function gj(i,l,d){try{var p=i.onCaughtError;p(d.value,{componentStack:d.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Av(i,l,d){return d=Ha(d),d.tag=3,d.payload={element:null},d.callback=function(){gh(i,l)},d}function vj(i){return i=Ha(i),i.tag=3,i}function yj(i,l,d,p){var b=d.type.getDerivedStateFromError;if(typeof b=="function"){var w=p.value;i.payload=function(){return b(w)},i.callback=function(){gj(l,d,p)}}var A=d.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(i.callback=function(){gj(l,d,p),typeof b!="function"&&(Xa===null?Xa=new Set([this]):Xa.add(this));var N=p.stack;this.componentDidCatch(p.value,{componentStack:N!==null?N:""})})}function g4(i,l,d,p,b){if(d.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(l=d.alternate,l!==null&&rc(l,d,b,!0),d=ii.current,d!==null){switch(d.tag){case 31:case 13:return Ti===null?_h():d.alternate===null&&Un===0&&(Un=3),d.flags&=-257,d.flags|=65536,d.lanes=b,p===rh?d.flags|=16384:(l=d.updateQueue,l===null?d.updateQueue=new Set([p]):l.add(p),ty(i,p,b)),!1;case 22:return d.flags|=65536,p===rh?d.flags|=16384:(l=d.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([p])},d.updateQueue=l):(d=l.retryQueue,d===null?l.retryQueue=new Set([p]):d.add(p)),ty(i,p,b)),!1}throw Error(r(435,d.tag))}return ty(i,p,b),_h(),!1}if(It)return l=ii.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=b,p!==Yg&&(i=Error(r(422),{cause:p}),Ou(wi(i,d)))):(p!==Yg&&(l=Error(r(423),{cause:p}),Ou(wi(l,d))),i=i.current.alternate,i.flags|=65536,b&=-b,i.lanes|=b,p=wi(p,d),b=Av(i.stateNode,p,b),av(i,b),Un!==4&&(Un=2)),!1;var w=Error(r(520),{cause:p});if(w=wi(w,d),Zu===null?Zu=[w]:Zu.push(w),Un!==4&&(Un=2),l===null)return!0;p=wi(p,d),d=l;do{switch(d.tag){case 3:return d.flags|=65536,i=b&-b,d.lanes|=i,i=Av(d.stateNode,p,i),av(d,i),!1;case 1:if(l=d.type,w=d.stateNode,(d.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Xa===null||!Xa.has(w))))return d.flags|=65536,b&=-b,d.lanes|=b,b=vj(b),yj(b,i,d,p),av(d,b),!1}d=d.return}while(d!==null);return!1}var kv=Error(r(461)),er=!1;function yr(i,l,d,p){l.child=i===null?ww(l,null,d,p):Ks(l,i.child,d,p)}function xj(i,l,d,p,b){d=d.render;var w=l.ref;if("ref"in p){var A={};for(var N in p)N!=="ref"&&(A[N]=p[N])}else A=p;return Gs(l),p=fv(i,l,d,A,w,b),N=hv(),i!==null&&!er?(pv(i,l,b),aa(i,l,b)):(It&&N&&Wg(l),l.flags|=1,yr(i,l,p,b),l.child)}function bj(i,l,d,p,b){if(i===null){var w=d.type;return typeof w=="function"&&!Hg(w)&&w.defaultProps===void 0&&d.compare===null?(l.tag=15,l.type=w,Sj(i,l,w,p,b)):(i=Xf(d.type,null,p,l,l.mode,b),i.ref=l.ref,i.return=l,l.child=i)}if(w=i.child,!$v(i,b)){var A=w.memoizedProps;if(d=d.compare,d=d!==null?d:ku,d(A,p)&&i.ref===l.ref)return aa(i,l,b)}return l.flags|=1,i=ea(w,p),i.ref=l.ref,i.return=l,l.child=i}function Sj(i,l,d,p,b){if(i!==null){var w=i.memoizedProps;if(ku(w,p)&&i.ref===l.ref)if(er=!1,l.pendingProps=p=w,$v(i,b))(i.flags&131072)!==0&&(er=!0);else return l.lanes=i.lanes,aa(i,l,b)}return Pv(i,l,d,p,b)}function wj(i,l,d,p){var b=p.children,w=i!==null?i.memoizedState:null;if(i===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((l.flags&128)!==0){if(w=w!==null?w.baseLanes|d:d,i!==null){for(p=l.child=i.child,b=0;p!==null;)b=b|p.lanes|p.childLanes,p=p.sibling;p=b&~w}else p=0,l.child=null;return jj(i,l,w,d,p)}if((d&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},i!==null&&th(l,w!==null?w.cachePool:null),w!==null?Ew(l,w):lv(),Tw(l);else return p=l.lanes=536870912,jj(i,l,w!==null?w.baseLanes|d:d,d,p)}else w!==null?(th(l,w.cachePool),Ew(l,w),Wa(),l.memoizedState=null):(i!==null&&th(l,null),lv(),Wa());return yr(i,l,b,d),l.child}function Gu(i,l){return i!==null&&i.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function jj(i,l,d,p,b){var w=nv();return w=w===null?null:{parent:Jn._currentValue,pool:w},l.memoizedState={baseLanes:d,cachePool:w},i!==null&&th(l,null),lv(),Tw(l),i!==null&&rc(i,l,p,!0),l.childLanes=b,null}function vh(i,l){return l=xh({mode:l.mode,children:l.children},i.mode),l.ref=i.ref,i.child=l,l.return=i,l}function Cj(i,l,d){return Ks(l,i.child,null,d),i=vh(l,l.pendingProps),i.flags|=2,oi(l),l.memoizedState=null,i}function v4(i,l,d){var p=l.pendingProps,b=(l.flags&128)!==0;if(l.flags&=-129,i===null){if(It){if(p.mode==="hidden")return i=vh(l,p),l.lanes=536870912,Gu(null,i);if(uv(l),(i=xn)?(i=LC(i,Ei),i=i!==null&&i.data==="&"?i:null,i!==null&&(l.memoizedState={dehydrated:i,treeContext:$a!==null?{id:vo,overflow:yo}:null,retryLane:536870912,hydrationErrors:null},d=sw(i),d.return=l,l.child=d,gr=l,xn=null)):i=null,i===null)throw Ba(l);return l.lanes=536870912,null}return vh(l,p)}var w=i.memoizedState;if(w!==null){var A=w.dehydrated;if(uv(l),b)if(l.flags&256)l.flags&=-257,l=Cj(i,l,d);else if(l.memoizedState!==null)l.child=i.child,l.flags|=128,l=null;else throw Error(r(558));else if(er||rc(i,l,d,!1),b=(d&i.childLanes)!==0,er||b){if(p=sn,p!==null&&(A=X(p,d),A!==0&&A!==w.retryLane))throw w.retryLane=A,Vs(i,A),Gr(p,i,A),kv;_h(),l=Cj(i,l,d)}else i=w.treeContext,xn=Ri(A.nextSibling),gr=l,It=!0,Ua=null,Ei=!1,i!==null&&uw(l,i),l=vh(l,p),l.flags|=4096;return l}return i=ea(i.child,{mode:p.mode,children:p.children}),i.ref=l.ref,l.child=i,i.return=l,i}function yh(i,l){var d=l.ref;if(d===null)i!==null&&i.ref!==null&&(l.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(r(284));(i===null||i.ref!==d)&&(l.flags|=4194816)}}function Pv(i,l,d,p,b){return Gs(l),d=fv(i,l,d,p,void 0,b),p=hv(),i!==null&&!er?(pv(i,l,b),aa(i,l,b)):(It&&p&&Wg(l),l.flags|=1,yr(i,l,d,b),l.child)}function Ej(i,l,d,p,b,w){return Gs(l),l.updateQueue=null,d=_w(l,p,d,b),Rw(i),p=hv(),i!==null&&!er?(pv(i,l,w),aa(i,l,w)):(It&&p&&Wg(l),l.flags|=1,yr(i,l,d,w),l.child)}function Tj(i,l,d,p,b){if(Gs(l),l.stateNode===null){var w=Zl,A=d.contextType;typeof A=="object"&&A!==null&&(w=vr(A)),w=new d(p,w),l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Dv,l.stateNode=w,w._reactInternals=l,w=l.stateNode,w.props=p,w.state=l.memoizedState,w.refs={},iv(l),A=d.contextType,w.context=typeof A=="object"&&A!==null?vr(A):Zl,w.state=l.memoizedState,A=d.getDerivedStateFromProps,typeof A=="function"&&(_v(l,d,A,p),w.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(A=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),A!==w.state&&Dv.enqueueReplaceState(w,w.state,null),Bu(l,p,w,b),Uu(),w.state=l.memoizedState),typeof w.componentDidMount=="function"&&(l.flags|=4194308),p=!0}else if(i===null){w=l.stateNode;var N=l.memoizedProps,q=Js(d,N);w.props=q;var re=w.context,fe=d.contextType;A=Zl,typeof fe=="object"&&fe!==null&&(A=vr(fe));var ve=d.getDerivedStateFromProps;fe=typeof ve=="function"||typeof w.getSnapshotBeforeUpdate=="function",N=l.pendingProps!==N,fe||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(N||re!==A)&&fj(l,w,p,A),Fa=!1;var ae=l.memoizedState;w.state=ae,Bu(l,p,w,b),Uu(),re=l.memoizedState,N||ae!==re||Fa?(typeof ve=="function"&&(_v(l,d,ve,p),re=l.memoizedState),(q=Fa||dj(l,d,q,p,ae,re,A))?(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=p,l.memoizedState=re),w.props=p,w.state=re,w.context=A,p=q):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),p=!1)}else{w=l.stateNode,ov(i,l),A=l.memoizedProps,fe=Js(d,A),w.props=fe,ve=l.pendingProps,ae=w.context,re=d.contextType,q=Zl,typeof re=="object"&&re!==null&&(q=vr(re)),N=d.getDerivedStateFromProps,(re=typeof N=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(A!==ve||ae!==q)&&fj(l,w,p,q),Fa=!1,ae=l.memoizedState,w.state=ae,Bu(l,p,w,b),Uu();var ue=l.memoizedState;A!==ve||ae!==ue||Fa||i!==null&&i.dependencies!==null&&Zf(i.dependencies)?(typeof N=="function"&&(_v(l,d,N,p),ue=l.memoizedState),(fe=Fa||dj(l,d,fe,p,ae,ue,q)||i!==null&&i.dependencies!==null&&Zf(i.dependencies))?(re||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(p,ue,q),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(p,ue,q)),typeof w.componentDidUpdate=="function"&&(l.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof w.componentDidUpdate!="function"||A===i.memoizedProps&&ae===i.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||A===i.memoizedProps&&ae===i.memoizedState||(l.flags|=1024),l.memoizedProps=p,l.memoizedState=ue),w.props=p,w.state=ue,w.context=q,p=fe):(typeof w.componentDidUpdate!="function"||A===i.memoizedProps&&ae===i.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||A===i.memoizedProps&&ae===i.memoizedState||(l.flags|=1024),p=!1)}return w=p,yh(i,l),p=(l.flags&128)!==0,w||p?(w=l.stateNode,d=p&&typeof d.getDerivedStateFromError!="function"?null:w.render(),l.flags|=1,i!==null&&p?(l.child=Ks(l,i.child,null,b),l.child=Ks(l,null,d,b)):yr(i,l,d,b),l.memoizedState=w.state,i=l.child):i=aa(i,l,b),i}function Rj(i,l,d,p){return Hs(),l.flags|=256,yr(i,l,d,p),l.child}var Nv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ov(i){return{baseLanes:i,cachePool:gw()}}function Mv(i,l,d){return i=i!==null?i.childLanes&~d:0,l&&(i|=si),i}function _j(i,l,d){var p=l.pendingProps,b=!1,w=(l.flags&128)!==0,A;if((A=w)||(A=i!==null&&i.memoizedState===null?!1:(Hn.current&2)!==0),A&&(b=!0,l.flags&=-129),A=(l.flags&32)!==0,l.flags&=-33,i===null){if(It){if(b?Ga(l):Wa(),(i=xn)?(i=LC(i,Ei),i=i!==null&&i.data!=="&"?i:null,i!==null&&(l.memoizedState={dehydrated:i,treeContext:$a!==null?{id:vo,overflow:yo}:null,retryLane:536870912,hydrationErrors:null},d=sw(i),d.return=l,l.child=d,gr=l,xn=null)):i=null,i===null)throw Ba(l);return vy(i)?l.lanes=32:l.lanes=536870912,null}var N=p.children;return p=p.fallback,b?(Wa(),b=l.mode,N=xh({mode:"hidden",children:N},b),p=Fs(p,b,d,null),N.return=l,p.return=l,N.sibling=p,l.child=N,p=l.child,p.memoizedState=Ov(d),p.childLanes=Mv(i,A,d),l.memoizedState=Nv,Gu(null,p)):(Ga(l),Lv(l,N))}var q=i.memoizedState;if(q!==null&&(N=q.dehydrated,N!==null)){if(w)l.flags&256?(Ga(l),l.flags&=-257,l=Iv(i,l,d)):l.memoizedState!==null?(Wa(),l.child=i.child,l.flags|=128,l=null):(Wa(),N=p.fallback,b=l.mode,p=xh({mode:"visible",children:p.children},b),N=Fs(N,b,d,null),N.flags|=2,p.return=l,N.return=l,p.sibling=N,l.child=p,Ks(l,i.child,null,d),p=l.child,p.memoizedState=Ov(d),p.childLanes=Mv(i,A,d),l.memoizedState=Nv,l=Gu(null,p));else if(Ga(l),vy(N)){if(A=N.nextSibling&&N.nextSibling.dataset,A)var re=A.dgst;A=re,p=Error(r(419)),p.stack="",p.digest=A,Ou({value:p,source:null,stack:null}),l=Iv(i,l,d)}else if(er||rc(i,l,d,!1),A=(d&i.childLanes)!==0,er||A){if(A=sn,A!==null&&(p=X(A,d),p!==0&&p!==q.retryLane))throw q.retryLane=p,Vs(i,p),Gr(A,i,p),kv;gy(N)||_h(),l=Iv(i,l,d)}else gy(N)?(l.flags|=192,l.child=i.child,l=null):(i=q.treeContext,xn=Ri(N.nextSibling),gr=l,It=!0,Ua=null,Ei=!1,i!==null&&uw(l,i),l=Lv(l,p.children),l.flags|=4096);return l}return b?(Wa(),N=p.fallback,b=l.mode,q=i.child,re=q.sibling,p=ea(q,{mode:"hidden",children:p.children}),p.subtreeFlags=q.subtreeFlags&65011712,re!==null?N=ea(re,N):(N=Fs(N,b,d,null),N.flags|=2),N.return=l,p.return=l,p.sibling=N,l.child=p,Gu(null,p),p=l.child,N=i.child.memoizedState,N===null?N=Ov(d):(b=N.cachePool,b!==null?(q=Jn._currentValue,b=b.parent!==q?{parent:q,pool:q}:b):b=gw(),N={baseLanes:N.baseLanes|d,cachePool:b}),p.memoizedState=N,p.childLanes=Mv(i,A,d),l.memoizedState=Nv,Gu(i.child,p)):(Ga(l),d=i.child,i=d.sibling,d=ea(d,{mode:"visible",children:p.children}),d.return=l,d.sibling=null,i!==null&&(A=l.deletions,A===null?(l.deletions=[i],l.flags|=16):A.push(i)),l.child=d,l.memoizedState=null,d)}function Lv(i,l){return l=xh({mode:"visible",children:l},i.mode),l.return=i,i.child=l}function xh(i,l){return i=ri(22,i,null,l),i.lanes=0,i}function Iv(i,l,d){return Ks(l,i.child,null,d),i=Lv(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function Dj(i,l,d){i.lanes|=l;var p=i.alternate;p!==null&&(p.lanes|=l),Jg(i.return,l,d)}function zv(i,l,d,p,b,w){var A=i.memoizedState;A===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:p,tail:d,tailMode:b,treeForkCount:w}:(A.isBackwards=l,A.rendering=null,A.renderingStartTime=0,A.last=p,A.tail=d,A.tailMode=b,A.treeForkCount=w)}function Aj(i,l,d){var p=l.pendingProps,b=p.revealOrder,w=p.tail;p=p.children;var A=Hn.current,N=(A&2)!==0;if(N?(A=A&1|2,l.flags|=128):A&=1,se(Hn,A),yr(i,l,p,d),p=It?Nu:0,!N&&i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Dj(i,d,l);else if(i.tag===19)Dj(i,d,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(b){case"forwards":for(d=l.child,b=null;d!==null;)i=d.alternate,i!==null&&sh(i)===null&&(b=d),d=d.sibling;d=b,d===null?(b=l.child,l.child=null):(b=d.sibling,d.sibling=null),zv(l,!1,b,d,w,p);break;case"backwards":case"unstable_legacy-backwards":for(d=null,b=l.child,l.child=null;b!==null;){if(i=b.alternate,i!==null&&sh(i)===null){l.child=b;break}i=b.sibling,b.sibling=d,d=b,b=i}zv(l,!0,d,null,w,p);break;case"together":zv(l,!1,null,null,void 0,p);break;default:l.memoizedState=null}return l.child}function aa(i,l,d){if(i!==null&&(l.dependencies=i.dependencies),Ka|=l.lanes,(d&l.childLanes)===0)if(i!==null){if(rc(i,l,d,!1),(d&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,d=ea(i,i.pendingProps),l.child=d,d.return=l;i.sibling!==null;)i=i.sibling,d=d.sibling=ea(i,i.pendingProps),d.return=l;d.sibling=null}return l.child}function $v(i,l){return(i.lanes&l)!==0?!0:(i=i.dependencies,!!(i!==null&&Zf(i)))}function y4(i,l,d){switch(l.tag){case 3:Ke(l,l.stateNode.containerInfo),Va(l,Jn,i.memoizedState.cache),Hs();break;case 27:case 5:dt(l);break;case 4:Ke(l,l.stateNode.containerInfo);break;case 10:Va(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,uv(l),null;break;case 13:var p=l.memoizedState;if(p!==null)return p.dehydrated!==null?(Ga(l),l.flags|=128,null):(d&l.child.childLanes)!==0?_j(i,l,d):(Ga(l),i=aa(i,l,d),i!==null?i.sibling:null);Ga(l);break;case 19:var b=(i.flags&128)!==0;if(p=(d&l.childLanes)!==0,p||(rc(i,l,d,!1),p=(d&l.childLanes)!==0),b){if(p)return Aj(i,l,d);l.flags|=128}if(b=l.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),se(Hn,Hn.current),p)break;return null;case 22:return l.lanes=0,wj(i,l,d,l.pendingProps);case 24:Va(l,Jn,i.memoizedState.cache)}return aa(i,l,d)}function kj(i,l,d){if(i!==null)if(i.memoizedProps!==l.pendingProps)er=!0;else{if(!$v(i,d)&&(l.flags&128)===0)return er=!1,y4(i,l,d);er=(i.flags&131072)!==0}else er=!1,It&&(l.flags&1048576)!==0&&cw(l,Nu,l.index);switch(l.lanes=0,l.tag){case 16:e:{var p=l.pendingProps;if(i=Qs(l.elementType),l.type=i,typeof i=="function")Hg(i)?(p=Js(i,p),l.tag=1,l=Tj(null,l,i,p,d)):(l.tag=0,l=Pv(null,l,i,p,d));else{if(i!=null){var b=i.$$typeof;if(b===_){l.tag=11,l=xj(null,l,i,p,d);break e}else if(b===D){l.tag=14,l=bj(null,l,i,p,d);break e}}throw l=U(i)||i,Error(r(306,l,""))}}return l;case 0:return Pv(i,l,l.type,l.pendingProps,d);case 1:return p=l.type,b=Js(p,l.pendingProps),Tj(i,l,p,b,d);case 3:e:{if(Ke(l,l.stateNode.containerInfo),i===null)throw Error(r(387));p=l.pendingProps;var w=l.memoizedState;b=w.element,ov(i,l),Bu(l,p,null,d);var A=l.memoizedState;if(p=A.cache,Va(l,Jn,p),p!==w.cache&&Zg(l,[Jn],d,!0),Uu(),p=A.element,w.isDehydrated)if(w={element:p,isDehydrated:!1,cache:A.cache},l.updateQueue.baseState=w,l.memoizedState=w,l.flags&256){l=Rj(i,l,p,d);break e}else if(p!==b){b=wi(Error(r(424)),l),Ou(b),l=Rj(i,l,p,d);break e}else for(i=l.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,xn=Ri(i.firstChild),gr=l,It=!0,Ua=null,Ei=!0,d=ww(l,null,p,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Hs(),p===b){l=aa(i,l,d);break e}yr(i,l,p,d)}l=l.child}return l;case 26:return yh(i,l),i===null?(d=VC(l.type,null,l.pendingProps,null))?l.memoizedState=d:It||(d=l.type,i=l.pendingProps,p=Mh(je.current).createElement(d),p[Me]=l,p[Ue]=i,xr(p,d,i),Dn(p),l.stateNode=p):l.memoizedState=VC(l.type,i.memoizedProps,l.pendingProps,i.memoizedState),null;case 27:return dt(l),i===null&&It&&(p=l.stateNode=$C(l.type,l.pendingProps,je.current),gr=l,Ei=!0,b=xn,ts(l.type)?(yy=b,xn=Ri(p.firstChild)):xn=b),yr(i,l,l.pendingProps.children,d),yh(i,l),i===null&&(l.flags|=4194304),l.child;case 5:return i===null&&It&&((b=p=xn)&&(p=Q4(p,l.type,l.pendingProps,Ei),p!==null?(l.stateNode=p,gr=l,xn=Ri(p.firstChild),Ei=!1,b=!0):b=!1),b||Ba(l)),dt(l),b=l.type,w=l.pendingProps,A=i!==null?i.memoizedProps:null,p=w.children,hy(b,w)?p=null:A!==null&&hy(b,A)&&(l.flags|=32),l.memoizedState!==null&&(b=fv(i,l,c4,null,null,d),sd._currentValue=b),yh(i,l),yr(i,l,p,d),l.child;case 6:return i===null&&It&&((i=d=xn)&&(d=Y4(d,l.pendingProps,Ei),d!==null?(l.stateNode=d,gr=l,xn=null,i=!0):i=!1),i||Ba(l)),null;case 13:return _j(i,l,d);case 4:return Ke(l,l.stateNode.containerInfo),p=l.pendingProps,i===null?l.child=Ks(l,null,p,d):yr(i,l,p,d),l.child;case 11:return xj(i,l,l.type,l.pendingProps,d);case 7:return yr(i,l,l.pendingProps,d),l.child;case 8:return yr(i,l,l.pendingProps.children,d),l.child;case 12:return yr(i,l,l.pendingProps.children,d),l.child;case 10:return p=l.pendingProps,Va(l,l.type,p.value),yr(i,l,p.children,d),l.child;case 9:return b=l.type._context,p=l.pendingProps.children,Gs(l),b=vr(b),p=p(b),l.flags|=1,yr(i,l,p,d),l.child;case 14:return bj(i,l,l.type,l.pendingProps,d);case 15:return Sj(i,l,l.type,l.pendingProps,d);case 19:return Aj(i,l,d);case 31:return v4(i,l,d);case 22:return wj(i,l,d,l.pendingProps);case 24:return Gs(l),p=vr(Jn),i===null?(b=nv(),b===null&&(b=sn,w=ev(),b.pooledCache=w,w.refCount++,w!==null&&(b.pooledCacheLanes|=d),b=w),l.memoizedState={parent:p,cache:b},iv(l),Va(l,Jn,b)):((i.lanes&d)!==0&&(ov(i,l),Bu(l,null,null,d),Uu()),b=i.memoizedState,w=l.memoizedState,b.parent!==p?(b={parent:p,cache:p},l.memoizedState=b,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=b),Va(l,Jn,p)):(p=w.cache,Va(l,Jn,p),p!==b.cache&&Zg(l,[Jn],d,!0))),yr(i,l,l.pendingProps.children,d),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function sa(i){i.flags|=4}function Uv(i,l,d,p,b){if((l=(i.mode&32)!==0)&&(l=!1),l){if(i.flags|=16777216,(b&335544128)===b)if(i.stateNode.complete)i.flags|=8192;else if(iC())i.flags|=8192;else throw Ys=rh,rv}else i.flags&=-16777217}function Pj(i,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!WC(l))if(iC())i.flags|=8192;else throw Ys=rh,rv}function bh(i,l){l!==null&&(i.flags|=4),i.flags&16384&&(l=i.tag!==22?pr():536870912,i.lanes|=l,mc|=l)}function Wu(i,l){if(!It)switch(i.tailMode){case"hidden":l=i.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?i.tail=null:d.sibling=null;break;case"collapsed":d=i.tail;for(var p=null;d!==null;)d.alternate!==null&&(p=d),d=d.sibling;p===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:p.sibling=null}}function bn(i){var l=i.alternate!==null&&i.alternate.child===i.child,d=0,p=0;if(l)for(var b=i.child;b!==null;)d|=b.lanes|b.childLanes,p|=b.subtreeFlags&65011712,p|=b.flags&65011712,b.return=i,b=b.sibling;else for(b=i.child;b!==null;)d|=b.lanes|b.childLanes,p|=b.subtreeFlags,p|=b.flags,b.return=i,b=b.sibling;return i.subtreeFlags|=p,i.childLanes=d,l}function x4(i,l,d){var p=l.pendingProps;switch(Qg(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 d=l.stateNode,p=null,i!==null&&(p=i.memoizedState.cache),l.memoizedState.cache!==p&&(l.flags|=2048),ra(Jn),De(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(i===null||i.child===null)&&(nc(l)?sa(l):i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Kg())),bn(l),null;case 26:var b=l.type,w=l.memoizedState;return i===null?(sa(l),w!==null?(bn(l),Pj(l,w)):(bn(l),Uv(l,b,null,p,d))):w?w!==i.memoizedState?(sa(l),bn(l),Pj(l,w)):(bn(l),l.flags&=-16777217):(i=i.memoizedProps,i!==p&&sa(l),bn(l),Uv(l,b,i,p,d)),null;case 27:if(Ct(l),d=je.current,b=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==p&&sa(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return bn(l),null}i=de.current,nc(l)?dw(l):(i=$C(b,p,d),l.stateNode=i,sa(l))}return bn(l),null;case 5:if(Ct(l),b=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==p&&sa(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return bn(l),null}if(w=de.current,nc(l))dw(l);else{var A=Mh(je.current);switch(w){case 1:w=A.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:w=A.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":w=A.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":w=A.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":w=A.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof p.is=="string"?A.createElement("select",{is:p.is}):A.createElement("select"),p.multiple?w.multiple=!0:p.size&&(w.size=p.size);break;default:w=typeof p.is=="string"?A.createElement(b,{is:p.is}):A.createElement(b)}}w[Me]=l,w[Ue]=p;e:for(A=l.child;A!==null;){if(A.tag===5||A.tag===6)w.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===l)break e;for(;A.sibling===null;){if(A.return===null||A.return===l)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}l.stateNode=w;e:switch(xr(w,b,p),b){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&sa(l)}}return bn(l),Uv(l,l.type,i===null?null:i.memoizedProps,l.pendingProps,d),null;case 6:if(i&&l.stateNode!=null)i.memoizedProps!==p&&sa(l);else{if(typeof p!="string"&&l.stateNode===null)throw Error(r(166));if(i=je.current,nc(l)){if(i=l.stateNode,d=l.memoizedProps,p=null,b=gr,b!==null)switch(b.tag){case 27:case 5:p=b.memoizedProps}i[Me]=l,i=!!(i.nodeValue===d||p!==null&&p.suppressHydrationWarning===!0||_C(i.nodeValue,d)),i||Ba(l,!0)}else i=Mh(i).createTextNode(p),i[Me]=l,l.stateNode=i}return bn(l),null;case 31:if(d=l.memoizedState,i===null||i.memoizedState!==null){if(p=nc(l),d!==null){if(i===null){if(!p)throw Error(r(318));if(i=l.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Me]=l}else Hs(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;bn(l),i=!1}else d=Kg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=d),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(p=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(b=nc(l),p!==null&&p.dehydrated!==null){if(i===null){if(!b)throw Error(r(318));if(b=l.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[Me]=l}else Hs(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;bn(l),b=!1}else b=Kg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=b),b=!0;if(!b)return l.flags&256?(oi(l),l):(oi(l),null)}return oi(l),(l.flags&128)!==0?(l.lanes=d,l):(d=p!==null,i=i!==null&&i.memoizedState!==null,d&&(p=l.child,b=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(b=p.alternate.memoizedState.cachePool.pool),w=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(w=p.memoizedState.cachePool.pool),w!==b&&(p.flags|=2048)),d!==i&&d&&(l.child.flags|=8192),bh(l,l.updateQueue),bn(l),null);case 4:return De(),i===null&&ly(l.stateNode.containerInfo),bn(l),null;case 10:return ra(l.type),bn(l),null;case 19:if(F(Hn),p=l.memoizedState,p===null)return bn(l),null;if(b=(l.flags&128)!==0,w=p.rendering,w===null)if(b)Wu(p,!1);else{if(Un!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(w=sh(i),w!==null){for(l.flags|=128,Wu(p,!1),i=w.updateQueue,l.updateQueue=i,bh(l,i),l.subtreeFlags=0,i=d,d=l.child;d!==null;)aw(d,i),d=d.sibling;return se(Hn,Hn.current&1|2),It&&ta(l,p.treeForkCount),l.child}i=i.sibling}p.tail!==null&&pe()>Eh&&(l.flags|=128,b=!0,Wu(p,!1),l.lanes=4194304)}else{if(!b)if(i=sh(w),i!==null){if(l.flags|=128,b=!0,i=i.updateQueue,l.updateQueue=i,bh(l,i),Wu(p,!0),p.tail===null&&p.tailMode==="hidden"&&!w.alternate&&!It)return bn(l),null}else 2*pe()-p.renderingStartTime>Eh&&d!==536870912&&(l.flags|=128,b=!0,Wu(p,!1),l.lanes=4194304);p.isBackwards?(w.sibling=l.child,l.child=w):(i=p.last,i!==null?i.sibling=w:l.child=w,p.last=w)}return p.tail!==null?(i=p.tail,p.rendering=i,p.tail=i.sibling,p.renderingStartTime=pe(),i.sibling=null,d=Hn.current,se(Hn,b?d&1|2:d&1),It&&ta(l,p.treeForkCount),i):(bn(l),null);case 22:case 23:return oi(l),cv(),p=l.memoizedState!==null,i!==null?i.memoizedState!==null!==p&&(l.flags|=8192):p&&(l.flags|=8192),p?(d&536870912)!==0&&(l.flags&128)===0&&(bn(l),l.subtreeFlags&6&&(l.flags|=8192)):bn(l),d=l.updateQueue,d!==null&&bh(l,d.retryQueue),d=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),p=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),p!==d&&(l.flags|=2048),i!==null&&F(Ws),null;case 24:return d=null,i!==null&&(d=i.memoizedState.cache),l.memoizedState.cache!==d&&(l.flags|=2048),ra(Jn),bn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function b4(i,l){switch(Qg(l),l.tag){case 1:return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return ra(Jn),De(),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));Hs()}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));Hs()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return F(Hn),null;case 4:return De(),null;case 10:return ra(l.type),null;case 22:case 23:return oi(l),cv(),i!==null&&F(Ws),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 24:return ra(Jn),null;case 25:return null;default:return null}}function Nj(i,l){switch(Qg(l),l.tag){case 3:ra(Jn),De();break;case 26:case 27:case 5:Ct(l);break;case 4:De();break;case 31:l.memoizedState!==null&&oi(l);break;case 13:oi(l);break;case 19:F(Hn);break;case 10:ra(l.type);break;case 22:case 23:oi(l),cv(),i!==null&&F(Ws);break;case 24:ra(Jn)}}function Qu(i,l){try{var d=l.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var b=p.next;d=b;do{if((d.tag&i)===i){p=void 0;var w=d.create,A=d.inst;p=w(),A.destroy=p}d=d.next}while(d!==b)}}catch(N){Zt(l,l.return,N)}}function Qa(i,l,d){try{var p=l.updateQueue,b=p!==null?p.lastEffect:null;if(b!==null){var w=b.next;p=w;do{if((p.tag&i)===i){var A=p.inst,N=A.destroy;if(N!==void 0){A.destroy=void 0,b=l;var q=d,re=N;try{re()}catch(fe){Zt(b,q,fe)}}}p=p.next}while(p!==w)}}catch(fe){Zt(l,l.return,fe)}}function Oj(i){var l=i.updateQueue;if(l!==null){var d=i.stateNode;try{Cw(l,d)}catch(p){Zt(i,i.return,p)}}}function Mj(i,l,d){d.props=Js(i.type,i.memoizedProps),d.state=i.memoizedState;try{d.componentWillUnmount()}catch(p){Zt(i,l,p)}}function Yu(i,l){try{var d=i.ref;if(d!==null){switch(i.tag){case 26:case 27:case 5:var p=i.stateNode;break;case 30:p=i.stateNode;break;default:p=i.stateNode}typeof d=="function"?i.refCleanup=d(p):d.current=p}}catch(b){Zt(i,l,b)}}function xo(i,l){var d=i.ref,p=i.refCleanup;if(d!==null)if(typeof p=="function")try{p()}catch(b){Zt(i,l,b)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(b){Zt(i,l,b)}else d.current=null}function Lj(i){var l=i.type,d=i.memoizedProps,p=i.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":d.autoFocus&&p.focus();break e;case"img":d.src?p.src=d.src:d.srcSet&&(p.srcset=d.srcSet)}}catch(b){Zt(i,i.return,b)}}function Bv(i,l,d){try{var p=i.stateNode;V4(p,i.type,d,l),p[Ue]=l}catch(b){Zt(i,i.return,b)}}function Ij(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&ts(i.type)||i.tag===4}function Vv(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Ij(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&&ts(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 Fv(i,l,d){var p=i.tag;if(p===5||p===6)i=i.stateNode,l?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(i,l):(l=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,l.appendChild(i),d=d._reactRootContainer,d!=null||l.onclick!==null||(l.onclick=Jo));else if(p!==4&&(p===27&&ts(i.type)&&(d=i.stateNode,l=null),i=i.child,i!==null))for(Fv(i,l,d),i=i.sibling;i!==null;)Fv(i,l,d),i=i.sibling}function Sh(i,l,d){var p=i.tag;if(p===5||p===6)i=i.stateNode,l?d.insertBefore(i,l):d.appendChild(i);else if(p!==4&&(p===27&&ts(i.type)&&(d=i.stateNode),i=i.child,i!==null))for(Sh(i,l,d),i=i.sibling;i!==null;)Sh(i,l,d),i=i.sibling}function zj(i){var l=i.stateNode,d=i.memoizedProps;try{for(var p=i.type,b=l.attributes;b.length;)l.removeAttributeNode(b[0]);xr(l,p,d),l[Me]=i,l[Ue]=d}catch(w){Zt(i,i.return,w)}}var la=!1,tr=!1,Hv=!1,$j=typeof WeakSet=="function"?WeakSet:Set,sr=null;function S4(i,l){if(i=i.containerInfo,dy=Vh,i=X1(i),Ig(i)){if("selectionStart"in i)var d={start:i.selectionStart,end:i.selectionEnd};else e:{d=(d=i.ownerDocument)&&d.defaultView||window;var p=d.getSelection&&d.getSelection();if(p&&p.rangeCount!==0){d=p.anchorNode;var b=p.anchorOffset,w=p.focusNode;p=p.focusOffset;try{d.nodeType,w.nodeType}catch{d=null;break e}var A=0,N=-1,q=-1,re=0,fe=0,ve=i,ae=null;t:for(;;){for(var ue;ve!==d||b!==0&&ve.nodeType!==3||(N=A+b),ve!==w||p!==0&&ve.nodeType!==3||(q=A+p),ve.nodeType===3&&(A+=ve.nodeValue.length),(ue=ve.firstChild)!==null;)ae=ve,ve=ue;for(;;){if(ve===i)break t;if(ae===d&&++re===b&&(N=A),ae===w&&++fe===p&&(q=A),(ue=ve.nextSibling)!==null)break;ve=ae,ae=ve.parentNode}ve=ue}d=N===-1||q===-1?null:{start:N,end:q}}else d=null}d=d||{start:0,end:0}}else d=null;for(fy={focusedElem:i,selectionRange:d},Vh=!1,sr=l;sr!==null;)if(l=sr,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,sr=i;else for(;sr!==null;){switch(l=sr,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(d=0;d<i.length;d++)b=i[d],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&w!==null){i=void 0,d=l,b=w.memoizedProps,w=w.memoizedState,p=d.stateNode;try{var We=Js(d.type,b);i=p.getSnapshotBeforeUpdate(We,w),p.__reactInternalSnapshotBeforeUpdate=i}catch(ct){Zt(d,d.return,ct)}}break;case 3:if((i&1024)!==0){if(i=l.stateNode.containerInfo,d=i.nodeType,d===9)my(i);else if(d===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":my(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,sr=i;break}sr=l.return}}function Uj(i,l,d){var p=d.flags;switch(d.tag){case 0:case 11:case 15:ua(i,d),p&4&&Qu(5,d);break;case 1:if(ua(i,d),p&4)if(i=d.stateNode,l===null)try{i.componentDidMount()}catch(A){Zt(d,d.return,A)}else{var b=Js(d.type,l.memoizedProps);l=l.memoizedState;try{i.componentDidUpdate(b,l,i.__reactInternalSnapshotBeforeUpdate)}catch(A){Zt(d,d.return,A)}}p&64&&Oj(d),p&512&&Yu(d,d.return);break;case 3:if(ua(i,d),p&64&&(i=d.updateQueue,i!==null)){if(l=null,d.child!==null)switch(d.child.tag){case 27:case 5:l=d.child.stateNode;break;case 1:l=d.child.stateNode}try{Cw(i,l)}catch(A){Zt(d,d.return,A)}}break;case 27:l===null&&p&4&&zj(d);case 26:case 5:ua(i,d),l===null&&p&4&&Lj(d),p&512&&Yu(d,d.return);break;case 12:ua(i,d);break;case 31:ua(i,d),p&4&&Fj(i,d);break;case 13:ua(i,d),p&4&&Hj(i,d),p&64&&(i=d.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(d=A4.bind(null,d),K4(i,d))));break;case 22:if(p=d.memoizedState!==null||la,!p){l=l!==null&&l.memoizedState!==null||tr,b=la;var w=tr;la=p,(tr=l)&&!w?da(i,d,(d.subtreeFlags&8772)!==0):ua(i,d),la=b,tr=w}break;case 30:break;default:ua(i,d)}}function Bj(i){var l=i.alternate;l!==null&&(i.alternate=null,Bj(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&st(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 An=null,Vr=!1;function ca(i,l,d){for(d=d.child;d!==null;)Vj(i,l,d),d=d.sibling}function Vj(i,l,d){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(Sr,d)}catch{}switch(d.tag){case 26:tr||xo(d,l),ca(i,l,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:tr||xo(d,l);var p=An,b=Vr;ts(d.type)&&(An=d.stateNode,Vr=!1),ca(i,l,d),id(d.stateNode),An=p,Vr=b;break;case 5:tr||xo(d,l);case 6:if(p=An,b=Vr,An=null,ca(i,l,d),An=p,Vr=b,An!==null)if(Vr)try{(An.nodeType===9?An.body:An.nodeName==="HTML"?An.ownerDocument.body:An).removeChild(d.stateNode)}catch(w){Zt(d,l,w)}else try{An.removeChild(d.stateNode)}catch(w){Zt(d,l,w)}break;case 18:An!==null&&(Vr?(i=An,OC(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,d.stateNode),jc(i)):OC(An,d.stateNode));break;case 4:p=An,b=Vr,An=d.stateNode.containerInfo,Vr=!0,ca(i,l,d),An=p,Vr=b;break;case 0:case 11:case 14:case 15:Qa(2,d,l),tr||Qa(4,d,l),ca(i,l,d);break;case 1:tr||(xo(d,l),p=d.stateNode,typeof p.componentWillUnmount=="function"&&Mj(d,l,p)),ca(i,l,d);break;case 21:ca(i,l,d);break;case 22:tr=(p=tr)||d.memoizedState!==null,ca(i,l,d),tr=p;break;default:ca(i,l,d)}}function Fj(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{jc(i)}catch(d){Zt(l,l.return,d)}}}function Hj(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{jc(i)}catch(d){Zt(l,l.return,d)}}function w4(i){switch(i.tag){case 31:case 13:case 19:var l=i.stateNode;return l===null&&(l=i.stateNode=new $j),l;case 22:return i=i.stateNode,l=i._retryCache,l===null&&(l=i._retryCache=new $j),l;default:throw Error(r(435,i.tag))}}function wh(i,l){var d=w4(i);l.forEach(function(p){if(!d.has(p)){d.add(p);var b=k4.bind(null,i,p);p.then(b,b)}})}function Fr(i,l){var d=l.deletions;if(d!==null)for(var p=0;p<d.length;p++){var b=d[p],w=i,A=l,N=A;e:for(;N!==null;){switch(N.tag){case 27:if(ts(N.type)){An=N.stateNode,Vr=!1;break e}break;case 5:An=N.stateNode,Vr=!1;break e;case 3:case 4:An=N.stateNode.containerInfo,Vr=!0;break e}N=N.return}if(An===null)throw Error(r(160));Vj(w,A,b),An=null,Vr=!1,w=b.alternate,w!==null&&(w.return=null),b.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)qj(l,i),l=l.sibling}var Ji=null;function qj(i,l){var d=i.alternate,p=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Fr(l,i),Hr(i),p&4&&(Qa(3,i,i.return),Qu(3,i),Qa(5,i,i.return));break;case 1:Fr(l,i),Hr(i),p&512&&(tr||d===null||xo(d,d.return)),p&64&&la&&(i=i.updateQueue,i!==null&&(p=i.callbacks,p!==null&&(d=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=d===null?p:d.concat(p))));break;case 26:var b=Ji;if(Fr(l,i),Hr(i),p&512&&(tr||d===null||xo(d,d.return)),p&4){var w=d!==null?d.memoizedState:null;if(p=i.memoizedState,d===null)if(p===null)if(i.stateNode===null){e:{p=i.type,d=i.memoizedProps,b=b.ownerDocument||b;t:switch(p){case"title":w=b.getElementsByTagName("title")[0],(!w||w[gn]||w[Me]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=b.createElement(p),b.head.insertBefore(w,b.querySelector("head > title"))),xr(w,p,d),w[Me]=i,Dn(w),p=w;break e;case"link":var A=qC("link","href",b).get(p+(d.href||""));if(A){for(var N=0;N<A.length;N++)if(w=A[N],w.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&w.getAttribute("rel")===(d.rel==null?null:d.rel)&&w.getAttribute("title")===(d.title==null?null:d.title)&&w.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){A.splice(N,1);break t}}w=b.createElement(p),xr(w,p,d),b.head.appendChild(w);break;case"meta":if(A=qC("meta","content",b).get(p+(d.content||""))){for(N=0;N<A.length;N++)if(w=A[N],w.getAttribute("content")===(d.content==null?null:""+d.content)&&w.getAttribute("name")===(d.name==null?null:d.name)&&w.getAttribute("property")===(d.property==null?null:d.property)&&w.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&w.getAttribute("charset")===(d.charSet==null?null:d.charSet)){A.splice(N,1);break t}}w=b.createElement(p),xr(w,p,d),b.head.appendChild(w);break;default:throw Error(r(468,p))}w[Me]=i,Dn(w),p=w}i.stateNode=p}else GC(b,i.type,i.stateNode);else i.stateNode=HC(b,p,i.memoizedProps);else w!==p?(w===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):w.count--,p===null?GC(b,i.type,i.stateNode):HC(b,p,i.memoizedProps)):p===null&&i.stateNode!==null&&Bv(i,i.memoizedProps,d.memoizedProps)}break;case 27:Fr(l,i),Hr(i),p&512&&(tr||d===null||xo(d,d.return)),d!==null&&p&4&&Bv(i,i.memoizedProps,d.memoizedProps);break;case 5:if(Fr(l,i),Hr(i),p&512&&(tr||d===null||xo(d,d.return)),i.flags&32){b=i.stateNode;try{Gl(b,"")}catch(We){Zt(i,i.return,We)}}p&4&&i.stateNode!=null&&(b=i.memoizedProps,Bv(i,b,d!==null?d.memoizedProps:b)),p&1024&&(Hv=!0);break;case 6:if(Fr(l,i),Hr(i),p&4){if(i.stateNode===null)throw Error(r(162));p=i.memoizedProps,d=i.stateNode;try{d.nodeValue=p}catch(We){Zt(i,i.return,We)}}break;case 3:if(zh=null,b=Ji,Ji=Lh(l.containerInfo),Fr(l,i),Ji=b,Hr(i),p&4&&d!==null&&d.memoizedState.isDehydrated)try{jc(l.containerInfo)}catch(We){Zt(i,i.return,We)}Hv&&(Hv=!1,Gj(i));break;case 4:p=Ji,Ji=Lh(i.stateNode.containerInfo),Fr(l,i),Hr(i),Ji=p;break;case 12:Fr(l,i),Hr(i);break;case 31:Fr(l,i),Hr(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,wh(i,p)));break;case 13:Fr(l,i),Hr(i),i.child.flags&8192&&i.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Ch=pe()),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,wh(i,p)));break;case 22:b=i.memoizedState!==null;var q=d!==null&&d.memoizedState!==null,re=la,fe=tr;if(la=re||b,tr=fe||q,Fr(l,i),tr=fe,la=re,Hr(i),p&8192)e:for(l=i.stateNode,l._visibility=b?l._visibility&-2:l._visibility|1,b&&(d===null||q||la||tr||Zs(i)),d=null,l=i;;){if(l.tag===5||l.tag===26){if(d===null){q=d=l;try{if(w=q.stateNode,b)A=w.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{N=q.stateNode;var ve=q.memoizedProps.style,ae=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;N.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(We){Zt(q,q.return,We)}}}else if(l.tag===6){if(d===null){q=l;try{q.stateNode.nodeValue=b?"":q.memoizedProps}catch(We){Zt(q,q.return,We)}}}else if(l.tag===18){if(d===null){q=l;try{var ue=q.stateNode;b?MC(ue,!0):MC(q.stateNode,!1)}catch(We){Zt(q,q.return,We)}}}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;d===l&&(d=null),l=l.return}d===l&&(d=null),l.sibling.return=l.return,l=l.sibling}p&4&&(p=i.updateQueue,p!==null&&(d=p.retryQueue,d!==null&&(p.retryQueue=null,wh(i,d))));break;case 19:Fr(l,i),Hr(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,wh(i,p)));break;case 30:break;case 21:break;default:Fr(l,i),Hr(i)}}function Hr(i){var l=i.flags;if(l&2){try{for(var d,p=i.return;p!==null;){if(Ij(p)){d=p;break}p=p.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var b=d.stateNode,w=Vv(i);Sh(i,w,b);break;case 5:var A=d.stateNode;d.flags&32&&(Gl(A,""),d.flags&=-33);var N=Vv(i);Sh(i,N,A);break;case 3:case 4:var q=d.stateNode.containerInfo,re=Vv(i);Fv(i,re,q);break;default:throw Error(r(161))}}catch(fe){Zt(i,i.return,fe)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function Gj(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var l=i;Gj(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),i=i.sibling}}function ua(i,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)Uj(i,l.alternate,l),l=l.sibling}function Zs(i){for(i=i.child;i!==null;){var l=i;switch(l.tag){case 0:case 11:case 14:case 15:Qa(4,l,l.return),Zs(l);break;case 1:xo(l,l.return);var d=l.stateNode;typeof d.componentWillUnmount=="function"&&Mj(l,l.return,d),Zs(l);break;case 27:id(l.stateNode);case 26:case 5:xo(l,l.return),Zs(l);break;case 22:l.memoizedState===null&&Zs(l);break;case 30:Zs(l);break;default:Zs(l)}i=i.sibling}}function da(i,l,d){for(d=d&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var p=l.alternate,b=i,w=l,A=w.flags;switch(w.tag){case 0:case 11:case 15:da(b,w,d),Qu(4,w);break;case 1:if(da(b,w,d),p=w,b=p.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(re){Zt(p,p.return,re)}if(p=w,b=p.updateQueue,b!==null){var N=p.stateNode;try{var q=b.shared.hiddenCallbacks;if(q!==null)for(b.shared.hiddenCallbacks=null,b=0;b<q.length;b++)jw(q[b],N)}catch(re){Zt(p,p.return,re)}}d&&A&64&&Oj(w),Yu(w,w.return);break;case 27:zj(w);case 26:case 5:da(b,w,d),d&&p===null&&A&4&&Lj(w),Yu(w,w.return);break;case 12:da(b,w,d);break;case 31:da(b,w,d),d&&A&4&&Fj(b,w);break;case 13:da(b,w,d),d&&A&4&&Hj(b,w);break;case 22:w.memoizedState===null&&da(b,w,d),Yu(w,w.return);break;case 30:break;default:da(b,w,d)}l=l.sibling}}function qv(i,l){var d=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),i=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==d&&(i!=null&&i.refCount++,d!=null&&Mu(d))}function Gv(i,l){i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Mu(i))}function Zi(i,l,d,p){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Wj(i,l,d,p),l=l.sibling}function Wj(i,l,d,p){var b=l.flags;switch(l.tag){case 0:case 11:case 15:Zi(i,l,d,p),b&2048&&Qu(9,l);break;case 1:Zi(i,l,d,p);break;case 3:Zi(i,l,d,p),b&2048&&(i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Mu(i)));break;case 12:if(b&2048){Zi(i,l,d,p),i=l.stateNode;try{var w=l.memoizedProps,A=w.id,N=w.onPostCommit;typeof N=="function"&&N(A,l.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(q){Zt(l,l.return,q)}}else Zi(i,l,d,p);break;case 31:Zi(i,l,d,p);break;case 13:Zi(i,l,d,p);break;case 23:break;case 22:w=l.stateNode,A=l.alternate,l.memoizedState!==null?w._visibility&2?Zi(i,l,d,p):Ku(i,l):w._visibility&2?Zi(i,l,d,p):(w._visibility|=2,fc(i,l,d,p,(l.subtreeFlags&10256)!==0||!1)),b&2048&&qv(A,l);break;case 24:Zi(i,l,d,p),b&2048&&Gv(l.alternate,l);break;default:Zi(i,l,d,p)}}function fc(i,l,d,p,b){for(b=b&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var w=i,A=l,N=d,q=p,re=A.flags;switch(A.tag){case 0:case 11:case 15:fc(w,A,N,q,b),Qu(8,A);break;case 23:break;case 22:var fe=A.stateNode;A.memoizedState!==null?fe._visibility&2?fc(w,A,N,q,b):Ku(w,A):(fe._visibility|=2,fc(w,A,N,q,b)),b&&re&2048&&qv(A.alternate,A);break;case 24:fc(w,A,N,q,b),b&&re&2048&&Gv(A.alternate,A);break;default:fc(w,A,N,q,b)}l=l.sibling}}function Ku(i,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var d=i,p=l,b=p.flags;switch(p.tag){case 22:Ku(d,p),b&2048&&qv(p.alternate,p);break;case 24:Ku(d,p),b&2048&&Gv(p.alternate,p);break;default:Ku(d,p)}l=l.sibling}}var Xu=8192;function hc(i,l,d){if(i.subtreeFlags&Xu)for(i=i.child;i!==null;)Qj(i,l,d),i=i.sibling}function Qj(i,l,d){switch(i.tag){case 26:hc(i,l,d),i.flags&Xu&&i.memoizedState!==null&&l3(d,Ji,i.memoizedState,i.memoizedProps);break;case 5:hc(i,l,d);break;case 3:case 4:var p=Ji;Ji=Lh(i.stateNode.containerInfo),hc(i,l,d),Ji=p;break;case 22:i.memoizedState===null&&(p=i.alternate,p!==null&&p.memoizedState!==null?(p=Xu,Xu=16777216,hc(i,l,d),Xu=p):hc(i,l,d));break;default:hc(i,l,d)}}function Yj(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 Ju(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var p=l[d];sr=p,Xj(p,i)}Yj(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Kj(i),i=i.sibling}function Kj(i){switch(i.tag){case 0:case 11:case 15:Ju(i),i.flags&2048&&Qa(9,i,i.return);break;case 3:Ju(i);break;case 12:Ju(i);break;case 22:var l=i.stateNode;i.memoizedState!==null&&l._visibility&2&&(i.return===null||i.return.tag!==13)?(l._visibility&=-3,jh(i)):Ju(i);break;default:Ju(i)}}function jh(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var p=l[d];sr=p,Xj(p,i)}Yj(i)}for(i=i.child;i!==null;){switch(l=i,l.tag){case 0:case 11:case 15:Qa(8,l,l.return),jh(l);break;case 22:d=l.stateNode,d._visibility&2&&(d._visibility&=-3,jh(l));break;default:jh(l)}i=i.sibling}}function Xj(i,l){for(;sr!==null;){var d=sr;switch(d.tag){case 0:case 11:case 15:Qa(8,d,l);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var p=d.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:Mu(d.memoizedState.cache)}if(p=d.child,p!==null)p.return=d,sr=p;else e:for(d=i;sr!==null;){p=sr;var b=p.sibling,w=p.return;if(Bj(p),p===d){sr=null;break e}if(b!==null){b.return=w,sr=b;break e}sr=w}}}var j4={getCacheForType:function(i){var l=vr(Jn),d=l.data.get(i);return d===void 0&&(d=i(),l.data.set(i,d)),d},cacheSignal:function(){return vr(Jn).controller.signal}},C4=typeof WeakMap=="function"?WeakMap:Map,Gt=0,sn=null,Dt=null,Nt=0,Jt=0,ai=null,Ya=!1,pc=!1,Wv=!1,fa=0,Un=0,Ka=0,el=0,Qv=0,si=0,mc=0,Zu=null,qr=null,Yv=!1,Ch=0,Jj=0,Eh=1/0,Th=null,Xa=null,rr=0,Ja=null,gc=null,ha=0,Kv=0,Xv=null,Zj=null,ed=0,Jv=null;function li(){return(Gt&2)!==0&&Nt!==0?Nt&-Nt:M.T!==null?iy():_e()}function eC(){if(si===0)if((Nt&536870912)===0||It){var i=yi;yi<<=1,(yi&3932160)===0&&(yi=262144),si=i}else si=536870912;return i=ii.current,i!==null&&(i.flags|=32),si}function Gr(i,l,d){(i===sn&&(Jt===2||Jt===9)||i.cancelPendingCommit!==null)&&(vc(i,0),Za(i,Nt,si,!1)),Nn(i,d),((Gt&2)===0||i!==sn)&&(i===sn&&((Gt&2)===0&&(el|=d),Un===4&&Za(i,Nt,si,!1)),bo(i))}function tC(i,l,d){if((Gt&6)!==0)throw Error(r(327));var p=!d&&(l&127)===0&&(l&i.expiredLanes)===0||Gi(i,l),b=p?R4(i,l):ey(i,l,!0),w=p;do{if(b===0){pc&&!p&&Za(i,l,0,!1);break}else{if(d=i.current.alternate,w&&!E4(d)){b=ey(i,l,!1),w=!1;continue}if(b===2){if(w=l,i.errorRecoveryDisabledLanes&w)var A=0;else A=i.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){l=A;e:{var N=i;b=Zu;var q=N.current.memoizedState.isDehydrated;if(q&&(vc(N,A).flags|=256),A=ey(N,A,!1),A!==2){if(Wv&&!q){N.errorRecoveryDisabledLanes|=w,el|=w,b=4;break e}w=qr,qr=b,w!==null&&(qr===null?qr=w:qr.push.apply(qr,w))}b=A}if(w=!1,b!==2)continue}}if(b===1){vc(i,0),Za(i,l,0,!0);break}e:{switch(p=i,w=b,w){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Za(p,l,si,!Ya);break e;case 2:qr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(b=Ch+300-pe(),10<b)){if(Za(p,l,si,!Ya),go(p,0,!0)!==0)break e;ha=l,p.timeoutHandle=PC(nC.bind(null,p,d,qr,Th,Yv,l,si,el,mc,Ya,w,"Throttled",-0,0),b);break e}nC(p,d,qr,Th,Yv,l,si,el,mc,Ya,w,null,-0,0)}}break}while(!0);bo(i)}function nC(i,l,d,p,b,w,A,N,q,re,fe,ve,ae,ue){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:Jo},Qj(l,w,ve);var We=(w&62914560)===w?Ch-pe():(w&4194048)===w?Jj-pe():0;if(We=c3(ve,We),We!==null){ha=w,i.cancelPendingCommit=We(uC.bind(null,i,l,w,d,p,b,A,N,q,fe,ve,null,ae,ue)),Za(i,w,A,!re);return}}uC(i,l,w,d,p,b,A,N,q)}function E4(i){for(var l=i;;){var d=l.tag;if((d===0||d===11||d===15)&&l.flags&16384&&(d=l.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var p=0;p<d.length;p++){var b=d[p],w=b.getSnapshot;b=b.value;try{if(!ni(w(),b))return!1}catch{return!1}}if(d=l.child,l.subtreeFlags&16384&&d!==null)d.return=l,l=d;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 Za(i,l,d,p){l&=~Qv,l&=~el,i.suspendedLanes|=l,i.pingedLanes&=~l,p&&(i.warmLanes|=l),p=i.expirationTimes;for(var b=l;0<b;){var w=31-zn(b),A=1<<w;p[w]=-1,b&=~A}d!==0&&wu(i,d,l)}function Rh(){return(Gt&6)===0?(td(0),!1):!0}function Zv(){if(Dt!==null){if(Jt===0)var i=Dt.return;else i=Dt,na=qs=null,mv(i),sc=null,Iu=0,i=Dt;for(;i!==null;)Nj(i.alternate,i),i=i.return;Dt=null}}function vc(i,l){var d=i.timeoutHandle;d!==-1&&(i.timeoutHandle=-1,q4(d)),d=i.cancelPendingCommit,d!==null&&(i.cancelPendingCommit=null,d()),ha=0,Zv(),sn=i,Dt=d=ea(i.current,null),Nt=l,Jt=0,ai=null,Ya=!1,pc=Gi(i,l),Wv=!1,mc=si=Qv=el=Ka=Un=0,qr=Zu=null,Yv=!1,(l&8)!==0&&(l|=l&32);var p=i.entangledLanes;if(p!==0)for(i=i.entanglements,p&=l;0<p;){var b=31-zn(p),w=1<<b;l|=i[b],p&=~w}return fa=l,Qf(),d}function rC(i,l){xt=null,M.H=qu,l===ac||l===nh?(l=xw(),Jt=3):l===rv?(l=xw(),Jt=4):Jt=l===kv?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,ai=l,Dt===null&&(Un=1,gh(i,wi(l,i.current)))}function iC(){var i=ii.current;return i===null?!0:(Nt&4194048)===Nt?Ti===null:(Nt&62914560)===Nt||(Nt&536870912)!==0?i===Ti:!1}function oC(){var i=M.H;return M.H=qu,i===null?qu:i}function aC(){var i=M.A;return M.A=j4,i}function _h(){Un=4,Ya||(Nt&4194048)!==Nt&&ii.current!==null||(pc=!0),(Ka&134217727)===0&&(el&134217727)===0||sn===null||Za(sn,Nt,si,!1)}function ey(i,l,d){var p=Gt;Gt|=2;var b=oC(),w=aC();(sn!==i||Nt!==l)&&(Th=null,vc(i,l)),l=!1;var A=Un;e:do try{if(Jt!==0&&Dt!==null){var N=Dt,q=ai;switch(Jt){case 8:Zv(),A=6;break e;case 3:case 2:case 9:case 6:ii.current===null&&(l=!0);var re=Jt;if(Jt=0,ai=null,yc(i,N,q,re),d&&pc){A=0;break e}break;default:re=Jt,Jt=0,ai=null,yc(i,N,q,re)}}T4(),A=Un;break}catch(fe){rC(i,fe)}while(!0);return l&&i.shellSuspendCounter++,na=qs=null,Gt=p,M.H=b,M.A=w,Dt===null&&(sn=null,Nt=0,Qf()),A}function T4(){for(;Dt!==null;)sC(Dt)}function R4(i,l){var d=Gt;Gt|=2;var p=oC(),b=aC();sn!==i||Nt!==l?(Th=null,Eh=pe()+500,vc(i,l)):pc=Gi(i,l);e:do try{if(Jt!==0&&Dt!==null){l=Dt;var w=ai;t:switch(Jt){case 1:Jt=0,ai=null,yc(i,l,w,1);break;case 2:case 9:if(vw(w)){Jt=0,ai=null,lC(l);break}l=function(){Jt!==2&&Jt!==9||sn!==i||(Jt=7),bo(i)},w.then(l,l);break e;case 3:Jt=7;break e;case 4:Jt=5;break e;case 7:vw(w)?(Jt=0,ai=null,lC(l)):(Jt=0,ai=null,yc(i,l,w,7));break;case 5:var A=null;switch(Dt.tag){case 26:A=Dt.memoizedState;case 5:case 27:var N=Dt;if(A?WC(A):N.stateNode.complete){Jt=0,ai=null;var q=N.sibling;if(q!==null)Dt=q;else{var re=N.return;re!==null?(Dt=re,Dh(re)):Dt=null}break t}}Jt=0,ai=null,yc(i,l,w,5);break;case 6:Jt=0,ai=null,yc(i,l,w,6);break;case 8:Zv(),Un=6;break e;default:throw Error(r(462))}}_4();break}catch(fe){rC(i,fe)}while(!0);return na=qs=null,M.H=p,M.A=b,Gt=d,Dt!==null?0:(sn=null,Nt=0,Qf(),Un)}function _4(){for(;Dt!==null&&!et();)sC(Dt)}function sC(i){var l=kj(i.alternate,i,fa);i.memoizedProps=i.pendingProps,l===null?Dh(i):Dt=l}function lC(i){var l=i,d=l.alternate;switch(l.tag){case 15:case 0:l=Ej(d,l,l.pendingProps,l.type,void 0,Nt);break;case 11:l=Ej(d,l,l.pendingProps,l.type.render,l.ref,Nt);break;case 5:mv(l);default:Nj(d,l),l=Dt=aw(l,fa),l=kj(d,l,fa)}i.memoizedProps=i.pendingProps,l===null?Dh(i):Dt=l}function yc(i,l,d,p){na=qs=null,mv(l),sc=null,Iu=0;var b=l.return;try{if(g4(i,b,l,d,Nt)){Un=1,gh(i,wi(d,i.current)),Dt=null;return}}catch(w){if(b!==null)throw Dt=b,w;Un=1,gh(i,wi(d,i.current)),Dt=null;return}l.flags&32768?(It||p===1?i=!0:pc||(Nt&536870912)!==0?i=!1:(Ya=i=!0,(p===2||p===9||p===3||p===6)&&(p=ii.current,p!==null&&p.tag===13&&(p.flags|=16384))),cC(l,i)):Dh(l)}function Dh(i){var l=i;do{if((l.flags&32768)!==0){cC(l,Ya);return}i=l.return;var d=x4(l.alternate,l,fa);if(d!==null){Dt=d;return}if(l=l.sibling,l!==null){Dt=l;return}Dt=l=i}while(l!==null);Un===0&&(Un=5)}function cC(i,l){do{var d=b4(i.alternate,i);if(d!==null){d.flags&=32767,Dt=d;return}if(d=i.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!l&&(i=i.sibling,i!==null)){Dt=i;return}Dt=i=d}while(i!==null);Un=6,Dt=null}function uC(i,l,d,p,b,w,A,N,q){i.cancelPendingCommit=null;do Ah();while(rr!==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|=Vg,Su(i,d,w,A,N,q),i===sn&&(Dt=sn=null,Nt=0),gc=l,Ja=i,ha=d,Kv=w,Xv=b,Zj=p,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,P4(kt,function(){return mC(),null})):(i.callbackNode=null,i.callbackPriority=0),p=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||p){p=M.T,M.T=null,b=L.p,L.p=2,A=Gt,Gt|=4;try{S4(i,l,d)}finally{Gt=A,L.p=b,M.T=p}}rr=1,dC(),fC(),hC()}}function dC(){if(rr===1){rr=0;var i=Ja,l=gc,d=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||d){d=M.T,M.T=null;var p=L.p;L.p=2;var b=Gt;Gt|=4;try{qj(l,i);var w=fy,A=X1(i.containerInfo),N=w.focusedElem,q=w.selectionRange;if(A!==N&&N&&N.ownerDocument&&K1(N.ownerDocument.documentElement,N)){if(q!==null&&Ig(N)){var re=q.start,fe=q.end;if(fe===void 0&&(fe=re),"selectionStart"in N)N.selectionStart=re,N.selectionEnd=Math.min(fe,N.value.length);else{var ve=N.ownerDocument||document,ae=ve&&ve.defaultView||window;if(ae.getSelection){var ue=ae.getSelection(),We=N.textContent.length,ct=Math.min(q.start,We),an=q.end===void 0?ct:Math.min(q.end,We);!ue.extend&&ct>an&&(A=an,an=ct,ct=A);var J=Y1(N,ct),Q=Y1(N,an);if(J&&Q&&(ue.rangeCount!==1||ue.anchorNode!==J.node||ue.anchorOffset!==J.offset||ue.focusNode!==Q.node||ue.focusOffset!==Q.offset)){var ne=ve.createRange();ne.setStart(J.node,J.offset),ue.removeAllRanges(),ct>an?(ue.addRange(ne),ue.extend(Q.node,Q.offset)):(ne.setEnd(Q.node,Q.offset),ue.addRange(ne))}}}}for(ve=[],ue=N;ue=ue.parentNode;)ue.nodeType===1&&ve.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<ve.length;N++){var me=ve[N];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}Vh=!!dy,fy=dy=null}finally{Gt=b,L.p=p,M.T=d}}i.current=l,rr=2}}function fC(){if(rr===2){rr=0;var i=Ja,l=gc,d=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||d){d=M.T,M.T=null;var p=L.p;L.p=2;var b=Gt;Gt|=4;try{Uj(i,l.alternate,l)}finally{Gt=b,L.p=p,M.T=d}}rr=3}}function hC(){if(rr===4||rr===3){rr=0,ft();var i=Ja,l=gc,d=ha,p=Zj;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?rr=5:(rr=0,gc=Ja=null,pC(i,i.pendingLanes));var b=i.pendingLanes;if(b===0&&(Xa=null),Se(d),l=l.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(Sr,l,void 0,(l.current.flags&128)===128)}catch{}if(p!==null){l=M.T,b=L.p,L.p=2,M.T=null;try{for(var w=i.onRecoverableError,A=0;A<p.length;A++){var N=p[A];w(N.value,{componentStack:N.stack})}}finally{M.T=l,L.p=b}}(ha&3)!==0&&Ah(),bo(i),b=i.pendingLanes,(d&261930)!==0&&(b&42)!==0?i===Jv?ed++:(ed=0,Jv=i):ed=0,td(0)}}function pC(i,l){(i.pooledCacheLanes&=l)===0&&(l=i.pooledCache,l!=null&&(i.pooledCache=null,Mu(l)))}function Ah(){return dC(),fC(),hC(),mC()}function mC(){if(rr!==5)return!1;var i=Ja,l=Kv;Kv=0;var d=Se(ha),p=M.T,b=L.p;try{L.p=32>d?32:d,M.T=null,d=Xv,Xv=null;var w=Ja,A=ha;if(rr=0,gc=Ja=null,ha=0,(Gt&6)!==0)throw Error(r(331));var N=Gt;if(Gt|=4,Kj(w.current),Wj(w,w.current,A,d),Gt=N,td(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(Sr,w)}catch{}return!0}finally{L.p=b,M.T=p,pC(i,l)}}function gC(i,l,d){l=wi(d,l),l=Av(i.stateNode,l,2),i=qa(i,l,2),i!==null&&(Nn(i,2),bo(i))}function Zt(i,l,d){if(i.tag===3)gC(i,i,d);else for(;l!==null;){if(l.tag===3){gC(l,i,d);break}else if(l.tag===1){var p=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Xa===null||!Xa.has(p))){i=wi(d,i),d=vj(2),p=qa(l,d,2),p!==null&&(yj(d,p,l,i),Nn(p,2),bo(p));break}}l=l.return}}function ty(i,l,d){var p=i.pingCache;if(p===null){p=i.pingCache=new C4;var b=new Set;p.set(l,b)}else b=p.get(l),b===void 0&&(b=new Set,p.set(l,b));b.has(d)||(Wv=!0,b.add(d),i=D4.bind(null,i,l,d),l.then(i,i))}function D4(i,l,d){var p=i.pingCache;p!==null&&p.delete(l),i.pingedLanes|=i.suspendedLanes&d,i.warmLanes&=~d,sn===i&&(Nt&d)===d&&(Un===4||Un===3&&(Nt&62914560)===Nt&&300>pe()-Ch?(Gt&2)===0&&vc(i,0):Qv|=d,mc===Nt&&(mc=0)),bo(i)}function vC(i,l){l===0&&(l=pr()),i=Vs(i,l),i!==null&&(Nn(i,l),bo(i))}function A4(i){var l=i.memoizedState,d=0;l!==null&&(d=l.retryLane),vC(i,d)}function k4(i,l){var d=0;switch(i.tag){case 31:case 13:var p=i.stateNode,b=i.memoizedState;b!==null&&(d=b.retryLane);break;case 19:p=i.stateNode;break;case 22:p=i.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(l),vC(i,d)}function P4(i,l){return Ie(i,l)}var kh=null,xc=null,ny=!1,Ph=!1,ry=!1,es=0;function bo(i){i!==xc&&i.next===null&&(xc===null?kh=xc=i:xc=xc.next=i),Ph=!0,ny||(ny=!0,O4())}function td(i,l){if(!ry&&Ph){ry=!0;do for(var d=!1,p=kh;p!==null;){if(i!==0){var b=p.pendingLanes;if(b===0)var w=0;else{var A=p.suspendedLanes,N=p.pingedLanes;w=(1<<31-zn(42|i)+1)-1,w&=b&~(A&~N),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(d=!0,SC(p,w))}else w=Nt,w=go(p,p===sn?w:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(w&3)===0||Gi(p,w)||(d=!0,SC(p,w));p=p.next}while(d);ry=!1}}function N4(){yC()}function yC(){Ph=ny=!1;var i=0;es!==0&&H4()&&(i=es);for(var l=pe(),d=null,p=kh;p!==null;){var b=p.next,w=xC(p,l);w===0?(p.next=null,d===null?kh=b:d.next=b,b===null&&(xc=d)):(d=p,(i!==0||(w&3)!==0)&&(Ph=!0)),p=b}rr!==0&&rr!==5||td(i),es!==0&&(es=0)}function xC(i,l){for(var d=i.suspendedLanes,p=i.pingedLanes,b=i.expirationTimes,w=i.pendingLanes&-62914561;0<w;){var A=31-zn(w),N=1<<A,q=b[A];q===-1?((N&d)===0||(N&p)!==0)&&(b[A]=Ia(N,l)):q<=l&&(i.expiredLanes|=N),w&=~N}if(l=sn,d=Nt,d=go(i,i===l?d:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p=i.callbackNode,d===0||i===l&&(Jt===2||Jt===9)||i.cancelPendingCommit!==null)return p!==null&&p!==null&<(p),i.callbackNode=null,i.callbackPriority=0;if((d&3)===0||Gi(i,d)){if(l=d&-d,l===i.callbackPriority)return l;switch(p!==null&<(p),Se(d)){case 2:case 8:d=ke;break;case 32:d=kt;break;case 268435456:d=mn;break;default:d=kt}return p=bC.bind(null,i),d=Ie(d,p),i.callbackPriority=l,i.callbackNode=d,l}return p!==null&&p!==null&<(p),i.callbackPriority=2,i.callbackNode=null,2}function bC(i,l){if(rr!==0&&rr!==5)return i.callbackNode=null,i.callbackPriority=0,null;var d=i.callbackNode;if(Ah()&&i.callbackNode!==d)return null;var p=Nt;return p=go(i,i===sn?p:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p===0?null:(tC(i,p,l),xC(i,pe()),i.callbackNode!=null&&i.callbackNode===d?bC.bind(null,i):null)}function SC(i,l){if(Ah())return null;tC(i,l,!0)}function O4(){G4(function(){(Gt&6)!==0?Ie(Ce,N4):yC()})}function iy(){if(es===0){var i=ic;i===0&&(i=Hi,Hi<<=1,(Hi&261888)===0&&(Hi=256)),es=i}return es}function wC(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Uf(""+i)}function jC(i,l){var d=l.ownerDocument.createElement("input");return d.name=l.name,d.value=l.value,i.id&&d.setAttribute("form",i.id),l.parentNode.insertBefore(d,l),i=new FormData(i),d.parentNode.removeChild(d),i}function M4(i,l,d,p,b){if(l==="submit"&&d&&d.stateNode===b){var w=wC((b[Ue]||null).action),A=p.submitter;A&&(l=(l=A[Ue]||null)?wC(l.formAction):A.getAttribute("formAction"),l!==null&&(w=l,A=null));var N=new Hf("action","action",null,p,b);i.push({event:N,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(es!==0){var q=A?jC(b,A):new FormData(b);Cv(d,{pending:!0,data:q,method:b.method,action:w},null,q)}}else typeof w=="function"&&(N.preventDefault(),q=A?jC(b,A):new FormData(b),Cv(d,{pending:!0,data:q,method:b.method,action:w},w,q))},currentTarget:b}]})}}for(var oy=0;oy<Bg.length;oy++){var ay=Bg[oy],L4=ay.toLowerCase(),I4=ay[0].toUpperCase()+ay.slice(1);Xi(L4,"on"+I4)}Xi(ew,"onAnimationEnd"),Xi(tw,"onAnimationIteration"),Xi(nw,"onAnimationStart"),Xi("dblclick","onDoubleClick"),Xi("focusin","onFocus"),Xi("focusout","onBlur"),Xi(ZO,"onTransitionRun"),Xi(e4,"onTransitionStart"),Xi(t4,"onTransitionCancel"),Xi(rw,"onTransitionEnd"),xi("onMouseEnter",["mouseout","mouseover"]),xi("onMouseLeave",["mouseout","mouseover"]),xi("onPointerEnter",["pointerout","pointerover"]),xi("onPointerLeave",["pointerout","pointerover"]),Yi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Yi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Yi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Yi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Yi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Yi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var nd="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(" "),z4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(nd));function CC(i,l){l=(l&4)!==0;for(var d=0;d<i.length;d++){var p=i[d],b=p.event;p=p.listeners;e:{var w=void 0;if(l)for(var A=p.length-1;0<=A;A--){var N=p[A],q=N.instance,re=N.currentTarget;if(N=N.listener,q!==w&&b.isPropagationStopped())break e;w=N,b.currentTarget=re;try{w(b)}catch(fe){Wf(fe)}b.currentTarget=null,w=q}else for(A=0;A<p.length;A++){if(N=p[A],q=N.instance,re=N.currentTarget,N=N.listener,q!==w&&b.isPropagationStopped())break e;w=N,b.currentTarget=re;try{w(b)}catch(fe){Wf(fe)}b.currentTarget=null,w=q}}}}function At(i,l){var d=l[at];d===void 0&&(d=l[at]=new Set);var p=i+"__bubble";d.has(p)||(EC(l,i,2,!1),d.add(p))}function sy(i,l,d){var p=0;l&&(p|=4),EC(d,i,p,l)}var Nh="_reactListening"+Math.random().toString(36).slice(2);function ly(i){if(!i[Nh]){i[Nh]=!0,Qi.forEach(function(d){d!=="selectionchange"&&(z4.has(d)||sy(d,!1,i),sy(d,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[Nh]||(l[Nh]=!0,sy("selectionchange",!1,l))}}function EC(i,l,d,p){switch(eE(l)){case 2:var b=f3;break;case 8:b=h3;break;default:b=jy}d=b.bind(null,l,d,i),b=void 0,!_g||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(b=!0),p?b!==void 0?i.addEventListener(l,d,{capture:!0,passive:b}):i.addEventListener(l,d,!0):b!==void 0?i.addEventListener(l,d,{passive:b}):i.addEventListener(l,d,!1)}function cy(i,l,d,p,b){var w=p;if((l&1)===0&&(l&2)===0&&p!==null)e:for(;;){if(p===null)return;var A=p.tag;if(A===3||A===4){var N=p.stateNode.containerInfo;if(N===b)break;if(A===4)for(A=p.return;A!==null;){var q=A.tag;if((q===3||q===4)&&A.stateNode.containerInfo===b)return;A=A.return}for(;N!==null;){if(A=vn(N),A===null)return;if(q=A.tag,q===5||q===6||q===26||q===27){p=w=A;continue e}N=N.parentNode}}p=p.return}A1(function(){var re=w,fe=Tg(d),ve=[];e:{var ae=iw.get(i);if(ae!==void 0){var ue=Hf,We=i;switch(i){case"keypress":if(Vf(d)===0)break e;case"keydown":case"keyup":ue=kO;break;case"focusin":We="focus",ue=Pg;break;case"focusout":We="blur",ue=Pg;break;case"beforeblur":case"afterblur":ue=Pg;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=N1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=xO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=OO;break;case ew:case tw:case nw:ue=wO;break;case rw:ue=LO;break;case"scroll":case"scrollend":ue=vO;break;case"wheel":ue=zO;break;case"copy":case"cut":case"paste":ue=CO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=M1;break;case"toggle":case"beforetoggle":ue=UO}var ct=(l&4)!==0,an=!ct&&(i==="scroll"||i==="scrollend"),J=ct?ae!==null?ae+"Capture":null:ae;ct=[];for(var Q=re,ne;Q!==null;){var me=Q;if(ne=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||ne===null||J===null||(me=Cu(Q,J),me!=null&&ct.push(rd(Q,me,ne))),an)break;Q=Q.return}0<ct.length&&(ae=new ue(ae,We,null,d,fe),ve.push({event:ae,listeners:ct}))}}if((l&7)===0){e:{if(ae=i==="mouseover"||i==="pointerover",ue=i==="mouseout"||i==="pointerout",ae&&d!==Eg&&(We=d.relatedTarget||d.fromElement)&&(vn(We)||We[Qe]))break e;if((ue||ae)&&(ae=fe.window===fe?fe:(ae=fe.ownerDocument)?ae.defaultView||ae.parentWindow:window,ue?(We=d.relatedTarget||d.toElement,ue=re,We=We?vn(We):null,We!==null&&(an=s(We),ct=We.tag,We!==an||ct!==5&&ct!==27&&ct!==6)&&(We=null)):(ue=null,We=re),ue!==We)){if(ct=N1,me="onMouseLeave",J="onMouseEnter",Q="mouse",(i==="pointerout"||i==="pointerover")&&(ct=M1,me="onPointerLeave",J="onPointerEnter",Q="pointer"),an=ue==null?ae:Xn(ue),ne=We==null?ae:Xn(We),ae=new ct(me,Q+"leave",ue,d,fe),ae.target=an,ae.relatedTarget=ne,me=null,vn(fe)===re&&(ct=new ct(J,Q+"enter",We,d,fe),ct.target=ne,ct.relatedTarget=an,me=ct),an=me,ue&&We)t:{for(ct=$4,J=ue,Q=We,ne=0,me=J;me;me=ct(me))ne++;me=0;for(var it=Q;it;it=ct(it))me++;for(;0<ne-me;)J=ct(J),ne--;for(;0<me-ne;)Q=ct(Q),me--;for(;ne--;){if(J===Q||Q!==null&&J===Q.alternate){ct=J;break t}J=ct(J),Q=ct(Q)}ct=null}else ct=null;ue!==null&&TC(ve,ae,ue,ct,!1),We!==null&&an!==null&&TC(ve,an,We,ct,!0)}}e:{if(ae=re?Xn(re):window,ue=ae.nodeName&&ae.nodeName.toLowerCase(),ue==="select"||ue==="input"&&ae.type==="file")var Ft=F1;else if(B1(ae))if(H1)Ft=KO;else{Ft=QO;var Je=WO}else ue=ae.nodeName,!ue||ue.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?re&&Cg(re.elementType)&&(Ft=F1):Ft=YO;if(Ft&&(Ft=Ft(i,re))){V1(ve,Ft,d,fe);break e}Je&&Je(i,ae,re),i==="focusout"&&re&&ae.type==="number"&&re.memoizedProps.value!=null&&jg(ae,"number",ae.value)}switch(Je=re?Xn(re):window,i){case"focusin":(B1(Je)||Je.contentEditable==="true")&&(Kl=Je,zg=re,Pu=null);break;case"focusout":Pu=zg=Kl=null;break;case"mousedown":$g=!0;break;case"contextmenu":case"mouseup":case"dragend":$g=!1,J1(ve,d,fe);break;case"selectionchange":if(JO)break;case"keydown":case"keyup":J1(ve,d,fe)}var jt;if(Og)e:{switch(i){case"compositionstart":var Ot="onCompositionStart";break e;case"compositionend":Ot="onCompositionEnd";break e;case"compositionupdate":Ot="onCompositionUpdate";break e}Ot=void 0}else Yl?$1(i,d)&&(Ot="onCompositionEnd"):i==="keydown"&&d.keyCode===229&&(Ot="onCompositionStart");Ot&&(L1&&d.locale!=="ko"&&(Yl||Ot!=="onCompositionStart"?Ot==="onCompositionEnd"&&Yl&&(jt=k1()):(za=fe,Dg="value"in za?za.value:za.textContent,Yl=!0)),Je=Oh(re,Ot),0<Je.length&&(Ot=new O1(Ot,i,null,d,fe),ve.push({event:Ot,listeners:Je}),jt?Ot.data=jt:(jt=U1(d),jt!==null&&(Ot.data=jt)))),(jt=VO?FO(i,d):HO(i,d))&&(Ot=Oh(re,"onBeforeInput"),0<Ot.length&&(Je=new O1("onBeforeInput","beforeinput",null,d,fe),ve.push({event:Je,listeners:Ot}),Je.data=jt)),M4(ve,i,re,d,fe)}CC(ve,l)})}function rd(i,l,d){return{instance:i,listener:l,currentTarget:d}}function Oh(i,l){for(var d=l+"Capture",p=[];i!==null;){var b=i,w=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||w===null||(b=Cu(i,d),b!=null&&p.unshift(rd(i,b,w)),b=Cu(i,l),b!=null&&p.push(rd(i,b,w))),i.tag===3)return p;i=i.return}return[]}function $4(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function TC(i,l,d,p,b){for(var w=l._reactName,A=[];d!==null&&d!==p;){var N=d,q=N.alternate,re=N.stateNode;if(N=N.tag,q!==null&&q===p)break;N!==5&&N!==26&&N!==27||re===null||(q=re,b?(re=Cu(d,w),re!=null&&A.unshift(rd(d,re,q))):b||(re=Cu(d,w),re!=null&&A.push(rd(d,re,q)))),d=d.return}A.length!==0&&i.push({event:l,listeners:A})}var U4=/\r\n?/g,B4=/\u0000|\uFFFD/g;function RC(i){return(typeof i=="string"?i:""+i).replace(U4,`
|
|
214
|
-
`).replace(B4,"")}function _C(i,l){return l=RC(l),RC(i)===l}function on(i,l,d,p,b,w){switch(d){case"children":typeof p=="string"?l==="body"||l==="textarea"&&p===""||Gl(i,p):(typeof p=="number"||typeof p=="bigint")&&l!=="body"&&Gl(i,""+p);break;case"className":Ki(i,"class",p);break;case"tabIndex":Ki(i,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Ki(i,d,p);break;case"style":_1(i,p,w);break;case"data":if(l!=="object"){Ki(i,"data",p);break}case"src":case"href":if(p===""&&(l!=="a"||d!=="href")){i.removeAttribute(d);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){i.removeAttribute(d);break}p=Uf(""+p),i.setAttribute(d,p);break;case"action":case"formAction":if(typeof p=="function"){i.setAttribute(d,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(d==="formAction"?(l!=="input"&&on(i,l,"name",b.name,b,null),on(i,l,"formEncType",b.formEncType,b,null),on(i,l,"formMethod",b.formMethod,b,null),on(i,l,"formTarget",b.formTarget,b,null)):(on(i,l,"encType",b.encType,b,null),on(i,l,"method",b.method,b,null),on(i,l,"target",b.target,b,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){i.removeAttribute(d);break}p=Uf(""+p),i.setAttribute(d,p);break;case"onClick":p!=null&&(i.onclick=Jo);break;case"onScroll":p!=null&&At("scroll",i);break;case"onScrollEnd":p!=null&&At("scrollend",i);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(d=p.__html,d!=null){if(b.children!=null)throw Error(r(60));i.innerHTML=d}}break;case"multiple":i.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":i.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){i.removeAttribute("xlink:href");break}d=Uf(""+p),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(d,""+p):i.removeAttribute(d);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(d,""):i.removeAttribute(d);break;case"capture":case"download":p===!0?i.setAttribute(d,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(d,p):i.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?i.setAttribute(d,p):i.removeAttribute(d);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?i.removeAttribute(d):i.setAttribute(d,p);break;case"popover":At("beforetoggle",i),At("toggle",i),Fn(i,"popover",p);break;case"xlinkActuate":mr(i,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":mr(i,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":mr(i,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":mr(i,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":mr(i,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":mr(i,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":mr(i,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":mr(i,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":mr(i,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Fn(i,"is",p);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=mO.get(d)||d,Fn(i,d,p))}}function uy(i,l,d,p,b,w){switch(d){case"style":_1(i,p,w);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(d=p.__html,d!=null){if(b.children!=null)throw Error(r(60));i.innerHTML=d}}break;case"children":typeof p=="string"?Gl(i,p):(typeof p=="number"||typeof p=="bigint")&&Gl(i,""+p);break;case"onScroll":p!=null&&At("scroll",i);break;case"onScrollEnd":p!=null&&At("scrollend",i);break;case"onClick":p!=null&&(i.onclick=Jo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ti.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(b=d.endsWith("Capture"),l=d.slice(2,b?d.length-7:void 0),w=i[Ue]||null,w=w!=null?w[d]:null,typeof w=="function"&&i.removeEventListener(l,w,b),typeof p=="function")){typeof w!="function"&&w!==null&&(d in i?i[d]=null:i.hasAttribute(d)&&i.removeAttribute(d)),i.addEventListener(l,p,b);break e}d in i?i[d]=p:p===!0?i.setAttribute(d,""):Fn(i,d,p)}}}function xr(i,l,d){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":At("error",i),At("load",i);var p=!1,b=!1,w;for(w in d)if(d.hasOwnProperty(w)){var A=d[w];if(A!=null)switch(w){case"src":p=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:on(i,l,w,A,d,null)}}b&&on(i,l,"srcSet",d.srcSet,d,null),p&&on(i,l,"src",d.src,d,null);return;case"input":At("invalid",i);var N=w=A=b=null,q=null,re=null;for(p in d)if(d.hasOwnProperty(p)){var fe=d[p];if(fe!=null)switch(p){case"name":b=fe;break;case"type":A=fe;break;case"checked":q=fe;break;case"defaultChecked":re=fe;break;case"value":w=fe;break;case"defaultValue":N=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,l));break;default:on(i,l,p,fe,d,null)}}C1(i,w,N,q,re,A,b,!1);return;case"select":At("invalid",i),p=A=w=null;for(b in d)if(d.hasOwnProperty(b)&&(N=d[b],N!=null))switch(b){case"value":w=N;break;case"defaultValue":A=N;break;case"multiple":p=N;default:on(i,l,b,N,d,null)}l=w,d=A,i.multiple=!!p,l!=null?ql(i,!!p,l,!1):d!=null&&ql(i,!!p,d,!0);return;case"textarea":At("invalid",i),w=b=p=null;for(A in d)if(d.hasOwnProperty(A)&&(N=d[A],N!=null))switch(A){case"value":p=N;break;case"defaultValue":b=N;break;case"children":w=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(r(91));break;default:on(i,l,A,N,d,null)}T1(i,p,b,w);return;case"option":for(q in d)d.hasOwnProperty(q)&&(p=d[q],p!=null)&&(q==="selected"?i.selected=p&&typeof p!="function"&&typeof p!="symbol":on(i,l,q,p,d,null));return;case"dialog":At("beforetoggle",i),At("toggle",i),At("cancel",i),At("close",i);break;case"iframe":case"object":At("load",i);break;case"video":case"audio":for(p=0;p<nd.length;p++)At(nd[p],i);break;case"image":At("error",i),At("load",i);break;case"details":At("toggle",i);break;case"embed":case"source":case"link":At("error",i),At("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(re in d)if(d.hasOwnProperty(re)&&(p=d[re],p!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:on(i,l,re,p,d,null)}return;default:if(Cg(l)){for(fe in d)d.hasOwnProperty(fe)&&(p=d[fe],p!==void 0&&uy(i,l,fe,p,d,void 0));return}}for(N in d)d.hasOwnProperty(N)&&(p=d[N],p!=null&&on(i,l,N,p,d,null))}function V4(i,l,d,p){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,w=null,A=null,N=null,q=null,re=null,fe=null;for(ue in d){var ve=d[ue];if(d.hasOwnProperty(ue)&&ve!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":q=ve;default:p.hasOwnProperty(ue)||on(i,l,ue,null,p,ve)}}for(var ae in p){var ue=p[ae];if(ve=d[ae],p.hasOwnProperty(ae)&&(ue!=null||ve!=null))switch(ae){case"type":w=ue;break;case"name":b=ue;break;case"checked":re=ue;break;case"defaultChecked":fe=ue;break;case"value":A=ue;break;case"defaultValue":N=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,l));break;default:ue!==ve&&on(i,l,ae,ue,p,ve)}}wg(i,A,N,q,re,fe,w,b);return;case"select":ue=A=N=ae=null;for(w in d)if(q=d[w],d.hasOwnProperty(w)&&q!=null)switch(w){case"value":break;case"multiple":ue=q;default:p.hasOwnProperty(w)||on(i,l,w,null,p,q)}for(b in p)if(w=p[b],q=d[b],p.hasOwnProperty(b)&&(w!=null||q!=null))switch(b){case"value":ae=w;break;case"defaultValue":N=w;break;case"multiple":A=w;default:w!==q&&on(i,l,b,w,p,q)}l=N,d=A,p=ue,ae!=null?ql(i,!!d,ae,!1):!!p!=!!d&&(l!=null?ql(i,!!d,l,!0):ql(i,!!d,d?[]:"",!1));return;case"textarea":ue=ae=null;for(N in d)if(b=d[N],d.hasOwnProperty(N)&&b!=null&&!p.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:on(i,l,N,null,p,b)}for(A in p)if(b=p[A],w=d[A],p.hasOwnProperty(A)&&(b!=null||w!=null))switch(A){case"value":ae=b;break;case"defaultValue":ue=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==w&&on(i,l,A,b,p,w)}E1(i,ae,ue);return;case"option":for(var We in d)ae=d[We],d.hasOwnProperty(We)&&ae!=null&&!p.hasOwnProperty(We)&&(We==="selected"?i.selected=!1:on(i,l,We,null,p,ae));for(q in p)ae=p[q],ue=d[q],p.hasOwnProperty(q)&&ae!==ue&&(ae!=null||ue!=null)&&(q==="selected"?i.selected=ae&&typeof ae!="function"&&typeof ae!="symbol":on(i,l,q,ae,p,ue));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 d)ae=d[ct],d.hasOwnProperty(ct)&&ae!=null&&!p.hasOwnProperty(ct)&&on(i,l,ct,null,p,ae);for(re in p)if(ae=p[re],ue=d[re],p.hasOwnProperty(re)&&ae!==ue&&(ae!=null||ue!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,l));break;default:on(i,l,re,ae,p,ue)}return;default:if(Cg(l)){for(var an in d)ae=d[an],d.hasOwnProperty(an)&&ae!==void 0&&!p.hasOwnProperty(an)&&uy(i,l,an,void 0,p,ae);for(fe in p)ae=p[fe],ue=d[fe],!p.hasOwnProperty(fe)||ae===ue||ae===void 0&&ue===void 0||uy(i,l,fe,ae,p,ue);return}}for(var J in d)ae=d[J],d.hasOwnProperty(J)&&ae!=null&&!p.hasOwnProperty(J)&&on(i,l,J,null,p,ae);for(ve in p)ae=p[ve],ue=d[ve],!p.hasOwnProperty(ve)||ae===ue||ae==null&&ue==null||on(i,l,ve,ae,p,ue)}function DC(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function F4(){if(typeof performance.getEntriesByType=="function"){for(var i=0,l=0,d=performance.getEntriesByType("resource"),p=0;p<d.length;p++){var b=d[p],w=b.transferSize,A=b.initiatorType,N=b.duration;if(w&&N&&DC(A)){for(A=0,N=b.responseEnd,p+=1;p<d.length;p++){var q=d[p],re=q.startTime;if(re>N)break;var fe=q.transferSize,ve=q.initiatorType;fe&&DC(ve)&&(q=q.responseEnd,A+=fe*(q<N?1:(N-re)/(q-re)))}if(--p,l+=8*(w+A)/(b.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 dy=null,fy=null;function Mh(i){return i.nodeType===9?i:i.ownerDocument}function AC(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 kC(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 hy(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 py=null;function H4(){var i=window.event;return i&&i.type==="popstate"?i===py?!1:(py=i,!0):(py=null,!1)}var PC=typeof setTimeout=="function"?setTimeout:void 0,q4=typeof clearTimeout=="function"?clearTimeout:void 0,NC=typeof Promise=="function"?Promise:void 0,G4=typeof queueMicrotask=="function"?queueMicrotask:typeof NC<"u"?function(i){return NC.resolve(null).then(i).catch(W4)}:PC;function W4(i){setTimeout(function(){throw i})}function ts(i){return i==="head"}function OC(i,l){var d=l,p=0;do{var b=d.nextSibling;if(i.removeChild(d),b&&b.nodeType===8)if(d=b.data,d==="/$"||d==="/&"){if(p===0){i.removeChild(b),jc(l);return}p--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")p++;else if(d==="html")id(i.ownerDocument.documentElement);else if(d==="head"){d=i.ownerDocument.head,id(d);for(var w=d.firstChild;w;){var A=w.nextSibling,N=w.nodeName;w[gn]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&w.rel.toLowerCase()==="stylesheet"||d.removeChild(w),w=A}}else d==="body"&&id(i.ownerDocument.body);d=b}while(d);jc(l)}function MC(i,l){var d=i;i=0;do{var p=d.nextSibling;if(d.nodeType===1?l?(d._stashedDisplay=d.style.display,d.style.display="none"):(d.style.display=d._stashedDisplay||"",d.getAttribute("style")===""&&d.removeAttribute("style")):d.nodeType===3&&(l?(d._stashedText=d.nodeValue,d.nodeValue=""):d.nodeValue=d._stashedText||""),p&&p.nodeType===8)if(d=p.data,d==="/$"){if(i===0)break;i--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||i++;d=p}while(d)}function my(i){var l=i.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var d=l;switch(l=l.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":my(d),st(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}i.removeChild(d)}}function Q4(i,l,d,p){for(;i.nodeType===1;){var b=d;if(i.nodeName.toLowerCase()!==l.toLowerCase()){if(!p&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(p){if(!i[gn])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!==b.rel||i.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||i.getAttribute("title")!==(b.title==null?null:b.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(w=i.getAttribute("src"),(w!==(b.src==null?null:b.src)||i.getAttribute("type")!==(b.type==null?null:b.type)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&w&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(l==="input"&&i.type==="hidden"){var w=b.name==null?null:""+b.name;if(b.type==="hidden"&&i.getAttribute("name")===w)return i}else return i;if(i=Ri(i.nextSibling),i===null)break}return null}function Y4(i,l,d){if(l==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!d||(i=Ri(i.nextSibling),i===null))return null;return i}function LC(i,l){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!l||(i=Ri(i.nextSibling),i===null))return null;return i}function gy(i){return i.data==="$?"||i.data==="$~"}function vy(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function K4(i,l){var d=i.ownerDocument;if(i.data==="$~")i._reactRetry=l;else if(i.data!=="$?"||d.readyState!=="loading")l();else{var p=function(){l(),d.removeEventListener("DOMContentLoaded",p)};d.addEventListener("DOMContentLoaded",p),i._reactRetry=p}}function Ri(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 yy=null;function IC(i){i=i.nextSibling;for(var l=0;i;){if(i.nodeType===8){var d=i.data;if(d==="/$"||d==="/&"){if(l===0)return Ri(i.nextSibling);l--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||l++}i=i.nextSibling}return null}function zC(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var d=i.data;if(d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"){if(l===0)return i;l--}else d!=="/$"&&d!=="/&"||l++}i=i.previousSibling}return null}function $C(i,l,d){switch(l=Mh(d),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 id(i){for(var l=i.attributes;l.length;)i.removeAttributeNode(l[0]);st(i)}var _i=new Map,UC=new Set;function Lh(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var pa=L.d;L.d={f:X4,r:J4,D:Z4,C:e3,L:t3,m:n3,X:i3,S:r3,M:o3};function X4(){var i=pa.f(),l=Rh();return i||l}function J4(i){var l=_t(i);l!==null&&l.tag===5&&l.type==="form"?rj(l):pa.r(i)}var bc=typeof document>"u"?null:document;function BC(i,l,d){var p=bc;if(p&&typeof l=="string"&&l){var b=bi(l);b='link[rel="'+i+'"][href="'+b+'"]',typeof d=="string"&&(b+='[crossorigin="'+d+'"]'),UC.has(b)||(UC.add(b),i={rel:i,crossOrigin:d,href:l},p.querySelector(b)===null&&(l=p.createElement("link"),xr(l,"link",i),Dn(l),p.head.appendChild(l)))}}function Z4(i){pa.D(i),BC("dns-prefetch",i,null)}function e3(i,l){pa.C(i,l),BC("preconnect",i,l)}function t3(i,l,d){pa.L(i,l,d);var p=bc;if(p&&i&&l){var b='link[rel="preload"][as="'+bi(l)+'"]';l==="image"&&d&&d.imageSrcSet?(b+='[imagesrcset="'+bi(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(b+='[imagesizes="'+bi(d.imageSizes)+'"]')):b+='[href="'+bi(i)+'"]';var w=b;switch(l){case"style":w=Sc(i);break;case"script":w=wc(i)}_i.has(w)||(i=g({rel:"preload",href:l==="image"&&d&&d.imageSrcSet?void 0:i,as:l},d),_i.set(w,i),p.querySelector(b)!==null||l==="style"&&p.querySelector(od(w))||l==="script"&&p.querySelector(ad(w))||(l=p.createElement("link"),xr(l,"link",i),Dn(l),p.head.appendChild(l)))}}function n3(i,l){pa.m(i,l);var d=bc;if(d&&i){var p=l&&typeof l.as=="string"?l.as:"script",b='link[rel="modulepreload"][as="'+bi(p)+'"][href="'+bi(i)+'"]',w=b;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=wc(i)}if(!_i.has(w)&&(i=g({rel:"modulepreload",href:i},l),_i.set(w,i),d.querySelector(b)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(ad(w)))return}p=d.createElement("link"),xr(p,"link",i),Dn(p),d.head.appendChild(p)}}}function r3(i,l,d){pa.S(i,l,d);var p=bc;if(p&&i){var b=Ur(p).hoistableStyles,w=Sc(i);l=l||"default";var A=b.get(w);if(!A){var N={loading:0,preload:null};if(A=p.querySelector(od(w)))N.loading=5;else{i=g({rel:"stylesheet",href:i,"data-precedence":l},d),(d=_i.get(w))&&xy(i,d);var q=A=p.createElement("link");Dn(q),xr(q,"link",i),q._p=new Promise(function(re,fe){q.onload=re,q.onerror=fe}),q.addEventListener("load",function(){N.loading|=1}),q.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Ih(A,l,p)}A={type:"stylesheet",instance:A,count:1,state:N},b.set(w,A)}}}function i3(i,l){pa.X(i,l);var d=bc;if(d&&i){var p=Ur(d).hoistableScripts,b=wc(i),w=p.get(b);w||(w=d.querySelector(ad(b)),w||(i=g({src:i,async:!0},l),(l=_i.get(b))&&by(i,l),w=d.createElement("script"),Dn(w),xr(w,"link",i),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(b,w))}}function o3(i,l){pa.M(i,l);var d=bc;if(d&&i){var p=Ur(d).hoistableScripts,b=wc(i),w=p.get(b);w||(w=d.querySelector(ad(b)),w||(i=g({src:i,async:!0,type:"module"},l),(l=_i.get(b))&&by(i,l),w=d.createElement("script"),Dn(w),xr(w,"link",i),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(b,w))}}function VC(i,l,d,p){var b=(b=je.current)?Lh(b):null;if(!b)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(l=Sc(d.href),d=Ur(b).hoistableStyles,p=d.get(l),p||(p={type:"style",instance:null,count:0,state:null},d.set(l,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){i=Sc(d.href);var w=Ur(b).hoistableStyles,A=w.get(i);if(A||(b=b.ownerDocument||b,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(i,A),(w=b.querySelector(od(i)))&&!w._p&&(A.instance=w,A.state.loading=5),_i.has(i)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},_i.set(i,d),w||a3(b,i,d,A.state))),l&&p===null)throw Error(r(528,""));return A}if(l&&p!==null)throw Error(r(529,""));return null;case"script":return l=d.async,d=d.src,typeof d=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=wc(d),d=Ur(b).hoistableScripts,p=d.get(l),p||(p={type:"script",instance:null,count:0,state:null},d.set(l,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Sc(i){return'href="'+bi(i)+'"'}function od(i){return'link[rel="stylesheet"]['+i+"]"}function FC(i){return g({},i,{"data-precedence":i.precedence,precedence:null})}function a3(i,l,d,p){i.querySelector('link[rel="preload"][as="style"]['+l+"]")?p.loading=1:(l=i.createElement("link"),p.preload=l,l.addEventListener("load",function(){return p.loading|=1}),l.addEventListener("error",function(){return p.loading|=2}),xr(l,"link",d),Dn(l),i.head.appendChild(l))}function wc(i){return'[src="'+bi(i)+'"]'}function ad(i){return"script[async]"+i}function HC(i,l,d){if(l.count++,l.instance===null)switch(l.type){case"style":var p=i.querySelector('style[data-href~="'+bi(d.href)+'"]');if(p)return l.instance=p,Dn(p),p;var b=g({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return p=(i.ownerDocument||i).createElement("style"),Dn(p),xr(p,"style",b),Ih(p,d.precedence,i),l.instance=p;case"stylesheet":b=Sc(d.href);var w=i.querySelector(od(b));if(w)return l.state.loading|=4,l.instance=w,Dn(w),w;p=FC(d),(b=_i.get(b))&&xy(p,b),w=(i.ownerDocument||i).createElement("link"),Dn(w);var A=w;return A._p=new Promise(function(N,q){A.onload=N,A.onerror=q}),xr(w,"link",p),l.state.loading|=4,Ih(w,d.precedence,i),l.instance=w;case"script":return w=wc(d.src),(b=i.querySelector(ad(w)))?(l.instance=b,Dn(b),b):(p=d,(b=_i.get(w))&&(p=g({},d),by(p,b)),i=i.ownerDocument||i,b=i.createElement("script"),Dn(b),xr(b,"link",p),i.head.appendChild(b),l.instance=b);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(p=l.instance,l.state.loading|=4,Ih(p,d.precedence,i));return l.instance}function Ih(i,l,d){for(var p=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=p.length?p[p.length-1]:null,w=b,A=0;A<p.length;A++){var N=p[A];if(N.dataset.precedence===l)w=N;else if(w!==b)break}w?w.parentNode.insertBefore(i,w.nextSibling):(l=d.nodeType===9?d.head:d,l.insertBefore(i,l.firstChild))}function xy(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.title==null&&(i.title=l.title)}function by(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.integrity==null&&(i.integrity=l.integrity)}var zh=null;function qC(i,l,d){if(zh===null){var p=new Map,b=zh=new Map;b.set(d,p)}else b=zh,p=b.get(d),p||(p=new Map,b.set(d,p));if(p.has(i))return p;for(p.set(i,null),d=d.getElementsByTagName(i),b=0;b<d.length;b++){var w=d[b];if(!(w[gn]||w[Me]||i==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var A=w.getAttribute(l)||"";A=i+A;var N=p.get(A);N?N.push(w):p.set(A,[w])}}return p}function GC(i,l,d){i=i.ownerDocument||i,i.head.insertBefore(d,l==="title"?i.querySelector("head > title"):null)}function s3(i,l,d){if(d===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;return l.rel==="stylesheet"?(i=l.disabled,typeof l.precedence=="string"&&i==null):!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 WC(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function l3(i,l,d,p){if(d.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var b=Sc(p.href),w=l.querySelector(od(b));if(w){l=w._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(i.count++,i=$h.bind(i),l.then(i,i)),d.state.loading|=4,d.instance=w,Dn(w);return}w=l.ownerDocument||l,p=FC(p),(b=_i.get(b))&&xy(p,b),w=w.createElement("link"),Dn(w);var A=w;A._p=new Promise(function(N,q){A.onload=N,A.onerror=q}),xr(w,"link",p),d.instance=w}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(d,l),(l=d.state.preload)&&(d.state.loading&3)===0&&(i.count++,d=$h.bind(i),l.addEventListener("load",d),l.addEventListener("error",d))}}var Sy=0;function c3(i,l){return i.stylesheets&&i.count===0&&Bh(i,i.stylesheets),0<i.count||0<i.imgCount?function(d){var p=setTimeout(function(){if(i.stylesheets&&Bh(i,i.stylesheets),i.unsuspend){var w=i.unsuspend;i.unsuspend=null,w()}},6e4+l);0<i.imgBytes&&Sy===0&&(Sy=62500*F4());var b=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Bh(i,i.stylesheets),i.unsuspend)){var w=i.unsuspend;i.unsuspend=null,w()}},(i.imgBytes>Sy?50:800)+l);return i.unsuspend=d,function(){i.unsuspend=null,clearTimeout(p),clearTimeout(b)}}:null}function $h(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Uh=null;function Bh(i,l){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Uh=new Map,l.forEach(u3,i),Uh=null,$h.call(i))}function u3(i,l){if(!(l.state.loading&4)){var d=Uh.get(i);if(d)var p=d.get(null);else{d=new Map,Uh.set(i,d);for(var b=i.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<b.length;w++){var A=b[w];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(d.set(A.dataset.precedence,A),p=A)}p&&d.set(null,p)}b=l.instance,A=b.getAttribute("data-precedence"),w=d.get(A)||p,w===p&&d.set(null,b),d.set(A,b),this.count++,p=$h.bind(this),b.addEventListener("load",p),b.addEventListener("error",p),w?w.parentNode.insertBefore(b,w.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(b,i.firstChild)),l.state.loading|=4}}var sd={$$typeof:E,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function d3(i,l,d,p,b,w,A,N,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=Wi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wi(0),this.hiddenUpdates=Wi(null),this.identifierPrefix=p,this.onUncaughtError=b,this.onCaughtError=w,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function QC(i,l,d,p,b,w,A,N,q,re,fe,ve){return i=new d3(i,l,d,A,q,re,fe,ve,N),l=1,w===!0&&(l|=24),w=ri(3,null,null,l),i.current=w,w.stateNode=i,l=ev(),l.refCount++,i.pooledCache=l,l.refCount++,w.memoizedState={element:p,isDehydrated:d,cache:l},iv(w),i}function YC(i){return i?(i=Zl,i):Zl}function KC(i,l,d,p,b,w){b=YC(b),p.context===null?p.context=b:p.pendingContext=b,p=Ha(l),p.payload={element:d},w=w===void 0?null:w,w!==null&&(p.callback=w),d=qa(i,p,l),d!==null&&(Gr(d,i,l),$u(d,i,l))}function XC(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var d=i.retryLane;i.retryLane=d!==0&&d<l?d:l}}function wy(i,l){XC(i,l),(i=i.alternate)&&XC(i,l)}function JC(i){if(i.tag===13||i.tag===31){var l=Vs(i,67108864);l!==null&&Gr(l,i,67108864),wy(i,67108864)}}function ZC(i){if(i.tag===13||i.tag===31){var l=li();l=ee(l);var d=Vs(i,l);d!==null&&Gr(d,i,l),wy(i,l)}}var Vh=!0;function f3(i,l,d,p){var b=M.T;M.T=null;var w=L.p;try{L.p=2,jy(i,l,d,p)}finally{L.p=w,M.T=b}}function h3(i,l,d,p){var b=M.T;M.T=null;var w=L.p;try{L.p=8,jy(i,l,d,p)}finally{L.p=w,M.T=b}}function jy(i,l,d,p){if(Vh){var b=Cy(p);if(b===null)cy(i,l,p,Fh,d),tE(i,p);else if(m3(b,i,l,d,p))p.stopPropagation();else if(tE(i,p),l&4&&-1<p3.indexOf(i)){for(;b!==null;){var w=_t(b);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var A=qi(w.pendingLanes);if(A!==0){var N=w;for(N.pendingLanes|=2,N.entangledLanes|=2;A;){var q=1<<31-zn(A);N.entanglements[1]|=q,A&=~q}bo(w),(Gt&6)===0&&(Eh=pe()+500,td(0))}}break;case 31:case 13:N=Vs(w,2),N!==null&&Gr(N,w,2),Rh(),wy(w,2)}if(w=Cy(p),w===null&&cy(i,l,p,Fh,d),w===b)break;b=w}b!==null&&p.stopPropagation()}else cy(i,l,p,null,d)}}function Cy(i){return i=Tg(i),Ey(i)}var Fh=null;function Ey(i){if(Fh=null,i=vn(i),i!==null){var l=s(i);if(l===null)i=null;else{var d=l.tag;if(d===13){if(i=c(l),i!==null)return i;i=null}else if(d===31){if(i=u(l),i!==null)return i;i=null}else if(d===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null)}}return Fh=i,null}function eE(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(qe()){case Ce:return 2;case ke:return 8;case kt:case pn:return 32;case mn:return 268435456;default:return 32}default:return 32}}var Ty=!1,ns=null,rs=null,is=null,ld=new Map,cd=new Map,os=[],p3="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 tE(i,l){switch(i){case"focusin":case"focusout":ns=null;break;case"dragenter":case"dragleave":rs=null;break;case"mouseover":case"mouseout":is=null;break;case"pointerover":case"pointerout":ld.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":cd.delete(l.pointerId)}}function ud(i,l,d,p,b,w){return i===null||i.nativeEvent!==w?(i={blockedOn:l,domEventName:d,eventSystemFlags:p,nativeEvent:w,targetContainers:[b]},l!==null&&(l=_t(l),l!==null&&JC(l)),i):(i.eventSystemFlags|=p,l=i.targetContainers,b!==null&&l.indexOf(b)===-1&&l.push(b),i)}function m3(i,l,d,p,b){switch(l){case"focusin":return ns=ud(ns,i,l,d,p,b),!0;case"dragenter":return rs=ud(rs,i,l,d,p,b),!0;case"mouseover":return is=ud(is,i,l,d,p,b),!0;case"pointerover":var w=b.pointerId;return ld.set(w,ud(ld.get(w)||null,i,l,d,p,b)),!0;case"gotpointercapture":return w=b.pointerId,cd.set(w,ud(cd.get(w)||null,i,l,d,p,b)),!0}return!1}function nE(i){var l=vn(i.target);if(l!==null){var d=s(l);if(d!==null){if(l=d.tag,l===13){if(l=c(d),l!==null){i.blockedOn=l,Xe(i.priority,function(){ZC(d)});return}}else if(l===31){if(l=u(d),l!==null){i.blockedOn=l,Xe(i.priority,function(){ZC(d)});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){i.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Hh(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var d=Cy(i.nativeEvent);if(d===null){d=i.nativeEvent;var p=new d.constructor(d.type,d);Eg=p,d.target.dispatchEvent(p),Eg=null}else return l=_t(d),l!==null&&JC(l),i.blockedOn=d,!1;l.shift()}return!0}function rE(i,l,d){Hh(i)&&d.delete(l)}function g3(){Ty=!1,ns!==null&&Hh(ns)&&(ns=null),rs!==null&&Hh(rs)&&(rs=null),is!==null&&Hh(is)&&(is=null),ld.forEach(rE),cd.forEach(rE)}function qh(i,l){i.blockedOn===l&&(i.blockedOn=null,Ty||(Ty=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,g3)))}var Gh=null;function iE(i){Gh!==i&&(Gh=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Gh===i&&(Gh=null);for(var l=0;l<i.length;l+=3){var d=i[l],p=i[l+1],b=i[l+2];if(typeof p!="function"){if(Ey(p||d)===null)continue;break}var w=_t(d);w!==null&&(i.splice(l,3),l-=3,Cv(w,{pending:!0,data:b,method:d.method,action:p},p,b))}}))}function jc(i){function l(q){return qh(q,i)}ns!==null&&qh(ns,i),rs!==null&&qh(rs,i),is!==null&&qh(is,i),ld.forEach(l),cd.forEach(l);for(var d=0;d<os.length;d++){var p=os[d];p.blockedOn===i&&(p.blockedOn=null)}for(;0<os.length&&(d=os[0],d.blockedOn===null);)nE(d),d.blockedOn===null&&os.shift();if(d=(i.ownerDocument||i).$$reactFormReplay,d!=null)for(p=0;p<d.length;p+=3){var b=d[p],w=d[p+1],A=b[Ue]||null;if(typeof w=="function")A||iE(d);else if(A){var N=null;if(w&&w.hasAttribute("formAction")){if(b=w,A=w[Ue]||null)N=A.formAction;else if(Ey(b)!==null)continue}else N=A.action;typeof N=="function"?d[p+1]=N:(d.splice(p,3),p-=3),iE(d)}}}function oE(){function i(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(A){return b=A})},focusReset:"manual",scroll:"manual"})}function l(){b!==null&&(b(),b=null),p||setTimeout(d,20)}function d(){if(!p&&!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 p=!1,b=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(d,100),function(){p=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),b!==null&&(b(),b=null)}}}function Ry(i){this._internalRoot=i}Wh.prototype.render=Ry.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(r(409));var d=l.current,p=li();KC(d,p,i,l,null,null)},Wh.prototype.unmount=Ry.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;KC(i.current,2,null,i,null,null),Rh(),l[Qe]=null}};function Wh(i){this._internalRoot=i}Wh.prototype.unstable_scheduleHydration=function(i){if(i){var l=_e();i={blockedOn:null,target:i,priority:l};for(var d=0;d<os.length&&l!==0&&l<os[d].priority;d++);os.splice(d,0,i),d===0&&nE(i)}};var aE=t.version;if(aE!=="19.2.3")throw Error(r(527,aE,"19.2.3"));L.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=h(l),i=i!==null?m(i):null,i=i===null?null:i.stateNode,i};var v3={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Qh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qh.isDisabled&&Qh.supportsFiber)try{Sr=Qh.inject(v3),Qt=Qh}catch{}}return md.createRoot=function(i,l){if(!o(i))throw Error(r(299));var d=!1,p="",b=hj,w=pj,A=mj;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(b=l.onUncaughtError),l.onCaughtError!==void 0&&(w=l.onCaughtError),l.onRecoverableError!==void 0&&(A=l.onRecoverableError)),l=QC(i,1,!1,null,null,d,p,null,b,w,A,oE),i[Qe]=l.current,ly(i),new Ry(l)},md.hydrateRoot=function(i,l,d){if(!o(i))throw Error(r(299));var p=!1,b="",w=hj,A=pj,N=mj,q=null;return d!=null&&(d.unstable_strictMode===!0&&(p=!0),d.identifierPrefix!==void 0&&(b=d.identifierPrefix),d.onUncaughtError!==void 0&&(w=d.onUncaughtError),d.onCaughtError!==void 0&&(A=d.onCaughtError),d.onRecoverableError!==void 0&&(N=d.onRecoverableError),d.formState!==void 0&&(q=d.formState)),l=QC(i,1,!0,l,d??null,p,b,q,w,A,N,oE),l.context=YC(null),d=l.current,p=li(),p=ee(p),b=Ha(p),b.callback=null,qa(d,b,p),d=p,l.current.lanes=d,Nn(l,d),bo(l),i[Qe]=l.current,ly(i),new Wh(l)},md.version="19.2.3",md}var HR;function aee(){if(HR)return hx.exports;HR=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(),hx.exports=oee(),hx.exports}var see=aee();var fN=e=>{throw TypeError(e)},lee=(e,t,n)=>t.has(e)||fN("Cannot "+n),gx=(e,t,n)=>(lee(e,t,"read from private field"),n?n.call(e):t.get(e)),cee=(e,t,n)=>t.has(e)?fN("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),qR="popstate";function uee(e={}){function t(r,o){let{pathname:s,search:c,hash:u}=r.location;return Gd("",{pathname:s,search:c,hash:u},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:Fo(o)}return fee(t,n,null,e)}function bt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Bn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function dee(){return Math.random().toString(36).substring(2,10)}function GR(e,t){return{usr:e.state,key:e.key,idx:t}}function Gd(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ma(t):t,state:n,key:t&&t.key||r||dee()}}function Fo({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 Ma(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 fee(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:s=!1}=r,c=o.history,u="POP",f=null,h=m();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function m(){return(c.state||{idx:null}).idx}function g(){u="POP";let C=m(),T=C==null?null:C-h;h=C,f&&f({action:u,location:j.location,delta:T})}function y(C,T){u="PUSH";let R=Gd(j.location,C,T);h=m()+1;let E=GR(R,h),_=j.createHref(R);try{c.pushState(E,"",_)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;o.location.assign(_)}s&&f&&f({action:u,location:j.location,delta:1})}function x(C,T){u="REPLACE";let R=Gd(j.location,C,T);h=m();let E=GR(R,h),_=j.createHref(R);c.replaceState(E,"",_),s&&f&&f({action:u,location:j.location,delta:0})}function S(C){return hN(C)}let j={get action(){return u},get location(){return e(o,c)},listen(C){if(f)throw new Error("A history only accepts one active listener");return o.addEventListener(qR,g),f=C,()=>{o.removeEventListener(qR,g),f=null}},createHref(C){return t(o,C)},createURL:S,encodeLocation(C){let T=S(C);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:y,replace:x,go(C){return c.go(C)}};return j}function hN(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:Fo(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Sd,WR=class{constructor(e){if(cee(this,Sd,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(gx(this,Sd).has(e))return gx(this,Sd).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){gx(this,Sd).set(e,t)}};Sd=new WeakMap;var hee=new Set(["lazy","caseSensitive","path","id","index","children"]);function pee(e){return hee.has(e)}var mee=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function gee(e){return mee.has(e)}function vee(e){return e.index===!0}function Wd(e,t,n=[],r={},o=!1){return e.map((s,c)=>{let u=[...n,String(c)],f=typeof s.id=="string"?s.id:u.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`),vee(s)){let h={...s,id:f};return r[f]=QR(h,t(h)),h}else{let h={...s,id:f,children:void 0};return r[f]=QR(h,t(h)),s.children&&(h.children=Wd(s.children,t,u,r,o)),h}})}function QR(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function ms(e,t,n="/"){return wd(e,t,n,!1)}function wd(e,t,n,r){let o=typeof t=="string"?Ma(t):t,s=Ii(o.pathname||"/",n);if(s==null)return null;let c=pN(e);xee(c);let u=null;for(let f=0;u==null&&f<c.length;++f){let h=Aee(s);u=_ee(c[f],h,r)}return u}function yee(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 pN(e,t=[],n=[],r="",o=!1){let s=(c,u,f=o,h)=>{let m={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:u,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=Io([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}".`),pN(c.children,t,y,g,f)),!(c.path==null&&!c.index)&&t.push({path:g,score:Tee(g,c.index),routesMeta:y})};return e.forEach((c,u)=>{if(c.path===""||!c.path?.includes("?"))s(c,u);else for(let f of mN(c.path))s(c,u,!0,f)}),t}function mN(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=mN(r.join("/")),u=[];return u.push(...c.map(f=>f===""?s:[s,f].join("/"))),o&&u.push(...c),u.map(f=>e.startsWith("/")&&f===""?"/":f)}function xee(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Ree(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var bee=/^:[\w-]+$/,See=3,wee=2,jee=1,Cee=10,Eee=-2,YR=e=>e==="*";function Tee(e,t){let n=e.split("/"),r=n.length;return n.some(YR)&&(r+=Eee),t&&(r+=wee),n.filter(o=>!YR(o)).reduce((o,s)=>o+(bee.test(s)?See:s===""?jee:Cee),r)}function Ree(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 _ee(e,t,n=!1){let{routesMeta:r}=e,o={},s="/",c=[];for(let u=0;u<r.length;++u){let f=r[u],h=u===r.length-1,m=s==="/"?t:t.slice(s.length)||"/",g=tm({path:f.relativePath,caseSensitive:f.caseSensitive,end:h},m),y=f.route;if(!g&&h&&n&&!r[r.length-1].route.index&&(g=tm({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!g)return null;Object.assign(o,g.params),c.push({params:o,pathname:Io([s,g.pathname]),pathnameBase:Nee(Io([s,g.pathnameBase])),route:y}),g.pathnameBase!=="/"&&(s=Io([s,g.pathnameBase]))}return c}function tm(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Dee(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let s=o[0],c=s.replace(/(.)\/+$/,"$1"),u=o.slice(1);return{params:r.reduce((h,{paramName:m,isOptional:g},y)=>{if(m==="*"){let S=u[y]||"";c=s.slice(0,s.length-S.length).replace(/(.)\/+$/,"$1")}const x=u[y];return g&&!x?h[m]=void 0:h[m]=(x||"").replace(/%2F/g,"/"),h},{}),pathname:s,pathnameBase:c,pattern:e}}function Dee(e,t=!1,n=!0){Bn(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,u,f)=>(r.push({paramName:u,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 Aee(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Bn(!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 Ii(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 kee({basename:e,pathname:t}){return t==="/"?e:Io([e,t])}var gN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vg=e=>gN.test(e);function Pee(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Ma(e):e,s;if(n)if(vg(n))s=n;else{if(n.includes("//")){let c=n;n=n.replace(/\/\/+/g,"/"),Bn(!1,`Pathnames cannot have embedded double slashes - normalizing ${c} -> ${n}`)}n.startsWith("/")?s=KR(n.substring(1),"/"):s=KR(n,t)}else s=t;return{pathname:s,search:Oee(r),hash:Mee(o)}}function KR(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 vx(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 vN(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function i1(e){let t=vN(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function o1(e,t,n,r=!1){let o;typeof e=="string"?o=Ma(e):(o={...e},bt(!o.pathname||!o.pathname.includes("?"),vx("?","pathname","search",o)),bt(!o.pathname||!o.pathname.includes("#"),vx("#","pathname","hash",o)),bt(!o.search||!o.search.includes("#"),vx("#","search","hash",o)));let s=e===""||o.pathname==="",c=s?"/":o.pathname,u;if(c==null)u=n;else{let g=t.length-1;if(!r&&c.startsWith("..")){let y=c.split("/");for(;y[0]==="..";)y.shift(),g-=1;o.pathname=y.join("/")}u=g>=0?t[g]:"/"}let f=Pee(o,u),h=c&&c!=="/"&&c.endsWith("/"),m=(s||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||m)&&(f.pathname+="/"),f}var Io=e=>e.join("/").replace(/\/\/+/g,"/"),Nee=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Oee=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Mee=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,kf=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 Qd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Pf(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var yN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function xN(e,t){let n=e;if(typeof n!="string"||!gN.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,o=!1;if(yN)try{let s=new URL(window.location.href),c=n.startsWith("//")?new URL(s.protocol+n):new URL(n),u=Ii(c.pathname,t);c.origin===s.origin&&u!=null?n=u+c.search+c.hash:o=!0}catch{Bn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:o,to:n}}var xs=Symbol("Uninstrumented");function Lee(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 u of c)s[u]&&n[u].push(s[u])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let o=Uc(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],u=n[`lazy.${s}`];if(typeof c=="function"&&u.length>0){let f=Uc(u,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[xs]??s,u=Uc(n[o],c,(...f)=>XR(f[0]));u&&(o==="loader"&&c.hydrate===!0&&(u.hydrate=!0),u[xs]=c,r[o]=u)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(o=>{let s=o[xs]??o,c=Uc(n.middleware,s,(...u)=>XR(u[0]));return c?(c[xs]=s,c):o})),r}function Iee(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[xs]??e.navigate,o=Uc(n.navigate,r,(...s)=>{let[c,u]=s;return{to:typeof c=="number"||typeof c=="string"?c:c?Fo(c):".",...JR(e,u??{})}});o&&(o[xs]=r,e.navigate=o)}if(n.fetch.length>0){let r=e.fetch[xs]??e.fetch,o=Uc(n.fetch,r,(...s)=>{let[c,,u,f]=s;return{href:u??".",fetcherKey:c,...JR(e,f??{})}});o&&(o[xs]=r,e.fetch=o)}return e}function Uc(e,t,n){return e.length===0?null:async(...r)=>{let o=await bN(e,n(...r),()=>t(...r),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function bN(e,t,n,r){let o=e[r],s;if(o){let c,u=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=bN(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(u,t)}catch(f){console.error("An instrumentation function threw an error:",f)}c||await u(),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 XR(e){let{request:t,context:n,params:r,unstable_pattern:o}=e;return{request:zee(t),params:{...r},unstable_pattern:o,context:$ee(n)}}function JR(e,t){return{currentUrl:Fo(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 zee(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function $ee(e){if(Bee(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Uee=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Bee(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")===Uee}var SN=["POST","PUT","PATCH","DELETE"],Vee=new Set(SN),Fee=["GET",...SN],Hee=new Set(Fee),wN=new Set([301,302,303,307,308]),qee=new Set([307,308]),yx={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Gee={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},gd={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Wee=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),jN="remix-router-transitions",CN=Symbol("ResetLoaderData");function Qee(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||Wee,s=o;if(e.unstable_instrumentations){let H=e.unstable_instrumentations;s=X=>({...o(X),...Lee(H.map(ee=>ee.route).filter(Boolean),X)})}let c={},u=Wd(e.routes,s,void 0,c),f,h=e.basename||"/";h.startsWith("/")||(h=`/${h}`);let m=e.dataStrategy||Zee,g={...e.future},y=null,x=new Set,S=null,j=null,C=null,T=e.hydrationData!=null,R=ms(u,e.history.location,h),E=!1,_=null,k;if(R==null&&!e.patchRoutesOnNavigation){let H=Pi(404,{pathname:e.history.location.pathname}),{matches:X,route:ee}=lp(u);k=!0,R=X,_={[ee.id]:H}}else if(R&&!e.hydrationData&&pr(R,u,e.history.location.pathname).active&&(R=null),R)if(R.some(H=>H.route.lazy))k=!1;else if(!R.some(H=>a1(H.route)))k=!0;else{let H=e.hydrationData?e.hydrationData.loaderData:null,X=e.hydrationData?e.hydrationData.errors:null;if(X){let ee=R.findIndex(Se=>X[Se.route.id]!==void 0);k=R.slice(0,ee+1).every(Se=>!ub(Se.route,H,X))}else k=R.every(ee=>!ub(ee.route,H,X))}else{k=!1,R=[];let H=pr(null,u,e.history.location.pathname);H.active&&H.matches&&(E=!0,R=H.matches)}let I,D={historyAction:e.history.action,location:e.history.location,matches:R,initialized:k,navigation:yx,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},P="POP",$=null,B=!1,W,Y=!1,Z=new Map,U=null,G=!1,M=!1,L=new Set,z=new Map,V=0,K=-1,O=new Map,F=new Set,se=new Map,de=new Map,ye=new Set,je=new Map,Ee,Ke=null;function De(){if(y=e.history.listen(({action:H,location:X,delta:ee})=>{if(Ee){Ee(),Ee=void 0;return}Bn(je.size===0||ee!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Se=yi({currentLocation:D.location,nextLocation:X,historyAction:H});if(Se&&ee!=null){let _e=new Promise(Xe=>{Ee=Xe});e.history.go(ee*-1),Hi(Se,{state:"blocked",location:X,proceed(){Hi(Se,{state:"proceeding",proceed:void 0,reset:void 0,location:X}),_e.then(()=>e.history.go(ee))},reset(){let Xe=new Map(D.blockers);Xe.set(Se,gd),rt({blockers:Xe})}}),$?.resolve(),$=null;return}return wt(H,X)}),n){vte(t,Z);let H=()=>yte(t,Z);t.addEventListener("pagehide",H),U=()=>t.removeEventListener("pagehide",H)}return D.initialized||wt("POP",D.location,{initialHydration:!0}),I}function dt(){y&&y(),U&&U(),x.clear(),W&&W.abort(),D.fetchers.forEach((H,X)=>nn(X)),D.blockers.forEach((H,X)=>La(X))}function Ct(H){return x.add(H),()=>x.delete(H)}function rt(H,X={}){H.matches&&(H.matches=H.matches.map(_e=>{let Xe=c[_e.route.id],ze=_e.route;return ze.element!==Xe.element||ze.errorElement!==Xe.errorElement||ze.hydrateFallbackElement!==Xe.hydrateFallbackElement?{..._e,route:Xe}:_e})),D={...D,...H};let ee=[],Se=[];D.fetchers.forEach((_e,Xe)=>{_e.state==="idle"&&(ye.has(Xe)?ee.push(Xe):Se.push(Xe))}),ye.forEach(_e=>{!D.fetchers.has(_e)&&!z.has(_e)&&ee.push(_e)}),[...x].forEach(_e=>_e(D,{deletedFetchers:ee,newErrors:H.errors??null,viewTransitionOpts:X.viewTransitionOpts,flushSync:X.flushSync===!0})),ee.forEach(_e=>nn(_e)),Se.forEach(_e=>D.fetchers.delete(_e))}function nt(H,X,{flushSync:ee}={}){let Se=D.actionData!=null&&D.navigation.formMethod!=null&&Er(D.navigation.formMethod)&&D.navigation.state==="loading"&&H.state?._isRedirect!==!0,_e;X.actionData?Object.keys(X.actionData).length>0?_e=X.actionData:_e=null:Se?_e=D.actionData:_e=null;let Xe=X.loaderData?l2(D.loaderData,X.loaderData,X.matches||[],X.errors):D.loaderData,ze=D.blockers;ze.size>0&&(ze=new Map(ze),ze.forEach((at,tt)=>ze.set(tt,gd)));let Me=G?!1:Ia(H,X.matches||D.matches),Ue=B===!0||D.navigation.formMethod!=null&&Er(D.navigation.formMethod)&&H.state?._isRedirect!==!0;f&&(u=f,f=void 0),G||P==="POP"||(P==="PUSH"?e.history.push(H,H.state):P==="REPLACE"&&e.history.replace(H,H.state));let Qe;if(P==="POP"){let at=Z.get(D.location.pathname);at&&at.has(H.pathname)?Qe={currentLocation:D.location,nextLocation:H}:Z.has(H.pathname)&&(Qe={currentLocation:H,nextLocation:D.location})}else if(Y){let at=Z.get(D.location.pathname);at?at.add(H.pathname):(at=new Set([H.pathname]),Z.set(D.location.pathname,at)),Qe={currentLocation:D.location,nextLocation:H}}rt({...X,actionData:_e,loaderData:Xe,historyAction:P,location:H,initialized:!0,navigation:yx,revalidation:"idle",restoreScrollPosition:Me,preventScrollReset:Ue,blockers:ze},{viewTransitionOpts:Qe,flushSync:ee===!0}),P="POP",B=!1,Y=!1,G=!1,M=!1,$?.resolve(),$=null,Ke?.resolve(),Ke=null}async function mt(H,X){if($?.resolve(),$=null,typeof H=="number"){$||($=f2());let Rt=$.promise;return e.history.go(H),Rt}let ee=cb(D.location,D.matches,h,H,X?.fromRouteId,X?.relative),{path:Se,submission:_e,error:Xe}=ZR(!1,ee,X),ze=D.location,Me=Gd(D.location,Se,X&&X.state);Me={...Me,...e.history.encodeLocation(Me)};let Ue=X&&X.replace!=null?X.replace:void 0,Qe="PUSH";Ue===!0?Qe="REPLACE":Ue===!1||_e!=null&&Er(_e.formMethod)&&_e.formAction===D.location.pathname+D.location.search&&(Qe="REPLACE");let at=X&&"preventScrollReset"in X?X.preventScrollReset===!0:void 0,tt=(X&&X.flushSync)===!0,Pt=yi({currentLocation:ze,nextLocation:Me,historyAction:Qe});if(Pt){Hi(Pt,{state:"blocked",location:Me,proceed(){Hi(Pt,{state:"proceeding",proceed:void 0,reset:void 0,location:Me}),mt(H,X)},reset(){let Rt=new Map(D.blockers);Rt.set(Pt,gd),rt({blockers:Rt})}});return}await wt(Qe,Me,{submission:_e,pendingError:Xe,preventScrollReset:at,replace:X&&X.replace,enableViewTransition:X&&X.viewTransition,flushSync:tt,callSiteDefaultShouldRevalidate:X&&X.unstable_defaultShouldRevalidate})}function Tt(){Ke||(Ke=f2()),ke(),rt({revalidation:"loading"});let H=Ke.promise;return D.navigation.state==="submitting"?H:D.navigation.state==="idle"?(wt(D.historyAction,D.location,{startUninterruptedRevalidation:!0}),H):(wt(P||D.historyAction,D.navigation.location,{overrideNavigation:D.navigation,enableViewTransition:Y===!0}),H)}async function wt(H,X,ee){W&&W.abort(),W=null,P=H,G=(ee&&ee.startUninterruptedRevalidation)===!0,Gi(D.location,D.matches),B=(ee&&ee.preventScrollReset)===!0,Y=(ee&&ee.enableViewTransition)===!0;let Se=f||u,_e=ee&&ee.overrideNavigation,Xe=ee?.initialHydration&&D.matches&&D.matches.length>0&&!E?D.matches:ms(Se,X,h),ze=(ee&&ee.flushSync)===!0;if(Xe&&D.initialized&&!M&&ste(D.location,X)&&!(ee&&ee.submission&&Er(ee.submission.formMethod))){nt(X,{matches:Xe},{flushSync:ze});return}let Me=pr(Xe,Se,X.pathname);if(Me.active&&Me.matches&&(Xe=Me.matches),!Xe){let{error:st,notFoundMatches:vn,route:_t}=mo(X.pathname);nt(X,{matches:vn,loaderData:{},errors:{[_t.id]:st}},{flushSync:ze});return}W=new AbortController;let Ue=zc(e.history,X,W.signal,ee&&ee.submission),Qe=e.getContext?await e.getContext():new WR,at;if(ee&&ee.pendingError)at=[gs(Xe).route.id,{type:"error",error:ee.pendingError}];else if(ee&&ee.submission&&Er(ee.submission.formMethod)){let st=await Te(Ue,X,ee.submission,Xe,Qe,Me.active,ee&&ee.initialHydration===!0,{replace:ee.replace,flushSync:ze});if(st.shortCircuited)return;if(st.pendingActionResult){let[vn,_t]=st.pendingActionResult;if(ui(_t)&&Qd(_t.error)&&_t.error.status===404){W=null,nt(X,{matches:st.matches,loaderData:{},errors:{[vn]:_t.error}});return}}Xe=st.matches||Xe,at=st.pendingActionResult,_e=xx(X,ee.submission),ze=!1,Me.active=!1,Ue=zc(e.history,Ue.url,Ue.signal)}let{shortCircuited:tt,matches:Pt,loaderData:Rt,errors:gn}=await Pe(Ue,X,Xe,Qe,Me.active,_e,ee&&ee.submission,ee&&ee.fetcherSubmission,ee&&ee.replace,ee&&ee.initialHydration===!0,ze,at,ee&&ee.callSiteDefaultShouldRevalidate);tt||(W=null,nt(X,{matches:Pt||Xe,...c2(at),loaderData:Rt,errors:gn}))}async function Te(H,X,ee,Se,_e,Xe,ze,Me={}){ke();let Ue=mte(X,ee);if(rt({navigation:Ue},{flushSync:Me.flushSync===!0}),Xe){let tt=await Wi(Se,X.pathname,H.signal);if(tt.type==="aborted")return{shortCircuited:!0};if(tt.type==="error"){if(tt.partialMatches.length===0){let{matches:Rt,route:gn}=lp(u);return{matches:Rt,pendingActionResult:[gn.id,{type:"error",error:tt.error}]}}let Pt=gs(tt.partialMatches).route.id;return{matches:tt.partialMatches,pendingActionResult:[Pt,{type:"error",error:tt.error}]}}else if(tt.matches)Se=tt.matches;else{let{notFoundMatches:Pt,error:Rt,route:gn}=mo(X.pathname);return{matches:Pt,pendingActionResult:[gn.id,{type:"error",error:Rt}]}}}let Qe,at=Ep(Se,X);if(!at.route.action&&!at.route.lazy)Qe={type:"error",error:Pi(405,{method:H.method,pathname:X.pathname,routeId:at.route.id})};else{let tt=Gc(s,c,H,Se,at,ze?[]:r,_e),Pt=await qe(H,tt,_e,null);if(Qe=Pt[at.route.id],!Qe){for(let Rt of Se)if(Pt[Rt.route.id]){Qe=Pt[Rt.route.id];break}}if(H.signal.aborted)return{shortCircuited:!0}}if(ml(Qe)){let tt;return Me&&Me.replace!=null?tt=Me.replace:tt=o2(Qe.response.headers.get("Location"),new URL(H.url),h,e.history)===D.location.pathname+D.location.search,await pe(H,Qe,!0,{submission:ee,replace:tt}),{shortCircuited:!0}}if(ui(Qe)){let tt=gs(Se,at.route.id);return(Me&&Me.replace)!==!0&&(P="PUSH"),{matches:Se,pendingActionResult:[tt.route.id,Qe,at.route.id]}}return{matches:Se,pendingActionResult:[at.route.id,Qe]}}async function Pe(H,X,ee,Se,_e,Xe,ze,Me,Ue,Qe,at,tt,Pt){let Rt=Xe||xx(X,ze),gn=ze||Me||d2(Rt),st=!G&&!Qe;if(_e){if(st){let Fn=Ne(tt);rt({navigation:Rt,...Fn!==void 0?{actionData:Fn}:{}},{flushSync:at})}let Mt=await Wi(ee,X.pathname,H.signal);if(Mt.type==="aborted")return{shortCircuited:!0};if(Mt.type==="error"){if(Mt.partialMatches.length===0){let{matches:Ki,route:mr}=lp(u);return{matches:Ki,loaderData:{},errors:{[mr.id]:Mt.error}}}let Fn=gs(Mt.partialMatches).route.id;return{matches:Mt.partialMatches,loaderData:{},errors:{[Fn]:Mt.error}}}else if(Mt.matches)ee=Mt.matches;else{let{error:Fn,notFoundMatches:Ki,route:mr}=mo(X.pathname);return{matches:Ki,loaderData:{},errors:{[mr.id]:Fn}}}}let vn=f||u,{dsMatches:_t,revalidatingFetchers:Xn}=e2(H,Se,s,c,e.history,D,ee,gn,X,Qe?[]:r,Qe===!0,M,L,ye,se,F,vn,h,e.patchRoutesOnNavigation!=null,tt,Pt);if(K=++V,!e.dataStrategy&&!_t.some(Mt=>Mt.shouldLoad)&&!_t.some(Mt=>Mt.route.middleware&&Mt.route.middleware.length>0)&&Xn.length===0){let Mt=zn();return nt(X,{matches:ee,loaderData:{},errors:tt&&ui(tt[1])?{[tt[0]]:tt[1].error}:null,...c2(tt),...Mt?{fetchers:new Map(D.fetchers)}:{}},{flushSync:at}),{shortCircuited:!0}}if(st){let Mt={};if(!_e){Mt.navigation=Rt;let Fn=Ne(tt);Fn!==void 0&&(Mt.actionData=Fn)}Xn.length>0&&(Mt.fetchers=Ie(Xn)),rt(Mt,{flushSync:at})}Xn.forEach(Mt=>{Qt(Mt.key),Mt.controller&&z.set(Mt.key,Mt.controller)});let Ur=()=>Xn.forEach(Mt=>Qt(Mt.key));W&&W.signal.addEventListener("abort",Ur);let{loaderResults:Dn,fetcherResults:Qi}=await Ce(_t,Xn,H,Se);if(H.signal.aborted)return{shortCircuited:!0};W&&W.signal.removeEventListener("abort",Ur),Xn.forEach(Mt=>z.delete(Mt.key));let ti=cp(Dn);if(ti)return await pe(H,ti.result,!0,{replace:Ue}),{shortCircuited:!0};if(ti=cp(Qi),ti)return F.add(ti.key),await pe(H,ti.result,!0,{replace:Ue}),{shortCircuited:!0};let{loaderData:Yi,errors:xi}=s2(D,ee,Dn,tt,Xn,Qi);Qe&&D.errors&&(xi={...D.errors,...xi});let Xo=zn(),Ls=vi(K),Is=Xo||Ls||Xn.length>0;return{matches:ee,loaderData:Yi,errors:xi,...Is?{fetchers:new Map(D.fetchers)}:{}}}function Ne(H){if(H&&!ui(H[1]))return{[H[0]]:H[1].data};if(D.actionData)return Object.keys(D.actionData).length===0?null:D.actionData}function Ie(H){return H.forEach(X=>{let ee=D.fetchers.get(X.key),Se=vd(void 0,ee?ee.data:void 0);D.fetchers.set(X.key,Se)}),new Map(D.fetchers)}async function lt(H,X,ee,Se){Qt(H);let _e=(Se&&Se.flushSync)===!0,Xe=f||u,ze=cb(D.location,D.matches,h,ee,X,Se?.relative),Me=ms(Xe,ze,h),Ue=pr(Me,Xe,ze);if(Ue.active&&Ue.matches&&(Me=Ue.matches),!Me){pn(H,X,Pi(404,{pathname:ze}),{flushSync:_e});return}let{path:Qe,submission:at,error:tt}=ZR(!0,ze,Se);if(tt){pn(H,X,tt,{flushSync:_e});return}let Pt=e.getContext?await e.getContext():new WR,Rt=(Se&&Se.preventScrollReset)===!0;if(at&&Er(at.formMethod)){await et(H,X,Qe,Me,Pt,Ue.active,_e,Rt,at,Se&&Se.unstable_defaultShouldRevalidate);return}se.set(H,{routeId:X,path:Qe}),await ft(H,X,Qe,Me,Pt,Ue.active,_e,Rt,at)}async function et(H,X,ee,Se,_e,Xe,ze,Me,Ue,Qe){ke(),se.delete(H);let at=D.fetchers.get(H);kt(H,gte(Ue,at),{flushSync:ze});let tt=new AbortController,Pt=zc(e.history,ee,tt.signal,Ue);if(Xe){let Lt=await Wi(Se,new URL(Pt.url).pathname,Pt.signal,H);if(Lt.type==="aborted")return;if(Lt.type==="error"){pn(H,X,Lt.error,{flushSync:ze});return}else if(Lt.matches)Se=Lt.matches;else{pn(H,X,Pi(404,{pathname:ee}),{flushSync:ze});return}}let Rt=Ep(Se,ee);if(!Rt.route.action&&!Rt.route.lazy){let Lt=Pi(405,{method:Ue.formMethod,pathname:ee,routeId:X});pn(H,X,Lt,{flushSync:ze});return}z.set(H,tt);let gn=V,st=Gc(s,c,Pt,Se,Rt,r,_e),vn=await qe(Pt,st,_e,H),_t=vn[Rt.route.id];if(!_t){for(let Lt of st)if(vn[Lt.route.id]){_t=vn[Lt.route.id];break}}if(Pt.signal.aborted){z.get(H)===tt&&z.delete(H);return}if(ye.has(H)){if(ml(_t)||ui(_t)){kt(H,ya(void 0));return}}else{if(ml(_t))if(z.delete(H),K>gn){kt(H,ya(void 0));return}else return F.add(H),kt(H,vd(Ue)),pe(Pt,_t,!1,{fetcherSubmission:Ue,preventScrollReset:Me});if(ui(_t)){pn(H,X,_t.error);return}}let Xn=D.navigation.location||D.location,Ur=zc(e.history,Xn,tt.signal),Dn=f||u,Qi=D.navigation.state!=="idle"?ms(Dn,D.navigation.location,h):D.matches;bt(Qi,"Didn't find any matches after fetcher action");let ti=++V;O.set(H,ti);let Yi=vd(Ue,_t.data);D.fetchers.set(H,Yi);let{dsMatches:xi,revalidatingFetchers:Xo}=e2(Ur,_e,s,c,e.history,D,Qi,Ue,Xn,r,!1,M,L,ye,se,F,Dn,h,e.patchRoutesOnNavigation!=null,[Rt.route.id,_t],Qe);Xo.filter(Lt=>Lt.key!==H).forEach(Lt=>{let zs=Lt.key,zf=D.fetchers.get(zs),ju=vd(void 0,zf?zf.data:void 0);D.fetchers.set(zs,ju),Qt(zs),Lt.controller&&z.set(zs,Lt.controller)}),rt({fetchers:new Map(D.fetchers)});let Ls=()=>Xo.forEach(Lt=>Qt(Lt.key));tt.signal.addEventListener("abort",Ls);let{loaderResults:Is,fetcherResults:Mt}=await Ce(xi,Xo,Ur,_e);if(tt.signal.aborted)return;if(tt.signal.removeEventListener("abort",Ls),O.delete(H),z.delete(H),Xo.forEach(Lt=>z.delete(Lt.key)),D.fetchers.has(H)){let Lt=ya(_t.data);D.fetchers.set(H,Lt)}let Fn=cp(Is);if(Fn)return pe(Ur,Fn.result,!1,{preventScrollReset:Me});if(Fn=cp(Mt),Fn)return F.add(Fn.key),pe(Ur,Fn.result,!1,{preventScrollReset:Me});let{loaderData:Ki,errors:mr}=s2(D,Qi,Is,void 0,Xo,Mt);vi(ti),D.navigation.state==="loading"&&ti>K?(bt(P,"Expected pending action"),W&&W.abort(),nt(D.navigation.location,{matches:Qi,loaderData:Ki,errors:mr,fetchers:new Map(D.fetchers)})):(rt({errors:mr,loaderData:l2(D.loaderData,Ki,Qi,mr),fetchers:new Map(D.fetchers)}),M=!1)}async function ft(H,X,ee,Se,_e,Xe,ze,Me,Ue){let Qe=D.fetchers.get(H);kt(H,vd(Ue,Qe?Qe.data:void 0),{flushSync:ze});let at=new AbortController,tt=zc(e.history,ee,at.signal);if(Xe){let _t=await Wi(Se,new URL(tt.url).pathname,tt.signal,H);if(_t.type==="aborted")return;if(_t.type==="error"){pn(H,X,_t.error,{flushSync:ze});return}else if(_t.matches)Se=_t.matches;else{pn(H,X,Pi(404,{pathname:ee}),{flushSync:ze});return}}let Pt=Ep(Se,ee);z.set(H,at);let Rt=V,gn=Gc(s,c,tt,Se,Pt,r,_e),vn=(await qe(tt,gn,_e,H))[Pt.route.id];if(z.get(H)===at&&z.delete(H),!tt.signal.aborted){if(ye.has(H)){kt(H,ya(void 0));return}if(ml(vn))if(K>Rt){kt(H,ya(void 0));return}else{F.add(H),await pe(tt,vn,!1,{preventScrollReset:Me});return}if(ui(vn)){pn(H,X,vn.error);return}kt(H,ya(vn.data))}}async function pe(H,X,ee,{submission:Se,fetcherSubmission:_e,preventScrollReset:Xe,replace:ze}={}){ee||($?.resolve(),$=null),X.response.headers.has("X-Remix-Revalidate")&&(M=!0);let Me=X.response.headers.get("Location");bt(Me,"Expected a Location header on the redirect Response"),Me=o2(Me,new URL(H.url),h,e.history);let Ue=Gd(D.location,Me,{_isRedirect:!0});if(n){let gn=!1;if(X.response.headers.has("X-Remix-Reload-Document"))gn=!0;else if(vg(Me)){const st=hN(Me,!0);gn=st.origin!==t.location.origin||Ii(st.pathname,h)==null}if(gn){ze?t.location.replace(Me):t.location.assign(Me);return}}W=null;let Qe=ze===!0||X.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:at,formAction:tt,formEncType:Pt}=D.navigation;!Se&&!_e&&at&&tt&&Pt&&(Se=d2(D.navigation));let Rt=Se||_e;if(qee.has(X.response.status)&&Rt&&Er(Rt.formMethod))await wt(Qe,Ue,{submission:{...Rt,formAction:Me},preventScrollReset:Xe||B,enableViewTransition:ee?Y:void 0});else{let gn=xx(Ue,Se);await wt(Qe,Ue,{overrideNavigation:gn,fetcherSubmission:_e,preventScrollReset:Xe||B,enableViewTransition:ee?Y:void 0})}}async function qe(H,X,ee,Se){let _e,Xe={};try{_e=await tte(m,H,X,Se,ee,!1)}catch(ze){return X.filter(Me=>Me.shouldLoad).forEach(Me=>{Xe[Me.route.id]={type:"error",error:ze}}),Xe}if(H.signal.aborted)return Xe;if(!Er(H.method))for(let ze of X){if(_e[ze.route.id]?.type==="error")break;!_e.hasOwnProperty(ze.route.id)&&!D.loaderData.hasOwnProperty(ze.route.id)&&(!D.errors||!D.errors.hasOwnProperty(ze.route.id))&&ze.shouldCallHandler()&&(_e[ze.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${ze.route.id}`)})}for(let[ze,Me]of Object.entries(_e))if(dte(Me)){let Ue=Me.result;Xe[ze]={type:"redirect",response:ote(Ue,H,ze,X,h)}}else Xe[ze]=await ite(Me);return Xe}async function Ce(H,X,ee,Se){let _e=qe(ee,H,Se,null),Xe=Promise.all(X.map(async Ue=>{if(Ue.matches&&Ue.match&&Ue.request&&Ue.controller){let at=(await qe(Ue.request,Ue.matches,Se,Ue.key))[Ue.match.route.id];return{[Ue.key]:at}}else return Promise.resolve({[Ue.key]:{type:"error",error:Pi(404,{pathname:Ue.path})}})})),ze=await _e,Me=(await Xe).reduce((Ue,Qe)=>Object.assign(Ue,Qe),{});return{loaderResults:ze,fetcherResults:Me}}function ke(){M=!0,se.forEach((H,X)=>{z.has(X)&&L.add(X),Qt(X)})}function kt(H,X,ee={}){D.fetchers.set(H,X),rt({fetchers:new Map(D.fetchers)},{flushSync:(ee&&ee.flushSync)===!0})}function pn(H,X,ee,Se={}){let _e=gs(D.matches,X);nn(H),rt({errors:{[_e.route.id]:ee},fetchers:new Map(D.fetchers)},{flushSync:(Se&&Se.flushSync)===!0})}function mn(H){return de.set(H,(de.get(H)||0)+1),ye.has(H)&&ye.delete(H),D.fetchers.get(H)||Gee}function Kn(H,X){Qt(H,X?.reason),kt(H,ya(null))}function nn(H){let X=D.fetchers.get(H);z.has(H)&&!(X&&X.state==="loading"&&O.has(H))&&Qt(H),se.delete(H),O.delete(H),F.delete(H),ye.delete(H),L.delete(H),D.fetchers.delete(H)}function Sr(H){let X=(de.get(H)||0)-1;X<=0?(de.delete(H),ye.add(H)):de.set(H,X),rt({fetchers:new Map(D.fetchers)})}function Qt(H,X){let ee=z.get(H);ee&&(ee.abort(X),z.delete(H))}function hr(H){for(let X of H){let ee=mn(X),Se=ya(ee.data);D.fetchers.set(X,Se)}}function zn(){let H=[],X=!1;for(let ee of F){let Se=D.fetchers.get(ee);bt(Se,`Expected fetcher: ${ee}`),Se.state==="loading"&&(F.delete(ee),H.push(ee),X=!0)}return hr(H),X}function vi(H){let X=[];for(let[ee,Se]of O)if(Se<H){let _e=D.fetchers.get(ee);bt(_e,`Expected fetcher: ${ee}`),_e.state==="loading"&&(Qt(ee),O.delete(ee),X.push(ee))}return hr(X),X.length>0}function Ko(H,X){let ee=D.blockers.get(H)||gd;return je.get(H)!==X&&je.set(H,X),ee}function La(H){D.blockers.delete(H),je.delete(H)}function Hi(H,X){let ee=D.blockers.get(H)||gd;bt(ee.state==="unblocked"&&X.state==="blocked"||ee.state==="blocked"&&X.state==="blocked"||ee.state==="blocked"&&X.state==="proceeding"||ee.state==="blocked"&&X.state==="unblocked"||ee.state==="proceeding"&&X.state==="unblocked",`Invalid blocker state transition: ${ee.state} -> ${X.state}`);let Se=new Map(D.blockers);Se.set(H,X),rt({blockers:Se})}function yi({currentLocation:H,nextLocation:X,historyAction:ee}){if(je.size===0)return;je.size>1&&Bn(!1,"A router only supports one blocker at a time");let Se=Array.from(je.entries()),[_e,Xe]=Se[Se.length-1],ze=D.blockers.get(_e);if(!(ze&&ze.state==="proceeding")&&Xe({currentLocation:H,nextLocation:X,historyAction:ee}))return _e}function mo(H){let X=Pi(404,{pathname:H}),ee=f||u,{matches:Se,route:_e}=lp(ee);return{notFoundMatches:Se,route:_e,error:X}}function qi(H,X,ee){if(S=H,C=X,j=ee||null,!T&&D.navigation===yx){T=!0;let Se=Ia(D.location,D.matches);Se!=null&&rt({restoreScrollPosition:Se})}return()=>{S=null,C=null,j=null}}function go(H,X){return j&&j(H,X.map(Se=>yee(Se,D.loaderData)))||H.key}function Gi(H,X){if(S&&C){let ee=go(H,X);S[ee]=C()}}function Ia(H,X){if(S){let ee=go(H,X),Se=S[ee];if(typeof Se=="number")return Se}return null}function pr(H,X,ee){if(e.patchRoutesOnNavigation)if(H){if(Object.keys(H[0].params).length>0)return{active:!0,matches:wd(X,ee,h,!0)}}else return{active:!0,matches:wd(X,ee,h,!0)||[]};return{active:!1,matches:null}}async function Wi(H,X,ee,Se){if(!e.patchRoutesOnNavigation)return{type:"success",matches:H};let _e=H;for(;;){let Xe=f==null,ze=f||u,Me=c;try{await e.patchRoutesOnNavigation({signal:ee,path:X,matches:_e,fetcherKey:Se,patch:(at,tt)=>{ee.aborted||t2(at,tt,ze,Me,s,!1)}})}catch(at){return{type:"error",error:at,partialMatches:_e}}finally{Xe&&!ee.aborted&&(u=[...u])}if(ee.aborted)return{type:"aborted"};let Ue=ms(ze,X,h),Qe=null;if(Ue){if(Object.keys(Ue[0].params).length===0)return{type:"success",matches:Ue};if(Qe=wd(ze,X,h,!0),!(Qe&&_e.length<Qe.length&&Nn(_e,Qe.slice(0,_e.length))))return{type:"success",matches:Ue}}if(Qe||(Qe=wd(ze,X,h,!0)),!Qe||Nn(_e,Qe))return{type:"success",matches:null};_e=Qe}}function Nn(H,X){return H.length===X.length&&H.every((ee,Se)=>ee.route.id===X[Se].route.id)}function Su(H){c={},f=Wd(H,s,void 0,c)}function wu(H,X,ee=!1){let Se=f==null;t2(H,X,f||u,c,s,ee),Se&&(u=[...u],rt({}))}return I={get basename(){return h},get future(){return g},get state(){return D},get routes(){return u},get window(){return t},initialize:De,subscribe:Ct,enableScrollRestoration:qi,navigate:mt,fetch:lt,revalidate:Tt,createHref:H=>e.history.createHref(H),encodeLocation:H=>e.history.encodeLocation(H),getFetcher:mn,resetFetcher:Kn,deleteFetcher:Sr,dispose:dt,getBlocker:Ko,deleteBlocker:La,patchRoutes:wu,_internalFetchControllers:z,_internalSetRoutes:Su,_internalSetStateDoNotUseOrYouWillBreakYourApp(H){rt(H)}},e.unstable_instrumentations&&(I=Iee(I,e.unstable_instrumentations.map(H=>H.router).filter(Boolean))),I}function Yee(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function cb(e,t,n,r,o,s){let c,u;if(o){c=[];for(let h of t)if(c.push(h),h.route.id===o){u=h;break}}else c=t,u=t[t.length-1];let f=o1(r||".",i1(c),Ii(e.pathname,n)||e.pathname,s==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&u){let h=l1(f.search);if(u.route.index&&!h)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&h){let m=new URLSearchParams(f.search),g=m.getAll("index");m.delete("index"),g.filter(x=>x).forEach(x=>m.append("index",x));let y=m.toString();f.search=y?`?${y}`:""}}return n!=="/"&&(f.pathname=kee({basename:n,pathname:f.pathname})),Fo(f)}function ZR(e,t,n){if(!n||!Yee(n))return{path:t};if(n.formMethod&&!pte(n.formMethod))return{path:t,error:Pi(405,{method:n.formMethod})};let r=()=>({path:t,error:Pi(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),c=AN(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Er(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,[x,S])=>`${y}${x}=${S}
|
|
215
|
-
`,""):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(!Er(s))return r();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:s,formAction:c,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return r()}}}bt(typeof FormData=="function","FormData is not available in this environment");let u,f;if(n.formData)u=fb(n.formData),f=n.formData;else if(n.body instanceof FormData)u=fb(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=a2(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=a2(u)}catch{return r()}let h={formMethod:s,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(Er(h.formMethod))return{path:t,submission:h};let m=Ma(t);return e&&m.search&&l1(m.search)&&u.append("index",""),m.search=`?${u}`,{path:Fo(m),submission:h}}function e2(e,t,n,r,o,s,c,u,f,h,m,g,y,x,S,j,C,T,R,E,_){let k=E?ui(E[1])?E[1].error:E[1].data:void 0,I=o.createURL(s.location),D=o.createURL(f),P;if(m&&s.errors){let G=Object.keys(s.errors)[0];P=c.findIndex(M=>M.route.id===G)}else if(E&&ui(E[1])){let G=E[0];P=c.findIndex(M=>M.route.id===G)-1}let $=E?E[1].statusCode:void 0,B=$&&$>=400,W={currentUrl:I,currentParams:s.matches[0]?.params||{},nextUrl:D,nextParams:c[0].params,...u,actionResult:k,actionStatus:$},Y=Pf(c),Z=c.map((G,M)=>{let{route:L}=G,z=null;if(P!=null&&M>P?z=!1:L.lazy?z=!0:a1(L)?m?z=ub(L,s.loaderData,s.errors):Kee(s.loaderData,s.matches[M],G)&&(z=!0):z=!1,z!==null)return db(n,r,e,Y,G,h,t,z);let V=!1;typeof _=="boolean"?V=_:B?V=!1:(g||I.pathname+I.search===D.pathname+D.search||I.search!==D.search||Xee(s.matches[M],G))&&(V=!0);let K={...W,defaultShouldRevalidate:V},O=Td(G,K);return db(n,r,e,Y,G,h,t,O,K,_)}),U=[];return S.forEach((G,M)=>{if(m||!c.some(de=>de.route.id===G.routeId)||x.has(M))return;let L=s.fetchers.get(M),z=L&&L.state!=="idle"&&L.data===void 0,V=ms(C,G.path,T);if(!V){if(R&&z)return;U.push({key:M,routeId:G.routeId,path:G.path,matches:null,match:null,request:null,controller:null});return}if(j.has(M))return;let K=Ep(V,G.path),O=new AbortController,F=zc(o,G.path,O.signal),se=null;if(y.has(M))y.delete(M),se=Gc(n,r,F,V,K,h,t);else if(z)g&&(se=Gc(n,r,F,V,K,h,t));else{let de;typeof _=="boolean"?de=_:B?de=!1:de=g;let ye={...W,defaultShouldRevalidate:de};Td(K,ye)&&(se=Gc(n,r,F,V,K,h,t,ye))}se&&U.push({key:M,routeId:G.routeId,path:G.path,matches:se,match:K,request:F,controller:O})}),{dsMatches:Z,revalidatingFetchers:U}}function a1(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function ub(e,t,n){if(e.lazy)return!0;if(!a1(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 Kee(e,t,n){let r=!t||n.route.id!==t.route.id,o=!e.hasOwnProperty(n.route.id);return r||o}function Xee(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Td(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function t2(e,t,n,r,o,s){let c;if(e){let h=r[e];bt(h,`No route found to patch children into: routeId = ${e}`),h.children||(h.children=[]),c=h.children}else c=n;let u=[],f=[];if(t.forEach(h=>{let m=c.find(g=>EN(h,g));m?f.push({existingRoute:m,newRoute:h}):u.push(h)}),u.length>0){let h=Wd(u,o,[e||"_","patch",String(c?.length||"0")],r);c.push(...h)}if(s&&f.length>0)for(let h=0;h<f.length;h++){let{existingRoute:m,newRoute:g}=f[h],y=m,[x]=Wd([g],o,[],{},!0);Object.assign(y,{element:x.element?x.element:y.element,errorElement:x.errorElement?x.errorElement:y.errorElement,hydrateFallbackElement:x.hydrateFallbackElement?x.hydrateFallbackElement:y.hydrateFallbackElement})}}function EN(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=>EN(n,o))):!1}var n2=new WeakMap,TN=({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=n2.get(o);c||(c={},n2.set(o,c));let u=c[e];if(u)return u;let f=(async()=>{let h=pee(e),g=o[e]!==void 0&&e!=="hasErrorBoundary";if(h)Bn(!h,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(g)Bn(!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},r2=new WeakMap;function Jee(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=r2.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(),x={};for(let S in y){let j=y[S];if(j===void 0)continue;let C=gee(S),R=s[S]!==void 0&&S!=="hasErrorBoundary";C?Bn(!C,"Route property "+S+" is not a supported property to be returned from a lazy route function. This property will be ignored."):R?Bn(!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.`):x[S]=j}Object.assign(s,x),Object.assign(s,{...r(s),lazy:void 0})})();return r2.set(s,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let c=Object.keys(e.lazy),u=[],f;for(let m of c){if(o&&o.includes(m))continue;let g=TN({key:m,route:e,manifest:n,mapRouteProperties:r});g&&(u.push(g),m===t&&(f=g))}let h=u.length>0?Promise.all(u).then(()=>{}):void 0;return h?.catch(()=>{}),f?.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:f}}async function i2(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 Zee(e){return e.matches.some(t=>t.route.middleware)?RN(e,()=>i2(e)):i2(e)}function RN(e,t){return ete(e,t,r=>{if(hte(r))throw r;return r},cte,n);function n(r,o,s){if(s)return Promise.resolve(Object.assign(s.value,{[o]:{type:"error",result:r}}));{let{matches:c}=e,u=Math.min(Math.max(c.findIndex(h=>h.route.id===o),0),Math.max(c.findIndex(h=>h.shouldCallHandler()),0)),f=gs(c,c[u].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function ete(e,t,n,r,o){let{matches:s,request:c,params:u,context:f,unstable_pattern:h}=e,m=s.flatMap(y=>y.route.middleware?y.route.middleware.map(x=>[y.route.id,x]):[]);return await _N({request:c,params:u,context:f,unstable_pattern:h},m,t,n,r,o)}async function _N(e,t,n,r,o,s,c=0){let{request:u}=e;if(u.signal.aborted)throw u.signal.reason??new Error(`Request aborted: ${u.method} ${u.url}`);let f=t[c];if(!f)return await n();let[h,m]=f,g,y=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await _N(e,t,n,r,o,s,c+1)},g.value}catch(x){return g={value:await s(x,h,g)},g.value}};try{let x=await m(e,y),S=x!=null?r(x):void 0;return o(S)?S:g?S??g.value:(g={value:await y()},g.value)}catch(x){return await s(x,h,g)}}function DN(e,t,n,r,o){let s=TN({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=Jee(r.route,Er(n.method)?"action":"loader",t,e,o);return{middleware:s,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function db(e,t,n,r,o,s,c,u,f=null,h){let m=!1,g=DN(e,t,n,o,s);return{...o,_lazyPromises:g,shouldLoad:u,shouldRevalidateArgs:f,shouldCallHandler(y){return m=!0,f?typeof h=="boolean"?Td(o,{...f,defaultShouldRevalidate:h}):typeof y=="boolean"?Td(o,{...f,defaultShouldRevalidate:y}):Td(o,f):u},resolve(y){let{lazy:x,loader:S,middleware:j}=o.route,C=m||u||y&&!Er(n.method)&&(x||S),T=j&&j.length>0&&!S&&!x;return C&&(Er(n.method)||!T)?nte({request:n,unstable_pattern:r,match:o,lazyHandlerPromise:g?.handler,lazyRoutePromise:g?.route,handlerOverride:y,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function Gc(e,t,n,r,o,s,c,u=null){return r.map(f=>f.route.id!==o.route.id?{...f,shouldLoad:!1,shouldRevalidateArgs:u,shouldCallHandler:()=>!1,_lazyPromises:DN(e,t,n,f,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:db(e,t,n,Pf(r),f,s,c,!0,u))}async function tte(e,t,n,r,o,s){n.some(h=>h._lazyPromises?.middleware)&&await Promise.all(n.map(h=>h._lazyPromises?.middleware));let c={request:t,unstable_pattern:Pf(n),params:n[0].params,context:o,matches:n},f=await e({...c,fetcherKey:r,runClientMiddleware:h=>{let m=c;return RN(m,()=>h({...m,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(h=>[h._lazyPromises?.handler,h._lazyPromises?.route]))}catch{}return f}async function nte({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:o,handlerOverride:s,scopedContext:c}){let u,f,h=Er(e.method),m=h?"action":"loader",g=y=>{let x,S=new Promise((T,R)=>x=R);f=()=>x(),e.signal.addEventListener("abort",f);let j=T=>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},...T!==void 0?[T]:[]),C=(async()=>{try{return{type:"data",result:await(s?s(R=>j(R)):j())}}catch(T){return{type:"error",result:T}}})();return Promise.race([C,S])};try{let y=h?n.route.action:n.route.loader;if(r||o)if(y){let x,[S]=await Promise.all([g(y).catch(j=>{x=j}),r,o]);if(x!==void 0)throw x;u=S}else{await r;let x=h?n.route.action:n.route.loader;if(x)[u]=await Promise.all([g(x),o]);else if(m==="action"){let S=new URL(e.url),j=S.pathname+S.search;throw Pi(405,{method:e.method,pathname:j,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(y)u=await g(y);else{let x=new URL(e.url),S=x.pathname+x.search;throw Pi(404,{pathname:S})}}catch(y){return{type:"error",result:y}}finally{f&&e.signal.removeEventListener("abort",f)}return u}async function rte(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 ite(e){let{result:t,type:n}=e;if(s1(t)){let r;try{r=await rte(t)}catch(o){return{type:"error",error:o}}return n==="error"?{type:"error",error:new kf(t.status,t.statusText,r),statusCode:t.status,headers:t.headers}:{type:"data",data:r,statusCode:t.status,headers:t.headers}}return n==="error"?u2(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:lte(t),statusCode:Qd(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Qd(t)?t.status:void 0}:u2(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 ote(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"),!vg(s)){let c=r.slice(0,r.findIndex(u=>u.route.id===n)+1);s=cb(new URL(t.url),c,o,s),e.headers.set("Location",s)}return e}function o2(e,t,n,r){let o=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(vg(e)){let s=e,c=s.startsWith("//")?new URL(t.protocol+s):new URL(s);if(o.includes(c.protocol))throw new Error("Invalid redirect location");let u=Ii(c.pathname,n)!=null;if(c.origin===t.origin&&u)return c.pathname+c.search+c.hash}try{let s=r.createURL(e);if(o.includes(s.protocol))throw new Error("Invalid redirect location")}catch{}return e}function zc(e,t,n,r){let o=e.createURL(AN(t)).toString(),s={signal:n};if(r&&Er(r.formMethod)){let{formMethod:c,formEncType:u}=r;s.method=c.toUpperCase(),u==="application/json"?(s.headers=new Headers({"Content-Type":u}),s.body=JSON.stringify(r.json)):u==="text/plain"?s.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?s.body=fb(r.formData):s.body=r.formData}return new Request(o,s)}function fb(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function a2(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function ate(e,t,n,r=!1,o=!1){let s={},c=null,u,f=!1,h={},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,x=t[y];if(bt(!ml(x),"Cannot handle redirect results in processLoaderData"),ui(x)){let S=x.error;if(m!==void 0&&(S=m,m=void 0),c=c||{},o)c[y]=S;else{let j=gs(e,y);c[j.route.id]==null&&(c[j.route.id]=S)}r||(s[y]=CN),f||(f=!0,u=Qd(x.error)?x.error.status:500),x.headers&&(h[y]=x.headers)}else s[y]=x.data,x.statusCode&&x.statusCode!==200&&!f&&(u=x.statusCode),x.headers&&(h[y]=x.headers)}),m!==void 0&&n&&(c={[n[0]]:m},n[2]&&(s[n[2]]=void 0)),{loaderData:s,errors:c,statusCode:u||200,loaderHeaders:h}}function s2(e,t,n,r,o,s){let{loaderData:c,errors:u}=ate(t,n,r);return o.filter(f=>!f.matches||f.matches.some(h=>h.shouldLoad)).forEach(f=>{let{key:h,match:m,controller:g}=f;if(g&&g.signal.aborted)return;let y=s[h];if(bt(y,"Did not find corresponding fetcher result"),ui(y)){let x=gs(e.matches,m?.route.id);u&&u[x.route.id]||(u={...u,[x.route.id]:y.error}),e.fetchers.delete(h)}else if(ml(y))bt(!1,"Unhandled fetcher revalidation redirect");else{let x=ya(y.data);e.fetchers.set(h,x)}}),{loaderData:c,errors:u}}function l2(e,t,n,r){let o=Object.entries(t).filter(([,s])=>s!==CN).reduce((s,[c,u])=>(s[c]=u,s),{});for(let s of n){let c=s.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&s.route.loader&&(o[c]=e[c]),r&&r.hasOwnProperty(c))break}return o}function c2(e){return e?ui(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function gs(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 lp(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 Pi(e,{pathname:t,routeId:n,method:r,type:o,message:s}={}){let c="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&n?u=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:o==="invalid-body"&&(u="Unable to encode submission body")):e===403?(c="Forbidden",u=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",u=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",r&&t&&n?u=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(u=`Invalid request method "${r.toUpperCase()}"`)),new kf(e||500,c,new Error(u),!0)}function cp(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(ml(o))return{key:r,result:o}}}function AN(e){let t=typeof e=="string"?Ma(e):e;return Fo({...t,hash:""})}function ste(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function lte(e){return new kf(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function cte(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&ute(n))}function ute(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function dte(e){return s1(e.result)&&wN.has(e.result.status)}function ui(e){return e.type==="error"}function ml(e){return(e&&e.type)==="redirect"}function u2(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function s1(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function fte(e){return wN.has(e)}function hte(e){return s1(e)&&fte(e.status)&&e.headers.has("Location")}function pte(e){return Hee.has(e.toUpperCase())}function Er(e){return Vee.has(e.toUpperCase())}function l1(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Ep(e,t){let n=typeof t=="string"?Ma(t).search:t.search;if(e[e.length-1].route.index&&l1(n||""))return e[e.length-1];let r=vN(e);return r[r.length-1]}function d2(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 xx(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 mte(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 vd(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 gte(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 ya(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 vte(e,t){try{let n=e.sessionStorage.getItem(jN);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 yte(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(jN,JSON.stringify(n))}catch(r){Bn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function f2(){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 Hl=v.createContext(null);Hl.displayName="DataRouter";var Nf=v.createContext(null);Nf.displayName="DataRouterState";var kN=v.createContext(!1);function xte(){return v.useContext(kN)}var c1=v.createContext({isTransitioning:!1});c1.displayName="ViewTransition";var PN=v.createContext(new Map);PN.displayName="Fetchers";var bte=v.createContext(null);bte.displayName="Await";var Fi=v.createContext(null);Fi.displayName="Navigation";var Of=v.createContext(null);Of.displayName="Location";var po=v.createContext({outlet:null,matches:[],isDataRoute:!1});po.displayName="Route";var u1=v.createContext(null);u1.displayName="RouteError";var NN="REACT_ROUTER_ERROR",Ste="REDIRECT",wte="ROUTE_ERROR_RESPONSE";function jte(e){if(e.startsWith(`${NN}:${Ste}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function Cte(e){if(e.startsWith(`${NN}:${wte}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new kf(t.status,t.statusText,t.data)}catch{}}function Ete(e,{relative:t}={}){bt(Mf(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=v.useContext(Fi),{hash:o,pathname:s,search:c}=Lf(e,{relative:t}),u=s;return n!=="/"&&(u=s==="/"?n:Io([n,s])),r.createHref({pathname:u,search:c,hash:o})}function Mf(){return v.useContext(Of)!=null}function gi(){return bt(Mf(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Of).location}var ON="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function MN(e){v.useContext(Fi).static||v.useLayoutEffect(e)}function Yn(){let{isDataRoute:e}=v.useContext(po);return e?Ute():Tte()}function Tte(){bt(Mf(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(Hl),{basename:t,navigator:n}=v.useContext(Fi),{matches:r}=v.useContext(po),{pathname:o}=gi(),s=JSON.stringify(i1(r)),c=v.useRef(!1);return MN(()=>{c.current=!0}),v.useCallback((f,h={})=>{if(Bn(c.current,ON),!c.current)return;if(typeof f=="number"){n.go(f);return}let m=o1(f,JSON.parse(s),o,h.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Io([t,m.pathname])),(h.replace?n.replace:n.push)(m,h.state,h)},[t,n,s,o,e])}var Rte=v.createContext(null);function _te(e){let t=v.useContext(po).outlet;return v.useMemo(()=>t&&v.createElement(Rte.Provider,{value:e},t),[t,e])}function qt(){let{matches:e}=v.useContext(po),t=e[e.length-1];return t?t.params:{}}function Lf(e,{relative:t}={}){let{matches:n}=v.useContext(po),{pathname:r}=gi(),o=JSON.stringify(i1(n));return v.useMemo(()=>o1(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function Dte(e,t){return LN(e,t)}function LN(e,t,n,r,o){bt(Mf(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=v.useContext(Fi),{matches:c}=v.useContext(po),u=c[c.length-1],f=u?u.params:{},h=u?u.pathname:"/",m=u?u.pathnameBase:"/",g=u&&u.route;{let R=g&&g.path||"";zN(h,!g||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (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.
|
|
216
|
-
|
|
217
|
-
Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let y=gi(),x;if(t){let R=typeof t=="string"?Ma(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.`),x=R}else x=y;let S=x.pathname||"/",j=S;if(m!=="/"){let R=m.replace(/^\//,"").split("/");j="/"+S.replace(/^\//,"").split("/").slice(R.length).join("/")}let C=ms(e,{pathname:j});Bn(g||C!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),Bn(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 "${x.pathname}${x.search}${x.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 T=Ote(C&&C.map(R=>Object.assign({},R,{params:Object.assign({},f,R.params),pathname:Io([m,s.encodeLocation?s.encodeLocation(R.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?m:Io([m,s.encodeLocation?s.encodeLocation(R.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),c,n,r,o);return t&&T?v.createElement(Of.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...x},navigationType:"POP"}},T):T}function Ate(){let e=$te(),t=Qd(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 kte=v.createElement(Ate,null),IN=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(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=Cte(e.digest);n&&(e=n)}let t=e!==void 0?v.createElement(po.Provider,{value:this.props.routeContext},v.createElement(u1.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(Pte,{error:e},t):t}};IN.contextType=kN;var bx=new WeakMap;function Pte({children:e,error:t}){let{basename:n}=v.useContext(Fi);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=jte(t.digest);if(r){let o=bx.get(t);if(o)throw o;let s=xN(r.location,n);if(yN&&!bx.get(t))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw bx.set(t,c),c}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function Nte({routeContext:e,match:t,children:n}){let r=v.useContext(Hl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(po.Provider,{value:e},n)}function Ote(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 u=!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:x}=n,S=g.route.loader&&!y.hasOwnProperty(g.route.id)&&(!x||x[g.route.id]===void 0);if(g.route.lazy||S){u=!0,f>=0?s=s.slice(0,f+1):s=[s[0]];break}}}let h=n&&r?(m,g)=>{r(m,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:Pf(n.matches),errorInfo:g})}:void 0;return s.reduceRight((m,g,y)=>{let x,S=!1,j=null,C=null;n&&(x=c&&g.route.id?c[g.route.id]:void 0,j=g.route.errorElement||kte,u&&(f<0&&y===0?(zN("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 T=t.concat(s.slice(0,y+1)),R=()=>{let E;return x?E=j:S?E=C:g.route.Component?E=v.createElement(g.route.Component,null):g.route.element?E=g.route.element:E=m,v.createElement(Nte,{match:g,routeContext:{outlet:m,matches:T,isDataRoute:n!=null},children:E})};return n&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?v.createElement(IN,{location:n.location,revalidation:n.revalidation,component:j,error:x,children:R(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:h}):R()},null)}function d1(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Mte(e){let t=v.useContext(Hl);return bt(t,d1(e)),t}function Lte(e){let t=v.useContext(Nf);return bt(t,d1(e)),t}function Ite(e){let t=v.useContext(po);return bt(t,d1(e)),t}function f1(e){let t=Ite(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 zte(){return f1("useRouteId")}function $te(){let e=v.useContext(u1),t=Lte("useRouteError"),n=f1("useRouteError");return e!==void 0?e:t.errors?.[n]}function Ute(){let{router:e}=Mte("useNavigate"),t=f1("useNavigate"),n=v.useRef(!1);return MN(()=>{n.current=!0}),v.useCallback(async(o,s={})=>{Bn(n.current,ON),n.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...s}))},[e,t])}var h2={};function zN(e,t,n){!t&&!h2[e]&&(h2[e]=!0,Bn(!1,n))}var p2={};function m2(e,t){!e&&!p2[t]&&(p2[t]=!0,console.warn(t))}var Bte="useOptimistic",g2=jb[Bte],Vte=()=>{};function Fte(e){return g2?g2(e):[e,Vte]}function Hte(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Bn(!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&&Bn(!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&&Bn(!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 qte=["HydrateFallback","hydrateFallbackElement"],Gte=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 Wte({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=xte()||r;let[s,c]=v.useState(e.state),[u,f]=Fte(s),[h,m]=v.useState(),[g,y]=v.useState({isTransitioning:!1}),[x,S]=v.useState(),[j,C]=v.useState(),[T,R]=v.useState(),E=v.useRef(new Map),_=v.useCallback((P,{deletedFetchers:$,newErrors:B,flushSync:W,viewTransitionOpts:Y})=>{B&&n&&Object.values(B).forEach(U=>n(U,{location:P.location,params:P.matches[0]?.params??{},unstable_pattern:Pf(P.matches)})),P.fetchers.forEach((U,G)=>{U.data!==void 0&&E.current.set(G,U.data)}),$.forEach(U=>E.current.delete(U)),m2(W===!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 Z=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(m2(Y==null||Z,"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."),!Y||!Z){t&&W?t(()=>c(P)):r===!1?c(P):v.startTransition(()=>{r===!0&&f(U=>v2(U,P)),c(P)});return}if(t&&W){t(()=>{j&&(x?.resolve(),j.skipTransition()),y({isTransitioning:!0,flushSync:!0,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation})});let U=e.window.document.startViewTransition(()=>{t(()=>c(P))});U.finished.finally(()=>{t(()=>{S(void 0),C(void 0),m(void 0),y({isTransitioning:!1})})}),t(()=>C(U));return}j?(x?.resolve(),j.skipTransition(),R({state:P,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation})):(m(P),y({isTransitioning:!0,flushSync:!1,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation}))},[e.window,t,j,x,r,f,n]);v.useLayoutEffect(()=>e.subscribe(_),[e,_]),v.useEffect(()=>{g.isTransitioning&&!g.flushSync&&S(new Gte)},[g]),v.useEffect(()=>{if(x&&h&&e.window){let P=h,$=x.promise,B=e.window.document.startViewTransition(async()=>{r===!1?c(P):v.startTransition(()=>{r===!0&&f(W=>v2(W,P)),c(P)}),await $});B.finished.finally(()=>{S(void 0),C(void 0),m(void 0),y({isTransitioning:!1})}),C(B)}},[h,x,e.window,r,f]),v.useEffect(()=>{x&&h&&u.location.key===h.location.key&&x.resolve()},[x,j,u.location,h]),v.useEffect(()=>{!g.isTransitioning&&T&&(m(T.state),y({isTransitioning:!0,flushSync:!1,currentLocation:T.currentLocation,nextLocation:T.nextLocation}),R(void 0))},[g.isTransitioning,T]);let k=v.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:P=>e.navigate(P),push:(P,$,B)=>e.navigate(P,{state:$,preventScrollReset:B?.preventScrollReset}),replace:(P,$,B)=>e.navigate(P,{replace:!0,state:$,preventScrollReset:B?.preventScrollReset})}),[e]),I=e.basename||"/",D=v.useMemo(()=>({router:e,navigator:k,static:!1,basename:I,onError:n}),[e,k,I,n]);return v.createElement(v.Fragment,null,v.createElement(Hl.Provider,{value:D},v.createElement(Nf.Provider,{value:u},v.createElement(PN.Provider,{value:E.current},v.createElement(c1.Provider,{value:g},v.createElement(Kte,{basename:I,location:u.location,navigationType:u.historyAction,navigator:k,unstable_useTransitions:r},v.createElement(Qte,{routes:e.routes,future:e.future,state:u,onError:n})))))),null)}function v2(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 Qte=v.memo(Yte);function Yte({routes:e,future:t,state:n,onError:r}){return LN(e,void 0,n,r,t)}function h1(e){return _te(e.context)}function Be(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 Kte({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:s=!1,unstable_useTransitions:c}){bt(!Mf(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:u,navigator:o,static:s,unstable_useTransitions:c,future:{}}),[u,o,s,c]);typeof n=="string"&&(n=Ma(n));let{pathname:h="/",search:m="",hash:g="",state:y=null,key:x="default"}=n,S=v.useMemo(()=>{let j=Ii(h,u);return j==null?null:{location:{pathname:j,search:m,hash:g,state:y,key:x},navigationType:r}},[u,h,m,g,y,x,r]);return Bn(S!=null,`<Router basename="${u}"> is not able to match the URL "${h}${m}${g}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:v.createElement(Fi.Provider,{value:f},v.createElement(Of.Provider,{children:t,value:S}))}function Xte({children:e,location:t}){return Dte(hb(e),t)}function hb(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,hb(r.props.children,s));return}bt(r.type===Be,`[${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=hb(r.props.children,s)),n.push(c)}),n}var Tp="get",Rp="application/x-www-form-urlencoded";function yg(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Jte(e){return yg(e)&&e.tagName.toLowerCase()==="button"}function Zte(e){return yg(e)&&e.tagName.toLowerCase()==="form"}function ene(e){return yg(e)&&e.tagName.toLowerCase()==="input"}function tne(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function nne(e,t){return e.button===0&&(!t||t==="_self")&&!tne(e)}function pb(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 rne(e,t){let n=pb(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(s=>{n.append(o,s)})}),n}var up=null;function ine(){if(up===null)try{new FormData(document.createElement("form"),0),up=!1}catch{up=!0}return up}var one=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Sx(e){return e!=null&&!one.has(e)?(Bn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Rp}"`),null):e}function ane(e,t){let n,r,o,s,c;if(Zte(e)){let u=e.getAttribute("action");r=u?Ii(u,t):null,n=e.getAttribute("method")||Tp,o=Sx(e.getAttribute("enctype"))||Rp,s=new FormData(e)}else if(Jte(e)||ene(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||u.getAttribute("action");if(r=f?Ii(f,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Tp,o=Sx(e.getAttribute("formenctype"))||Sx(u.getAttribute("enctype"))||Rp,s=new FormData(u,e),!ine()){let{name:h,type:m,value:g}=e;if(m==="image"){let y=h?`${h}.`:"";s.append(`${y}x`,"0"),s.append(`${y}y`,"0")}else h&&s.append(h,g)}}else{if(yg(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Tp,r=null,o=Rp,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 p1(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function sne(e,t,n,r){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${r}`:o.pathname=`${o.pathname}.${r}`:o.pathname==="/"?o.pathname=`_root.${r}`:t&&Ii(o.pathname,t)==="/"?o.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${r}`,o}async function lne(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 cne(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 une(e,t,n){let r=await Promise.all(e.map(async o=>{let s=t.routes[o.route.id];if(s){let c=await lne(s,n);return c.links?c.links():[]}return[]}));return pne(r.flat(1).filter(cne).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function y2(e,t,n,r,o,s){let c=(f,h)=>n[h]?f.route.id!==n[h].route.id:!0,u=(f,h)=>n[h].pathname!==f.pathname||n[h].route.path?.endsWith("*")&&n[h].params["*"]!==f.params["*"];return s==="assets"?t.filter((f,h)=>c(f,h)||u(f,h)):s==="data"?t.filter((f,h)=>{let m=r.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(c(f,h)||u(f,h))return!0;if(f.route.shouldRevalidate){let 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 dne(e,t,{includeHydrateFallback:n}={}){return fne(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 fne(e){return[...new Set(e)]}function hne(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function pne(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let s=JSON.stringify(hne(o));return n.has(s)||(n.add(s),r.push({key:s,link:o})),r},[])}function $N(){let e=v.useContext(Hl);return p1(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function mne(){let e=v.useContext(Nf);return p1(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var m1=v.createContext(void 0);m1.displayName="FrameworkContext";function UN(){let e=v.useContext(m1);return p1(e,"You must render this element inside a <HydratedRouter> element"),e}function gne(e,t){let n=v.useContext(m1),[r,o]=v.useState(!1),[s,c]=v.useState(!1),{onFocus:u,onBlur:f,onMouseEnter:h,onMouseLeave:m,onTouchStart:g}=t,y=v.useRef(null);v.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=T=>{T.forEach(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 x=()=>{o(!0)},S=()=>{o(!1),c(!1)};return n?e!=="intent"?[s,y,{}]:[s,y,{onFocus:yd(u,x),onBlur:yd(f,S),onMouseEnter:yd(h,x),onMouseLeave:yd(m,S),onTouchStart:yd(g,x)}]:[!1,y,{}]}function yd(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function vne({page:e,...t}){let{router:n}=$N(),r=v.useMemo(()=>ms(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(xne,{page:e,matches:r,...t}):null}function yne(e){let{manifest:t,routeModules:n}=UN(),[r,o]=v.useState([]);return v.useEffect(()=>{let s=!1;return une(e,t,n).then(c=>{s||o(c)}),()=>{s=!0}},[e,t,n]),r}function xne({page:e,matches:t,...n}){let r=gi(),{future:o,manifest:s,routeModules:c}=UN(),{basename:u}=$N(),{loaderData:f,matches:h}=mne(),m=v.useMemo(()=>y2(e,t,h,s,r,"data"),[e,t,h,s,r]),g=v.useMemo(()=>y2(e,t,h,s,r,"assets"),[e,t,h,s,r]),y=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let j=new Set,C=!1;if(t.forEach(R=>{let E=s.routes[R.route.id];!E||!E.hasLoader||(!m.some(_=>_.route.id===R.route.id)&&R.route.id in f&&c[R.route.id]?.shouldRevalidate||E.hasClientLoader?C=!0:j.add(R.route.id))}),j.size===0)return[];let T=sne(e,u,o.unstable_trailingSlashAwareDataRequests,"data");return C&&j.size>0&&T.searchParams.set("_routes",t.filter(R=>j.has(R.route.id)).map(R=>R.route.id).join(",")),[T.pathname+T.search]},[u,o.unstable_trailingSlashAwareDataRequests,f,r,s,m,t,e,c]),x=v.useMemo(()=>dne(g,s),[g,s]),S=yne(g);return v.createElement(v.Fragment,null,y.map(j=>v.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),x.map(j=>v.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),S.map(({key:j,link:C})=>v.createElement("link",{key:j,nonce:n.nonce,...C})))}function bne(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Sne=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Sne&&(window.__reactRouterVersion="7.12.0")}catch{}function wne(e,t){return Qee({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:uee({window:t?.window}),hydrationData:jne(),routes:e,mapRouteProperties:Hte,hydrationRouteProperties:qte,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function jne(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Cne(e.errors)}),e}function Cne(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 kf(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 BN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,VN=v.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:s,replace:c,state:u,target:f,to:h,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:y,...x},S){let{basename:j,unstable_useTransitions:C}=v.useContext(Fi),T=typeof h=="string"&&BN.test(h),R=xN(h,j);h=R.to;let E=Ete(h,{relative:o}),[_,k,I]=gne(r,x),D=_ne(h,{replace:c,state:u,target:f,preventScrollReset:m,relative:o,viewTransition:g,unstable_defaultShouldRevalidate:y,unstable_useTransitions:C});function P(B){t&&t(B),B.defaultPrevented||D(B)}let $=v.createElement("a",{...x,...I,href:R.absoluteURL||E,onClick:R.isExternal||s?t:P,ref:bne(S,k),target:f,"data-discover":!T&&n==="render"?"true":void 0});return _&&!T?v.createElement(v.Fragment,null,$,v.createElement(vne,{page:E})):$});VN.displayName="Link";var Ene=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:s,to:c,viewTransition:u,children:f,...h},m){let g=Lf(c,{relative:h.relative}),y=gi(),x=v.useContext(Nf),{navigator:S,basename:j}=v.useContext(Fi),C=x!=null&&Nne(g)&&u===!0,T=S.encodeLocation?S.encodeLocation(g).pathname:g.pathname,R=y.pathname,E=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(R=R.toLowerCase(),E=E?E.toLowerCase():null,T=T.toLowerCase()),E&&j&&(E=Ii(E,j)||E);const _=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let k=R===T||!o&&R.startsWith(T)&&R.charAt(_)==="/",I=E!=null&&(E===T||!o&&E.startsWith(T)&&E.charAt(T.length)==="/"),D={isActive:k,isPending:I,isTransitioning:C},P=k?t:void 0,$;typeof r=="function"?$=r(D):$=[r,k?"active":null,I?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let B=typeof s=="function"?s(D):s;return v.createElement(VN,{...h,"aria-current":P,className:$,ref:m,style:B,to:c,viewTransition:u},typeof f=="function"?f(D):f)});Ene.displayName="NavLink";var Tne=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:s,method:c=Tp,action:u,onSubmit:f,relative:h,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:y,...x},S)=>{let{unstable_useTransitions:j}=v.useContext(Fi),C=kne(),T=Pne(u,{relative:h}),R=c.toLowerCase()==="get"?"get":"post",E=typeof u=="string"&&BN.test(u),_=k=>{if(f&&f(k),k.defaultPrevented)return;k.preventDefault();let I=k.nativeEvent.submitter,D=I?.getAttribute("formmethod")||c,P=()=>C(I||k.currentTarget,{fetcherKey:t,method:D,navigate:n,replace:o,state:s,relative:h,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:y});j&&n!==!1?v.startTransition(()=>P()):P()};return v.createElement("form",{ref:S,method:R,action:T,onSubmit:r?f:_,...x,"data-discover":!E&&e==="render"?"true":void 0})});Tne.displayName="Form";function Rne(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function FN(e){let t=v.useContext(Hl);return bt(t,Rne(e)),t}function _ne(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:u,unstable_useTransitions:f}={}){let h=Yn(),m=gi(),g=Lf(e,{relative:s});return v.useCallback(y=>{if(nne(y,t)){y.preventDefault();let x=n!==void 0?n:Fo(m)===Fo(g),S=()=>h(e,{replace:x,state:r,preventScrollReset:o,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:u});f?v.startTransition(()=>S()):S()}},[m,h,g,n,r,t,e,o,s,c,u,f])}function xg(e){Bn(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(pb(e)),n=v.useRef(!1),r=gi(),o=v.useMemo(()=>rne(r.search,n.current?null:t.current),[r.search]),s=Yn(),c=v.useCallback((u,f)=>{const h=pb(typeof u=="function"?u(new URLSearchParams(o)):u);n.current=!0,s("?"+h,f)},[s,o]);return[o,c]}var Dne=0,Ane=()=>`__${String(++Dne)}__`;function kne(){let{router:e}=FN("useSubmit"),{basename:t}=v.useContext(Fi),n=zte(),r=e.fetch,o=e.navigate;return v.useCallback(async(s,c={})=>{let{action:u,method:f,encType:h,formData:m,body:g}=ane(s,t);if(c.navigate===!1){let y=c.fetcherKey||Ane();await r(y,n,c.action||u,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:m,body:g,formMethod:c.method||f,formEncType:c.encType||h,flushSync:c.flushSync})}else await o(c.action||u,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:m,body:g,formMethod:c.method||f,formEncType:c.encType||h,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[r,o,t,n])}function Pne(e,{relative:t}={}){let{basename:n}=v.useContext(Fi),r=v.useContext(po);bt(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),s={...Lf(e||".",{relative:t})},c=gi();if(e==null){s.search=c.search;let u=new URLSearchParams(s.search),f=u.getAll("index");if(f.some(m=>m==="")){u.delete("index"),f.filter(g=>g).forEach(g=>u.append("index",g));let m=u.toString();s.search=m?`?${m}`:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:Io([n,s.pathname])),Fo(s)}function Nne(e,{relative:t}={}){let n=v.useContext(c1);bt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=FN("useViewTransitionState"),o=Lf(e,{relative:t});if(!n.isTransitioning)return!1;let s=Ii(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=Ii(n.nextLocation.pathname,r)||n.nextLocation.pathname;return tm(o.pathname,c)!=null||tm(o.pathname,s)!=null}function g1(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function One(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 Os(e){return Sl(e.getActiveLogin()?.project)}function bg(e){const t=Re(),n=Os(t),r=Yn(),[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(bu,{search:o,onClick:c=>r(`/admin/members/${c.resource.id}`)?.catch(console.error),onChange:c=>s(c.definition),hideFilters:!0,hideToolbar:!0})}function Mne(){return a.jsxs(a.Fragment,{children:[a.jsx(Ve,{children:"Bots"}),a.jsx(bg,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(xe,{justify:"flex-end",children:a.jsx(St,{to:"/admin/bots/new",children:"Create new bot"})})]})}function Lne(){return a.jsxs(a.Fragment,{children:[a.jsx(Ve,{children:"Clients"}),a.jsx(bg,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(xe,{justify:"flex-end",children:a.jsx(St,{to:"/admin/clients/new",children:"Create new client"})})]})}function Sg(e){return a.jsx(Vl,{resourceType:"AccessPolicy",name:e.name,defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{Qo(t)?e.onChange(Yt(t)):e.onChange(void 0)}})}function Ine(){const e=Re(),t=Os(e),[n,r]=v.useState(""),[o,s]=v.useState(""),[c,u]=v.useState(),[f,h]=v.useState(),[m,g]=v.useState(void 0);return a.jsxs(a.Fragment,{children:[a.jsx(Ve,{children:"Create new Bot"}),a.jsxs(pt,{onSubmit:()=>{const y={name:n,description:o,accessPolicy:c};e.post("admin/projects/"+t+"/bot",y).then(x=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),g(x),Ae({color:"green",message:"Bot created"})}).catch(x=>{Ae({color:"red",message:Ge(x),autoClose:!1}),h(Wt(x))})},children:[!m&&a.jsxs(Le,{children:[a.jsx(Ut,{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:$t(f,"name")})}),a.jsx(Ut,{title:"Description",htmlFor:"description",outcome:f,children:a.jsx(He,{id:"description",name:"description",onChange:y=>s(y.currentTarget.value),error:$t(f,"description")})}),a.jsx(Ut,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:a.jsx(Sg,{name:"accessPolicy",onChange:u})}),a.jsx(xe,{justify:"flex-end",children:a.jsx(Oe,{type:"submit",children:"Create Bot"})})]}),m&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(be,{children:"Bot created"}),a.jsxs(Or,{children:[a.jsx(Or.Item,{children:a.jsx(St,{to:m,children:"Go to new bot"})}),a.jsx(Or.Item,{children:a.jsx(St,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function zne(){const e=Re(),t=Os(e),[n,r]=v.useState(""),[o,s]=v.useState(""),[c,u]=v.useState(""),[f,h]=v.useState(),[m,g]=v.useState(),[y,x]=v.useState(void 0);return a.jsxs(a.Fragment,{children:[a.jsx(Ve,{children:"Create new Client"}),a.jsxs(pt,{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"),x(j),Ae({color:"green",message:"Client created"})}).catch(j=>{Ae({color:"red",message:Ge(j),autoClose:!1}),g(Wt(j))})},children:[!y&&a.jsxs(Le,{children:[a.jsx(Ut,{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:$t(m,"name")})}),a.jsx(Ut,{title:"Description",htmlFor:"description",outcome:m,children:a.jsx(He,{id:"description",name:"description",onChange:S=>s(S.currentTarget.value),error:$t(m,"description")})}),a.jsx(Ut,{title:"Redirect URI",htmlFor:"redirectUri",outcome:m,children:a.jsx(He,{id:"redirectUri",name:"redirectUri",onChange:S=>u(S.currentTarget.value),error:$t(m,"redirectUri")})}),a.jsx(Ut,{title:"Access Policy",htmlFor:"accessPolicy",outcome:m,children:a.jsx(Sg,{name:"accessPolicy",onChange:h})}),a.jsx(xe,{justify:"flex-end",children:a.jsx(Oe,{type:"submit",children:"Create Client"})})]}),y&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(be,{children:"Client created"}),a.jsxs(Or,{children:[a.jsx(Or.Item,{children:a.jsx(St,{to:y,children:"Go to new client"})}),a.jsx(Or.Item,{children:a.jsx(St,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}const $ne=8;function HN({inputProps:e,data:t,onChange:n}){const r=Il({onDropdownClose:()=>r.resetSelectedOption()}),[o,s]=v.useState(null),[c,u]=v.useState(""),f=v.useMemo(()=>t.filter(m=>m.toLowerCase().includes(c.toLowerCase().trim())),[t,c]),h=v.useMemo(()=>{const m=new Array(Math.min(f.length,$ne));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),u(m),r.closeDropdown()},children:[a.jsx(Ye.Target,{children:a.jsx($r,{rightSection:a.jsx(Ye.Chevron,{}),value:c,onChange:m=>{r.openDropdown(),r.updateSelectedOptionIndex(),u(m.currentTarget.value)},onClick:()=>r.openDropdown(),onFocus:()=>r.openDropdown(),onBlur:()=>{r.closeDropdown(),u(o||"")},rightSectionPointerEvents:"none",...e})}),a.jsx(Ye.Dropdown,{children:a.jsx(Ye.Options,{children:h.length>0?h:a.jsx(Ye.Empty,{children:"Nothing found"})})})]})}function Une(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=tu(t),t}function qN(e){return typeof e=="string"?e.length>50?e.substring(0,50)+"...":e:typeof e=="boolean"?e.toString().toLocaleUpperCase():e}const GN=({medplum:e,onChange:t,onError:n})=>{v.useEffect(()=>{async function r(){return(await e.valueSetExpand({url:"https://medplum.com/fhir/ValueSet/resource-types",count:200})).expansion?.contains?.map(s=>s.code).filter(s=>s!==void 0)??[]}r().then(o=>{t(Une(o))}).catch(o=>{n?n(o):console.error(o)})},[e,t,n])};function Bne(){const e=Re(),[t,{open:n,close:r}]=Pl(!1),[o,s]=v.useState(""),[c,u]=v.useState(),[f,h]=v.useState(void 0),[m,g]=v.useState(0),[y,x]=v.useState(!1),[S,j]=v.useState([]),[C,T]=v.useState([]),[R,E]=v.useState(!1),[_,k]=v.useState(void 0),[I,D]=v.useState([]),[P,$]=v.useState(0),[B,W]=v.useState(!1),[Y,Z]=v.useState(!1);GN({medplum:e,onChange:D}),v.useEffect(()=>{x(!0),e.get("fhir/R4/$db-column-statistics?tableName="+encodeURIComponent(f??""),{cache:"no-cache"}).then(L=>{const z=L.parameter?.find(O=>O.name==="defaultStatisticsTarget")?.valueInteger??0;g(z);const K=L.parameter?.find(O=>O.name==="table")?.part?.filter(O=>O.name==="column");j(K??[])}).finally(()=>{x(!1)}).catch(L=>{Ae({color:"red",message:L.message})})},[e,f,P]);function U(){if(f){if(C.length===0){Ae({color:"red",message:"No columns selected",autoClose:!0});return}Ae({title:"Submit",message:JSON.stringify({resetToDefault:R,newStatisticsTarget:_,selectedRowNames:C}),autoClose:!0}),e.post("fhir/R4/$db-configure-column-statistics",{tableName:f,columnNames:C,resetToDefault:R,newStatisticsTarget:R?void 0:_}).then(L=>{Ae({color:"green",message:"Done"}),$(z=>z+1)}).catch(L=>Ae({color:"red",message:Ge(L),autoClose:!1}))}}const G={onClick:L=>{s("Details"),u(a.jsx("pre",{children:L})),n()}};let M=0;return a.jsxs(pt,{onSubmit:U,children:[a.jsxs(Le,{gap:"sm",children:[a.jsxs(xe,{children:[a.jsx(HN,{data:I,inputProps:{placeholder:"Table name",inputSize:"50"},onChange:L=>{h(L),T([])}}),a.jsx(Oe,{loading:y,onClick:()=>$(L=>L+1),children:"Refresh"})]}),a.jsxs(xe,{children:[a.jsx(be,{span:!0,fw:700,children:"Statistics Target:"}),a.jsx(Yr,{value:R?"":_,disabled:R,required:!R,size:"sm",w:"100",min:0,step:100,max:1e4,onChange:L=>{typeof L=="number"&&k(L)}}),a.jsx(be,{span:!0,fw:700,c:"dimmed",children:"– or –"}),a.jsx(cn,{checked:R,onChange:L=>E(L.currentTarget.checked),label:"Reset to default ("+m+")",size:"sm"}),a.jsx(dr,{size:"sm",children:"Update"})]}),a.jsx(xe,{children:a.jsx(cn,{checked:Y,onChange:L=>Z(L.currentTarget.checked),label:"Hide columns with default statistics target",size:"sm"})}),a.jsx(xe,{children:a.jsx(cn,{checked:B,onChange:L=>W(L.currentTarget.checked),label:"Show all column stats",size:"sm"})}),a.jsx(te.ScrollContainer,{minWidth:500,children:a.jsxs(te,{striped:!0,highlightOnHover:!0,children:[a.jsx(te.Thead,{children:a.jsxs(te.Tr,{children:[a.jsx(te.Th,{children:a.jsx(cn,{size:"sm",checked:S.length>0&&C.length===S.length,indeterminate:C.length>0&&C.length<S.length,onChange:()=>{C.length===S.length?T([]):T(S.map(L=>L.part?.find(z=>z.name==="name")?.valueString??""))}})}),a.jsx(te.Th,{children:"Column"}),a.jsx(te.Th,{children:"Statistics Target"}),a.jsx(te.Th,{children:"null_frac"}),a.jsx(te.Th,{children:"avg_width"}),a.jsx(te.Th,{children:"n_distinct"}),a.jsx(te.Th,{children:"correlation"}),B&&a.jsxs(a.Fragment,{children:[a.jsx(te.Th,{children:"most_common_vals"}),a.jsx(te.Th,{children:"most_common_freqs"}),a.jsx(te.Th,{children:"histogram_bounds"}),a.jsx(te.Th,{children:"most_common_elems"}),a.jsx(te.Th,{children:"most_common_elem_freqs"}),a.jsx(te.Th,{children:"elem_count_histogram"})]})]})}),a.jsxs(te.Tbody,{children:[S?.map(L=>{const z=L.part??[],V=z.find(O=>O.name==="name")?.valueString,K=z.find(O=>O.name==="statisticsTarget")?.valueInteger;if(K===-1&&(M++,Y))return null;if(!V)throw new Error("Column missing name",{cause:L});return a.jsxs(te.Tr,{children:[a.jsx(te.Td,{children:a.jsx(cn,{size:"sm",checked:C.includes(V),onChange:O=>{T(O.currentTarget.checked?[...C,V]:C.filter(F=>F!==V))}})}),a.jsx(te.Td,{children:V}),a.jsx(te.Td,{children:K===-1?a.jsxs(be,{span:!0,c:"dimmed",fs:"italic",children:["default (",m,")"]}):K}),a.jsx(wo,{value:z.find(O=>O.name==="nullFraction")?.valueDecimal,...G}),a.jsx(wo,{value:z.find(O=>O.name==="avgWidth")?.valueInteger,...G}),a.jsx(wo,{value:z.find(O=>O.name==="nDistinct")?.valueDecimal,...G}),a.jsx(wo,{value:z.find(O=>O.name==="correlation")?.valueDecimal,...G}),B&&a.jsxs(a.Fragment,{children:[a.jsx(wo,{value:z.find(O=>O.name==="mostCommonValues")?.valueString,...G}),a.jsx(wo,{value:z.find(O=>O.name==="mostCommonFreqs")?.valueString,...G}),a.jsx(wo,{value:z.find(O=>O.name==="histogramBounds")?.valueString,...G}),a.jsx(wo,{value:z.find(O=>O.name==="mostCommonElems")?.valueString,...G}),a.jsx(wo,{value:z.find(O=>O.name==="mostCommonElemFreqs")?.valueString,...G}),a.jsx(wo,{value:z.find(O=>O.name==="elemCountHistogram")?.valueString,...G})]})]},V)}),Y&&a.jsx(te.Tr,{children:a.jsx(te.Td,{colSpan:B?13:7,children:a.jsxs(be,{c:"dimmed",fs:"italic",children:[M," hidden columns with default statistics target"]})})})]})]})})]}),a.jsx(In,{opened:t,onClose:r,title:o,centered:!0,size:"auto",children:c})]})}function wo({value:e,onClick:t}){return a.jsx(te.Td,{style:{cursor:"pointer"},onClick:()=>t?.(e),children:Vne(e)})}function Vne(e){return typeof e=="string"&&e.length>30?e.substring(0,30)+"...":e}function v1(e,t,n,r){const o=Date.now().toString();Ae({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 u="Done";return c.resourceType==="AsyncJob"?u=a.jsx(St,{to:c,children:"View AsyncJob"}):c.resourceType==="OperationOutcome"&&c.issue?.[0]?.details?.text&&(u=a.jsx(be,{children:c.issue[0].details.text})),Ni.update({id:o,color:"green",title:t,message:u,icon:a.jsx(Yo,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c}).catch(c=>{throw Ni.update({id:o,color:"red",title:t,message:Ge(c),icon:a.jsx(El,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c})}function Mc(e,t,n,r){v1(e,t,n,r).catch(()=>{})}const Fne=8;function Hne({pillInputProps:e,inputProps:t,data:n,onChange:r}){const o=Il({onDropdownClose:()=>o.resetSelectedOption(),onDropdownOpen:()=>o.updateSelectedOptionIndex("active")}),[s,c]=v.useState(""),[u,f]=v.useState([]),h=S=>{const j=u.includes(S)?u.filter(C=>C!==S):[...u,S];f(j),r&&r(j)},m=S=>f(j=>j.filter(C=>C!==S)),g=v.useMemo(()=>u.map(S=>a.jsx(ja,{withRemoveButton:!0,onRemove:()=>m(S),children:S},S)),[u]),y=v.useMemo(()=>{const S=s.trim().toLowerCase();return n.filter(j=>j.toLowerCase().includes(S))},[n,s]),x=v.useMemo(()=>{const S=new Array(Math.min(y.length,Fne));for(let j=0;j<S.length;j++){const C=y[j];S[j]=a.jsx(Ye.Option,{value:C,active:u.includes(C),children:a.jsxs(xe,{gap:"sm",children:[u.includes(C)?a.jsx(sf,{size:12}):null,a.jsx("span",{children:C})]})},C)}return S},[y,u]);return a.jsxs(Ye,{store:o,onOptionSubmit:h,withinPortal:!1,children:[a.jsx(Ye.DropdownTarget,{children:a.jsx(Ss,{onClick:()=>o.openDropdown(),...e,children:a.jsxs(ja.Group,{children:[g,a.jsx(Ye.EventsTarget,{children:a.jsx(Ss.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&&u.length>0&&(S.preventDefault(),m(u[u.length-1]))},...t})})]})})}),a.jsx(Ye.Dropdown,{children:a.jsx(Ye.Options,{children:x.length>0?x:a.jsx(Ye.Empty,{children:"Nothing found..."})})})]})}function qne({defaultGinPendingListLimit:e,availableTables:t,onResponse:n}){const r=Re(),[o,s]=v.useState(!1),[c,u]=v.useState([]),[f,h]=v.useState("unspecified"),[m,g]=v.useState("unspecified"),[y,x]=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),v1(r,"Configure GIN Indexes","fhir/R4/$db-configure-indexes",j).then(C=>{n(C)}).catch(()=>{}).finally(()=>{s(!1)})};return a.jsx(pt,{onSubmit:S,children:a.jsxs(Le,{gap:"sm",maw:"800",children:[a.jsx(nf,{label:"Table(s)",children:a.jsx(Hne,{data:t,onChange:j=>u(j),inputProps:{name:"tables",placeholder:"e.g. Observation"}})}),a.jsx(jr.Group,{name:"fastUpdate",label:"fastupdate",value:f,onChange:j=>h(j),children:a.jsxs(xe,{h:"36",children:[a.jsx(jr,{size:"sm",value:"unspecified",label:"unspecified"}),a.jsx(jr,{size:"sm",value:"reset",label:"reset to default (on)"}),a.jsx(jr,{size:"sm",value:"off",label:"off"}),a.jsx(jr,{size:"sm",value:"on",label:"on"})]})}),a.jsx(jr.Group,{name:"ginPendingListLimit",label:"gin_pending_list_limit",value:m,onChange:j=>{g(j),j!=="set"&&x(void 0)},children:a.jsxs(xe,{h:"36",children:[a.jsx(jr,{size:"sm",value:"unspecified",label:"unspecified"}),a.jsx(jr,{size:"sm",value:"reset",label:`reset to default (${e}kB)`}),a.jsxs(xe,{children:[a.jsx(jr,{size:"sm",value:"set",label:"Set to (kB)"}),a.jsx(Yr,{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=>{x(typeof j=="number"?j:void 0)}})]})]})}),a.jsx(xe,{justify:"center",children:a.jsx(dr,{size:"sm",loading:o,children:"Update"})})]})})}function Gne(){const e=Re(),[t,{open:n,close:r}]=Pl(!1),[o,s]=v.useState(""),[c,u]=v.useState(),[f,h]=v.useState(void 0),[m,g]=v.useState(0),[y,x]=v.useState(!1),[S,j]=v.useState(void 0),[C,T]=v.useState([]),[R,E]=v.useState(0);GN({medplum:e,onChange:T}),v.useEffect(()=>{x(!0),e.get("fhir/R4/$db-indexes?tableName="+encodeURIComponent(f??""),{cache:"no-cache"}).then(D=>{const P=D.parameter?.find(B=>B.name==="defaultGinPendingListLimit")?.valueInteger??0;g(P);const $=D.parameter?.filter(B=>B.name==="index");j($??[])}).finally(()=>{x(!1)}).catch(D=>{Ae({color:"red",message:D.message})})},[e,f,R]);const _=D=>{s("Configure results"),u(a.jsx("pre",{children:JSON.stringify(D,null,2)})),n(),E(P=>(P+1)%100)},k={onClick:D=>{s("Details"),u(a.jsx("pre",{children:D})),n()}};let I;return y?I="Loading...":f?S?.length===0&&(I="No GIN indexes on this table"):I="Select a table",a.jsxs(a.Fragment,{children:[a.jsxs(Le,{gap:"sm",children:[a.jsx("h2",{children:"Configure GIN indexes"}),a.jsx(xe,{children:a.jsx(qne,{defaultGinPendingListLimit:m,availableTables:C,onResponse:_})}),a.jsx("h2",{children:"GIN index stats"}),a.jsxs(xe,{children:[a.jsx(HN,{data:C,inputProps:{placeholder:"Table name",inputSize:"50"},onChange:D=>{h(D)}}),a.jsx(Oe,{loading:y,onClick:()=>E(D=>(D+1)%100),disabled:!f,children:"Refresh"})]}),a.jsx(te.ScrollContainer,{minWidth:500,children:a.jsxs(te,{striped:!0,highlightOnHover:!0,children:[a.jsx(te.Thead,{children:a.jsxs(te.Tr,{children:[a.jsx(te.Th,{children:"Schema"}),a.jsx(te.Th,{children:"Table"}),a.jsx(te.Th,{children:"Index"}),a.jsx(te.Th,{children:"fastupdate"}),a.jsx(te.Th,{children:"gin_pending_list_limit"}),a.jsx(te.Th,{children:"options"})]})}),a.jsxs(te.Tbody,{children:[I&&a.jsx(te.Tr,{children:a.jsx(te.Td,{colSpan:16,children:I})}),!I&&S?.map(D=>{const P=D.part??[],$=P.find(B=>B.name==="indexName")?.valueString;if(!$)throw new Error("Index missing name",{cause:D});return a.jsxs(te.Tr,{children:[a.jsx(te.Td,{children:P.find(B=>B.name==="schemaName")?.valueString}),a.jsx(te.Td,{children:P.find(B=>B.name==="tableName")?.valueString}),a.jsx(te.Td,{children:$}),a.jsx(wx,{value:P.find(B=>B.name==="fastUpdate")?.valueBoolean,defaultValue:a.jsxs(be,{span:!0,c:"dimmed",fs:"italic",children:["default (",qN(!0),")"]}),...k}),a.jsx(wx,{value:P.find(B=>B.name==="ginPendingListLimit")?.valueInteger,defaultValue:a.jsxs(be,{span:!0,c:"dimmed",fs:"italic",children:["default (",m,")"]}),...k}),a.jsx(wx,{value:P.find(B=>B.name==="indexOptions")?.valueString,defaultValue:a.jsx(be,{span:!0,c:"dimmed",fs:"italic",children:"NULL"}),...k})]},$)})]})]})})]}),a.jsx(In,{opened:t,onClose:r,title:o,centered:!0,size:"auto",children:c})]})}function wx({value:e,onClick:t,defaultValue:n}){return a.jsx(te.Td,{style:{cursor:"pointer"},onClick:()=>t?.(e),children:e===void 0?n:qN(e)})}const Wne=[{label:"GIN Indexes",value:"gin-indexes"},{label:"Column Statistics",value:"column-statistics"}];function x2(){const e=Re();return!e.isLoading()&&!e.isSuperAdmin()?a.jsx(fr,{outcome:vf}):a.jsx(xu,{maw:"100%",children:a.jsxs(Bl,{children:[a.jsx(Ve,{order:1,children:"Database Tools"}),a.jsxs(Af,{baseUrl:"/admin/super/db",tabs:Wne,children:[a.jsx(jn.Panel,{value:"gin-indexes",pt:"md",children:a.jsx(Gne,{})}),a.jsx(jn.Panel,{value:"column-statistics",pt:"md",children:a.jsx(Bne,{})})]})]})})}function Qne(e){return a.jsx(Vl,{resourceType:"UserConfiguration",name:e.name,defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{Qo(t)?e.onChange(Yt(t)):e.onChange(void 0)}})}function Yne(){const{membershipId:e}=qt(),t=Re(),n=Os(t),r=Yn(),o=t.get(`admin/projects/${n}/members/${e}`).read(),[s,c]=v.useState(o.accessPolicy),[u,f]=v.useState(o.userConfiguration),[h,m]=v.useState(o.admin),[g,y]=v.useState(),[x,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(Wt(C)))}return a.jsxs(a.Fragment,{children:[a.jsx(Ve,{children:"Edit membership"}),a.jsx("h3",{children:a.jsx(qc,{value:o.profile,link:!0})}),a.jsxs(pt,{onSubmit:()=>{const C={...o,accessPolicy:s,userConfiguration:u,admin:h};t.post(`admin/projects/${n}/members/${e}`,C).then(()=>S(!0)).catch(T=>y(Wt(T)))},children:[!x&&a.jsxs(Le,{children:[a.jsx(Ut,{title:"Access Policy",htmlFor:"accessPolicy",outcome:g,children:a.jsx(Sg,{name:"accessPolicy",defaultValue:s,onChange:c})}),a.jsx(Ut,{title:"User Configuration",htmlFor:"userConfiguration",outcome:g,children:a.jsx(Qne,{name:"userConfiguration",defaultValue:u,onChange:f})}),a.jsx(Ut,{title:"Admin",htmlFor:"admin",outcome:g,children:a.jsx(cn,{id:"admin",name:"admin",defaultChecked:h,onChange:C=>m(C.currentTarget.checked)})}),a.jsxs(xe,{justify:"flex-end",mt:"xl",children:[a.jsx(Oe,{type:"submit",children:"Save"}),a.jsx(Oe,{type:"button",color:"red",variant:"outline",onClick:j,children:"Remove user"})]})]}),x&&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(St,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function Kne(){const e=Re(),[t,n]=v.useState(e.getProject()),[r,o]=v.useState(),[s,c]=v.useState(),[u,f]=v.useState(!1),[h,m]=v.useState(void 0),g=v.useCallback(y=>{const x={resourceType:y.resourceType,firstName:y.firstName,lastName:y.lastName,email:y.email,sendEmail:y.sendEmail==="on",accessPolicy:r,admin:y.isAdmin==="on",scope:y.isProjectScoped==="on"?"project":"server",mfaRequired:y.mfaRequired==="on"};return e.invite(t?.id,x).then(S=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),yf(S)?c(S):m(S),f(x.sendEmail??!1),Ae({color:"green",message:"Invite success"})}).catch(S=>{Ae({color:"red",message:Ge(S),autoClose:!1}),c(Wt(S))})},[e,t,r]);return a.jsxs(pt,{onSubmit:g,children:[!h&&!s&&a.jsxs(Le,{children:[a.jsx(Ve,{children:"Invite new member"}),e.isSuperAdmin()&&a.jsx(Ut,{title:"Project",htmlFor:"project",outcome:s,children:a.jsx(Vl,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),a.jsx(dn,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:$t(s,"resourceType")}),a.jsx(He,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:$t(s,"firstName")}),a.jsx(He,{name:"lastName",label:"Last Name",required:!0,error:$t(s,"lastName")}),a.jsx(He,{name:"email",type:"email",label:"Email",required:!0,error:$t(s,"email")}),a.jsx(Ut,{title:"Access Policy",htmlFor:"accessPolicy",outcome:s,children:a.jsx(Sg,{name:"accessPolicy",onChange:o})}),a.jsx(cn,{name:"sendEmail",label:"Send email",defaultChecked:!0}),a.jsx(cn,{name:"isAdmin",label:"Admin"}),a.jsx(cn,{name:"isProjectScoped",label:"Project scoped"}),a.jsx(cn,{name:"mfaRequired",label:"MFA required"}),a.jsx(xe,{justify:"flex-end",children:a.jsx(dr,{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(St,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),h&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(be,{children:"User created"}),u&&a.jsx(be,{children:"Email sent"}),a.jsxs(Or,{children:[a.jsx(Or.Item,{children:a.jsx(St,{to:h,children:"Go to new membership"})}),a.jsx(Or.Item,{children:a.jsx(St,{to:h.profile,children:"Go to new profile"})}),a.jsx(Or.Item,{children:a.jsx(St,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function Xne(){return a.jsxs(a.Fragment,{children:[a.jsx(Ve,{children:"Patients"}),a.jsx(bg,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),a.jsx(xe,{justify:"flex-end",children:a.jsx(St,{to:"/admin/invite",children:"Invite new patient"})})]})}function Jne(){const e=Re();if(!e.isLoading()&&!e.isProjectAdmin())return a.jsx(fr,{outcome:vf});function t(n){e.post("admin/projects/setpassword",n).then(()=>Ae({color:"green",message:"Done"})).catch(r=>Ae({color:"red",message:Ge(r),autoClose:!1}))}return a.jsxs(ut,{width:600,children:[a.jsx(Ve,{order:1,children:"Project Admin"}),a.jsx(wn,{my:"lg"}),a.jsx(Ve,{order:2,children:"Force Set Password"}),a.jsx(be,{children:"Sets the password for the specified user in this project."}),a.jsx(be,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),a.jsx(pt,{onSubmit:t,children:a.jsxs(Le,{children:[a.jsx(He,{name:"email",label:"Email",required:!0}),a.jsx(oo,{name:"password",label:"Password",required:!0}),a.jsx(Oe,{type:"submit",children:"Force Set Password"})]})})]})}function b2(){const e=Re(),t=Os(e),n=e.get(`admin/projects/${t}`).read();return a.jsxs(a.Fragment,{children:[a.jsx(Ve,{children:"Details"}),a.jsxs(Rf,{children:[a.jsx(Ir,{term:"ID",children:n.project.id}),a.jsx(Ir,{term:"Name",children:n.project.name})]})]})}const Zne=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function ere(){const e=Re(),t=Os(e),n=v.useMemo(()=>e.get("admin/projects/"+t).read(),[e,t]);return a.jsxs(a.Fragment,{children:[a.jsxs(Mr,{children:[a.jsx(yt,{children:a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Project"}),a.jsx(yt.Value,{children:n.project.name})]})}),a.jsx(Jr,{children:a.jsx(Af,{baseUrl:"/admin",tabs:Zne})})]}),a.jsx(ut,{children:a.jsx(h1,{})})]})}function tre(){const e=Re(),t=Os(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(pi(n.project.secret||[]))},[e,n]),!r||!s?a.jsx("div",{children:"Loading..."}):a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:u=>{u.preventDefault(),e.post(`admin/projects/${t}/secrets`,s).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>Ae({color:"green",message:"Saved"})).catch(console.log)},children:[a.jsx(Ve,{children:"Project Secrets"}),a.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),a.jsx(_f,{property:ks("Project","secret"),name:"secret",path:"Project.secret",defaultValue:s,onChange:c,outcome:void 0}),a.jsx(Oe,{type:"submit",children:"Save"})]})}function nre(){const e=Re(),t=Os(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(pi(n.project.site||[]))},[e,n]),!r||!s?a.jsx("div",{children:"Loading..."}):a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:u=>{u.preventDefault(),e.post(`admin/projects/${t}/sites`,s).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>Ae({color:"green",message:"Saved"})).catch(f=>{const h=Wt(f);Ae({color:"red",message:`Error ${h.issue?.[0].details?.text} ${h.issue?.[0].expression?.[0]}`,autoClose:!1})})},children:[a.jsx(Ve,{children:"Project Sites"}),a.jsx("p",{children:"Use project sites configure your project on a separate domain."}),a.jsx(_f,{property:ks("Project","site"),name:"site",path:"Project.site",defaultValue:s,onChange:c,outcome:void 0}),a.jsx(Oe,{type:"submit",children:"Save"})]})}const rre=[{label:"Post-deploy Migrations",value:"migrations"},{label:"System AsyncJob",value:"asyncjob"}];function S2(){const e=Re();return!e.isLoading()&&!e.isSuperAdmin()?a.jsx(fr,{outcome:vf}):a.jsx(xu,{miw:"1600",maw:"2000",children:a.jsxs(Bl,{children:[a.jsx(Ve,{order:1,children:"AsyncJob Dashboard"}),a.jsxs(Af,{baseUrl:"/admin/super/asyncjob",tabs:rre,keepMounted:!1,children:[a.jsx(jn.Panel,{value:"asyncjob",pt:"md",children:a.jsx(ore,{})}),a.jsx(jn.Panel,{value:"migrations",pt:"md",children:a.jsx(sre,{})})]})]})})}const ire={resourceType:"AsyncJob",fields:["id","_lastUpdated","request","status","type"],filters:[{code:"_project",operator:he.MISSING,value:"true"}],sortRules:[{code:"_lastUpdated",descending:!0}]};function ore(){const e=Yn(),[t]=v.useState(ire);return a.jsxs(Le,{children:[a.jsx(St,{to:`/${t.resourceType}/${ys(t)}`,children:"Show in search page"}),a.jsx(bu,{checkboxesEnabled:!1,search:t,onClick:n=>e(w2(n.resource))?.catch(console.error),onAuxClick:n=>window.open(w2(n.resource),"_blank")})]})}const are={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 sre(){const e=Re(),[t,n]=v.useState(),[r,o]=v.useState(),[s,c]=v.useState([]),[u,f]=v.useState(0),[h,m]=v.useState([]);v.useEffect(()=>{const j="info";m(C=>C.includes(j)?C:[...C,j]),e.get("admin/super/migrations",{cache:"no-cache"}).then(C=>{C.postDeployMigrations.sort((T,R)=>R-T),n(C)}).catch(C=>{Ae({color:"red",message:Ge(C),autoClose:!1})}).finally(()=>m(C=>C.filter(T=>T!==j)))},[e,u]),v.useEffect(()=>{const j="jobs";m(C=>C.includes(j)?C:[...C,j]),e.requestSchema("AsyncJob").then(()=>e.search("AsyncJob",ys({...are,total:"accurate",fields:void 0}),{cache:"no-cache"}).then(C=>{o(C.entry?.map(T=>T.resource))})).catch(C=>{o(void 0),Ae({color:"red",message:Ge(C),autoClose:!1})}).finally(()=>m(C=>C.filter(T=>T!==j)))},[e,u]);function g(){f(j=>j+1)}function y(j){v1(e,"Run pending post-deploy migration","admin/super/migrate",{dataVersion:j}).finally(()=>{g()}).catch(()=>{}),g()}const x=h.length>0;function S(j,{isLoading:C}){return a.jsxs("div",{style:{position:"relative"},children:[a.jsx(Em,{visible:C}),a.jsxs(te,{children:[a.jsx(te.Thead,{children:a.jsxs(te.Tr,{children:[a.jsx(te.Th,{children:"Version"}),a.jsx(te.Th,{children:"Action"}),a.jsx(te.Th,{children:"Status"}),a.jsx(te.Th,{children:"AsyncJob"}),a.jsx(te.Th,{children:"Last Updated"}),a.jsx(te.Th,{children:"Request Time"}),a.jsx(te.Th,{children:"Duration"}),a.jsx(te.Th,{children:"Attempts"})]})}),a.jsx(te.Tbody,{children:j()})]})]})}return a.jsxs(a.Fragment,{children:[a.jsx(Oe,{size:"xs",mb:"xs",variant:"subtle",leftSection:a.jsx(oP,{size:14}),onClick:g,loading:x,children:"Refresh"}),S(()=>{if(!x){if(!t)return a.jsx(te.Tr,{children:a.jsx(te.Td,{colSpan:6,children:"Failed to load migration info"})});if(!r)return a.jsx(te.Tr,{children:a.jsx(te.Td,{colSpan:6,children:"Failed to load async jobs"})})}return!t||!r?null:t.postDeployMigrations?.map(j=>{const{status:C,asyncJob:T,asyncJobs:R}=lre(j,r??[],t?.pendingPostDeployMigration),E=s.includes(j),_=j===t?.pendingPostDeployMigration&&(!T||T?.status==="error"),k=[a.jsxs(te.Tr,{children:[a.jsx(te.Td,{children:j}),a.jsx(te.Td,{children:_&&a.jsx(Oe,{color:"green",size:"xs",onClick:()=>y(j),children:"Start"})}),a.jsx(te.Td,{children:C}),a.jsx(te.Td,{children:T&&a.jsx(St,{to:`/AsyncJob/${T?.id}`,children:T?.id})}),a.jsx(te.Td,{children:T?.meta?.lastUpdated}),a.jsx(te.Td,{children:T?.requestTime}),a.jsx(te.Td,{children:j2(T)}),a.jsx(te.Td,{display:"flex",children:a.jsxs(xe,{gap:"xs",children:[R.length?R.length:"",E&&R.length>1&&a.jsx(Oe,{leftSection:a.jsx(TG,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(I=>I.includes(j)?I.filter(D=>D!==j):I),children:"Hide all"}),!E&&R.length>1&&a.jsx(Oe,{leftSection:a.jsx(zG,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(I=>I.includes(j)?I:[...I,j]),children:"Show all"})]})})]},j)];return E&&k.push(...R.filter(I=>I.id!==T?.id).map(I=>a.jsxs(te.Tr,{bg:"gray.1",children:[a.jsx(te.Td,{children:j}),a.jsx(te.Td,{}),a.jsx(te.Td,{children:I.status}),a.jsx(te.Td,{children:a.jsx(St,{to:`/AsyncJob/${I.id}`,children:I.id})}),a.jsx(te.Td,{children:I.meta?.lastUpdated}),a.jsx(te.Td,{children:I.requestTime}),a.jsx(te.Td,{children:j2(I)}),a.jsx(te.Td,{})]},I.id))),k})},{isLoading:x})]})}function lre(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 w2(e){return`/${e.resourceType}/${e.id}`}function j2(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 cre(){const e=Re(),[t,{open:n,close:r}]=Pl(!1),[o,s]=v.useState(""),[c,u]=v.useState();if(!e.isLoading()&&!e.isSuperAdmin())return a.jsx(fr,{outcome:vf});function f(){Mc(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function h(){Mc(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function m(){Mc(e,"Rebuilding Value Sets","admin/super/valuesets")}function g(_){Mc(e,"Reindexing Resources","admin/super/reindex",_)}function y(){Mc(e,"Reload Cron Resources","admin/super/reloadcron")}function x(_){e.post("admin/super/removebotidjobsfromqueue",_).then(()=>Ae({color:"green",message:"Done"})).catch(k=>Ae({color:"red",message:Ge(k),autoClose:!1}))}function S(_){e.post("admin/super/purge",{..._,before:GS(_.before)}).then(()=>Ae({color:"green",message:"Done"})).catch(k=>Ae({color:"red",message:Ge(k),autoClose:!1}))}function j(_){e.post("admin/super/setpassword",_).then(()=>Ae({color:"green",message:"Done"})).catch(k=>Ae({color:"red",message:Ge(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"),u(a.jsx("pre",{children:k.parameter?.find(I=>I.name==="tableString")?.valueString})),n()}).catch(k=>Ae({color:"red",message:Ge(k),autoClose:!1}))}function T(){e.post("fhir/R4/$db-invalid-indexes").then(_=>{s("Database Invalid Indexes"),u(a.jsx("pre",{children:_.parameter?.filter(k=>k.name==="invalidIndex").map(k=>k.valueString).join(`
|
|
218
|
-
`)})),n()}).catch(_=>Ae({color:"red",message:Ge(_),autoClose:!1}))}function R(){e.post("fhir/R4/$db-schema-diff").then(_=>{s("Schema Diff"),u(a.jsx("pre",{children:_.parameter?.find(k=>k.name==="migrationString")?.valueString})),n()}).catch(_=>Ae({color:"red",message:Ge(_),autoClose:!1}))}function E(){Mc(e,"Reconcile Schema Diff","admin/super/reconcile-db-schema-drift")}return a.jsxs(ut,{width:600,children:[a.jsx(Ve,{order:1,children:"Super Admin"}),a.jsx(wn,{my:"lg"}),a.jsx(Ve,{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(pt,{children:a.jsx(Oe,{onClick:f,children:"Rebuild StructureDefinitions"})}),a.jsx(wn,{my:"lg"}),a.jsx(Ve,{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(pt,{children:a.jsx(Oe,{onClick:h,children:"Rebuild SearchParameters"})}),a.jsx(wn,{my:"lg"}),a.jsx(Ve,{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(pt,{children:a.jsx(Oe,{onClick:m,children:"Rebuild ValueSets"})}),a.jsx(wn,{my:"lg"}),a.jsx(Ve,{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(dre,{onSubmit:g}),a.jsx(wn,{my:"lg"}),a.jsx(Ve,{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(pt,{onSubmit:S,children:a.jsxs(Le,{children:[a.jsx(Ut,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:a.jsx(dn,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),a.jsx(Ut,{title:"Purge Before",htmlFor:"before",children:a.jsx(Lo,{name:"before",placeholder:"Before Date"})}),a.jsx(Oe,{type:"submit",children:"Purge"})]})}),a.jsx(wn,{my:"lg"}),a.jsx(Ve,{order:2,children:"Remove Bot ID Jobs from Queue"}),a.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),a.jsx(pt,{onSubmit:x,children:a.jsxs(Le,{children:[a.jsx(Ut,{title:"Bot ID",children:a.jsx(He,{name:"botId",placeholder:"Bot Id"})}),a.jsx(Oe,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),a.jsx(wn,{my:"lg"}),a.jsx(Ve,{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(pt,{onSubmit:j,children:a.jsxs(Le,{children:[a.jsx(He,{name:"email",label:"Email",required:!0}),a.jsx(oo,{name:"password",label:"Password",required:!0}),a.jsx(He,{name:"projectId",label:"Project ID"}),a.jsx(Oe,{type:"submit",children:"Force Set Password"})]})}),a.jsx(wn,{my:"lg"}),a.jsx(Ve,{order:2,children:"Database Stats"}),a.jsx("p",{children:"Query current table statistics from the database."}),a.jsx(pt,{onSubmit:C,children:a.jsxs(Le,{children:[a.jsx(Ut,{title:"Table Names (comma-delimited)",htmlFor:"tableNames",children:a.jsx(He,{id:"tableNames",name:"tableNames",placeholder:"Observation,Observation_History"})}),a.jsx(Oe,{type:"submit",children:"Get Database Stats"})]})}),a.jsx(wn,{my:"lg"}),a.jsx(Ve,{order:2,children:"Database Invalid Indexes"}),a.jsx("p",{children:"Query invalid indexes from the database."}),a.jsx(pt,{onSubmit:T,children:a.jsx(Le,{children:a.jsx(Oe,{type:"submit",children:"Get Database Invalid Indexes"})})}),a.jsx(wn,{my:"lg"}),a.jsx(Ve,{order:2,children:"Database Schema Drift"}),a.jsx("p",{children:"Show the schema migration needed to match the expected database schema."}),a.jsxs(kn,{children:[a.jsx(kn.Col,{span:6,children:a.jsx(pt,{onSubmit:R,children:a.jsx(Le,{children:a.jsx(Oe,{type:"submit",children:"Get Schema Drift"})})})}),a.jsx(kn.Col,{span:6,children:a.jsx(pt,{onSubmit:E,children:a.jsx(Le,{children:a.jsx(Oe,{type:"submit",children:"Reconcile Schema Drift"})})})})]}),a.jsx(wn,{my:"lg"}),a.jsx(Ve,{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(pt,{onSubmit:y,children:a.jsx(Le,{children:a.jsx(Oe,{type:"submit",children:"Reload Cron Resources"})})}),a.jsx(wn,{my:"lg"}),a.jsx(Ve,{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(fre,{setModalTitle:s,setModalContent:u,openModal:n}),a.jsx(In,{opened:t,onClose:r,title:o,centered:!0,size:"auto",children:c})]})}function ure(){const[e,t]=v.useState("outdated");return a.jsxs(a.Fragment,{children:[a.jsx(dn,{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(Yr,{required:!0,name:"maxResourceVersion",placeholder:"Max Resource Version",min:0})]})}function dre({onSubmit:e}){const[t,n]=v.useState(!1);function r(o){const s={};for(const[c,u]of Object.entries(o))u!==""&&(s[c]=u);e(s)}return a.jsx(pt,{onSubmit:r,children:a.jsxs(Le,{children:[a.jsx(Ut,{title:"Resource Type",htmlFor:"resourceType",children:a.jsx(He,{id:"resourceType",name:"resourceType",placeholder:"Reindex Resource Type"})}),a.jsx(Ut,{title:"Search Filter",htmlFor:"filter",children:a.jsx(He,{id:"filter",name:"filter",placeholder:"e.g. name=Sam&birthdate=lt2000-01-01"})}),a.jsx(Ut,{title:"Max Resource Version",htmlFor:"maxResourceVersion",children:a.jsx(ure,{})}),a.jsx(Oe,{variant:"subtle",size:"xs",onClick:()=>n(!t),children:t?"Hide Advanced Options":"Show Advanced Options"}),t&&a.jsx(Le,{gap:"sm",children:a.jsxs(kn,{children:[a.jsx(kn.Col,{span:6,children:a.jsx(Yr,{name:"batchSize",label:"Resources per batch",description:a.jsx("span",{children:"default: 500"}),placeholder:"500",min:20,max:1e3})}),a.jsx(kn.Col,{span:6,children:a.jsx(Yr,{name:"searchStatementTimeout",label:"Search query timeout (ms)",description:a.jsx("span",{children:"default: 3,600,000 (1 hour)"}),placeholder:"3600000",min:1e3})}),a.jsx(kn.Col,{span:6,children:a.jsx(Yr,{name:"upsertStatementTimeout",label:"Upsert query timeout (ms)",description:a.jsx("span",{children:"default: server `database.queryTimeout`"}),placeholder:"database.queryTimeout",min:1e3})}),a.jsx(kn.Col,{span:6,children:a.jsx(Yr,{name:"delayBetweenBatches",label:"Delay between batches (ms)",description:a.jsx("span",{children:"default: 0"}),placeholder:"0",min:0,max:6e4})}),a.jsx(kn.Col,{span:6,children:a.jsx(Yr,{name:"progressLogThreshold",label:"Log progress every N resources",description:a.jsx("span",{children:"default: 50,000"}),placeholder:"50000",min:1})}),a.jsx(kn.Col,{span:6,children:a.jsx(Yr,{name:"endTimestampBufferMinutes",label:"End timestamp buffer (minutes)",description:a.jsx("span",{children:"default: 5"}),placeholder:"5",min:1})}),a.jsx(kn.Col,{span:6,children:a.jsx(Yr,{name:"maxIterationAttempts",label:"Max iteration attempts",description:a.jsx("span",{children:"default: 3"}),placeholder:"3",min:1,max:20})})]})}),a.jsx(Oe,{type:"submit",children:"Reindex"})]})})}function fre({setModalTitle:e,setModalContent:t,openModal:n}){const r=Re(),[o,s]=v.useState(),[c,u]=v.useState(),[f,h]=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){h(void 0);return}r.searchResources("ProjectMembership",{profile:c?.reference,project:o?.reference,_count:20}).then(j=>{h(j),j.length===1&&g(Yt(j[0]))}).catch(j=>{console.error(j),Ae({color:"red",message:Ge(j),autoClose:!1})})},[r,c,o]);const x=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){Ae({color:"red",message:"Query is required",autoClose:!1});return}const C=j.onBehalfOfProjectMembership;delete j.onBehalfOfProjectMembership;const T={query:j.query,analyze:j.analyze==="on",format:"text"},R={};C&&(R["x-medplum-on-behalf-of"]=C),r.post("fhir/R4/$explain",T,void 0,{headers:R}).then(E=>{e("Database Explain");const _=E.parameter?.find(P=>P.name==="explain")?.valueString,k=E.parameter?.find(P=>P.name==="query")?.valueString,I=E.parameter?.find(P=>P.name==="parameters")?.valueString,D=[k,I,`
|
|
219
|
-
`,_].join(`
|
|
220
|
-
`);t(a.jsx(lf,{block:!0,maw:"100%",children:D})),n()}).catch(E=>{Ae({color:"red",message:Ge(E),autoClose:!1})})}return!r.isLoading()&&!r.isSuperAdmin()?a.jsx(fr,{outcome:vf}):a.jsx(pt,{onSubmit:S,children:a.jsxs(Le,{children:[a.jsx(He,{name:"query",label:"Search",required:!0,placeholder:"Observation?code=85354-9&_sort=-date&_count=5"}),a.jsx(cn,{name:"analyze",label:"Analyze"}),a.jsx(nf,{label:"On Behalf Of",children:a.jsxs(Le,{gap:"sm",children:[a.jsx(bs,{required:!0,placeholder:"Project",targetTypes:["Project"],name:"onBehalfOfProject",onChange:s}),a.jsx(bs,{required:!0,placeholder:"Practitioner or Patient",name:"onBehalfOfProfile",targetTypes:["Practitioner","Patient"],onChange:u,searchCriteria:y}),f?.length!==1&&a.jsx(bs,{required:!0,placeholder:"ProjectMembership",name:"onBehalfOfProjectMembership",targetTypes:["ProjectMembership"],onChange:g,searchCriteria:x}),f?.length===1&&a.jsxs(a.Fragment,{children:[a.jsx("input",{type:"hidden",name:"onBehalfOfProjectMembership",value:zt(f[0])}),a.jsx(Qp,{value:Yt(f[0])})]}),!m&&a.jsx(be,{fs:"italic",children:"On Behalf Of not set. Running as super admin"})]})}),a.jsx(Oe,{type:"submit",children:"Explain Search"})]})})}function hre(){return a.jsxs(a.Fragment,{children:[a.jsx(Ve,{children:"Users"}),a.jsx(bg,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(xe,{justify:"flex-end",children:a.jsx(St,{to:"/admin/invite",children:"Invite new user"})})]})}const pre=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 ou(e,t,n){const r=mre(e),{webkitRelativePath:o}=e,s=typeof t=="string"?t:typeof o=="string"&&o.length>0?o:`./${e.name}`;return typeof r.path!="string"&&C2(r,"path",s),C2(r,"relativePath",s),r}function mre(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),o=pre.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}function C2(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const gre=[".DS_Store","Thumbs.db"];function vre(e){return Al(this,void 0,void 0,function*(){return nm(e)&&yre(e.dataTransfer)?wre(e.dataTransfer,e.type):xre(e)?bre(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?Sre(e):[]})}function yre(e){return nm(e)}function xre(e){return nm(e)&&nm(e.target)}function nm(e){return typeof e=="object"&&e!==null}function bre(e){return mb(e.target.files).map(t=>ou(t))}function Sre(e){return Al(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>ou(n))})}function wre(e,t){return Al(this,void 0,void 0,function*(){if(e.items){const n=mb(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(jre));return E2(WN(r))}return E2(mb(e.files).map(n=>ou(n)))})}function E2(e){return e.filter(t=>gre.indexOf(t.name)===-1)}function mb(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 jre(e){if(typeof e.webkitGetAsEntry!="function")return T2(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?QN(t):T2(e,t)}function WN(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?WN(n):[n]],[])}function T2(e,t){return Al(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,ou(c)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return ou(r,(n=t?.fullPath)!==null&&n!==void 0?n:void 0)})}function Cre(e){return Al(this,void 0,void 0,function*(){return e.isDirectory?QN(e):Ere(e)})}function QN(e){const t=e.createReader();return new Promise((n,r)=>{const o=[];function s(){t.readEntries(c=>Al(this,void 0,void 0,function*(){if(c.length){const u=Promise.all(c.map(Cre));o.push(u),s()}else try{const u=yield Promise.all(o);n(u)}catch(u){r(u)}}),c=>{r(c)})}s()})}function Ere(e){return Al(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const o=ou(r,e.fullPath);t(o)},r=>{n(r)})})})}var dp={},R2;function Tre(){return R2||(R2=1,dp.__esModule=!0,dp.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 u=c.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?s===u.replace(/\/.*$/,""):o===u})}return!0}),dp}var Rre=Tre();const jx=om(Rre);function _2(e){return Are(e)||Dre(e)||KN(e)||_re()}function _re(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
221
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Are(e){if(Array.isArray(e))return gb(e)}function D2(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 A2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?D2(Object(n),!0).forEach(function(r){YN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YN(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yd(e,t){return Nre(e)||Pre(e,t)||KN(e,t)||kre()}function kre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
222
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KN(e,t){if(e){if(typeof e=="string")return gb(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 gb(e,t)}}function gb(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 Pre(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,u;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,u=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function Nre(e){if(Array.isArray(e))return e}var Ore=typeof jx=="function"?jx:jx.default,Mre="file-invalid-type",Lre="file-too-large",Ire="file-too-small",zre="too-many-files",$re=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:Mre,message:"File type must be ".concat(r)}},k2=function(t){return{code:Lre,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},P2=function(t){return{code:Ire,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},Ure={code:zre,message:"Too many files"};function XN(e,t){var n=e.type==="application/x-moz-file"||Ore(e,t);return[n,n?null:$re(t)]}function JN(e,t,n){if(ll(e.size))if(ll(t)&&ll(n)){if(e.size>n)return[!1,k2(n)];if(e.size<t)return[!1,P2(t)]}else{if(ll(t)&&e.size<t)return[!1,P2(t)];if(ll(n)&&e.size>n)return[!1,k2(n)]}return[!0,null]}function ll(e){return e!=null}function Bre(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,c=e.maxFiles,u=e.validator;return!s&&t.length>1||s&&c>=1&&t.length>c?!1:t.every(function(f){var h=XN(f,n),m=Yd(h,1),g=m[0],y=JN(f,r,o),x=Yd(y,1),S=x[0],j=u?u(f):null;return g&&S&&!j})}function rm(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function fp(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 N2(e){e.preventDefault()}function Vre(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Fre(e){return e.indexOf("Edge/")!==-1}function Hre(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Vre(e)||Fre(e)}function jo(){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(u){return!rm(r)&&u&&u.apply(void 0,[r].concat(s)),rm(r)})}}function qre(){return"showOpenFilePicker"in window}function Gre(e){if(ll(e)){var t=Object.entries(e).filter(function(n){var r=Yd(n,2),o=r[0],s=r[1],c=!0;return ZN(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(eO))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),c=!1),c}).reduce(function(n,r){var o=Yd(r,2),s=o[0],c=o[1];return A2(A2({},n),{},YN({},s,c))},{});return[{description:"Files",accept:t}]}return e}function Wre(e){if(ll(e))return Object.entries(e).reduce(function(t,n){var r=Yd(n,2),o=r[0],s=r[1];return[].concat(_2(t),[o],_2(s))},[]).filter(function(t){return ZN(t)||eO(t)}).join(",")}function Qre(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function Yre(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function ZN(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function eO(e){return/^.*\.[\w]+$/.test(e)}var Kre=["children"],Xre=["open"],Jre=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Zre=["refKey","onChange","onClick"];function eie(e){return rie(e)||nie(e)||tO(e)||tie()}function tie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
223
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rie(e){if(Array.isArray(e))return vb(e)}function Cx(e,t){return aie(e)||oie(e,t)||tO(e,t)||iie()}function iie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
224
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tO(e,t){if(e){if(typeof e=="string")return vb(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 vb(e,t)}}function vb(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 oie(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,u;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,u=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function aie(e){if(Array.isArray(e))return e}function O2(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 On(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?O2(Object(n),!0).forEach(function(r){yb(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function im(e,t){if(e==null)return{};var n=sie(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 sie(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 y1=v.forwardRef(function(e,t){var n=e.children,r=im(e,Kre),o=rO(r),s=o.open,c=im(o,Xre);return v.useImperativeHandle(t,function(){return{open:s}},[s]),Mn.createElement(v.Fragment,null,n(On(On({},c),{},{open:s})))});y1.displayName="Dropzone";var nO={disabled:!1,getFilesFromEvent:vre,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};y1.defaultProps=nO;y1.propTypes={children:ln.func,accept:ln.objectOf(ln.arrayOf(ln.string)),multiple:ln.bool,preventDropOnDocument:ln.bool,noClick:ln.bool,noKeyboard:ln.bool,noDrag:ln.bool,noDragEventsBubbling:ln.bool,minSize:ln.number,maxSize:ln.number,maxFiles:ln.number,disabled:ln.bool,getFilesFromEvent:ln.func,onFileDialogCancel:ln.func,onFileDialogOpen:ln.func,useFsAccessApi:ln.bool,autoFocus:ln.bool,onDragEnter:ln.func,onDragLeave:ln.func,onDragOver:ln.func,onDrop:ln.func,onDropAccepted:ln.func,onDropRejected:ln.func,onError:ln.func,validator:ln.func};var xb={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function rO(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=On(On({},nO),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,c=t.minSize,u=t.multiple,f=t.maxFiles,h=t.onDragEnter,m=t.onDragLeave,g=t.onDragOver,y=t.onDrop,x=t.onDropAccepted,S=t.onDropRejected,j=t.onFileDialogCancel,C=t.onFileDialogOpen,T=t.useFsAccessApi,R=t.autoFocus,E=t.preventDropOnDocument,_=t.noClick,k=t.noKeyboard,I=t.noDrag,D=t.noDragEventsBubbling,P=t.onError,$=t.validator,B=v.useMemo(function(){return Wre(n)},[n]),W=v.useMemo(function(){return Gre(n)},[n]),Y=v.useMemo(function(){return typeof C=="function"?C:M2},[C]),Z=v.useMemo(function(){return typeof j=="function"?j:M2},[j]),U=v.useRef(null),G=v.useRef(null),M=v.useReducer(lie,xb),L=Cx(M,2),z=L[0],V=L[1],K=z.isFocused,O=z.isFileDialogActive,F=v.useRef(typeof window<"u"&&window.isSecureContext&&T&&qre()),se=function(){!F.current&&O&&setTimeout(function(){if(G.current){var qe=G.current.files;qe.length||(V({type:"closeDialog"}),Z())}},300)};v.useEffect(function(){return window.addEventListener("focus",se,!1),function(){window.removeEventListener("focus",se,!1)}},[G,O,Z,F]);var de=v.useRef([]),ye=function(qe){U.current&&U.current.contains(qe.target)||(qe.preventDefault(),de.current=[])};v.useEffect(function(){return E&&(document.addEventListener("dragover",N2,!1),document.addEventListener("drop",ye,!1)),function(){E&&(document.removeEventListener("dragover",N2),document.removeEventListener("drop",ye))}},[U,E]),v.useEffect(function(){return!r&&R&&U.current&&U.current.focus(),function(){}},[U,R,r]);var je=v.useCallback(function(pe){P?P(pe):console.error(pe)},[P]),Ee=v.useCallback(function(pe){pe.preventDefault(),pe.persist(),Ie(pe),de.current=[].concat(eie(de.current),[pe.target]),fp(pe)&&Promise.resolve(o(pe)).then(function(qe){if(!(rm(pe)&&!D)){var Ce=qe.length,ke=Ce>0&&Bre({files:qe,accept:B,minSize:c,maxSize:s,multiple:u,maxFiles:f,validator:$}),kt=Ce>0&&!ke;V({isDragAccept:ke,isDragReject:kt,isDragActive:!0,type:"setDraggedFiles"}),h&&h(pe)}}).catch(function(qe){return je(qe)})},[o,h,je,D,B,c,s,u,f,$]),Ke=v.useCallback(function(pe){pe.preventDefault(),pe.persist(),Ie(pe);var qe=fp(pe);if(qe&&pe.dataTransfer)try{pe.dataTransfer.dropEffect="copy"}catch{}return qe&&g&&g(pe),!1},[g,D]),De=v.useCallback(function(pe){pe.preventDefault(),pe.persist(),Ie(pe);var qe=de.current.filter(function(ke){return U.current&&U.current.contains(ke)}),Ce=qe.indexOf(pe.target);Ce!==-1&&qe.splice(Ce,1),de.current=qe,!(qe.length>0)&&(V({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),fp(pe)&&m&&m(pe))},[U,m,D]),dt=v.useCallback(function(pe,qe){var Ce=[],ke=[];pe.forEach(function(kt){var pn=XN(kt,B),mn=Cx(pn,2),Kn=mn[0],nn=mn[1],Sr=JN(kt,c,s),Qt=Cx(Sr,2),hr=Qt[0],zn=Qt[1],vi=$?$(kt):null;if(Kn&&hr&&!vi)Ce.push(kt);else{var Ko=[nn,zn];vi&&(Ko=Ko.concat(vi)),ke.push({file:kt,errors:Ko.filter(function(La){return La})})}}),(!u&&Ce.length>1||u&&f>=1&&Ce.length>f)&&(Ce.forEach(function(kt){ke.push({file:kt,errors:[Ure]})}),Ce.splice(0)),V({acceptedFiles:Ce,fileRejections:ke,isDragReject:ke.length>0,type:"setFiles"}),y&&y(Ce,ke,qe),ke.length>0&&S&&S(ke,qe),Ce.length>0&&x&&x(Ce,qe)},[V,u,B,c,s,f,y,x,S,$]),Ct=v.useCallback(function(pe){pe.preventDefault(),pe.persist(),Ie(pe),de.current=[],fp(pe)&&Promise.resolve(o(pe)).then(function(qe){rm(pe)&&!D||dt(qe,pe)}).catch(function(qe){return je(qe)}),V({type:"reset"})},[o,dt,je,D]),rt=v.useCallback(function(){if(F.current){V({type:"openDialog"}),Y();var pe={multiple:u,types:W};window.showOpenFilePicker(pe).then(function(qe){return o(qe)}).then(function(qe){dt(qe,null),V({type:"closeDialog"})}).catch(function(qe){Qre(qe)?(Z(qe),V({type:"closeDialog"})):Yre(qe)?(F.current=!1,G.current?(G.current.value=null,G.current.click()):je(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."))):je(qe)});return}G.current&&(V({type:"openDialog"}),Y(),G.current.value=null,G.current.click())},[V,Y,Z,T,dt,je,W,u]),nt=v.useCallback(function(pe){!U.current||!U.current.isEqualNode(pe.target)||(pe.key===" "||pe.key==="Enter"||pe.keyCode===32||pe.keyCode===13)&&(pe.preventDefault(),rt())},[U,rt]),mt=v.useCallback(function(){V({type:"focus"})},[]),Tt=v.useCallback(function(){V({type:"blur"})},[]),wt=v.useCallback(function(){_||(Hre()?setTimeout(rt,0):rt())},[_,rt]),Te=function(qe){return r?null:qe},Pe=function(qe){return k?null:Te(qe)},Ne=function(qe){return I?null:Te(qe)},Ie=function(qe){D&&qe.stopPropagation()},lt=v.useMemo(function(){return function(){var pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},qe=pe.refKey,Ce=qe===void 0?"ref":qe,ke=pe.role,kt=pe.onKeyDown,pn=pe.onFocus,mn=pe.onBlur,Kn=pe.onClick,nn=pe.onDragEnter,Sr=pe.onDragOver,Qt=pe.onDragLeave,hr=pe.onDrop,zn=im(pe,Jre);return On(On(yb({onKeyDown:Pe(jo(kt,nt)),onFocus:Pe(jo(pn,mt)),onBlur:Pe(jo(mn,Tt)),onClick:Te(jo(Kn,wt)),onDragEnter:Ne(jo(nn,Ee)),onDragOver:Ne(jo(Sr,Ke)),onDragLeave:Ne(jo(Qt,De)),onDrop:Ne(jo(hr,Ct)),role:typeof ke=="string"&&ke!==""?ke:"presentation"},Ce,U),!r&&!k?{tabIndex:0}:{}),zn)}},[U,nt,mt,Tt,wt,Ee,Ke,De,Ct,k,I,r]),et=v.useCallback(function(pe){pe.stopPropagation()},[]),ft=v.useMemo(function(){return function(){var pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},qe=pe.refKey,Ce=qe===void 0?"ref":qe,ke=pe.onChange,kt=pe.onClick,pn=im(pe,Zre),mn=yb({accept:B,multiple:u,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(jo(ke,Ct)),onClick:Te(jo(kt,et)),tabIndex:-1},Ce,G);return On(On({},mn),pn)}},[G,n,u,Ct,r]);return On(On({},z),{},{isFocused:K&&!r,getRootProps:lt,getInputProps:ft,rootRef:U,inputRef:G,open:Te(rt)})}function lie(e,t){switch(t.type){case"focus":return On(On({},e),{},{isFocused:!0});case"blur":return On(On({},e),{},{isFocused:!1});case"openDialog":return On(On({},xb),{},{isFileDialogActive:!0});case"closeDialog":return On(On({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return On(On({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return On(On({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return On({},xb);default:return e}}function M2(){}const[cie,uie]=Ar("Dropzone component was not found in tree");var Kd={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};function x1(e){const t=n=>{const{children:r,...o}=oe(`Dropzone${yE(e)}`,{},n),s=uie(),c=sm(r)?r:a.jsx("span",{children:r});return s[e]?v.cloneElement(c,o):null};return t.displayName=`@mantine/dropzone/${yE(e)}`,t}const die=x1("accept"),fie=x1("reject"),hie=x1("idle"),pie={multiple:!0,maxSize:1/0,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},mie=(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":Vt(t),"--dropzone-accept-color":s.color,"--dropzone-accept-bg":s.background,"--dropzone-reject-color":c.color,"--dropzone-reject-bg":c.background}}},Ms=ge((e,t)=>{const n=oe("Dropzone",pie,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,radius:h,disabled:m,loading:g,multiple:y,maxSize:x,accept:S,children:j,onDropAny:C,onDrop:T,onReject:R,openRef:E,name:_,maxFiles:k,autoFocus:I,activateOnClick:D,activateOnDrag:P,dragEventsBubbling:$,activateOnKeyboard:B,onDragEnter:W,onDragLeave:Y,onDragOver:Z,onFileDialogCancel:U,onFileDialogOpen:G,preventDropOnDocument:M,useFsAccessApi:L,getFilesFromEvent:z,validator:V,rejectColor:K,acceptColor:O,enablePointerEvents:F,loaderProps:se,inputProps:de,mod:ye,attributes:je,...Ee}=n,Ke=$e({name:"Dropzone",classes:Kd,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:je,vars:f,varsResolver:mie}),{getRootProps:De,getInputProps:dt,isDragAccept:Ct,isDragReject:rt,isDragActive:nt,open:mt}=rO({onDrop:C,onDropAccepted:T,onDropRejected:R,disabled:m||g,accept:Array.isArray(S)?S.reduce((Pe,Ne)=>({...Pe,[Ne]:[]}),{}):S,multiple:y,maxSize:x,maxFiles:k,autoFocus:I,noClick:!D,noDrag:!P,noDragEventsBubbling:!$,noKeyboard:!B,onDragEnter:W,onDragLeave:Y,onDragOver:Z,onFileDialogCancel:U,onFileDialogOpen:G,preventDropOnDocument:M,useFsAccessApi:L,validator:V,...z?{getFilesFromEvent:z}:null});Dd(E,mt);const Tt=nt&&Ct,wt=nt&&rt,Te=!Tt&&!wt;return a.jsx(cie,{value:{accept:Tt,reject:wt,idle:Te},children:a.jsxs(le,{...De(),...Ke("root",{focusable:!0}),...Ee,mod:[{accept:Tt,reject:wt,idle:Te,disabled:m,loading:g,"activate-on-click":D},ye],children:[a.jsx(Em,{visible:g,overlayProps:{radius:h},unstyled:u,loaderProps:se}),a.jsx("input",{...dt(de),name:_}),a.jsx("div",{...Ke("inner"),ref:t,"data-enable-pointer-events":F||void 0,children:j})]})})});Ms.classes=Kd;Ms.displayName="@mantine/dropzone/Dropzone";Ms.Accept=die;Ms.Idle=hie;Ms.Reject=fie;const gie={maxSize:1/0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:zr("max"),withinPortal:!0},b1=ge((e,t)=>{const n=oe("DropzoneFullScreen",gie,e),{classNames:r,className:o,style:s,styles:c,unstyled:u,vars:f,active:h,onDrop:m,onReject:g,zIndex:y,withinPortal:x,portalProps:S,attributes:j,...C}=n,T=$e({name:"DropzoneFullScreen",classes:Kd,props:n,className:o,style:s,classNames:r,styles:c,unstyled:u,attributes:j,rootSelector:"fullScreen"}),{resolvedClassNames:R,resolvedStyles:E}=Ol({classNames:r,styles:c,props:n}),[_,k]=v.useState(0),[I,{open:D,close:P}]=Pl(!1),$=W=>{W.dataTransfer?.types.includes("Files")&&(k(Y=>Y+1),D())},B=()=>{k(W=>W-1)};return v.useEffect(()=>{_===0&&P()},[_]),v.useEffect(()=>{if(h)return document.addEventListener("dragenter",$,!1),document.addEventListener("dragleave",B,!1),()=>{document.removeEventListener("dragenter",$,!1),document.removeEventListener("dragleave",B,!1)}},[h]),a.jsx(wa,{...S,withinPortal:x,children:a.jsx(le,{ref:t,...T("fullScreen",{style:{opacity:I?1:0,pointerEvents:I?"all":"none",zIndex:y}}),children:a.jsx(Ms,{activateOnClick:!1,...C,classNames:R,styles:E,unstyled:u,className:Kd.dropzone,onDrop:W=>{m?.(W),P(),k(0)},onReject:W=>{g?.(W),P(),k(0)}})})})});b1.classes=Kd;b1.displayName="@mantine/dropzone/DropzoneFullScreen";Ms.FullScreen=b1;const hp=Ms,vie='{"resourceType": "Bundle"}';function Ex({id:e,title:t,message:n,color:r,icon:o,withCloseButton:s=!1,method:c="show",loading:u}){Ni[c]({id:e,loading:u,title:t,message:n,color:r,icon:o,withCloseButton:s,autoClose:!1})}function yie(){const e=_n(),t=Re(),[n,r]=v.useState({}),o=v.useCallback(async(u,f)=>{const h="batch-upload";Ex({id:h,title:"Batch Upload in Progress",message:"Your batch data is being uploaded. This may take a moment...",method:"show",loading:!0});try{r({});let m=JSON.parse(u);m.type!=="batch"&&m.type!=="transaction"&&(m=Mk(m));const g=await t.executeBatch(m);r(y=>({...y,[f]:g})),Ex({id:h,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:a.jsx(Yo,{size:"1rem"}),withCloseButton:!0})}catch(m){Ex({id:h,title:"Batch Upload Failed",color:"red",message:Ge(m),method:"update",icon:a.jsx(El,{size:"1rem"}),withCloseButton:!0})}},[t]),s=v.useCallback(async u=>{for(const f of u){const h=new FileReader;h.onload=m=>o(m.target?.result,f.name),h.readAsText(f)}},[o]),c=v.useCallback(async u=>{await o(u.input,"JSON Data")},[o]);return a.jsxs(ut,{children:[a.jsx(Ve,{children:"Batch Create"}),a.jsxs(be,{children:["Use this page to create, read, or update multiple resources. For more details, see"," ",a.jsx(Et,{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(jn,{defaultValue:"upload",children:[a.jsxs(jn.List,{children:[a.jsx(jn.Tab,{value:"upload",children:"File Upload"}),a.jsx(jn.Tab,{value:"json",children:"JSON"})]}),a.jsx(jn.Panel,{value:"upload",pt:"xs",children:a.jsx(hp,{onDrop:s,accept:["application/json"],children:a.jsxs(xe,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[a.jsx(hp.Accept,{children:a.jsx(uR,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),a.jsx(hp.Reject,{children:a.jsx(El,{size:50,stroke:1.5,color:e.colors.red[5]})}),a.jsx(hp.Idle,{children:a.jsx(uR,{size:50,stroke:1.5})}),a.jsxs("div",{children:[a.jsx(be,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),a.jsx(be,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),a.jsx(jn.Panel,{value:"json",pt:"xs",children:a.jsxs(pt,{onSubmit:c,children:[a.jsx(fu,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:vie,deserialize:JSON.parse}),a.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Oe,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&a.jsxs(a.Fragment,{children:[a.jsx("h3",{children:"Output"}),a.jsxs(jn,{defaultValue:Object.keys(n)[0],children:[a.jsx(jn.List,{children:Object.keys(n).map(u=>a.jsx(jn.Tab,{value:u,children:u},u))}),Object.keys(n).map(u=>a.jsx(jn.Panel,{value:u,children:a.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[u],void 0,2)})},u))]}),a.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Oe,{onClick:()=>r({}),children:"Start over"})})]})]})}function xie(){const{resourceType:e}=qt(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(o=>!!o),[r]=ru("Questionnaire",`subject-type=${e}`);return r?r.length===0?a.jsxs(ut,{children:[a.jsxs(Ve,{children:["No apps for ",e]}),a.jsx(St,{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(St,{to:`/forms/${o.id}?subject=`+n.map(s=>`${e}/${s}`).join(","),children:o.name})}),a.jsx("p",{children:o.description})]},o.id))})}):a.jsx(Li,{})}function bie(){const e=Re(),[t,n]=v.useState(),[r,o]=v.useState(!1);return a.jsx(ut,{width:450,children:a.jsxs(pt,{onSubmit:s=>{n(void 0),e.post("auth/changepassword",s).then(()=>o(!0)).catch(c=>n(Wt(c)))},children:[a.jsxs(or,{direction:"column",align:"center",justify:"center",children:[a.jsx(Vi,{size:32}),a.jsx(Ve,{children:"Change password"})]}),!r&&a.jsxs(Le,{gap:"xl",mt:"xl",children:[a.jsx(oo,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:$t(t,"oldPassword")}),a.jsx(oo,{name:"newPassword",label:"New password",required:!0,error:$t(t,"newPassword")}),a.jsx(oo,{name:"confirmPassword",label:"Confirm new password",required:!0,error:$t(t,"confirmPassword")}),a.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Oe,{type:"submit",children:"Change password"})})]}),r&&a.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const Sie=["Form","JSON","Profiles"];function wie(){const{resourceType:e}=qt();return a.jsxs(a.Fragment,{children:[a.jsxs(Mr,{children:[a.jsxs(be,{p:"md",fw:500,children:["New ",e]}),a.jsx(Jr,{children:a.jsx(Af,{baseUrl:`/${e}/new`,tabs:Sie})})]}),a.jsx(h1,{})]})}function jie(){return a.jsx(ut,{children:a.jsxs(Le,{children:[a.jsx(Ve,{order:1,children:"Unexpected Error"}),a.jsx(be,{children:"We're sorry, something went wrong."}),a.jsxs(be,{children:["Please contact ",a.jsx(Et,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}function iO(e){const t=Xt(e.resource);if(!t)return null;const n=[{key:"Type",value:a.jsx(St,{to:`/${t.resourceType}`,children:t.resourceType})}];function r(c,u){c&&u&&n.push({key:c,value:u})}function o(c){c&&r(c.system,c.value)}function s(c,u){Array.isArray(u)?u.forEach(f=>s(c,f)):typeof u=="string"?r(c,u):u&&(Array.isArray(u.coding)?r(c,u.coding.map(f=>f.display||f.code).join(", ")):r(c,u.text))}if("name"in t){const c=Ea(t);c!==zt(t)&&r("Name",c)}return"category"in t&&s("Category",t.category),t.resourceType!=="Bot"&&"code"in t&&s("Code",t.code),"identifier"in t&&(Array.isArray(t.identifier)?t.identifier.forEach(o):o(t.identifier)),n.length===1&&n.push({key:"ID",value:t.id}),a.jsx(yt,{children:n.map((c,u)=>a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:c.key}),a.jsx(yt.Value,{children:c.value})]},`${c.key}-${u}`))})}function Cie(){const{id:e}=qt(),t=gi(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=Re(),[s,c]=v.useState(!0),[u,f]=v.useState(),[h,m]=v.useState(),[g,y]=v.useState(),[x,S]=v.useState(),[j,C]=v.useState();if(v.useEffect(()=>{const E={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const _=r.split(",").filter(k=>!!k);_.length===1&&E.entry.push({request:{method:"GET",url:_[0]}}),m(_)}o.executeBatch(E).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]),x)return a.jsx(ut,{children:a.jsx("pre",{"data-testid":"error",children:JSON.stringify(x,void 0,2)})});if(j)return a.jsxs(ut,{children:[a.jsx(Ve,{children:u?.title}),a.jsx("p",{children:"Your response has been recorded."}),a.jsxs("ul",{children:[j.length===1&&a.jsx("li",{children:a.jsx(St,{to:j[0],children:"Review your answers"})}),j.length>1&&a.jsxs("li",{children:["Review your answers:",a.jsx("ul",{children:j.map(E=>a.jsx("li",{children:a.jsx(St,{to:E,children:zt(E)})},E.id))})]}),g&&a.jsx("li",{children:a.jsxs(St,{to:g,children:["Back to ",Ea(g)]})}),a.jsx("li",{children:a.jsx(St,{to:"/",children:"Go back home"})})]})]});if(s||!u)return a.jsx(Li,{});const T=g&&g1(g);return a.jsxs(a.Fragment,{children:[a.jsxs(Mr,{shadow:"xs",radius:0,children:[T&&a.jsx(eN,{patient:T}),g&&g.resourceType!=="Patient"&&a.jsx(iO,{resource:g}),a.jsx(le,{px:"xl",py:"md",children:a.jsxs(be,{children:[Ea(u),h&&h.length>1&&a.jsxs(a.Fragment,{children:[" (for ",h.length," resources)"]})]})})]}),a.jsx(ut,{children:a.jsx(uN,{questionnaire:u,subject:g&&Yt(g),onSubmit:R})})]});async function R(E){const _=[];if(!h||h.length===0)_.push(await o.createResource(E));else for(const k of h)_.push(await o.createResource({...E,subject:{reference:k}}));C(_)}}const Eie="_paper_unw9o_1",Tie={paper:Eie},Rie={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function oO(e,t){const n=e.resourceType||_ie(t),r=e.fields??Die(n),o=e.filters??(e.resourceType?void 0:Aie(n)),s=e.sortRules??kie(n),c=e.offset??0,u=e.count??Qm;return{...e,resourceType:n,fields:r,filters:o,sortRules:s,offset:c,count:u}}function _ie(e){return localStorage.getItem("defaultResourceType")??e?.option?.find(t=>t.id==="defaultResourceType")?.valueString??"Patient"}function Die(e){const t=S1(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 Aie(e){return S1(e)?.filters}function kie(e){const t=S1(e);return t?.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function S1(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function Pie(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function Nie(e,t){const n={...e,count:1e3,offset:0},r=oO(n,t.getUserConfiguration()),o=await t.search(r.resourceType,ys({...r,total:"accurate",fields:void 0}));return Mk(o)}function L2(){const e=Re(),t=Yn(),n=gi(),[r,o]=v.useState();return v.useEffect(()=>{const s=Ak(n.pathname+n.search),c=oO(s,e.getUserConfiguration());n.pathname===`/${c.resourceType}`&&n.search===ys(c)?(Pie(c),o(c)):t(`/${c.resourceType}${ys(c)}`)?.catch(console.error)},[e,t,n]),!r?.resourceType||!r.fields||r.fields.length===0?a.jsx(Li,{}):a.jsx(Mr,{shadow:"xs",m:"md",p:"xs",className:Tie.paper,children:a.jsx(bu,{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}${ys(s.definition)}`)?.catch(console.error)},onNew:()=>{t(Rie[r.resourceType]??`/${r.resourceType}/new`)?.catch(console.error)},onExportCsv:()=>{const s=e.fhirUrl(r.resourceType,"$csv")+ys(r);e.download(s).then(c=>{window.open(window.URL.createObjectURL(c),"_blank")}).catch(c=>Ae({color:"red",message:Ge(c),autoClose:!1}))},onExportTransactionBundle:async()=>{Nie(r,e).then(s=>sP(JSON.stringify(s,void 0,2))).catch(s=>Ae({color:"red",message:Ge(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=>Ae({color:"red",message:Ge(c),autoClose:!1})))},onBulk:s=>{t(`/bulk/${r.resourceType}?ids=${s.join(",")}`)?.catch(console.error)}})})}function Oie(){const[e]=ru("ObservationDefinition","_count=100");return e?a.jsxs(te,{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(Mo,{value:t.category?.[0]})}),a.jsx("td",{children:a.jsx(Mo,{value:t.code})}),a.jsx("td",{children:a.jsx(Mo,{value:t.method})}),a.jsx("td",{children:t.quantitativeDetails?.unit?.text}),a.jsx("td",{children:t.quantitativeDetails?.decimalPrecision}),a.jsx("td",{children:a.jsx(bb,{ranges:t.qualifiedInterval})})]},t.id))})]}):a.jsx(Li,{})}function bb(e){const{ranges:t}=e;if(!t)return null;const n=I2(t.map(o=>o.gender));if(n.length>1)return tu(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(bb,{ranges:e.ranges?.filter(s=>s.gender===o)})]},o))});const r=I2(t.map(o=>o.age&&Ud(o.age)));return r.length>1?(tu(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(bb,{ranges:e.ranges?.filter(s=>Ud(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(qS,{value:o.range})})]})})},`range-${o.condition}`))})}function I2(e){return[...new Set(e.filter(t=>!!t))]}function Mie(){const[e]=ru("ActivityDefinition","_count=100"),[t]=ru("ObservationDefinition","_count=100");return!e||!t?a.jsx(Li,{}):a.jsxs(te,{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(Mo,{value:n.category?.[0]})}),a.jsx("td",{children:a.jsx(Mo,{value:n.code})}),e.map(r=>a.jsx("td",{children:r.observationResultRequirement?.find(o=>o.reference?.includes(n.id))?"✅":""},r.id))]},n.id))})]})}function Lie(){const e=Re(),[t,n]=v.useState(),[r,o]=v.useState(void 0),[s,c]=v.useState(!1),u=v.useCallback(()=>{e.get("auth/mfa/status",{cache:"no-cache"}).then(m=>{n(m.enrollQrCode),o(m.enrolled)}).catch(m=>Ae({color:"red",message:Ge(m),autoClose:!1}))},[e]);v.useEffect(()=>{u()},[u]);const f=v.useCallback(m=>{e.post("auth/mfa/enroll",m).then(()=>{o(!0),Ae({color:"green",message:"Success"})}).catch(g=>Ae({color:"red",message:Ge(g),autoClose:!1}))},[e]),h=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(In,{title:"Disable MFA",opened:s,onClose:()=>c(!1),children:a.jsx(Wp,{title:"Disable MFA",buttonText:"Submit code",onSubmit:async m=>{await h(m),c(!1),o(!1),Ae({id:"mfa-disabled",color:"green",title:"Success",message:"MFA disabled",icon:a.jsx(kq,{})}),u()}})}),a.jsxs(xe,{children:[a.jsx(Ve,{children:"MFA is enabled"}),a.jsx(Oe,{onClick:()=>c(!0),children:"Disable MFA"})]})]}):a.jsx(ut,{width:400,children:a.jsx(Wp,{title:"Multi Factor Auth Setup",buttonText:"Enroll",qrCodeUrl:t,onSubmit:f})})}const Iie={},Sb={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__",awsTextractEnabled:Iie?.MEDPLUM_AWS_TEXTRACT_ENABLED};function If(){return Sb}function w1(){return aO("registerEnabled")}function zie(){return aO("awsTextractEnabled")}function aO(e){try{return Sb[e]!==!1&&Sb[e]!=="false"}catch{return!0}}function $ie(){const e=Yn(),[t]=xg(),n=Re(),r=t.get("scope")||"openid",[o,s]=v.useState(),[c,u]=v.useState(!0),f=t.get("client_id"),h=t.get("login");if(v.useEffect(()=>{if(!f||f==="medplum-cli")return;async function g(){try{const y=await n.get(`/auth/clientinfo/${f}`);s(y)}catch(y){Ae({id:"clientinfofail",title:"Failed to retrieve client information.",color:"red",message:Ge(y),withCloseButton:!0})}finally{u(!1)}}g().catch(console.error)},[n,f]),!f)return null;function m(g){const y=new URL(t.get("redirect_uri"));for(const x of["scope","state","nonce"])t.has(x)&&y.searchParams.set(x,t.get(x));y.searchParams.set("code",g),nr.assign(y.toString())}return a.jsx(_P,{onCode:m,onForgotPassword:()=>e("/resetpassword")?.catch(console.error),onRegister:()=>e("/register")?.catch(console.error),googleClientId:If().googleClientId,clientId:f||void 0,redirectUri:t.get("redirect_uri")||void 0,scope:r,nonce:t.get("nonce")||void 0,launch:t.get("launch")||void 0,codeChallenge:t.get("code_challenge")||void 0,codeChallengeMethod:t.get("code_challenge_method")||void 0,chooseScopes:r!=="openid",login:h||void 0,children:!c&&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(Vi,{size:32}),a.jsx(Ve,{children:o?.welcomeString??"Sign in to Medplum"})]})})}function Uie(){const e=Re(),t=Yn(),n=If();return v.useEffect(()=>{e.getProfile()&&t("/signin?project=new")?.catch(console.error)},[e,t]),w1()?a.jsxs(eY,{type:"project",projectId:"new",onSuccess:()=>{window.location.href="/"},googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[a.jsx(Vi,{size:32}),a.jsx(Ve,{order:3,py:"lg",children:"Register a new account"})]}):a.jsx(ut,{width:450,children:a.jsx(Go,{icon:a.jsx(Ps,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function Bie(){const e=Yn(),[t]=xg(),n=Re(),[r,o]=v.useState(),[s,c]=v.useState(!1),u=If().recaptchaSiteKey,f=t.get("project")||void 0;return v.useEffect(()=>{EP(u)},[u]),a.jsx(ut,{width:400,px:"xl",py:"xl",bdrs:"md",children:a.jsxs(pt,{onSubmit:async h=>{o(void 0);try{let m="";u&&(m=await TP(u)),await n.post("auth/resetpassword",{...h,projectId:f,recaptchaToken:m}),c(!0)}catch(m){o(Wt(m))}},children:[a.jsxs(or,{direction:"column",align:"center",justify:"center",children:[a.jsx(Vi,{size:32}),a.jsx(Ve,{order:3,py:"lg",children:"Reset your password"})]}),a.jsx(fr,{issues:Ns(r,void 0),mb:"lg"}),!s&&a.jsxs(a.Fragment,{children:[a.jsx(Le,{gap:"sm",mb:"md",children:a.jsx(He,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:$t(r,"email")})}),a.jsxs(Le,{gap:"xs",children:[a.jsx(dr,{fullWidth:!0,children:"Reset Password"}),a.jsx(be,{size:"sm",mt:"lg",c:"dimmed",style:{textAlign:"center"},"data-dashlane-ignore":"true","data-lp-ignore":"true","data-no-autofill":"true","data-form-type":"navigation",children:a.jsx(Et,{onClick:()=>e("/signin")?.catch(console.error),children:"Back to Sign In"})}),w1()&&a.jsxs(be,{size:"sm",mt:"none",c:"dimmed",style:{textAlign:"center"},"data-dashlane-ignore":"true","data-lp-ignore":"true","data-no-autofill":"true","data-form-type":"navigation",children:["Don't have an account?"," ",a.jsx(Et,{onClick:()=>e("/register")?.catch(console.error),children:"Sign Up"})]})]})]}),s&&a.jsx(be,{c:"dimmed",size:"sm",ta:"center",mt:"md",children:"If the account exists on our system, a password reset email will be sent."})]})})}function Vie(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(St,{to:o,suffix:"checklist",children:"Request Group"})]}),a.jsxs("li",{children:["Back to the ",a.jsx(St,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):a.jsx(pt,{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(Le,{children:[a.jsxs(Ve,{children:['Start "',e.planDefinition.title,'"']}),a.jsxs(be,{children:["Use the ",a.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),a.jsx(be,{children:"The following tasks will be created:"}),a.jsx("ul",{children:e.planDefinition.action?.map((c,u)=>a.jsxs("li",{children:[c.definitionCanonical?.startsWith("Questionnaire/")&&"Questionnaire request: ",c.title&&a.jsx(a.Fragment,{children:c.title}),c.code&&a.jsx(Mo,{value:c.code[0]})]},`action-${u}`))}),a.jsx(Ut,{title:"Subject",children:a.jsx(bs,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),a.jsx(xe,{justify:"flex-end",mt:"xl",children:a.jsx(Oe,{type:"submit",children:"Go"})})]})})}function Fie(){const{resourceType:e,id:t}=qt(),n=Xt({reference:e+"/"+t});return n?a.jsx(ut,{children:a.jsx(Vie,{planDefinition:n})}):null}function Hie(){const{resourceType:e,id:t}=qt(),n=Xt({reference:e+"/"+t}),[r,o]=ru("Questionnaire","subject-type="+e),[s,c]=ru("ClientApplication",{_count:1e3});if(!n||o||c)return a.jsx(Li,{});const u=s?.filter(m=>qie(e)&&!!m.launchUri);if((!r||r.length===0)&&(!u||u.length===0))return a.jsxs(ut,{children:[a.jsx(Ve,{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,h;return n.resourceType==="Patient"?f=Yt(n):n.resourceType==="Encounter"&&(f=n.subject,h=Yt(n)),a.jsxs(ut,{children:[r?.map(m=>a.jsxs("div",{children:[a.jsx(Ve,{order:3,children:a.jsx(St,{to:`/forms/${m.id}?subject=${zt(n)}`,children:m.title||m.name})}),a.jsx(be,{children:m.description})]},m.id)),u?.map(m=>a.jsxs("div",{children:[a.jsx(Ve,{order:3,children:a.jsx(nee,{client:m,patient:f,encounter:h,children:m.name})}),a.jsx(be,{children:m.description})]},m.id))]})}function qie(e){return e==="Patient"||e==="Encounter"}function Gie(){const{resourceType:e,id:t}=qt(),n=Yn(),[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(bu,{search:r,onClick:s=>n(`/${s.resource.resourceType}/${s.resource.id}`)?.catch(console.error),onChange:s=>o(s.definition),hideFilters:!0})})}function Wie(){const e=Re(),{resourceType:t,id:n}=qt(),r=e.readHistory(t,n).read();return a.jsx(cf,{maw:1200,children:a.jsx(Bl,{children:a.jsx(qZ,{history:r})})})}const Qie="_hl7Input_k5xm3_1",Yie={hl7Input:Qie};function Kie(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 Xie(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=>{Ed(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const Jie=`{
|
|
225
|
-
"resourceType": "Patient",
|
|
226
|
-
"name": [
|
|
227
|
-
{
|
|
228
|
-
"given": [
|
|
229
|
-
"Alice"
|
|
230
|
-
],
|
|
231
|
-
"family": "Smith"
|
|
232
|
-
}
|
|
233
|
-
]
|
|
234
|
-
}`,Zie="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 eoe(){const e=Re(),{id:t}=qt(),[n,r]=v.useState(),[o,s]=v.useState(),[c,u]=v.useState(),[f,h]=v.useState(Jie),[m,g]=v.useState(Zie),[y,x]=v.useState(tn.FHIR_JSON),S=v.useRef(null),j=v.useRef(null),[C,T]=v.useState(!1);v.useEffect(()=>{e.readResource("Bot",t).then(async P=>{r(P),s(P.runtimeVersion==="vmcontext"?"commonjs":"esnext"),u(await toe(e,P))}).catch(P=>Ae({color:"red",message:Ge(P),autoClose:!1}))},[e,t]);const R=v.useCallback(async()=>Ed(S.current,{command:"getValue"}),[]),E=v.useCallback(async()=>Ed(S.current,{command:"getOutput"}),[]),_=v.useCallback(async()=>y===tn.FHIR_JSON?JSON.parse(f):m,[y,f,m]),k=v.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),T(!0);try{const $=await R(),B=await E(),W=await e.createAttachment({data:$,filename:"index.ts",contentType:tn.TYPESCRIPT}),Y=await e.createAttachment({data:B,filename:o==="commonjs"?"index.cjs":"index.mjs",contentType:tn.JAVASCRIPT}),Z=[{op:"add",path:"/sourceCode",value:W},{op:"add",path:"/executableCode",value:Y}];await e.patchResource("Bot",t,Z),Ae({color:"green",message:"Saved"})}catch($){Ae({color:"red",message:Ge($),autoClose:!1})}finally{T(!1)}},[e,t,o,R,E]),I=v.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),T(!0);try{await e.post(e.fhirUrl("Bot",t,"$deploy")),Ae({color:"green",message:"Deployed"})}catch($){Ae({color:"red",message:Ge($),autoClose:!1})}finally{T(!1)}},[e,t]),D=v.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),T(!0);try{const $=await _(),B=await e.post(e.fhirUrl("Bot",t,"$execute"),$,y);await Ed(j.current,{command:"setValue",value:B}),Ae({color:"green",message:"Success"})}catch($){Ae({color:"red",message:Ge($),autoClose:!1})}finally{T(!1)}},[e,t,_,y]);return!n||c===void 0?null:a.jsxs(kn,{m:0,gutter:0,style:{overflow:"hidden"},children:[a.jsx(kn.Col,{span:8,children:a.jsxs(Mr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[a.jsx(Xie,{iframeRef:S,language:"typescript",module:o,testId:"code-frame",defaultValue:c,minHeight:"528px"}),a.jsxs(xe,{justify:"flex-end",gap:"xs",children:[a.jsx(Oe,{type:"button",onClick:k,loading:C,leftSection:a.jsx(Fq,{size:"1rem"}),children:"Save"}),a.jsx(Oe,{type:"button",onClick:I,loading:C,leftSection:a.jsx(NS,{size:"1rem"}),children:"Deploy"}),a.jsx(Oe,{type:"button",onClick:D,loading:C,leftSection:a.jsx(LG,{size:"1rem"}),children:"Execute"})]})]})}),a.jsxs(kn.Col,{span:4,children:[a.jsxs(Mr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[a.jsx(dn,{data:[{label:"FHIR",value:tn.FHIR_JSON},{label:"HL7",value:tn.HL7_V2}],onChange:P=>x(P.currentTarget.value)}),y===tn.FHIR_JSON?a.jsx(fu,{value:f,onChange:P=>h(P),autosize:!0,minRows:15}):a.jsx("textarea",{className:Yie.hl7Input,value:m,onChange:P=>g(P.currentTarget.value),rows:15})]}),a.jsx(Mr,{m:2,p:"xs",shadow:"md",children:a.jsx(Kie,{iframeRef:j,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function toe(e,t){if(t.sourceCode?.url){const n=t.sourceCode.url?.split("/")?.find(pS);return(await e.download(e.fhirUrl("Binary",n))).text()}return t.code??""}function Cs(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function noe(){const e=Re(),{resourceType:t,id:n}=qt(),r={reference:t+"/"+n},o=v.useCallback(s=>{e.updateResource(Cs(s)).then(()=>{Ae({color:"green",message:"Success"})}).catch(c=>{Ae({color:"red",message:Ge(c),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return a.jsx(ut,{children:a.jsx(EJ,{value:r,onSubmit:o})});case"Questionnaire":return a.jsx(ut,{children:a.jsx(ZJ,{questionnaire:r,onSubmit:o})});default:return null}}function roe(){const{resourceType:e,id:t}=qt(),n=Xt({reference:e+"/"+t}),r=Yn();return n?a.jsx(ut,{children:a.jsx(RZ,{value:n,onStart:(o,s)=>r(`/forms/${Sl(s)}`)?.catch(console.error),onEdit:(o,s,c)=>r(`/${c.reference}}`)?.catch(console.error)})}):null}function ioe(){const e=Re(),{resourceType:t,id:n}=qt(),r=Yn();return a.jsxs(ut,{children:[a.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),a.jsx(Oe,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>r(`/${t}`)?.catch(console.error)).catch(o=>Ae({color:"red",message:Ge(o),autoClose:!1}))},children:"Delete"})]})}const ooe="_selectProfileBtn_tbaz6_1",aoe="_chevron_tbaz6_13",z2={selectProfileBtn:ooe,chevron:aoe};function soe(){const{resourceType:e,id:t}=qt(),n=Xt({reference:e+"/"+t}),[r,o]=v.useState(),s=Il({onDropdownClose:()=>s.resetSelectedOption()}),c=v.useMemo(()=>{if(Ln(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 u;return Ln(c)&&(u=a.jsx(xe,{justify:"flex-end",children:a.jsxs(Le,{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(Pn,{onClick:()=>s.toggleDropdown(),children:a.jsxs(lf,{fw:"bold",fs:"sm",className:z2.selectProfileBtn,children:[a.jsx("span",{children:"Pick profile"}),a.jsx(PS,{stroke:1.5,className:z2.chevron})]})})}),a.jsx(Ye.Dropdown,{w:"max-content",children:a.jsx(Ye.Options,{children:c})})]}),a.jsx(le,{children:r?a.jsxs(a.Fragment,{children:[a.jsx(be,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),a.jsx(be,{span:!0,size:"sm",children:r||"Nothing selected"})]}):a.jsx(be,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),a.jsx(ut,{children:a.jsxs(Le,{gap:"xl",children:[u,a.jsx(JS,{value:n,profileUrl:r})]})})}function loe(){const e=Re(),{resourceType:t,id:n}=qt(),[r,o]=v.useState(),[s,c]=v.useState(),u=Yn(),[f,h]=v.useState();v.useEffect(()=>{e.readResource(t,n).then(x=>{o(pi(x)),c(pi(x))}).catch(x=>{h(Wt(x)),Ae({color:"red",message:Ge(x),autoClose:!1})})},[e,t,n]);const m=v.useCallback(x=>{h(void 0),e.updateResource(Cs(x)).then(()=>{u(`/${t}/${n}/details`)?.catch(console.error),Ae({id:"succes",color:"green",message:"Success"})}).catch(S=>{h(Wt(S)),Ae({color:"red",message:Ge(S),autoClose:!1})})},[e,t,n,u]),g=v.useCallback(x=>{h(void 0);const S=HP.createPatch(r,Cs(x));e.patchResource(t,n,S).then(()=>{u(`/${t}/${n}/details`)?.catch(console.error),Ae({id:"succes",color:"green",message:"Success"})}).catch(j=>{h(Wt(j)),Ae({color:"red",message:Ge(j),autoClose:!1})})},[e,t,n,r,u]),y=v.useCallback(()=>u(`/${t}/${n}/delete`)?.catch(console.error),[u,t,n]);return s?a.jsx(ut,{children:a.jsx(em,{defaultValue:s,onSubmit:m,onPatch:g,onDelete:y,outcome:f})}):null}function coe(){const{resourceType:e,id:t}=qt(),n=Xt({reference:e+"/"+t});return n?a.jsx(ut,{maw:700,children:n.resourceType==="Patient"?a.jsx(xJ,{patient:n}):a.jsx(Go,{icon:a.jsx(Ps,{size:16}),title:"Unsupported export type",color:"red",children:"This page is only supported for Patient resources"})}):null}function sO({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(u=>{c(u.filter(MY))}).catch(console.error)},[o,n,r]),a.jsx(jn,{value:t?.url,onChange:u=>{const f=s?.find(h=>h.url===u);f&&n(f)},children:a.jsx(jn.List,{children:s?.map(u=>{const f=e.meta?.profile?.includes(u.url),h=f?"This profile is present in this resource's meta.profile property.":"This profile is not included in this resource's meta.profile property.";return a.jsx(jn.Tab,{value:u.url,title:h,rightSection:f&&a.jsx(sS,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:a.jsx(pW,{size:"90%"})}),children:u.title||u.name},u.url)})})})}function lO(e,t){const n=Re(),r=Yn();return{defaultValue:{resourceType:e},handleSubmit:c=>{t&&t(void 0),n.createResource(c).then(u=>r("/"+u.resourceType+"/"+u.id)).catch(u=>{t&&t(Wt(u)),Ae({color:"red",message:Ge(u),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function Tx(){const{resourceType:e}=qt(),t=gi(),[n,r]=v.useState(),{defaultValue:o,handleSubmit:s}=lO(e,r),[c,u]=v.useState(),f=t.pathname.toLowerCase().endsWith("profiles"),h=v.useCallback(m=>{const g=Cs(m);c&&Sk(g,c.url),s(g)},[c,s]);return f?a.jsx(ut,{children:a.jsxs(Le,{children:[a.jsx(sO,{resource:o,currentProfile:c,onChange:u}),c?a.jsx(em,{defaultValue:o,onSubmit:h,outcome:n,profileUrl:c.url},c.url):a.jsx(be,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):a.jsx(ut,{children:a.jsx(em,{defaultValue:o,onSubmit:s,outcome:n})})}function $2(){const e=Re(),{resourceType:t,id:n}=qt(),r=e.readHistory(t,n).read();return a.jsx(ut,{children:a.jsx(JZ,{history:r})})}function uoe(){const{resourceType:e}=qt(),[t,n]=v.useState(),{defaultValue:r,handleSubmit:o}=lO(e,n),s=v.useCallback(c=>{o(JSON.parse(c["new-resource"]))},[o]);return a.jsxs(ut,{children:[t&&a.jsx(fr,{outcome:t}),a.jsxs(pt,{onSubmit:s,children:[a.jsx(fu,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:co(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Oe,{type:"submit",children:"OK"})})]})]})}function doe(){const e=Re(),{resourceType:t,id:n}=qt(),r=Xt({reference:t+"/"+n}),o=Yn(),[s,c]=v.useState(),u=v.useCallback(f=>{e.updateResource(Cs(JSON.parse(f.resource))).then(()=>{c(void 0),o(`/${t}/${n}/details`)?.catch(console.error),Ae({color:"green",message:"Success"})}).catch(h=>{Ae({color:"red",message:Ge(h),autoClose:!1})})},[e,t,n,o]);return r?a.jsxs(ut,{children:[s&&a.jsx(fr,{outcome:s}),a.jsxs(pt,{onSubmit:u,children:[a.jsx(fu,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:co(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Oe,{type:"submit",children:"OK"})})]})]}):null}function foe(e){const{resourceType:t,id:n}=e;return a.jsxs(ut,{children:[a.jsxs(Go,{icon:a.jsx(Ps,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",a.jsx("br",{}),a.jsx(Et,{href:`/forms/${n}`,children:`/forms/${n}`})]}),a.jsx(uN,{questionnaire:{reference:t+"/"+n},onSubmit:()=>alert("You submitted the preview")})]})}const hoe="_propertyTable_1xts4_1",poe="_propertiesTitle_1xts4_17",cO={propertyTable:hoe,propertiesTitle:poe};function moe(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 goe(e){const{properties:t}=e,n=t.map(r=>{let o="",s="",c="";return r.part?.forEach(u=>{u.name==="code"?o=u.valueCode||"":u.name==="description"?s=u.valueString||"":u.name==="value"&&(c=moe(u))}),{code:o,description:s,value:c}});return a.jsxs(te,{className:cO.propertyTable,children:[a.jsx(te.Thead,{children:a.jsxs(te.Tr,{children:[a.jsx(te.Th,{children:"Code"}),a.jsx(te.Th,{children:"Description"}),a.jsx(te.Th,{children:"Value"})]})}),a.jsx(te.Tbody,{children:n.map((r,o)=>a.jsxs(te.Tr,{children:[a.jsx(te.Td,{children:r.code}),a.jsx(te.Td,{children:r.description}),a.jsx(te.Td,{children:r.value})]},`property-${o}`))})]})}function voe(e){const{valueSet:t}=e,n=Re(),r=t.url,[o,s]=v.useState(),[c,u]=v.useState(),[f,h]=v.useState(!1),[m,g]=v.useState(),y=v.useCallback(async j=>{if(s(j),u(void 0),g(void 0),!j?.code||!j?.system){h(!1);return}h(!0);try{const C=new URLSearchParams({system:j.system,code:j.code}),T=n.fhirUrl("CodeSystem","$lookup")+"?"+C.toString(),R=await n.get(T);u(R)}catch(C){g(C instanceof Error?C:new Error(String(C)))}finally{h(!1)}},[n]),x=v.useMemo(()=>c?.parameter?.filter(j=>j.name==="property"&&j.part)??[],[c]),S=x.length>0;return a.jsx(ut,{children:a.jsxs(Le,{gap:"xl",children:[a.jsx(Ef,{binding:r,placeholder:"Select a value from the ValueSet",onChange:j=>y(j[0]),defaultValue:o,maxValues:1}),o?a.jsxs(Le,{gap:"md",children:[a.jsxs(Rf,{children:[a.jsx(Ir,{term:"Code",children:o.code}),o.system&&a.jsx(Ir,{term:"System",children:o.system}),o.display&&a.jsx(Ir,{term:"Display",children:o.display})]}),f&&a.jsxs(xe,{gap:"xs",children:[a.jsx(_r,{size:"sm"}),a.jsx(be,{size:"sm",c:"dimmed",children:"Loading properties..."})]}),!f&&m&&a.jsxs(Go,{icon:a.jsx(Ps,{size:16}),title:"Lookup Failed",color:"red",children:["Failed to retrieve code information: ",Ge(m)]}),!f&&!m&&S&&a.jsx(IS,{children:a.jsxs(Le,{gap:"xs",mt:"lg",children:[a.jsx(be,{fw:500,size:"sm",c:"dimmed",className:cO.propertiesTitle,children:"Properties"}),a.jsx(goe,{properties:x})]})})]}):null]})})}function yoe(){const{resourceType:e,id:t}=qt(),n=Xt({reference:e+"/"+t});return n?n.resourceType==="Questionnaire"?a.jsx(foe,{resourceType:e,id:t}):n.resourceType==="ValueSet"?a.jsx(voe,{valueSet:n}):null:null}function xoe(){const e=Re(),{resourceType:t,id:n}=qt(),[r,o]=v.useState(),[s,c]=v.useState();return v.useEffect(()=>{e.readResource(t,n).then(u=>o(pi(u))).catch(u=>{Ae({color:"red",message:Ge(u)})})},[e,t,n]),r?a.jsxs(ut,{children:[a.jsxs(Ve,{order:2,children:["Available ",t," profiles"]}),a.jsx(Le,{children:a.jsxs(a.Fragment,{children:[a.jsx(sO,{resource:r,currentProfile:s,onChange:c}),s?a.jsx(boe,{profile:s,resource:r,onResourceUpdated:u=>o(u)},s.url):a.jsx(be,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const boe=({profile:e,resource:t,onResourceUpdated:n})=>{const r=Re(),[o,s]=v.useState(),[c,u]=v.useState(()=>t.meta?.profile?.includes(e.url)),f=v.useCallback(h=>{s(void 0);const m=Cs(h);c?Sk(m,e.url):$B(m,e.url),r.updateResource(m).then(g=>{n(g),Ae({color:"green",message:"Success"})}).catch(g=>{s(Wt(g)),Ae({color:"red",message:Ge(g),autoClose:!1})})},[r,e.url,n,c]);return a.jsxs(Le,{children:[a.jsx(hf,{size:"md",checked:c,label:`Conform resource to ${e.title}`,onChange:h=>u(h.currentTarget.checked),"data-testid":"profile-toggle"}),c?a.jsx(em,{profileUrl:e.url,defaultValue:t,onSubmit:f,outcome:o}):a.jsx("form",{noValidate:!0,onSubmit:h=>{h.preventDefault(),f(t)},children:a.jsx(xe,{justify:"flex-end",mt:"xl",children:a.jsx(Oe,{type:"submit",children:"OK"})})})]})},uO={"Create Only":"create","Update Only":"update","Delete Only":"delete","All Interactions":void 0},Soe=Object.keys(uO);function woe(){const e=Re(),{id:t}=qt(),n=Xt({reference:`Questionnaire/${t}`}),[r,o]=v.useState(),[s,c]=v.useState("create"),[u,f]=v.useState(0),h=e.searchResources("Subscription","status=active&_count=100").read().filter(g=>joe(g,n));function m(){r&&n&&e.createResource({resourceType:"Subscription",status:"active",reason:`Connect bot ${r.name} to questionnaire responses`,criteria:`QuestionnaireResponse?questionnaire=${n.url?`${n.url},${zt(n)}`:zt(n)}`,channel:{type:"rest-hook",endpoint:zt(r)},...s?{extension:[{url:"https://medplum.com/fhir/StructureDefinition/subscription-supported-interaction",valueCode:s}]}:void 0}).then(()=>{o(void 0),f(Date.now()),e.invalidateSearches("Subscription"),Ae({color:"green",message:"Success"})}).catch(g=>Ae({color:"red",message:Ge(g),autoClose:!1}))}return a.jsxs(ut,{children:[a.jsx(Ve,{children:"Bots"}),a.jsxs(Le,{children:[h.length===0&&a.jsx("p",{children:"No bots found."}),h.map(g=>a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(Fl,{value:{reference:g.channel?.endpoint},link:!0})}),a.jsxs("p",{children:["Criteria: ",g.criteria]})]},g.id))]}),a.jsx(wn,{}),a.jsxs(Le,{mt:10,children:[a.jsx(tf,{size:"lg",htmlFor:"bot",children:"Connect to bot"}),a.jsxs(xe,{children:[a.jsx(Vl,{name:"bot",resourceType:"Bot",onChange:g=>o(g)}),a.jsx(Oe,{onClick:m,children:"Connect"})]}),a.jsx(xe,{children:a.jsx(dn,{name:"subscription-trigger-event",defaultValue:"Create Only",label:"Subscription Trigger Event",data:Soe,onChange:g=>c(uO[g.target.value])})})]}),a.jsx("div",{style:{display:"none"},children:u})]})}function joe(e,t){if(!t)return!1;const n=e.criteria||"",r=e.channel?.endpoint||"";return n.startsWith("QuestionnaireResponse?")&&r.startsWith("Bot/")&&(n.includes(zt(t))||(t.url?n.includes(t.url):!1))}function Coe(){const{id:e}=qt(),t=Yn(),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(bu,{search:o,onClick:c=>t(`/${c.resource.resourceType}/${c.resource.id}`)?.catch(console.error),onChange:c=>s(c.definition),hideFilters:!0,hideToolbar:!0})})}function Eoe(){const e=Re(),{resourceType:t,id:n}=qt(),r=Xt({reference:t+"/"+n}),o=v.useCallback(s=>{e.updateResource(Cs(s)).then(()=>{Ae({color:"green",message:"Success"})}).catch(c=>{Ae({color:"red",message:Ge(c),autoClose:!1})})},[e]);return r?a.jsx(ut,{children:a.jsx(xZ,{onSubmit:o,definition:r})}):null}function Toe(){const{resourceType:e,id:t}=qt(),n=Xt({reference:e+"/"+t});return n?a.jsx(ut,{children:e==="MeasureReport"?a.jsx(vJ,{measureReport:n}):a.jsx(XS,{value:n})}):null}const Roe="_container_1ue98_1",_oe="_entry_1ue98_14",Doe="_active_1ue98_21",Rx={container:Roe,entry:_oe,active:Doe};function Aoe(e){const t=Re(),n=Xt(e.value),[r,o]=v.useState();return v.useEffect(()=>{if(!n)return;const s=g1(n);if(!s)return;const c="reference"in s?s.reference:zt(s);t.search("ServiceRequest","subject="+c).then(u=>{const h=(u.entry??[]).map(m=>m.resource);qP(h),h.reverse(),o(h)}).catch(u=>Ae({color:"red",message:Ge(u),autoClose:!1}))},[t,n]),r?a.jsx("div",{"data-testid":"quick-service-requests",className:Rx.container,children:r.map(s=>a.jsxs("div",{className:Bt(Rx.entry,{[Rx.active]:s.id===n?.id}),children:[a.jsx("p",{children:a.jsx(St,{to:s,children:koe(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:Poe(s)})]},s.id))}):null}function koe(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function Poe(e){return e.authoredOn?e.authoredOn.substring(0,10):e.meta?.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const Noe="_container_1l2dh_1",Ooe={container:Noe};function Moe(e){const t=Xt(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:Ooe.container,children:a.jsx(dn,{defaultValue:e.defaultValue,onChange:o=>e.onChange(o.currentTarget.value),data:n})})}function Loe(e){const t=Xt(e.specimen);return t?a.jsxs(yt,{children:[a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Type"}),a.jsx(yt.Value,{children:"Specimen"})]}),a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Collected"}),a.jsx(yt.Value,{children:Dr(t.collection?.collectedDateTime)})]}),a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Specimen Age"}),a.jsx(yt.Value,{children:Ioe(t)})]}),t.collection?.collectedDateTime&&t.receivedTime?a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Specimen Stability"}),a.jsx(yt.Value,{children:zoe(t)})]}):a.jsx(a.Fragment,{})]}):null}function Ioe(e){const t=e.collection?.collectedDateTime;if(!t)return;const n=new Date(t);return dO(fO(n,new Date))}function zoe(e){if(!e.collection?.collectedDateTime||!e.receivedTime)return;const t=new Date(e.collection.collectedDateTime),n=new Date(e.receivedTime);return dO(fO(t,n))}function dO(e){return e.toString().padStart(3,"0")+"D"}function fO(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function $oe(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 Uoe(){const e=Re(),{resourceType:t,id:n}=qt(),r={reference:t+"/"+n},[o,s]=v.useState(),c=Xt(r,s),u=$oe(t);async function f(){const j=(await e.readHistory(t,n)).entry?.find(C=>!!C.resource)?.resource;j?h(j):Ae({color:"red",message:"No history to restore",autoClose:!1})}function h(S){e.updateResource(Cs(S)).then(()=>{s(void 0),Ae({color:"green",message:"Success"})}).catch(j=>{Ae({color:"red",message:Ge(j),autoClose:!1})})}if(o)return K8(o)?a.jsxs(ut,{children:[a.jsx(Ve,{children:"Deleted"}),a.jsx("p",{children:"The resource was deleted."}),a.jsx(Oe,{color:"red",onClick:f,children:"Restore"})]}):a.jsx(fr,{outcome:o});function m(S){const j=c,C=j.orderDetail||[];C.length===0&&C.push({}),C[0].text!==S&&(C[0].text=S,h({...j,orderDetail:C}))}const g=c&&g1(c),y=c&&One(c),x=e.getUserConfiguration()?.option?.find(S=>S.id==="statusValueSet")?.valueString;return a.jsxs(a.Fragment,{children:[c?.resourceType==="ServiceRequest"&&x&&a.jsx(Moe,{valueSet:{reference:x},defaultValue:c.orderDetail?.[0]?.text,onChange:m},zt(c)+"-"+c.orderDetail?.[0]?.text),c&&a.jsx(Aoe,{value:c}),c&&a.jsxs(Mr,{children:[g&&a.jsx(eN,{patient:g}),y&&a.jsx(Loe,{specimen:y}),t!=="Patient"&&a.jsx(iO,{resource:r}),a.jsx(Jr,{children:a.jsx(Af,{baseUrl:`/${t}/${n}`,tabs:u})})]}),a.jsx(h1,{})]})}function pp(){const e=Yn(),{resourceType:t,id:n,versionId:r,tab:o}=qt(),s=Re(),[c,u]=v.useState(!0),[f,h]=v.useState(),[m,g]=v.useState();if(v.useEffect(()=>{g(void 0),u(!0),s.readHistory(t,n).then(E=>h(E)).then(()=>u(!1)).catch(E=>{g(E),u(!1)})},[s,t,n]),c)return a.jsx(Li,{});const y=f?.entry??[],x=y.findIndex(E=>E.resource?.meta?.versionId===r);if(x===-1)return a.jsxs(ut,{children:[a.jsx(Ve,{children:"Version not found"}),a.jsx(St,{to:`/${t}/${n}`,children:"Return to resource"})]});const S=y[x].resource,j=x<y.length-1?y[x+1].resource:void 0,C="diff",T=o||C,R=y.length-x;return a.jsx(cf,{maw:1200,children:a.jsx(Bl,{children:a.jsxs(Le,{gap:"lg",children:[m&&a.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)}),a.jsxs(Fm,{cols:2,mb:"lg",children:[a.jsx(Bi,{total:y.length,value:R,getControlProps:KP,onChange:E=>e(`/${t}/${n}/_history/${y[y.length-E]?.resource?.meta?.versionId}/${T}`)?.catch(console.error)}),a.jsx(xe,{justify:"right",children:a.jsx(Zc,{data:[{value:"diff",label:"Diff"},{value:"raw",label:"Raw"}],value:T,onChange:E=>e(`/${t}/${n}/_history/${r}/${E||C}`)?.catch(console.error)})})]}),a.jsx(le,{mb:"lg",children:a.jsxs(Rf,{compact:!0,children:[a.jsx(Ir,{term:"Version ID",children:S.meta?.versionId}),a.jsx(Ir,{term:"Author",children:a.jsx(qc,{value:S.meta?.author,link:!0},S.meta?.author?.reference)}),a.jsx(Ir,{term:"Date/Time",children:Dr(S.meta?.lastUpdated)})]})}),T==="diff"&&a.jsx(QZ,{original:j??{resourceType:t,id:n},revised:S}),T==="raw"&&a.jsx("pre",{style:{fontSize:"9pt"},children:JSON.stringify(S,void 0,2)})]})})})}function Boe(){const{resourceType:e,id:t}=qt(),n=Yn(),[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(bu,{search:r,onClick:s=>n(`/${s.resource.resourceType}/${s.resource.id}`)?.catch(console.error),onChange:s=>o(s.definition),hideFilters:!0})})}function Voe(e){const t=Re(),{resource:n,opened:r,onClose:o}=e,[s,c]=v.useState(!1),[u,f]=v.useState(),[h,m]=v.useState(!1),g=v.useCallback(async()=>{if(n?.id)try{await t.post(t.fhirUrl(n.resourceType,n.id,"$resend"),{subscription:s&&u?zt(u):void 0,verbose:h}),Ae({color:"green",message:"Done"}),o()}catch(y){Ae({color:"red",message:Ge(y),autoClose:!1})}},[t,n,o,s,u,h]);return a.jsx(In,{opened:r,onClose:o,title:"Resend Subscriptions",children:a.jsx(pt,{onSubmit:g,children:a.jsxs(Le,{children:[a.jsx(cn,{label:"Choose subscription (all subscriptions by default)",onChange:y=>c(y.currentTarget.checked)}),s&&a.jsx(Vl,{name:"subscription",resourceType:"Subscription",placeholder:"Subscription",onChange:f}),a.jsx(cn,{label:"Verbose mode",onChange:y=>m(y.currentTarget.checked)}),a.jsx(xe,{justify:"flex-end",children:a.jsx(Oe,{type:"submit",children:"Resend"})})]})})})}function U2(){const e=Re(),t=vu(),{resourceType:n,id:r}=qt(),o={reference:n+"/"+r},[s,c]=v.useState(),u=Pl(!1);function f(R,E){return e.updateResource({...R,priority:E})}function h(R,E){f(R,"stat").then(E).catch(console.error)}function m(R,E){f(R,"routine").then(E).catch(console.error)}function g(R){t(`/${R.resourceType}/${R.id}`)}function y(R){t(`/${R.resourceType}/${R.id}/edit`)}function x(R){t(`/${R.resourceType}/${R.id}/delete`)}function S(R){c(R),u[1].open()}function j(R){t(`/${R.resourceType}/${R.id}/_history/${R.meta?.versionId}`)}function C(R,E){const _="aws-textract";Ae({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(()=>{E(),ul({id:_,title:"AWS Textract Successful",message:"Text successfully extracted.",color:"green",icon:a.jsx(Yo,{size:"1rem"}),loading:!1,withCloseButton:!0})}).catch(k=>ul({id:_,title:"AWS Textract Error",color:"red",message:Ge(k),icon:a.jsx(El,{size:"1rem"}),loading:!1,withCloseButton:!0}))}function T(R){const{primaryResource:E,currentResource:_,reloadTimeline:k}=R,I=_.resourceType===E.resourceType&&_.id===E.id,D=_.resourceType==="Communication"&&_.priority!=="stat",P=_.resourceType==="Communication"&&_.priority==="stat",$=I,B=!I,W=!I,Y=!I,Z=e.getProjectMembership()?.admin,U=Z,G=zie()&&(_.resourceType==="DocumentReference"||_.resourceType==="Media");return a.jsxs(we.Dropdown,{children:[a.jsx(we.Label,{children:"Resource"}),D&&a.jsx(we.Item,{leftSection:a.jsx(PG,{size:14}),onClick:()=>h(_,k),"aria-label":`Pin ${zt(_)}`,children:"Pin"}),P&&a.jsx(we.Item,{leftSection:a.jsx(OG,{size:14}),onClick:()=>m(_,k),"aria-label":`Unpin ${zt(_)}`,children:"Unpin"}),B&&a.jsx(we.Item,{leftSection:a.jsx(cR,{size:14}),onClick:()=>g(_),"aria-label":`Details ${zt(_)}`,children:"Details"}),$&&a.jsx(we.Item,{leftSection:a.jsx(cR,{size:14}),onClick:()=>j(_),"aria-label":`Details ${zt(_)}`,children:"Details"}),W&&a.jsx(we.Item,{leftSection:a.jsx(nP,{size:14}),onClick:()=>y(_),"aria-label":`Edit ${zt(_)}`,children:"Edit"}),Z&&a.jsxs(a.Fragment,{children:[a.jsx(we.Divider,{}),a.jsx(we.Label,{children:"Admin"}),U&&a.jsx(we.Item,{leftSection:a.jsx(FG,{size:14}),onClick:()=>S(_),"aria-label":`Resend Subscriptions ${zt(_)}`,children:"Resend Subscriptions"})]}),G&&a.jsxs(a.Fragment,{children:[a.jsx(we.Divider,{}),a.jsx(we.Label,{children:"AWS AI"}),a.jsx(we.Item,{leftSection:a.jsx(sW,{size:14}),onClick:()=>C(_,k),"aria-label":`AWS Textract ${zt(_)}`,children:"AWS Textract"})]}),Y&&a.jsxs(a.Fragment,{children:[a.jsx(we.Divider,{}),a.jsx(we.Label,{children:"Danger zone"}),a.jsx(we.Item,{color:"red",leftSection:a.jsx(tg,{size:14}),onClick:()=>x(_),"aria-label":`Delete ${zt(_)}`,children:"Delete"})]})]})}return a.jsxs(a.Fragment,{children:[n==="Encounter"&&a.jsx(aX,{encounter:o,getMenu:T}),n==="Patient"&&a.jsx(wJ,{patient:o,getMenu:T}),n==="ServiceRequest"&&a.jsx(tee,{serviceRequest:o,getMenu:T}),n!=="Encounter"&&n!=="Patient"&&n!=="ServiceRequest"&&a.jsx(oX,{resource:o,getMenu:T}),a.jsx(Voe,{resource:s,opened:u[0],onClose:u[1].close},`resend-subscriptions-${s?.id}`)]})}function Foe(e){const{opened:t,close:n,version:r,loadingStatus:o,handleStatus:s,handleUpgrade:c}=e,[u,f]=v.useState(),[h,m]=v.useState(!1);return v.useEffect(()=>{t&&(u||vH("app-tools-page").then(f).catch(console.error),s())},[t,u,s]),u&&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(u)?a.jsxs("p",{children:["This agent is already on the latest version (",u,")."]}):a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:["Are you sure you want to upgrade this agent from version ",r," to version ",u,"?"]}),a.jsxs(xe,{children:[a.jsx(Oe,{onClick:()=>{c(h),n()},"aria-label":"Confirm upgrade",children:"Confirm Upgrade"}),a.jsx(cn,{label:"Force",onChange:g=>m(g.currentTarget.checked)})]})]}):a.jsx(Li,{})}function Hoe(){const e=Re(),{id:t}=qt(),n=v.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,o]=v.useState(!1),[s,c]=v.useState(!1),[u,f]=v.useState(!1),[h,m]=v.useState(!1),[g,y]=v.useState(),[x,S]=v.useState(),[j,C]=v.useState(),[T,R]=v.useState(),[E,_]=v.useState(!1),[k,I]=v.useState(!1),[D,P]=v.useState(),[$,{open:B,close:W}]=Pl(!1);v.useEffect(()=>{if(r||s||u||E){I(!0);return}I(!1)},[r,s,u,E]);const Y=v.useCallback(()=>{o(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(V=>{y(V.parameter?.find(K=>K.name==="status")?.valueCode),S(V.parameter?.find(K=>K.name==="version")?.valueString),C(V.parameter?.find(K=>K.name==="lastUpdated")?.valueInstant)}).catch(V=>z(Ge(V))).finally(()=>o(!1))},[e,t]),Z=v.useCallback(V=>{const K=V.host,O=V.pingCount||1;K&&(_(!0),e.pushToAgent(n,K,`PING ${O}`,tn.PING,!0).then(F=>R(F)).catch(F=>z(Ge(F))).finally(()=>_(!1)))},[e,n]),U=v.useCallback(()=>{c(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(V=>{L("Agent config reloaded successfully.")}).catch(V=>z(Ge(V))).finally(()=>c(!1))},[e,t]),G=v.useCallback(V=>{f(!0);const K=e.fhirUrl("Agent",t,"$upgrade");K.searchParams.set("force",String(V)),e.get(K,{cache:"reload"}).then(O=>{L("Agent upgraded successfully.")}).catch(O=>z(Ge(O))).finally(()=>f(!1))},[e,t]),M=v.useCallback(V=>{m(!0);const K=V.logLimit||20;e.get(e.fhirUrl("Agent",t,`$fetch-logs${K!==void 0?`?limit=${K}`:""}`),{cache:"reload"}).then(O=>{const F=O?.parameter?.find(se=>se.name==="logs");F&&P(F?.valueString)}).catch(O=>z(Ge(O))).finally(()=>m(!1))},[e,t]);function L(V){Ae({color:"green",title:"Success",icon:a.jsx(Yo,{size:"1rem"}),message:V})}function z(V){Ae({color:"red",title:"Error",message:V,autoClose:!1})}return a.jsxs(ut,{children:[a.jsx(In,{opened:$,onClose:W,title:"Upgrade Agent",centered:!0,children:a.jsx(Foe,{opened:$,close:W,version:x,loadingStatus:r,handleStatus:Y,handleUpgrade:G})}),a.jsx(Ve,{order:1,children:"Agent Tools"}),a.jsxs("div",{style:{marginBottom:10},children:["Agent: ",a.jsx(Fl,{value:n,link:!0})]}),a.jsx(wn,{my:"lg"}),a.jsx(Ve,{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(Oe,{onClick:Y,loading:r,disabled:k&&!r,children:"Get Status"}),!r&&g&&a.jsx(te,{children:a.jsxs(te.Tbody,{children:[a.jsxs(te.Tr,{children:[a.jsx(te.Td,{children:"Status"}),a.jsx(te.Td,{children:a.jsx(dg,{status:g})})]}),a.jsxs(te.Tr,{children:[a.jsx(te.Td,{children:"Version"}),a.jsx(te.Td,{children:x})]}),a.jsxs(te.Tr,{children:[a.jsx(te.Td,{children:"Last Updated"}),a.jsx(te.Td,{children:Dr(j,void 0,{timeZoneName:"longOffset"})})]})]})}),a.jsx(wn,{my:"lg"}),a.jsx(Ve,{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(Oe,{onClick:U,loading:s,disabled:k&&!s,"aria-label":"Reload config",children:"Reload Config"}),a.jsx(wn,{my:"lg"}),a.jsx(Ve,{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(Oe,{onClick:B,loading:u,disabled:k&&!u,"aria-label":"Upgrade agent",children:"Upgrade"}),a.jsx(wn,{my:"lg"}),a.jsxs(pt,{onSubmit:M,children:[a.jsx(Ve,{order:2,children:"Fetch Logs"}),a.jsx("p",{children:"Fetch logs from the agent."}),D?.length?a.jsx(lf,{block:!0,mb:15,children:D}):null,a.jsxs(xe,{children:[a.jsx(Yr,{w:100,id:"logLimit",name:"logLimit",placeholder:"20",label:"Log Limit"}),a.jsx(Oe,{mt:22,loading:h,disabled:k&&!h,"aria-label":"Fetch logs",type:"submit",children:"Fetch Logs"})]})]}),a.jsx(wn,{my:"lg"}),a.jsx(Ve,{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(pt,{onSubmit:Z,children:a.jsxs(xe,{children:[a.jsx(He,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:a.jsx(Rn,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:E,disabled:k&&!E,children:a.jsx(WG,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),a.jsx(Yr,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!E&&T&&a.jsxs(a.Fragment,{children:[a.jsx(Ve,{order:5,mt:"sm",mb:0,children:"Last Ping"}),a.jsx("pre",{children:T})]})]})}function qoe(){const e=Yn(),t=Re(),[n,r]=v.useState();v.useEffect(()=>{t.get("auth/me",{cache:"no-cache"}).then(r).catch(s=>Ae({color:"red",message:Ge(s),autoClose:!1}))},[t]);function o(s){t.post("auth/revoke",{loginId:s}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>Ae({color:"green",message:"Login revoked"})).catch(c=>Ae({color:"red",message:Ge(c),autoClose:!1}))}return n?a.jsxs(a.Fragment,{children:[a.jsxs(ut,{children:[a.jsx(Ve,{children:"Security"}),a.jsxs(Rf,{children:[a.jsx(Ir,{term:"ID",children:a.jsx(Et,{href:`/${zt(n.profile)}`,children:n.profile.id})}),a.jsx(Ir,{term:"Resource Type",children:n.profile.resourceType}),a.jsx(Ir,{term:"Name",children:Na(n.profile.name?.[0])})]})]}),a.jsxs(ut,{children:[a.jsx(Ve,{children:"Sessions"}),a.jsxs(te,{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:Dr(s.lastUpdated)}),a.jsx("td",{children:a.jsx(Et,{href:"#",onClick:()=>o(s.id),children:"Revoke"})})]},s.id))})]})]}),a.jsxs(ut,{children:[a.jsx(Ve,{children:"Password"}),a.jsx(Oe,{onClick:()=>e("/changepassword")?.catch(console.error),children:"Change password"})]}),a.jsxs(ut,{children:[a.jsx(Ve,{children:"Multi Factor Auth"}),a.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&a.jsx(Oe,{onClick:()=>e("/mfa")?.catch(console.error),children:"Enroll"})]})]}):null}function Goe(){const{id:e,secret:t}=qt(),n=Re(),[r,o]=v.useState(),[s,c]=v.useState(!1),u=Ns(r,void 0);return a.jsxs(ut,{width:450,children:[a.jsx(fr,{issues:u}),a.jsxs(pt,{onSubmit:f=>{if(f.password!==f.confirmPassword){o(No("Passwords do not match","confirmPassword"));return}o(void 0);const h={id:e,secret:t,password:f.password};n.post("auth/setpassword",h).then(()=>c(!0)).catch(m=>o(Wt(m)))},children:[a.jsxs(or,{direction:"column",align:"center",justify:"center",children:[a.jsx(Vi,{size:32}),a.jsx(Ve,{children:"Set password"})]}),!s&&a.jsxs(Le,{children:[a.jsx(oo,{name:"password",label:"New password",required:!0,error:$t(r,"password")}),a.jsx(oo,{name:"confirmPassword",label:"Confirm new password",required:!0,error:$t(r,"confirmPassword")}),a.jsx(xe,{justify:"flex-end",mt:"xl",children:a.jsx(Oe,{type:"submit",children:"Set password"})})]}),s&&a.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",a.jsx(St,{to:"/signin",children:"sign in"}),"."]})]})]})}function Woe(){const e=Sf(),t=Yn(),[n]=xg(),r=If(),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(_P,{onSuccess:()=>o(),onForgotPassword:()=>t("/resetpassword")?.catch(console.error),onRegister:w1()?()=>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(Vi,{size:32}),n.get("project")!=="new"&&a.jsxs(Ve,{order:3,py:"lg",ta:"center",children:["Sign in to ",lP()]}),n.get("project")==="new"&&a.jsx(Ve,{order:3,py:"lg",ta:"center",children:"Sign in again to create a new project"})]})}function Qoe(){const e=Yn(),t=gi(),[n,r]=v.useState(),[o,s]=v.useState(),[c,u]=v.useState();return v.useEffect(()=>{const f=Object.fromEntries(new URLSearchParams(t.search).entries());r(f.resourceType),s(f.query),u(JSON.parse(f.fields))},[t]),!n||!o||!c?null:a.jsx(rJ,{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 Yoe(){const{id:e,secret:t}=qt(),n=Re(),[r,o]=v.useState(),[s,c]=v.useState(!1),u=Ns(r,void 0);return a.jsxs(ut,{width:450,children:[a.jsx(fr,{issues:u}),a.jsxs(pt,{onSubmit:()=>{o(void 0);const f={id:e,secret:t};n.post("auth/verifyemail",f).then(()=>c(!0)).catch(h=>o(Wt(h)))},children:[a.jsxs(or,{direction:"column",align:"center",justify:"center",children:[a.jsx(Vi,{size:32}),a.jsx(Ve,{children:"Email address verification required"})]}),!s&&a.jsxs(Le,{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(xe,{justify:"flex-end",mt:"xl",children:a.jsx(Oe,{type:"submit",children:"Verify email"})})]}),s&&a.jsxs("div",{"data-testid":"success",children:["Email verified. You can now ",a.jsx(St,{to:"/signin",children:"sign in"}),"."]})]})]})}function Koe(){return a.jsx(Xte,{children:a.jsxs(Be,{errorElement:a.jsx(jie,{}),children:[a.jsx(Be,{path:"/signin",element:a.jsx(Woe,{})}),a.jsx(Be,{path:"/oauth",element:a.jsx($ie,{})}),a.jsx(Be,{path:"/resetpassword",element:a.jsx(Bie,{})}),a.jsx(Be,{path:"/setpassword/:id/:secret",element:a.jsx(Goe,{})}),a.jsx(Be,{path:"/verifyemail/:id/:secret",element:a.jsx(Yoe,{})}),a.jsx(Be,{path:"/register",element:a.jsx(Uie,{})}),a.jsx(Be,{path:"/changepassword",element:a.jsx(bie,{})}),a.jsx(Be,{path:"/security",element:a.jsx(qoe,{})}),a.jsx(Be,{path:"/mfa",element:a.jsx(Lie,{})}),a.jsx(Be,{path:"/batch",element:a.jsx(yie,{})}),a.jsx(Be,{path:"/bulk/:resourceType",element:a.jsx(xie,{})}),a.jsx(Be,{path:"/smart",element:a.jsx(Qoe,{})}),a.jsx(Be,{path:"/forms/:id",element:a.jsx(Cie,{})}),a.jsx(Be,{path:"/admin/super",element:a.jsx(cre,{})}),a.jsx(Be,{path:"/admin/super/asyncjob/:tab",element:a.jsx(S2,{})}),a.jsx(Be,{path:"/admin/super/asyncjob",element:a.jsx(S2,{})}),a.jsx(Be,{path:"/admin/super/db/:tab",element:a.jsx(x2,{})}),a.jsx(Be,{path:"/admin/super/db",element:a.jsx(x2,{})}),a.jsx(Be,{path:"/admin/config",element:a.jsx(Jne,{})}),a.jsxs(Be,{path:"/admin",element:a.jsx(ere,{}),children:[a.jsx(Be,{path:"patients",element:a.jsx(Xne,{})}),a.jsx(Be,{path:"bots/new",element:a.jsx(Ine,{})}),a.jsx(Be,{path:"bots",element:a.jsx(Mne,{})}),a.jsx(Be,{path:"clients/new",element:a.jsx(zne,{})}),a.jsx(Be,{path:"clients",element:a.jsx(Lne,{})}),a.jsx(Be,{path:"details",element:a.jsx(b2,{})}),a.jsx(Be,{path:"invite",element:a.jsx(Kne,{})}),a.jsx(Be,{path:"users",element:a.jsx(hre,{})}),a.jsx(Be,{path:"project",element:a.jsx(b2,{})}),a.jsx(Be,{path:"secrets",element:a.jsx(tre,{})}),a.jsx(Be,{path:"sites",element:a.jsx(nre,{})}),a.jsx(Be,{path:"members/:membershipId",element:a.jsx(Yne,{})})]}),a.jsx(Be,{path:"/lab/assays",element:a.jsx(Oie,{})}),a.jsx(Be,{path:"/lab/panels",element:a.jsx(Mie,{})}),a.jsxs(Be,{path:"/:resourceType/new",element:a.jsx(wie,{}),children:[a.jsx(Be,{index:!0,element:a.jsx(Tx,{})}),a.jsx(Be,{path:"form",element:a.jsx(Tx,{})}),a.jsx(Be,{path:"json",element:a.jsx(uoe,{})}),a.jsx(Be,{path:"profiles",element:a.jsx(Tx,{})})]}),a.jsxs(Be,{path:"/:resourceType/:id",element:a.jsx(Uoe,{}),children:[a.jsx(Be,{index:!0,element:a.jsx(U2,{})}),a.jsx(Be,{path:"apply",element:a.jsx(Fie,{})}),a.jsx(Be,{path:"apps",element:a.jsx(Hie,{})}),a.jsx(Be,{path:"event",element:a.jsx(Gie,{})}),a.jsx(Be,{path:"blame",element:a.jsx(Wie,{})}),a.jsx(Be,{path:"bots",element:a.jsx(woe,{})}),a.jsx(Be,{path:"builder",element:a.jsx(noe,{})}),a.jsx(Be,{path:"checklist",element:a.jsx(roe,{})}),a.jsx(Be,{path:"delete",element:a.jsx(ioe,{})}),a.jsx(Be,{path:"details",element:a.jsx(soe,{})}),a.jsx(Be,{path:"edit",element:a.jsx(loe,{})}),a.jsx(Be,{path:"editor",element:a.jsx(eoe,{})}),a.jsxs(Be,{path:"history",children:[a.jsx(Be,{index:!0,element:a.jsx($2,{})}),a.jsx(Be,{path:":versionId/:tab",element:a.jsx(pp,{})}),a.jsx(Be,{path:":versionId",element:a.jsx(pp,{})})]}),a.jsxs(Be,{path:"_history",children:[a.jsx(Be,{index:!0,element:a.jsx($2,{})}),a.jsx(Be,{path:":versionId/:tab",element:a.jsx(pp,{})}),a.jsx(Be,{path:":versionId",element:a.jsx(pp,{})})]}),a.jsx(Be,{path:"json",element:a.jsx(doe,{})}),a.jsx(Be,{path:"preview",element:a.jsx(yoe,{})}),a.jsx(Be,{path:"responses",element:a.jsx(Coe,{})}),a.jsx(Be,{path:"report",element:a.jsx(Toe,{})}),a.jsx(Be,{path:"ranges",element:a.jsx(Eoe,{})}),a.jsx(Be,{path:"subscriptions",element:a.jsx(Boe,{})}),a.jsx(Be,{path:"timeline",element:a.jsx(U2,{})}),a.jsx(Be,{path:"tools",element:a.jsx(Hoe,{})}),a.jsx(Be,{path:"profiles",element:a.jsx(xoe,{})}),a.jsx(Be,{path:"export",element:a.jsx(coe,{})})]}),a.jsx(Be,{path:"/:resourceType",element:a.jsx(L2,{})}),a.jsx(Be,{path:"/",element:a.jsx(L2,{})})]})})}function Xoe(){const e=Re(),t=e.getUserConfiguration(),n=gi(),[r]=xg();return e.isLoading()?a.jsx(Li,{}):a.jsx(UQ,{logo:a.jsx(Vi,{size:24}),pathname:n.pathname,searchParams:r,version:zk,menus:Joe(t),displayAddBookmark:!!t?.id,children:a.jsx(v.Suspense,{fallback:a.jsx(Li,{}),children:a.jsx(Koe,{})})})}function Joe(e){const t=e?.menu?.map(n=>({title:n.title,links:n.link?.map(r=>({label:r.name,href:r.target,icon:Zoe(r.target)}))||[]}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:a.jsx(gG,{})}]}),t}const B2={Patient:tW,Practitioner:cG,Organization:Cq,ServiceRequest:UG,DiagnosticReport:qG,Questionnaire:sG,Project:oG,admin:gq,AccessPolicy:pG,Subscription:dW,batch:_G,Observation:CG};function Zoe(e){if(e.includes("admin/super/db"))return a.jsx(Bq,{});try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in B2){const n=B2[t];return a.jsx(n,{})}}catch{}}async function eae(){const e=If(),t=new $k({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=wne([{path:"*",element:a.jsx(Xoe,{})}]),o=c=>r.navigate(c);see.createRoot(document.getElementById("root")).render(a.jsx(v.StrictMode,{children:a.jsx(yH,{medplum:t,navigate:o,children:a.jsxs(d_,{theme:n,children:[a.jsx(Pa,{position:"bottom-right"}),a.jsx(Wte,{router:r})]})})}))}eae().catch(console.error);
|
|
235
|
-
//# sourceMappingURL=index-uNAsZ1OJ.js.map
|